LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

virt-xml

Edit libvirt domain XML configuration

TLDR

List suboptions for option
$ virt-xml --[option]=?
copy
List disk/network/boot suboptions
$ virt-xml --disk=? --network=? --boot=?
copy
Edit domain value
$ virt-xml [domain] --edit --[option] [suboption]=[new_value]
copy
Change description
$ virt-xml [domain] --edit --metadata description="[new_description]"
copy
Toggle boot menu
$ virt-xml [domain] --edit --boot bootmenu=[on|off]
copy
Attach USB device to running VM
$ virt-xml [domain] --update --add-device --hostdev [bus].[device]
copy

SYNOPSIS

virt-xml [OPTIONS] DOMAIN

DESCRIPTION

virt-xml edits libvirt domain XML files using explicit command-line options. It provides a way to modify VM configurations without manually editing XML.
Domain can be specified by name, UUID, or ID for existing VMs. Adding =? to any option lists available suboptions.

PARAMETERS

--edit

Edit existing configuration
--add-device
Add a new device
--update
Apply changes to running VM
--disk
Disk configuration options
--network
Network configuration options
--boot
Boot configuration options
--metadata
Metadata options (description, title, etc.)
--hostdev
Host device passthrough

CAVEATS

Changes to running VMs may require restart. Not all options can be changed on running VMs. Requires proper libvirt permissions.

SEE ALSO

Copied to clipboard
Kai