[Lxc-users] No console logging (guest converted from VServer)

Permjacov Evgeniy permeakra at gmail.com
Fri Jun 10 19:00:45 UTC 2011


my config file looks like this

lxc.arch = amd64
lxc.utsname = ws-log
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0 <== I use internal bridged network with nat so my
guests are not visible from external world.
lxc.network.name = eth0
lxc.network.ipv4 = 0.0.0.0
lxc.pts = 1024
lxc.console = /var/log/lxc/console-ws-log.log
lxc.tty = 4 # <== I allowed only four ttys
lxc.rootfs = /virtuals/ws-log/

#I mount all filesystems using host system. I created all needed device
nodes by hand and disabled udev daemon. I also do not have hald.
lxc.mount.entry = shm           /virtuals/ws-log/dev/shm       
tmpfs           defaults                0 0 <== this is some glibc
stuff. not sure what it is for
lxc.mount.entry = devpts        /virtuals/ws-log/dev/pts/      
devpts          defaults                0 0
lxc.mount.entry = proc          /virtuals/ws-log/proc/         
proc            defaults                0 0
lxc.mount.entry = sysfs         /virtuals/ws-log/sys/          
sysfs           defaults                0 0
lxc.mount.entry = tmpfs         /virtuals/ws-log/tmp/          
tmpfs           defaults                0 0
lxc.mount.entry = tmpfs         /virtuals/ws-log/usr/portage/distfiles 
tmpfs   defaults                0 0

lxc.cgroup.devices.deny = a
# /dev/null and zero <== you defenitly need this
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm # <=== you have no this line (this
is for /dev/console wich is console where boot logging occurs. Probable,
this is the point, but you need /dev/console node in guest system as well
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm # <== you also need this lines for
/dev/tty (I allowed 4 tty's here, you have to continue with two similiar
lines for 6 ttys If your guests setting will not be in sync with this
lxc container settings, you'll get annoying messages from inittabe about
respawning getty
lxc.cgroup.devices.allow = c 4:2 rwm
lxc.cgroup.devices.allow = c 4:3 rwm
lxc.cgroup.devices.allow = c 4:4 rwm


# /dev/{,u}random <== could not make this and all following stuff
working yet
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
# /dev/pts/* - pts namespaces are "coming soon"
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
==================
You also have to check, that your /guest-dir/dev has at least this nodes
/dev/null
/dev/console

may be you will have to make this nodes as well
/dev/random
/dev/urandom
/dev/tty0
...
/dev/tty6

for my gentoo guest I also had to set up this dirs
/dev/pts
/dev/shm

there are many, many resources, talking about /dev dir content and how
to create it.


On 06/10/11 15:27, Tzafrir Cohen wrote:
> Hi
>
> I'm trying to convert some guests from Linux-VServer to LXC.
> The system is Debian Squeese (recently upgraded from Lenny), running a
> 2.6.32-5-vserver-686 kernel.
>
> I set up one new LXC guest, and it seems to work fine. So I went on to
> convert one of the VServer gussts to LXC (basically set it not to start
> automatically in /etc/vservers, created a LXC config for it, and did
> some minimal changes). So far not so good.
>
> It has been sort-of-working. But now I can't seem to start it.
>
> What's even worse is that I don't see anything on the console log file I
> set up: it remains empty (and no: no disk space issues and such). The
> other guest seems to log the console output.
>
> What may be the cause for not having a console output?
>
> Condif file:
>
> lxc.utsname = vtiger
> lxc.network.type = veth
> lxc.network.flags = up
> lxc.network.link = br0
> lxc.network.hwaddr = 4a:49:43:49:79:01
> lxc.network.ipv4 = 192.168.0.212/20
> lxc.mounts = /etc/lxc/vtiger.fstab
> lxc.rootfs = /var/lib/vservers/vtiger
> lxc.console = /var/log/lxc/console_vtiger.log
> lxc.tty = 6
> lxc.cgroup.devices.allow = c 1:3 rwm # dev/null
> lxc.cgroup.devices.allow = c 1:5 rwm # dev/zero
> lxc.cgroup.devices.allow = c 1:9 rwm # dev/urandom
>
> vtiger.fstab:
> none /var/lib/vservers/vtiger/dev/pts devpts defaults 0 0
> none /var/lib/vservers/vtiger/proc    proc   defaults 0 0
> none /var/lib/vservers/vtiger/sys     sysfs  defaults 0 0
>





More information about the lxc-users mailing list