From aaf2c992dc2196bed3c9c75583d6006c4ac8abbe Mon Sep 17 00:00:00 2001 From: Fazle Arefin <1625934+FazleArefin@users.noreply.github.com> Date: Sun, 4 Jan 2026 14:16:06 +1100 Subject: [PATCH] virsh: refresh page (#20517) * virsh: refresh page --- pages/common/virsh.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pages/common/virsh.md b/pages/common/virsh.md index 3bd67c71a2..c2f4ef9efe 100644 --- a/pages/common/virsh.md +++ b/pages/common/virsh.md @@ -1,38 +1,38 @@ # virsh > Manage `virsh` guest domains. -> Note: `guest_id` can be the ID, name, or UUID of the guest. +> Note: Some of the commands below may require specifying `virsh --connect URI` explicitly. > Some subcommands such as `list` have their own usage documentation. > More information: . -- Connect to a hypervisor session: +- Connect to a hypervisor session interactively: -`virsh connect {{qemu:///system}}` - -- Activate a network named `default`: - -`sudo virsh net-start {{default}}` +`virsh {{[-c|--connect]}} {{qemu:///system|qemu:///session|xen:///system|lxc:///system|...}}` - List all domains: -`virsh list --all` +`virsh {{[-c|--connect]}} {{URI}} list --all` -- Create a guest from a configuration file: +- Activate a network named `default`: + +`virsh net-start {{default}}` + +- Create a domain from a configuration file: `virsh create {{path/to/config_file.xml}}` -- Edit a guest's configuration file (editor can be changed with `$EDITOR`): +- Edit a domain's configuration file (editor can be changed with `$EDITOR` or `$VISUAL`): -`virsh edit {{guest_id}}` +`virsh edit {{domain}}` -- Start/reboot/shutdown/suspend/resume a guest: +- Start/reboot/reset/shutdown/destroy/suspend/resume a domain: -`virsh {{command}} {{guest_id}}` +`virsh {{start|reboot|reset|shutdown|destroy|suspend|resume}} {{domain}}` -- Save the current state of a guest to a file: +- Save the current running state of a domain (RAM, but not disk state) to a state file (domain will be powered off): -`virsh save {{guest_id}} {{filename}}` +`virsh save {{domain}} {{path/to/state_file}}` -- Delete a running guest: +- Remove storage and snapshots of a stopped domain: -`virsh destroy {{guest_id}} && virsh undefine {{guest_id}}` +`virsh undefine {{domain}} --remove-all-storage --snapshots-metadata`