在遇到 命令: virsh version
返回:error: failed to connect to the hypervisor
error: internal error: libxenlight state driver is not active
的解决办法:
-
Start Nautilus as root in terminal:
sudo -H nautilus
-
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
-
Open the file
/etc/xen/xend-config.sxp
withgedit
ornano
:sudo -H gedit /etc/xen/xend-config.sxp
-
Find and uncomment the following lines:
xend-unix-server no
, and change it toxend-unix-server yes
xend-unix-path /var/lib/xend/xend-socket
, and change it toxend-unix-path /var/lib/xend/xend-socket
-
Save the edited file and exit gedit or nano.
-
Restart
libvirt-bin
,xen
andxendomains
services:sudo service libvirt-bin restart sudo service xen restart sudo service xendomains restart