Docker Community Forums

Share and learn in the Docker community.

Livirt-bin service not creating libvirt-sock in privileged mode

docker

(Chandru1989) #1

I ran container in privileged mode and manually started libvirt-bin service , it show like libvirt daemon is started but libvirt.pid and libvirt-sock is not created . If I ran container without privileged mode libvirt-sock is created successfully but KVM module will load only if container run in privileged mode

I dont know what is the issue and why libvirt-daemon is not creating libvirt-sock

chandru@chandru-OptiPlex-790:~$ sudo docker run -it --privileged localhost:5000/watermelon bash

  • ‘[’ -v INTERFACES ‘]’

  • ‘[’ -v JOB_NAME ‘]’

  • bash

root@2e3769adb550:/# sudo service libvirt-bin status

  • Checking status of libvirt management daemon libvirtd [fail]

root@2e3769adb550:/# sudo service libvirt-bin start

  • Starting libvirt management daemon libvirtd /var/run/libvirt/libvirt-sock ready.

                                                                                                                                                                                                                                    [ OK ]
    

root@2e3769adb550:/# cd /var/run/

root@2e3769adb550:/var/run# ls –lrt ----> both PID and socket not created but service start shows that libvirt-sock ready

total 36

-rw-rw-r-- 1 root utmp 0 Jan 19 2016 utmp

drwxrwxrwt 2 root root 4096 Jan 19 2016 lock

drwxr-xr-x 2 root root 4096 Jan 19 2016 shm

drwxr-xr-x 2 root root 4096 Jan 19 2016 sendsigs.omit.d

drwxr-xr-x 2 root netdev 4096 Jan 19 2016 network

-rw-r–r-- 1 root root 110 Jan 19 2016 motd.dynamic

drwxr-xr-x 3 root root 4096 Jan 19 2016 resolvconf

drwxr-xr-x 2 dnsmasq nogroup 4096 Oct 19 13:59 dnsmasq

drwxr-xr-x 2 root root 4096 Oct 19 14:00 sshd

drwxr-xr-x 2 root root 4096 Nov 21 18:33 libvirt

root@2e3769adb550:/var/run#

root@2e3769adb550:/var/run#

root@2e3769adb550:/var/run# cd libvirt/

root@2e3769adb550:/var/run/libvirt# ls -lrt

total 0

root@2e3769adb550:/var/run/libvirt#

root@2e3769adb550:/var/run/libvirt#

root@2e3769adb550:/var/run/libvirt# kvm

Could not initialize SDL(No available video device) - exiting

root@2e3769adb550:/var/run/libvirt# kvm-ok

INFO: /dev/kvm exists

KVM acceleration can be used

root@2e3769adb550:/var/run/libvirt# ls -l /dev/kvm

crw-rw---- 1 root 132 10, 232 Nov 21 18:33 /dev/kvm

root@2e3769adb550:/var/run/libvirt# sudo virsh net-list --all

error: failed to connect to the hypervisor

error: no valid connection

error: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock’: No such file or directory