[lxc-users] Ubuntu (maverick) container hangs at init

Fajar A. Nugraha list at fajar.net
Thu May 15 12:13:57 UTC 2014


On Thu, May 15, 2014 at 3:51 PM, Stephen Zhang <zsrkmyn at gmail.com> wrote:
>
> I corrected the line in fstab "none /lxc/rootfs.ubuntu/dev/pts devpts
> defaults 0 0" to right path, failed.
> I comment the line above, failed.
> I change the whole fstab using
> http://wiki.1tux.org/wiki/Lxc/Installation/Guest/Centos/6 provides,
> failed. TAT
> All the things happened as the same.
> I also changed the lxcguest.conf (the original one is provided by the
> package lxcguest) to this (which is found in a previous mail list):
>
> start on startup
>
> env container
> env LIBVIRT_LXC_UUID
>
> script
>         rm -rf /var/run/*.pid
>         rm -rf /var/run/network/*
>         /sbin/initctl emit stopped JOB=udevtrigger --no-wait
>         /sbin/initctl emit started JOB=udev --no-wait
> end script
>

I'm actually surprised that you were able to create it using template at
all. The template should fail due to the fact that lxcguest package is not
available for maverick.

Anyway, maverick seems to be a tough one. Here's what I did:
- Start with whatever lxc-create ended up with. In my case I copied
/var/cache/lxc/maverick/rootfs-amd4 to /var/lib/lxc/maverick/rootfs. Revert
whatever mannual changes you might have made.

- use a config file like this (the container name is "maverick" in this
example)
###
lxc.utsname = maverick
lxc.arch = x86_64
lxc.rootfs = /var/lib/lxc/maverick/rootfs

lxc.network.type=veth
lxc.network.link=lxcbr0
lxc.network.flags=up
lxc.network.hwaddr= 00:16:3E:82:28:D8
lxc.network.veth.pair=veth-maverick-0

lxc.include = /usr/share/lxc/config/ubuntu.common.conf
#override from common config
lxc.aa_profile = unconfined
###

- edit the container's etc/network/interfaces:
###
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
###

- create this file on the container (you can fine-tune this later)
# cat etc/init/lxcguest.conf
start on started ssh

script
umount /dev/pts || true
mount -t devpts devpts /dev/pts
end script

- lxc-start -n maverick

- (on a different window) lxc-attach -n maverick

- on the lxc-attach window, run
-- ps -efa
-- ifconfig eth0
-- (change the root password if you have to)

- (from the host): ssh to the container

In my test, the container pretty much runs well, all services (e.g. cron,
syslog, ssh) started. The only problem is that the console doesn't work
(hence, in the future, start the container using "-d"), but lxc-attach can
be a workaround for most needs.

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140515/ed824e5d/attachment.html>


More information about the lxc-users mailing list