Hello, I am having difficulty getting any sort of LXC container running. I am trying to use the following tutorial to run the hello world example: https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ Here are the results of my running the tutorial: [root@terraria ~]# virsh list Id Name State ---------------------------------------------------- [root@terraria ~]# virsh uri lxc:/// [root@terraria ~]# cat helloworld.xml <domain type='lxc'> <name>helloworld</name> <memory>102400</memory> <os> <type>exe</type> <init>/bin/sh</init> </os> <devices> <console type='pty'/> </devices> </domain> [root@terraria ~]# virsh define helloworld.xml Domain helloworld defined from helloworld.xml [root@terraria ~]# virsh start helloworld error: Failed to start domain helloworld error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux container=lxc-libvirt container_uuid=791640de-95a9-082c-7292-c55106bcdca9 LIBVIRT_LXC_UUID=791640de-95a9-082c-7292-c55106bcdca9 LIBVIRT_LXC_NAME=helloworld /bin/sh error receiving signal from container: Input/output error --- As you can see, I am getting an error. How do I go about diagnosing this error? This is a fresh install so the only thing I have been using this machine for is for LXC/libvirt testing. -- Jacob Everist cell: 310-425-9732 email: jacob.everist@gmail.com
Some more details on my system. I am running CentOS 6.5. To install libvirt and LXC, I performed the following command: yum install libvirt libvirt-client python-virtinst I have turned selinux to DISABLED. On Wed, Jan 22, 2014 at 10:34 AM, Jacob Everist <jacob.everist@gmail.com>wrote:> Hello, > > I am having difficulty getting any sort of LXC container running. I am > trying to use the following tutorial to run the hello world example: > > > https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ > > > Here are the results of my running the tutorial: > > [root@terraria ~]# virsh list > Id Name State > ---------------------------------------------------- > > [root@terraria ~]# virsh uri > lxc:/// > > [root@terraria ~]# cat helloworld.xml > <domain type='lxc'> > <name>helloworld</name> > <memory>102400</memory> > <os> > <type>exe</type> > <init>/bin/sh</init> > </os> > <devices> > <console type='pty'/> > </devices> > </domain> > [root@terraria ~]# virsh define helloworld.xml > Domain helloworld defined from helloworld.xml > > [root@terraria ~]# virsh start helloworld > error: Failed to start domain helloworld > error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux > container=lxc-libvirt container_uuid=791640de-95a9-082c-7292-c55106bcdca9 > LIBVIRT_LXC_UUID=791640de-95a9-082c-7292-c55106bcdca9 > LIBVIRT_LXC_NAME=helloworld /bin/sh > error receiving signal from container: Input/output error > > --- > > As you can see, I am getting an error. How do I go about diagnosing this > error? This is a fresh install so the only thing I have been using this > machine for is for LXC/libvirt testing. > > -- > Jacob Everist > > cell: 310-425-9732 > email: jacob.everist@gmail.com >-- Jacob Everist cell: 310-425-9732 email: jacob.everist@gmail.com
On 01/22/2014 11:42 AM, Jacob Everist wrote:> Some more details on my system. > > I am running CentOS 6.5. To install libvirt and LXC, I performed the > following command:That may be your problem. LXC is not very well supported in RHEL 6 (it was marked as a technology preview, which means Red Hat is not supporting it - and CentOS just adds another layer of non-support). There has been LOTS of upstream work on LXC in the meantime (RHEL 6 uses libvirt 0.10.2, and upstream is now at 1.2.1). You probably want to try rebuilding libvirt from upstream tarballs, and/or trying the RHEL 7 beta, before trying anything serious with libvirt LXC support. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Daniel P. Berrange
2014-Jan-23 10:33 UTC
Re: [libvirt-users] running LXC hello world example
On Wed, Jan 22, 2014 at 10:42:15AM -0800, Jacob Everist wrote:> Some more details on my system. > > I am running CentOS 6.5. To install libvirt and LXC, I performed the > following command: > > yum install libvirt libvirt-client python-virtinst > > I have turned selinux to DISABLED.When you say disabled, do you actually mean you booted with selinux=0 or do you just mean you set it to permissive. In RHEL-6 there was a bug that could break LXC if you boot with selinux=0. Running with selinux enabled, but in permissive mode should work just fine though.> On Wed, Jan 22, 2014 at 10:34 AM, Jacob Everist <jacob.everist@gmail.com>wrote: > > > Hello, > > > > I am having difficulty getting any sort of LXC container running. I am > > trying to use the following tutorial to run the hello world example: > > > > > > https://www.berrange.com/posts/2011/09/27/getting-started-with-lxc-using-libvirt/ > > > > > > Here are the results of my running the tutorial: > > > > [root@terraria ~]# virsh list > > Id Name State > > ---------------------------------------------------- > > > > [root@terraria ~]# virsh uri > > lxc:/// > > > > [root@terraria ~]# cat helloworld.xml > > <domain type='lxc'> > > <name>helloworld</name> > > <memory>102400</memory> > > <os> > > <type>exe</type> > > <init>/bin/sh</init> > > </os> > > <devices> > > <console type='pty'/> > > </devices> > > </domain> > > [root@terraria ~]# virsh define helloworld.xml > > Domain helloworld defined from helloworld.xml > > > > [root@terraria ~]# virsh start helloworld > > error: Failed to start domain helloworld > > error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux > > container=lxc-libvirt container_uuid=791640de-95a9-082c-7292-c55106bcdca9 > > LIBVIRT_LXC_UUID=791640de-95a9-082c-7292-c55106bcdca9 > > LIBVIRT_LXC_NAME=helloworld /bin/sh > > error receiving signal from container: Input/output error > > > > --- > > > > As you can see, I am getting an error. How do I go about diagnosing this > > error? This is a fresh install so the only thing I have been using this > > machine for is for LXC/libvirt testing.You can try looking at /var/log/libvirt/lxc/$GUEST.log if that has insufficient info, then you can do service libvirtd stop edit /etc/libvirt/lxc.conf and set log_with_libvirtd=1 LIBVIRT_LOG_FILTERS=1:lxc LIBVIRT_LOG_OUTPUTS=1:stderr /usr/sbin/libvirt and then start the guest - the guest log file should then have much more info in it. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|