Product SiteDocumentation Site

Chapter 1. Commands listed by group

These are the commands presently available in virsh.
Table 1.1. Domain management commands
Command Availability Description
From libvirt 0.2.3
Attach device from an XML file
From libvirt 0.3.0
Attach disk device
From libvirt 0.3.0
Attach network interface
From libvirt 0.2.1
Enable and disable the automatic starting of a guest domain when the libvirt daemon starts
From libvirt 0.2.0
Connect the virtual serial console for the guest
From libvirt 0.7.7
Compute baseline CPU
From libvirt 0.7.5
Compare host CPU with a CPU described by an XML file
From libvirt 0.1.0
Create a guest domain from an XML file
From libvirt 0.1.6
Define, but don't start, a guest domain from an XML file
From libvirt 0.0.1
Immediately terminates a running guest domain, releasing any resources in use by it
From libvirt 0.2.3
Detach a device from an XML file
From libvirt 0.3.0
Detach a disk device
From libvirt 0.3.0
Detach a network interface
From libvirt 0.1.0
Prior to version 0.1.0, this command was known as idof
Convert a domain name or UUID to domain id
From libvirt 0.7.7
Aborts the currently running guest domain job
From libvirt 0.7.7
Returns information about jobs running on a domain
From libvirt 0.1.0
Prior to version 0.1.0, this command was known as nameof
Convert a guest domain id or UUID to guest domain name
From libvirt 0.1.1
Convert a guest domain name or id to guest domain UUID
From libvirt 0.6.4
Convert native guest configuration format to domain XML format
From libvirt 0.6.4
Convert guest domain XML config to a native guest configuration format
From libvirt 0.1.9
Core dump a guest domain
From libvirt 0.0.1
Output the guest domain information as an XML dump to stdout
From libvirt 0.4.6
Edit the XML configuration for a guest domain
From libvirt 0.8.0
Save and destroy a running guest domain, so it can be restarted from the same state at a later time. When the virsh start command is next run for the guest domain, it will automatically be started from this saved state
From libvirt 0.8.3
Remove an existing managed save state file from a guest domain
From libvirt 0.8.5
Show maximum number of virtual CPUs for guest domains on this connection
From libvirt 0.8.5
Gets or sets the current memory parameters for a guest domain
From libvirt 0.3.2
Migrates a guest domain to another host
From libvirt 0.8.0
Set maximum tolerable downtime of a guest domain which is being live-migrated to another host
From libvirt 0.1.0
Run a reboot command in a guest domain
From libvirt 0.0.2
Restore a guest domain
From libvirt 0.0.1
Resume a guest domain
From libvirt 0.0.2
Save the running state of a guest domain to a file
From libvirt 0.2.3
Show or set scheduler parameters
From libvirt 0.1.4
Change the maximum memory allocation limit in the guest domain
From libvirt 0.1.4
Change the current memory allocation in the guest domain
From libvirt 0.1.4
Change the number of virtual CPUs in the guest domain
From libvirt 0.0.1
Run shutdown in a guest domain
From libvirt 0.1.6
Start a guest domain, either from the last managedsave state, or via a fresh boot if no managedsave state is present
From libvirt 0.0.1
Suspend a running guest domain
From libvirt 0.3.2
Output the device for the TTY console
From libvirt 0.1.6
Remove the configuration for an inactive guest domain
From libvirt 0.8.0
Update device from an XML file
From libvirt 0.8.5
Returns the number of virtual CPUs used by a guest domain
From libvirt 0.1.4
Returns basic information about a guest domains virtual CPUs
From libvirt 0.1.4
Pin guest domain virtual CPUs to physical host CPUs
From libvirt 0.0.1
Display the system version information
From libvirt 0.2.0
Output the IP address and port number for the VNC display

