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/07 22:00] – 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 46: | Line 46: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | You can also use a ZFS dataset as storage pool, with this alternative XML configuration: | ||
| + | |||
| + | < | ||
| + | <pool type=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | :!: 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 175: | Line 188: | ||
| </ | </ | ||
| - | You can then connect with a VNC client to the host to perform the installation. | + | You can then connect with a VNC client to the host to perform the installation. The recommended client is [[https:// |
| Some useful options: | Some useful options: | ||
| Line 199: | Line 212: | ||
| </ | </ | ||
| - | ===== Forcing a VM to stop ===== | + | If the server had NVRAM enabled, you must specify the '' |
| < | < | ||
| - | virsh destroy | + | virsh undefine |
| + | </ | ||
| + | ===== Stopping a guest ===== | ||
| + | |||
| + | This will ask a VM to shut down: | ||
| + | |||
| + | < | ||
| + | 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 210: | 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 216: | Line 278: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | * https:// | ||
public/managing_kvm_on_debian.1715119200.txt.gz · Last modified: by thomas
