Ubuntu – Virt-manager can’t connect to xen

14.04servervirt-managervirtualizationxen

When I try to connect to my XEN domain with virtmanager on Ubuntu 14.04 I just get the following error:

Unable to connect to libvirt.

internal error: libxenlight state driver is not active

Verify that:
 - A Xen host kernel was booted
 - The Xen service has been started

Libvirt URI is: xen:///

Traceback (most recent call last):   File "/usr/share/virt-manager/virtManager/connection.py", line 1027, in
_open_thread
    self.vmm = self._try_open()   File "/usr/share/virt-manager/virtManager/connection.py", line 1009, in
_try_open
    flags)   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 105, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed') libvirtError: internal error: libxenlight state driver is not active

Best Answer

Mm. The same bug hit me and my own suggestion did not work. I already had the latest version.

Try this:

  1. Start Nautilus as root in terminal:

    sudo -H nautilus
    
  2. Find and copy the file /etc/xen/xend-config.sxp to /etc/xen/xend-config.sxp.backup:

    sudo cp /etc/xen/xend-config.sxp /etc/xen/xend-config.sxp.backup
    
  3. Open the file /etc/xen/xend-config.sxp with gedit or nano:

    sudo -H gedit /etc/xen/xend-config.sxp
    
  4. Find and uncomment the following lines:

    • xend-unix-server no, and change it to xend-unix-server yes
    • xend-unix-path /var/lib/xend/xend-socket, and change it to xend-unix-path /var/lib/xend/xend-socket
  5. Save the edited file and exit gedit or nano.

  6. Restart libvirt-bin, xen and xendomains services:

    sudo service libvirt-bin restart
    sudo service xen restart
    sudo service xendomains restart
    

I did the same and virt-manager connected.

The above instructions are largely based on a review by Gizmo Chicken on virt-manager on Ubuntu's Software Centre.

This issue shows up here:
http://lists.xen.org/archives/html/xen-devel/2012-12/msg01867.html

And is maybe related to the issue here:
https://bugs.launchpad.net/ubuntu/+source/virt-manager/+bug/915954