Using ubuntu 13.04 latest; i've installed lxc and various other tools
Here's my XML definition:
<domain type='lxc'>
<name>vm1</name>
<memory>500000</memory>
<os>
<type>exe</type>
<init>/bin/bash</init>
</os>
<vcpu>1</vcpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
<interface type='network'>
<source network='default'/>
</interface>
<console type='pty' />
</devices>
</domain>
I define it :
virsh --connect lxc:/// define application-test.xml
But when I try to start :
root@lxc:~# virsh --connect lxc:/// start vm1
error: Failed to start domain vm1
error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux container=lxc-libvirt container_uuid=1302678e-0447-79b7-6cc1-db4be64fdaf5 LIBVIRT_LXC_UUID=1302678e-0447-79b7-6cc1-db4be64fdaf5 LIBVIRT_LXC_NAME=vm1 /bin/bash
2013-05-16 14:33:49.930+0000: 1: info : libvirt version: 1.0.2
2013-05-16 14:33:49.930+0000: 1: error : lxcContainerMountCGroups:1893 : Failed to mount cgroup on '/sys/fs/cgroup': No such file or directory
2013-05-16 14:33:49.932+0000: 1866: info : libvirt version: 1.0.2
2013-05-16 14:33:49.932+0000: 1866: error : virLXCControllerRun:1462 : Unable to send container continue message: Broken pipe
2013-05-16 14:33:49.938+0000: 1866: error : virCommandWait:2287 : internal error Child process (ip link del veth1) unexpected exit status 1: Cannot find device "veth1"
And mount:
root@lxc:~# mount
/dev/xvda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
cgroup on /sys/fs/cgroup type cgroup (rw)
As seen it's mounted; but still can't get it to start.
Pulling my hairs out; any idea ?
I think this has more to do with your rootfs not being set correctly. Where in your XML file have you mounted the rootfs? I think the error occurs because the "/bin/bash" file itself is not visible / mounted. I have linked below a sample DOM.XML file of one of my containers that should illustrate the mounts of the rootfs.
File name : originalcopy.xml
So as you can see i have mounted my filesystem directories related to the container in the filesystem tag. You need to do the same with your rootfs (root file system). just replace the source dir to point to your particular path in your machine. IMO this should resolve the problem. If you have any difficulty in creating a rootfs, let me know.