virsh
Manage
virshguest domains. Note: Some of the commands below may require specifyingvirsh --connect URIexplicitly. Some subcommands such aslisthave their own usage documentation. More information: https://libvirt.org/manpages/virsh.html.
- Connect to a hypervisor session interactively:
virsh
- List all domains:
virsh list --all
- Activate a network named
default:
sudo virsh net-start
- Create a domain from a configuration file:
sudo virsh create
- Edit a domain's configuration file (editor can be changed with
$EDITORor$VISUAL):
sudo virsh edit
- Start/reboot/reset/shutdown/destroy/suspend/resume a domain:
sudo virsh
- Save the current running state of a domain (RAM, but not disk state) to a state file (domain will be powered off):
sudo virsh save
- Remove storage and snapshots of a stopped domain:
sudo virsh undefine --remove-all-storage --snapshots-metadata
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
