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

Stephen Zhang zsrkmyn at gmail.com
Thu May 15 17:47:38 UTC 2014


2014-05-15 20:13 GMT+08:00 Fajar A. Nugraha <list at fajar.net>:

> 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
>
>
It does work!! Thx! But there still are 2 problems:
1. It seems that the .conf files in /etc/init/ don't work if they are set
"startup on runlevel [*]" (* means any possible number) such as rc.conf,
dmesg.conf and cron.conf. So, the tty*.conf, which are set "startup on
stopped rc RUNLEVEL=[2345]", are never to be run, for rc.conf does not
start at all.
2. I don't know why, but once I start the container, I sometimes may not
make my terminal work (both urxvt and xfce4-terminal), it says "Fail to
execute child     grantpt failed: Operation not permitted."

Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140516/63c3600d/attachment.html>


More information about the lxc-users mailing list