Linux command
virt-xml 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List available disk suboptions
virt-xml --disk=?
Edit VM metadata
virt-xml [domain] --edit --metadata description="[new_description]"
Toggle boot menu
virt-xml [domain] --edit --boot bootmenu=[on]
Add a disk to a VM
virt-xml [domain] --add-device --disk [path=/var/lib/libvirt/images/disk.qcow2]
Attach USB device to a running VM
virt-xml [domain] --update --add-device --hostdev [bus].[device]
说明
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.
参数
- --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
FAQ
What is the virt-xml command used for?
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.
How do I run a basic virt-xml example?
Run `virt-xml --disk=?` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --edit do in virt-xml?
Edit existing configuration