[libvirt] simple LXC/libvirt busybox container (Unable to get cgroup)

Ryota Ozaki ozaki.ryota at gmail.com
Thu Dec 10 12:26:39 UTC 2009


On Thu, Dec 10, 2009 at 9:03 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
> On Thu, Dec 10, 2009 at 02:22:37AM -0600, Tony Risinger wrote:
>> i'm trying to get even the simplest busybox container with libvirt+LXC
>> with very limited success.  I feel l am missing something supremely
>> simple for me to be hung on this for weeks.
>>
>> i dont see anything interesting in domain log, but getting this error
>> from "LIBVIRT_DEBUG=1 libvirtd":
>>
>> 05:27:56.113: error : lxcDomainGetInfo:462 : internal error Unable to
>> get cgroup for arch-nano
>> 05:27:56.113: debug : virDomainFree:2004 : domain=0x81d8e68
>> 05:27:56.113: debug : virUnrefDomain:422 : unref domain 0x81d8e68 arch-nano 1
>> 05:27:56.113: debug : virReleaseDomain:376 : release domain 0x81d8e68 arch-nano
>> 05:27:56.113: debug : virReleaseDomain:392 : unref connection 0x81dc0f0 2
>> 05:27:56.113: debug : remoteSerializeError:141 : prog=536903814 ver=1
>> proc=16 type=1 serial=4, msg=internal error Unable to get cgroup for
>> arch-nano
>>
>> i've been using this root filesystem layout:
>>
>> [root at PHS-001 arch-nano]# tree
>> .
>> |-- bin
>> |   |-- cat -> ../sbin/busybox
>> |   |-- chdir -> ../sbin/busybox
>> |   |-- chmod -> ../sbin/busybox
>> |   |-- ls -> ../sbin/busybox
>> |   |-- rm -> ../sbin/busybox
>> |   |-- sh -> ../sbin/busybox
>> |   `-- vi -> ../sbin/busybox
>> |-- dev
>> |   `-- pts
>> |-- etc
>> |-- proc
>> |-- sbin
>> |   |-- busybox
>> |   `-- init -> busybox
>> `-- sys
>>
>> all folders besides /bin and /sbin were created by libvirt.  i tried
>> using the /sbin/init script previously suggested:
>>
>> #!/sbin/busybox
>> sh
>
>
> Sorry, my suggestion was wrong. I forgot that if you have #!/sbin/busybox
> it will attempt to execute the command matching the name of the script.
> So it will in fact try to run 'init', rather than 'sh'.
>
> Just make the libvirt XML point directly to /bin/sh  instead and it
> should work. I even tested it this time :-)

Hem, I still have a problem with ns subsystem enabled. Yes, I can launch
a container however the cgroup hierarchy is wrong from libvirtd expecting
like:

/: libvirtd --daemon
/5345: /usr/libexec/libvirt_lxc --name

Daniel, could you confirm how about your cgroup hierarchy?

  ozaki-r

>
>> but i get a similar results either way (script/symlink):
>>
>>  8173 ?        Ss     0:00 /usr/lib/libvirt-git/libvirt_lxc --name
>> arch-nano --console 11 --background
>>  8175 pts/0    Ss+    0:00 init
>>  8177 ?        Ss     0:00 init
>>  8181 ?        Zs     0:00 [init] <defunct>
>>  8182 ?        Zs     0:00 [init] <defunct>
>>  8183 ?        Zs     0:00 [init] <defunct>
>
> Yeah this is what I see too, when i have /sbin/init - changing it to
> /bin/sh works
>
>
> Daniel
> --
> |: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
> |: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
>
> --
> Libvir-list mailing list
> Libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>




More information about the libvir-list mailing list