Create libvirt Virtual Network From an XML File

I have a need to setup a virtual network on a VM-host server. Usually, I just use the virt-manager gui application to create this task. However, I’d like to do this via command line this time. Why? Well, why not? It’s always fun to learn new thing. :) libvirt keeps network configuration in XML files under /etc/libvirt/qemu/networks/. Here is what I have on one of my machines: # ls -1 /etc/libvirt/qemu/networks/*xml /etc/libvirt/qemu/networks/classroom....

March 22, 2021 · 3 min · 543 words · kenno

Attaching a Disk to KVM Guest on Command Line

Again, just a quick note to remind myself how to attach a disk to a VM guest from the command line. The following steps is based on these assumptions: A spare disk: an LVM volume name db2_data on data volume group The name/domain of the VM is db2 List the name of the VM guest and available logical volume. [root@mathvm5 ~]# virsh list | grep db2 20 db2 running [root@mathvm5 ~]# lvs | grep db2 db2 vm -wi-ao---- 80....

December 2, 2020 · 1 min · 170 words · kenno

Autostart a KVM Domain

Again this is a quick note to explain myself how to set a kvm (domain/vm) autostart when the server boots up. To list autostart domains: virsh list --autostart To set a domian, e.g. dhcp1, to autostart: virsh autostart dhcp1 To disable autostart for a domain (e.g. named dhcp1): virsh autostart dhcp1 --disable Ref: KVM: Start a Virtual Machine / Guest At Boot Time

February 13, 2019 · 1 min · 63 words · Kenno