Eu construo o contêiner docker que contém qemu2.5 com base no ubuntu 16.
Quando tento executar o libvirt, recebo este erro:
root@1116a7e45f20:/# /etc/init.d/libvirt-bin start
* Starting libvirt management daemon libvirtd
/usr/sbin/libvirtd: error while loading shared libraries: libvirt-admin.so.0: cannot open shared object file: Permission denied
Waiting for /var/run/libvirt/libvirt-sock - recheck in 2 sec
Waiting for /var/run/libvirt/libvirt-sock - recheck in 2 sec
Waiting for /var/run/libvirt/libvirt-sock - recheck in 2 sec
Waiting for /var/run/libvirt/libvirt-sock - recheck in 2 sec
Waiting for /var/run/libvirt/libvirt-sock - recheck in 2 sec
Giving up waiting for /var/run/libvirt/libvirt-sock.
Eu corro o contêiner docker com a bandeira - privilegiada
Dentro do container docker não consigo adicionar novas regras para libvirt em apparmor como:
root@1116a7e45f20:/# aa-complain /etc/apparmor.d/usr.sbin.libvirtd
Setting /etc/apparmor.d/usr.sbin.libvirtd to complain mode.
ERROR: Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
Use --subdomainfs to override.
há saída strace:
lose(4) = 0
read(3, "1\n", 128) = 2
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=514, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]}) = 2
read(3, "", 128) = 0
close(3) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 514
stat("/var/run/libvirt/libvirt-sock", 0x7ffed1f87c90) = -1 ENOENT (No such file or directory)
write(1, "Waiting for /var/run/libvirt/lib"..., 61Waiting for /var/run/libvirt/libvirt-sock - recheck in 2 sec
) = 61
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fe834b3e9d0) = 515
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 515
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=515, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]}) = 515
pipe([3, 4]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fe834b3e9d0) = 516
close(4) = 0
read(3, "0\n", 128) = 2
read(3, "", 128) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=516, si_uid=0, si_status=1, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]}) = 0
close(3) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 516
write(1, "Giving up waiting for /var/run/l"..., 53Giving up waiting for /var/run/libvirt/libvirt-sock.
) = 53
exit_group(1) = ?
+++ exited with 1 +++
e apenas uma biblioteca não mostra seu caminho
root@1116a7e45f20:/# ldd /usr/sbin/libvirtd
linux-vdso.so.1 => (0x00007ffd58fa2000)
O que há de errado com esse contêiner?
Por favor, qual pode ser a causa raiz desse erro?