Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page