7

Since yesterday, I can't view any running VMs (QEMU/KVM) with my virt-manager GUI any more. When I try to view the screen of a VM in its built-in viewer, I get this error message instead:

Error connecting to graphical console:
internal error: unable to execute QEMU command 'getfd':
No file descriptor supplied via SCM_RIGHTS

This applies to all of my VMs.

I can still correctly view and interact with my VMs in virt-viewer though, only the virt-manager built-in viewer is dead.

What is wrong here and how can I fix it?

Edit: I just found out I am using virt-manager version 1:1.4.0-1~getdeb1 from the archive.getdeb.net repo.

2
  • Use spice it is faster and file a bug report – Panther Oct 6 '16 at 20:06
  • @bodhi.zazen It's already configured to use a spice display server by default, but neither that nor VNC works. – Byte Commander Oct 7 '16 at 18:32
12

In working to try to Merge the latest virt-manager 1.4.0 to Ubuntu I came across this same issue. It does not appear to be a bug in virt-manager just a change how it sends display data to VMs.

I've opened a bug to add the necessary permissions to libvirt which is where the apparmor profiles are defined - https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1668681

To fix this issue without disabling security append:

# allow connect with openGraphicsFD to work
unix (send, receive) type=stream addr=none peer=(label=/usr/sbin/libvirtd),

to the file /etc/apparmor.d/abstractions/libvirt-qemu but not in the qemu-bridge-helper section. (So right after "owner @{PROC}/0-9*/fd/ r,")

Then reload the profiles with sudo systemctl reload apparmor.

Having said all that, I always do recommend using the packages from our archive for best support.

3
  • where exactly do you need to add that rule in the libvirt-qemu file ? I appended it in the end, before the final }, did reload apparmor but I get the same error. I just installed the ubuntu updates yesterday, April 20th. virt-manager 1.4.1, now for every VM I create I get this error instead of accessing Splice as for the previous VMs I created... – firepol Apr 21 '17 at 14:50
  • 1
    edited to better explain what to do on 16.04. 16.04 has an additional qemu-bridge-helper child profile at the end of the file- you don't want to add it to that. – gQuigs Apr 27 '17 at 14:16
  • I had to remove the current virtual machine instance and reboot my pc, but after that this worked! Thanks :) – paddotk Jul 17 '17 at 14:25
2

In my case, it was apparmour preventing access. The apparmour magic profile generator doesn't seem to be working as it should. My workaround is as follows.

After starting the KVM instance and receiving the error, I did:

$sudo apparmour_status

which listed the profile causing the issue,

libvirt-<some long key> 

Then I set the apparmour profile to complain instead of enforce with:

$sudo aa-complain /etc/apparmor.d/libvirt/libvirt-<some long key>

Now I no longer receive the error. Hope this conflict gets fixed.

1

I could not reproduce the problem, but there were updates for libvirt on October, 5th :

libvirt-bin-1.3.1-1ubuntu10.2 was upgraded to libvirt-bin-1.3.1-1ubuntu10.3
libvirt0-1.3.1-1ubuntu10.2 was upgraded to libvirt01.3.1-1ubuntu10.3

If you did not change any settings or anything else, most probably something went wrong during the upgrade process. Completely remove all virt-manager related packages and reinstall them.

sudo apt purge libvirt-bin libvirt-glib libvirt0 virt-manager virt-viewer virtinst  
sudo apt install libvirt-bin libvirt-glib libvirt0 virt-manager virt-viewer virtinst  

Reboot the host operating system - now everything should work properly as it did before.

5
  • There is no package libvirt-glib... – Byte Commander Oct 7 '16 at 17:58
  • 1
    And nope, purging and reinstalling the other packages didn't help. :-( – Byte Commander Oct 7 '16 at 18:22
  • Solved it, seems like a bug in the version from GetDeb I had installed. Downgrading to the official repo version fixed it (see my answer). – Byte Commander Oct 7 '16 at 18:55
  • @ByteCommander : It would have been a good idea to provide the information that you were using a 3rd party solution in your question to give me the chance making my answer more precise ! Anyway, basically you solved the problem by doing exactly what I suggested, you removed the currently installed packages and reinstalled the packages from the official repositories. – cl-netbox Oct 8 '16 at 12:12
  • You're right, but actually I didn't know it or think of that possibility. I added the GetDeb repo long time ago for another package and didn't remember getting a virt-manager update from there. v(°_°)v – Byte Commander Oct 8 '16 at 13:37
0

Seems like a bug in virt-manager version 1:1.4.0-1~getdeb1 from http://getdeb.net.

Downgrading the package again to the latest version available from the official repos (1:1.3.2-3ubuntu1.16.04.2 from xenial-updates) fixes this.

Update: Version 1:1.4.0-1~getdeb2 didn't fix this issue yet.

1
  • Please note, no need to downgrade anymore: the answer by gQuigs explains how to configure apparmor, so that the last version of virt-manager (1.4.1 in my case) will work. I just tested gQuigs solution on my ubuntu 16.04 and it works fine. – firepol Apr 27 '17 at 16:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.