Product SiteDocumentation Site

5.6. Other useful tools

The following tools are used to access a virtual machine's disk via the host. The guest's disk is usually accessed directly via the disk-image file located on the host. However it is sometimes possible to gain access via the libvirt domain. The commands that follow are part of the libvirt domain and are used to gain access to the guest's disk image.
guestmount
A command line tool used to mount virtual machine file systems and disk images on the host machine. This tool is installed as part of the libguestfs-mount package.

Warning

Using guestmount in --r/w (read/write) mode to access a disk that is currently being used by a guest can cause the disk to become corrupted. Do not use guestmount in --r/w (read/write) mode on live virtual machines. Use the guestmount command with the --ro (read-only) option if the disk image is being used.
virt-cat
A command line tool that can be used to quickly view the contents of one or more files in a specified virtual machine's disk or disk image. This tool is installed as part of the libguestfs-tools package.
virt-df
A command line tool used to show the actual physical disk usage of virtual machines. Similar to the command line tool df. Note that this tool does not work across remote connections. It is installed as part of the libguestfs-tools package.
virt-edit
A command line tool used to edit files that exist on a specified virtual machine. This tool is installed as part of the libguestfs-tools package.

Warning

Using virt-edit on live virtual machines can cause disk corruption in the virtual machine. Although the virt-edit command will try to prevent users from editing files on live virtual machines, it is not guaranteed to catch all instances. Do not use virt-edit on a live virtual machine.
virt-filesystems
A command line tool used to discover file systems, partitions, logical volumes and their sizes in a disk image or virtual machine. One common use is in shell scripts, to iterate over all file systems in a disk image. This tool is installed as part of the libguestfs-tools package.
This tool replaces virt-list-filesystems and virt-list-partitions.
virt-inspector
A command line tool that can examine a virtual machine or disk image to determine the version of its operating system and other information. It can also produce XML output, which can be piped into other programs. Note that virt-inspector can only inspect one domain at a time. This tool is installed as part of the libguestfs-tools package.
virt-ls
A command line tool that lists files and directories inside a virtual machine. This tool is installed as part of the libguestfs-tools package.
virt-make-fs
A command line tool for creating a file system based on a tar archive or files in a directory. It is similar to tools like mkisofs and mksquashfs, but it can create common file system types such as ext2, ext3 and NTFS, and the size of the file system created can be equal to or greater than the size of the files it is based on. This tool is provided as part of the libguestfs-tools package.
virt-p2v
A graphical tool to convert physical machines into virtual machines. This tool is installed as part of the virt-v2v package.
virt-rescue
A command line tool that provides a rescue shell and some simple recovery tools for unbootable virtual machines and disk images. It can be run on any virtual machine known to libvirt, or directly on disk images. This tool is installed as part of the libguestfs-tools package.

Warning

Using virt-rescue on running virtual machines can cause disk corruption in the virtual machine. virt-rescue attempts to prevent its own use on running virtual machines, but cannot catch all cases.
Using the command with the --ro (read-only) option will not cause disk corruption, but may give strange or inconsistent results. It is better to avoid using virt-rescue on a running virtual machine.
virt-resize
A command line tool to resize virtual machine disks, and resize or delete any partitions on a virtual machine disk. It works by copying the guest image and leaving the original disk image untouched. This tool is installed as part of the libguestfs-tools package.

Important

Using virt-resize on running virtual machines can give inconsistent results. It is best to shut down virtual machines before attempting to resize them.
virt-top
A command line utility similar to top, which shows statistics related to virtualized domains. This tool ships in its own package: virt-top.
virt-v2v
A graphical tool to convert virtual machines from Xen and VMware hypervisors to run on KVM. This tool ships in its own package: virt-v2v.
virt-viewer
A minimal tool for displaying the graphical console of a virtual machine via the VNC and SPICE protocols. This tool ships in its own package: virt-viewer.
virt-what
A shell script that detects whether a program is running in a virtual machine. This tool ships in its own package: virt-what.
virt-who
The virt-who package is a Fedora host agent that queries libvirt for guest UUIDs. It then passes that data to the local entitlement server for the purposes of issuing certificates. This tool ships in its own package: virt-who.
virt-win-reg
A command line tool to export and merge Windows Registry entries from a Windows guest, and perform simple Registry operations. This tool is installed as part of the libguestfs-tools package.

Warning

Using virt-win-reg on running virtual machines will cause irreversible disk corruption in the virtual machine. virt-win-reg attempts to prevent its own use on running virtual machines, but cannot catch all cases.

Warning

Modifying the Windows Registry is an inherently risky operation, as the format is deliberately obscure and undocumented. Changes to the registry can leave the system unbootable, so ensure you have a reliable backup before you use the --merge option.
virt-xml-validate
A command line tool to validate libvirt XML files for compliance with the published schema. This tool is installed as part of the libvirt-client package.