Virt-Manager can't connect to graphical console

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.


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.


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.