wsidl
wsidl

Reputation: 106

CoreOS Image fails to load ignition file via libvirt (permission denied)

I'm testing out a new network config using VM's and got libvirt and qemu setup on my system. Following the documentation for Fedora CoreOS to help get started.

Steps Taken

Only issue is the machine will not work from virt-manager or virsh:

$ virsh start machine
error: Failed to start domain machine
error: internal error: qemu unexpectedly closed the monitor: 2020-09-21T00:34:59.972390Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-09-21T00:34:59.972427Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2020-09-21T00:34:59.973278Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-09-21T00:34:59.973287Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2020-09-21T00:34:59.980931Z qemu-system-x86_64: -fw_cfg name=opt/com.coreos/config,file=/var/lib/libvirt/machine/main.ign: can't load /var/lib/libvirt/machine/main.ign: Failed to open file “/var/lib/libvirt/machine/main.ign”: Permission denied

Now out of ideas on what to do. Someone have an idea?

Upvotes: 1

Views: 2790

Answers (3)

user12166168
user12166168

Reputation: 11

Setting

security_driver = "none"

in /etc/libvirt/qemu.conf and restart libvirtd worked for me to solve a similar problem. (Debian 11, neither AppArmor or SELinux activated / used at all). Error here looked like:

Error: error creating libvirt domain: internal error: process exited while connecting to monitor: ...

and

Could not open '/var/lib/libvirt/images/d1test4-centos7.qcow2': Permission denied

Upvotes: 1

likewu
likewu

Reputation: 11

Modify the following line in /etc/libvirt/qemu.conf

security_driver = "none"

Upvotes: 1

Cole Robinson
Cole Robinson

Reputation: 156

Try this instead

# mv main.ign /var/lib/libvirt/images/
# restorecon /var/lib/libvirt/images/main.ign

/var/lib/libvirt/images is properly permissioned and selinux labelled for VMs to access. /var/lib/libvirt/machines is not a standard libvirt directory so depending on how you created it the qemu process may not have access. Also on Fedora the qemu process is launched as 'qemu' user, not 'kvm' or 'libvirt', so it could be due to that too, but if the file is in /var/lib/libvirt/images and global read permissions then I think that should be enough

Upvotes: 0

Related Questions