public:managing_kvm_on_debian
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| public:managing_kvm_on_debian [2024/05/14 21:45] – [Moving storage to a custom location] thomas | public:managing_kvm_on_debian [2024/05/17 20:56] (current) – thomas | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| < | < | ||
| - | sudo apt install --no-install-recommends qemu-system libvirt-clients libvirt-daemon-system virtinst qemu-utils dnsmasq swtpm swtpm-tools ovmf bridge-utils | + | sudo apt install --no-install-recommends qemu-system libvirt-clients libvirt-daemon-system virtinst qemu-utils dnsmasq swtpm swtpm-tools ovmf bridge-utils |
| </ | </ | ||
| Line 57: | Line 57: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | :!: Note that this does not support libvirt snapshots. You will need to make snapshots via ZFS manually, which may not be ideal. | ||
| Then, create the pool based on the definition and make sure it autostarts: | Then, create the pool based on the definition and make sure it autostarts: | ||
| Line 215: | Line 217: | ||
| virsh undefine windows-server-2022 --nvram | virsh undefine windows-server-2022 --nvram | ||
| </ | </ | ||
| - | ===== Forcing | + | ===== Stopping |
| + | |||
| + | This will ask a VM to shut down: | ||
| < | < | ||
| - | virsh destroy | + | virsh shutdown < |
| + | </ | ||
| + | |||
| + | This will force a VM to shut down: | ||
| + | < | ||
| + | virsh destroy | ||
| </ | </ | ||
| ===== Editing a VM's XML configuration ===== | ===== Editing a VM's XML configuration ===== | ||
| Line 226: | Line 235: | ||
| </ | </ | ||
| + | ===== Finding the VNC display for a guest ===== | ||
| + | |||
| + | < | ||
| + | virsh vncdisplay < | ||
| + | </ | ||
| + | |||
| + | or | ||
| + | |||
| + | < | ||
| + | virsh domdisplay < | ||
| + | </ | ||
| + | |||
| + | This snippet will list out the displays for all guests: | ||
| + | |||
| + | < | ||
| + | for dom in $(virsh list --name); do echo -n "$dom: "; virsh domdisplay $dom; done | ||
| + | </ | ||
| + | |||
| + | ===== Managing media ===== | ||
| + | |||
| + | Listing attached media: | ||
| + | |||
| + | < | ||
| + | virsh domblklist < | ||
| + | </ | ||
| + | |||
| + | To replace a disk or cd-rom with another: | ||
| + | |||
| + | < | ||
| + | virsh change-media < | ||
| + | </ | ||
| + | |||
| + | Or to simply eject a disk: | ||
| + | |||
| + | < | ||
| + | virsh change-media vm1 hdc --eject | ||
| + | </ | ||
| ===== Resources ===== | ===== Resources ===== | ||
| Line 232: | Line 278: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | * https:// | ||
public/managing_kvm_on_debian.1715723104.txt.gz · Last modified: by thomas
