I need assistance with kvm on fedora 36

Aloha everyone,

I just moved to Fedora 36 from Arch Linux, as Fedora plays nice with Secure Boot and TPM. I have a dual-boot setup on my tower, and while in Arch Linux, I was able to run several VMs. I finally got everything set up in Fedora and used this guide to set up KVM:

I was pretty much the same process as that on Arch Linux, but I got an error when attempting to begin the installation.

Unable to complete install: ‘operation failed: unable to find any master var store for loader: /usr/share/edk2/ovmf/OVMF.amdsev.fd’

Does anyone know how to resolve this error? I’ve been attempting to find a solution, but have no joy at this point.

Mahalo in advance for any and all responses.

I think for UEFI booting you will want to make a copy of those files and then reference them in the parameters passed to qemu-kvm. I have the following lines in a script I use to do something similar.

# initialize the firmware for qemu
for FW in /usr/share/edk2/ovmf/OVMF_{CODE,VARS}.fd; do
	if ! [[ -e ${FW##*/} ]]; then
		if ! cp $FW . &>/dev/null; then
			echo "error: file '$FW' not found" 1>&2
			echo 'you may need to install the edk2-ovmf package.' 1>&2
			exit 1

And then later on in the script.

qemu-system-$ARCH -name fedora \
-accel kvm -m 16G \
-device virtio-rng-pci \
-device virtio-net,netdev=n0 \
-netdev "user,id=n0,hostfwd=tcp:${SSHPORT}-:22,guestfwd=tcp:'$0' -d" \
-drive if=pflash,format=raw,unit=0,file=OVMF_CODE.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
$(for i in "${SD[@]}"; do echo "-drive if=virtio,format=raw,file=$i"; done) \
-virtfs local,id=host,mount_tag=host,path=$RV,security_model=passthrough \
-nographic \
-kernel $RV/images/pxeboot/vmlinuz \
-initrd $RV/images/pxeboot/initrd.img \
-append "quiet selinux=0 rd.dm=0 rd.lvm=0 rd.luks=0 rd.md=0 console=ttyS0 inst.repo=https://download.fedoraproject.org/pub/fedora/linux/releases/$RV/Everything/$ARCH/os/ inst.stage2=$RV inst.ks=$KS inst.sshd inst.noninteractive=false"

The two -drive if=pflash, ... lines are the important ones that attach the firmware device files.

Do you have libvirt, qemu, and qemu-kvm installed?

Did you install virt-manger? (the vmm manger gui)
Did you enable and start libvirtd as instructed?

How are you trying to create the VM? I have only used the VMM and never attempted to use the command line to set it up. It always works for me. I install from an iso file on the host system.

Everything is installed. I used virt-manager to create the VM, not the terminal. I’m used to virt-manager from Arch. I just checked libvirtd and it was dead. I restarted it and enabled it (I thought I had done that before) and will try again. I’ll let you know how that turns out.

Ok, now the error is different. I verified that libvirtd is running, but now I have a permissions error. I created mount points for my three additional drives, then mounted them, after having changed ownership and group to my account. Now, however, they are owned by root, which is why virt-manager doesn’t have write permissions. I tried to, as root, change the permissions back to my account, but even though the terminal gave no indication of error, the permissions are still root:root. I did not have this issue with Arch Linux, so I’ll have to do a bit more research on this one.

Is your account in the libvirt group?
$ groups
user wheel audio libvirt render

If you don’t see libvirt then

sudo usermod -a -G libvirt "$USER"

Then log out and back in again.

Thanks for your response. Actually, I wasn’t in the group (brain fart on that one), but even after getting myself in the group, no joy.

How did you create the VMs.
On my machine I added myself to the libvirt group then create each vm using VMM as my regular user. I have done many and all work.

To make sure you have all the required packages, you should install the group:

dnf group install "Virtualization"

For whatever reason it’s not list when you do dnf groups list but it will install all the required packages. Afterwards add yourself to the correct group with usermod -aG libvirt <username>. Log out and back in and you should be all set.