Table 1.2. Domain monitoring commands
Command Availability Description
From libvirt 0.8.1
Get block device size info for a guest domain
From libvirt 0.3.2
Get device block stats for a running guest domain
From libvirt 0.3.2
Get network interface stats for a running guest domain
From libvirt 0.1.0
Returns basic information about a guest domain
From libvirt 0.7.5
Get memory statistics for a runnng guest domain
From libvirt 0.1.0
Prior to version 0.1.0, this command was known as dstate
Returns state about a guest domain
From libvirt 0.0.1
Returns a list of guest domains

Table 1.3. Host and hypervisor commands
Command Availability Description
From libvirt 0.2.1
Returns capabilities of hypervisor/driver
From libvirt 0.0.1
Connect to local hypervisor
From libvirt 0.3.3
Display available free memory for a NUMA cell
From libvirt 0.3.0
Display the name of the hypervisor host
From libvirt 0.1.0
Returns basic information about the node
From libvirt 0.8.6
Qemu monitor command
uri
From libvirt 0.3.0
Display the hypervisor canonical URI

Table 1.4. Interface commands
Command Availability Description
From libvirt 0.7.0
Define a physical host network interface
From libvirt 0.7.0
Shut down and disable a physical host network interface
From libvirt 0.7.0
Output information for a physical host network interface, as an XML dump to stdout
From libvirt 0.7.0
Edit the XML configuration for a physical host network interface
From libvirt 0.7.0
Returns a list of physical host network interfaces
From libvirt 0.7.0
Returns the MAC address for a physical host network interface
From libvirt 0.7.0
Returns the physical host interface name for a MAC address
From libvirt 0.7.0
Enables and starts a physical host network interface
From libvirt 0.7.0
Removes the configuration information for a physical host network interface

Table 1.5. Network filter commands
Command Availability Description
From libvirt 0.8.0
Define a new network filter or update an existing one
From libvirt 0.8.0
Output the network filter information as an XML dump to stdout
From libvirt 0.8.0
Edit the XML configuration for a network filter
From libvirt 0.8.0
Returns the list of network filters
From libvirt 0.8.0
Undefine a network filter

Table 1.6. (Virtual) Networking commands
Command Availability Description
From libvirt 0.2.1
Enable or disable the automatic starting of a virtual network, when the libvirt daemon starts
From libvirt 0.2.0
Creates a new transient virtual network from an XML file
From libvirt 0.2.0
Adds a new permanent virtual network from an XML file, without starting it
From libvirt 0.2.0
Shuts down a running virtual network
From libvirt 0.2.0
Displays the XML configuration for a virtual network (to stdout)
From libvirt 0.4.6
Allows the user to edit the XML configuration of a virtual network, using their preferred editor
From libvirt 0.8.6
Displays basic information for a virtual network
From libvirt 0.2.0
Lists the virtual networks libvirt is aware of
From libvirt 0.2.0
When given a network UUID, returns its corresponding network name
From libvirt 0.2.0
Starts a (previously defined) inactive virtual network
From libvirt 0.2.0
Removes an inactive virtual network from the libvirt configuration
From libvirt 0.2.0
When given a network name, returns its corresponding UUID

Table 1.7. Node device commands
Command Availability Description
From libvirt 0.6.5
Create a device on the physical host, which can then be assigned to a guest domain
From libvirt 0.6.5
Destroys a device on a physical host
From libvirt 0.6.1
Dettach a node device from its device driver before assigning to a guest domain
From libvirt 0.5.0
Output the details for a node device as an XML dump to stdout
From libvirt 0.5.0
Enumerate devices on the host
From libvirt 0.6.1
Reattach a node device to its device driver, once released by the guest domain
From libvirt 0.6.1
Reset a node device before or after assigning to a domain

Table 1.8. Secrets, commands for managing them
Command Availability Description
From libvirt 0.7.1
Define or modify a secret
From libvirt 0.7.1
Output attributes of a secret as an XML dump to stdout
From libvirt 0.7.1
Output a secret value to stdout
From libvirt 0.7.1
Returns a list of secrets
From libvirt 0.7.1
Set a secret value
From libvirt 0.7.1
Undefine a secret

