O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

virsh

Synopsis

virsh [options] [command [command-options]]

libvirt management interface. virsh uses the libvirt API to connect to a hypervisor and manipulate the configuration and state of virtual machines controlled by that hypervisor. If invoked with a command, it will execute the command and then exit. If invoked without a command, virsh enters a shell mode from which you can execute commands.

This manager will work with any hypervisor that has libvirt support. However, not all virsh commands are supported by all hypervisors. Nor will they work on all guests. Still, if a hypervisor can do something, you can generally use virsh to do it. Some hypervisors, including Xen, come with their own tools for managing virtual machines, but we still recommend you use virsh instead.

Most virsh commands expect a domain option. A domain refers to a virtual machine. You can use the virtual machine’s name or UUID. If the machine is running, it should also have an ID number within the hypervisor, and you can use this for the domain option as well. Use the list command to see names and IDs of domains managed by the hypervisor.

Options

--c uri, --connect=uri

Connect to a hypervisor specified by uri.

-d level, --debug=level

Set the level of debugging information to be printed to standard output. Accepted values are 0–5. 0 disables debugging messages and is the default. 5 prints all debugging messages.

-h, --help

Print a brief description of options and commands.

-l file, --log=file

Log debugging information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required