siil.arti.ee has support for libvirt based VM-s
Notes for when doing a clean install on a new box
Create a empty zfs filesystem for libvirt virtual machines
sudo zfs create rpool/var/lib/libvirt
Install libvirt and ovmf for uefi vm support
sudo apt install --no-install-recommends libvirt-daemon-system libvirt-clients qemu-kvm qemu-utils ovmf
Add your self to libvirt group
gpasswd --add <user> libvirt
Configure default networking
sudo -e /etc/libvirt/qemu/networks/default.xml
And change it to use existing bridge
<network>
<name>default</name>
<uuid>e9e68fd5-0c59-4bc0-a025-def4c7840cb2</uuid>
<forward mode='bridge'/>
<bridge name='br-int'/>
</network>
Allow users in libvirt group to add iso images into /var/lib/libvirt/boot
folder
chown :libvirt /var/lib/libvirt/boot
chmod g+rws /var/lib/libvirt/boot
This way you can easily wget
iso files into the boot folder and then boot them up in libvirt without having to become root
This should create a VM image quite fast.
qemu-img create -f qcow2 -o cluster_size=128k -o preallocation=metadata -o lazy_refcounts=on /var/lib/libvirt/images/name.qcow2 20G
Linux kernel has to booted with console=ttyS0
for this to work. After that systemd will start a getty instance on the serial line.
https://wiki.archlinux.org/index.php/Working_with_the_serial_console
From commandline you can connect to the serial like so:
virsh --connect=qemu:///system console <machine>
or
virsh --connect=qemu:///system console --devname serial0 <machine>
Default should be writeback
where writes go through linux page cache unless guest does a fsync.
none
cache mode bypasses page cache. unsafe
is like writeback but ignores fsync so its really fast for OS installs.
https://documentation.suse.com/sles/11-SP4/html/SLES-kvm4zseries/cha-qemu-cachemodes.html
Configure serial console boot log
https://www.freebsd.org/doc/handbook/serialconsole-setup.html
sysrc -f /boot/loader.conf console=comconsole