I have been struggling with LXC libvirt driver. I created LXC container fs
from "yum install" with install root option.
After that edited few files and created special nodes
rm -f /dev/null
mknod -m 666 /dev/null c 1 3
mknod -m 666 /dev/zero c 1 5
mknod -m 666 /dev/urandom c 1 9
ln -s /dev/urandom /dev/random
mknod -m 600 /dev/console c 5 1
mknod -m 660 /dev/tty1 c 4 1
chown root:tty /dev/tty1
mkdir -p /dev/shm
chmod 1777 /dev/shm
mkdir -p /dev/pts
chmod 755 /dev/pts
basically all instructions from here
http://wiki.1tux.org/wiki/Centos6/Installation/Minimal_installation_using...
My configuration looks like this
<domain type='lxc'>
<name>c03</name>
<memory unit="G">4</memory>
<os>
<type>exe</type>
<init>/sbin/init</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>/srv/libvirt-1.0.0/src/libvirt_lxc</emulator>
<filesystem type='mount'>
<source dir='/srv/guest/c03'/>
<target dir='/'/>
</filesystem>
<interface type='network'>
<mac address='52:54:00:00:00:01'/>
<source network='default'/>
<target dev='vnic-c03'/>
<model type='virtio'/>
</interface>
<console type='pty' />
</devices>
</domain>
I compiled libvirt from source. MY container comes up fine but I get
init: tty (/dev/tty1) main process ended, respawning
init: tty (console) respawning too fast, stopped
also, I can't login as root, because it say /dev/pts/0 is not safe, but if
I add a normal user with chroot and then I login, it works perfectly.
So in this case, after init stops everything, I can't get rc.local to
execute and in turn can't get ip address and other configurations up and
running.
help?
--
Thanks
Ajey