Qemu/KVM

UEFI Firmware

To make it possible to use UEFI firmware in kvm vms you would need:

sudo pacman -S ovmf qemu-block-iscsi
sudo tee -a /etc/libvirt/qemu.conf << EOF

nvram = [
    "/usr/share/ovmf/x64/OVMF_CODE.fd:/usr/share/ovmf/x64/OVMF_VARS.fd"
]

EOF

You want to restart libvirtd after this configuration happened.

Create Qcow2 Disk Image

qemu-img create -f qcow2 /data/scratch/disks/disk.qcow2 10G

Mount Qcow2

sudo modprobe nbd max_part=8
sudo qemu-nbd --connect=/dev/nbd0 /data/scratch/disks/disk.qcow2

Once you are done with that device:

# qemu-nbd --disconnect /dev/nbd0

Export a Block Device through Network

On the server you would need to make sure you let port 10809 through your firewall, as that is the default port for nbd

Then you start a serving a qcow2 image in a read-only fashion by:

# modprobe nbd max_part=8
# qemu-nbd path-to-disk.qcow2 -r -b 192.168.222.1

Note that I explicitly specified which interface to bind to.

On the client machine:

# nbd-client 192.168.222.1 /dev/nbd0

Then you will be able to access the device /dev/nbd0