Table 1.9. (Domain) Snapshot commands
Command Availability Description
From libvirt 0.8.0
Creates a snapshot of a domain
From libvirt 0.8.0
Gets the current snapshot for a domain
From libvirt 0.8.0
Removes a snapshot, and all of it's children, from a domain
From libvirt 0.8.0
Displays the XML fragment for a domain snapshot
From libvirt 0.8.0
Lists the snapshots for a domain
From libvirt 0.8.0
Reverts a domain to a given snapshot

Table 1.10. Storage pool commands
Command Availability Description
From libvirt 0.4.6
Discover potential storage pool sources
From libvirt 0.4.6
Discover potential storage pool sources
From libvirt 0.4.1
Enable or disable the automatic starting of a storage pool, when the libvirt daemon starts
From libvirt 0.4.1
Build a storage pool
From libvirt 0.4.1
Create and start a transient storage pool, that will not persist across system restarts, using settings from an XML file
From libvirt 0.4.1
Create and start a transient storage pool, that will not persist across system restarts, using settings passed as options
From libvirt 0.4.1
Add a new persistent storage pool to the configuration, without starting it, using settings from an XML file
From libvirt 0.4.1
Add a new persistent storage pool to the configuration, without starting it, using settings passed as options
From libvirt 0.4.1
Delete a storage pool
From libvirt 0.4.1
Shuts down a storage pool (from the libvirt point of view), releasing any resources in use by it
From libvirt 0.4.1
Displays the XML configuration for a storage pool (to stdout)
From libvirt 0.4.6
Allows the user to edit the XML configuration of a storage pool, using their preferred editor
From libvirt 0.4.1
Returns basic information about a storage pool
From libvirt 0.4.1
Displays a list of the storage pools libvirt is aware of
From libvirt 0.4.1
When given a pool UUID, returns the name of the corresponding storage pool
From libvirt 0.4.1
Re-examines the storage in a storage pool, updating the internal list of volumes present and their details
From libvirt 0.4.1
Starts a (previously defined) inactive storage pool
From libvirt 0.4.1
Removes an inactive storage pool from the libvirt configuration
From libvirt 0.4.1
When given a storage pool name, returns the corresponding storage pool UUID

Table 1.11. Storage volume commands
Command Availability Description
From libvirt 0.6.4
Copies an existing storage volume, including data, to a new storage volume
From libvirt 0.4.1
Creates a new storage volume, on a given storage pool, using settings from an XML file
From libvirt 0.4.1
Creates a new storage volume, on a given storage pool, using settings passed as options
From libvirt 0.6.4
Create a new storage volume from an existing storage volume
From libvirt 0.4.1
Removes a storage volume from a storage pool
From libvirt 0.4.1
Displays the XML configuration for a storage volume, to stdout
From libvirt 0.4.1
Returns basic information about a storage volume
From libvirt 0.4.1
When given a storage volume name or path, returns the corresponding key for that volume
From libvirt 0.4.1
Displays a list of the storage volumes libvirt is aware of, in a given storage pool
From libvirt 0.4.1
When given a storage volume path or key, returns the corresponding name for that volume
From libvirt 0.4.1
When given a storage volume name or key, returns the corresponding path for that volume
From libvirt 0.8.2
Returns the storage pool name or UUID for a given storage volume
From libvirt 0.8.0
Ensure data previously on a volume is not accessible to future reads

Table 1.12. Virsh commands
Command Availability Description
cd
From libvirt 0.7.0
Change the current directory
From libvirt 0.8.5
Echo back arguments, possibly with quoting
From libvirt 0.8.0
Quit this interactive terminal. Alternative name for the quit command, doing exactly the same thing.
From libvirt 0.0.1
Prints global help, command specific help, or help for a group of related commands
pwd
From libvirt 0.7.0
Displays the current directory
From libvirt 0.0.1
Quit this interactive terminal. Alternative name for the exit command, doing exactly the same thing.