[Lxc-users] lxc-console: failed to connect to tty service

Advait Alai advaitalai at gmail.com
Mon Mar 7 06:19:28 UTC 2011


>
> In order to use the console, the getty console should be launched inside
> the container with the proper configuration, a rootfs and a
> lxc.tty=<nrttys>
>

I am using / as my rootfs for the container (i.e., sharing with my main
system). I also included lxc.tty = 4 in my conf file. For console to work, I
learned that I need to define a /etc/inittab file. I have defined it as
follows:

id:3:initdefault:
si::sysinit:/etc/init.d/rcS
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin
 1:2345:respawn:/sbin/getty 38400 console
c1:12345:respawn:/sbin/getty 38400 tty1 linux
c2:12345:respawn:/sbin/getty 38400 tty2 linux

My conf file for the container is:

lxc.utsname = left
lxc.tty = 4
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br-left
lxc.network.ipv4 = 10.0.0.1

# /dev/null and zero
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
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
# /dev/pts/* - pts namespaces are "coming soon"
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm

When I try to login to the console, I just get the message "Type <Ctrl+a q>
to exit the console", and no prompt. How should I define inittab to get it
to call getty?


>
> It is inadequate to spawn an interactive shell within container in
> daemon mode where fd 0, fd 1 and fd 2 are closed.
>

I'm not sure I understand what this means. What changes do I need to make to
open fds 0,1,2?

Thanks


>
>
>
> ------------------------------------------------------------------------------
> What You Don't Know About Data Connectivity CAN Hurt You
> This paper provides an overview of data connectivity, details
> its effect on application quality, and explores various alternative
> solutions. http://p.sf.net/sfu/progress-d2d
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>



-- 
Advait Alai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20110307/5ef818e5/attachment.html>


More information about the lxc-users mailing list