[Lxc-users] LXC guests and their PTY (permissions): PTY allocation request failed on channel 0

Christian Parpart trapni at gmail.com
Thu Oct 20 17:59:17 UTC 2011


Hi all,

I am really very happy about the goal to get a virtualization solution
mainline, however, there a quite a few things I really hate about LXC right
now, and this is one:

    "PTY allocation request failed on channel 0"

I created a Gentoo stage3 image into a seperate dir inside my Gentoo-based
host, and then created a /etc/lxc/GUEST/config file as well as its
/etc/lxc/GUEST/fstab.

Starting it works, and some times I see the /bin/init output on the invoking
terminal, and sometimes I don't (why this?),

But I absolutely do not understand right now why I am getting the above
error when trying to log in via SSH into my test system.

trapni at windsor ~ $ ssh root at 10.26.91.6
Password:
PTY allocation request failed on channel 0
Last login: Thu Oct 20 18:01:52 CEST 2011 from 10.26.91.1 on ssh

I had to CTRL-C here.
But the following command however worked well.

trapni at windsor ~ $ ssh root at 10.26.91.6 ps -ef
Password:
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 19:49 ?        00:00:00 init [3]
root       189     1  0 19:49 ?        00:00:00 /sbin/udevd --daemon
root       779     1  0 19:49 ?        00:00:00 /usr/bin/rsync --daemon
root       792     1  0 19:49 ?        00:00:00 /usr/sbin/sshd
root       813     1  0 19:49 ?        00:00:00 /sbin/agetty 38400 tty1
linux
root       814     1  0 19:49 ?        00:00:00 /sbin/agetty 38400 tty2
linux
root       815     1  0 19:49 ?        00:00:00 /sbin/agetty 38400 tty3
linux
root       830   792  0 19:53 ?        00:00:00 sshd: root at notty
root       833   830  0 19:53 ?        00:00:00 ps -ef

Doing a lxc-start and passing it /bin/bash as init works kind of, but is no
solution.

The following is my /etc/lxc/GUEST/config
lxc.utsname = GUEST
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = 4a:49:43:49:79:bf
lxc.network.ipv4 = 10.26.91.6/24
#lxc.network.ipv4 = 0.0.0.0
lxc.mount = /etc/lxc/GUEST/fstab
lxc.rootfs = /vservers/GUEST
lxc.tty = 2
lxc.pts = 4

#
---------------------------------------------------------------------------
# see http://www.mjmwired.net/kernel/Documentation/devices.txt

# deny device access by default
lxc.cgroup.devices.deny = a

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:8 rwm # /dev/random
lxc.cgroup.devices.allow = c 1:9 rwm # /dev/urandom
lxc.cgroup.devices.allow = c 254:0 rwm # /dev/rtc

# pseudo TTY devices
lxc.cgroup.devices.allow = c 2:0 rwm
lxc.cgroup.devices.allow = c 2:1 rwm
lxc.cgroup.devices.allow = c 2:2 rwm
lxc.cgroup.devices.allow = c 2:3 rwm

# TTY devices
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
lxc.cgroup.devices.allow = c 4:2 rwm
lxc.cgroup.devices.allow = c 4:3 rwm

# alternative TTY devices
lxc.cgroup.devices.allow = c 5:0 rwm # /dev/tty
lxc.cgroup.devices.allow = c 5:1 rwm # /dev/console
lxc.cgroup.devices.allow = c 5:2 rwm # /dev/pmtx

Some people on the net (this error seems quite prominet) fixed this by
wiping their lxc/GUEST/fstab,
I remember, that this worked a few days back (AFAIR) but today, I wanted to
give LXC a second try,
it certainly does not work.

Why is the guest's SSH still not getting a terminal?
What is the true "reference-fix" to that issue?

Many thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20111020/6d6df58a/attachment.html>


More information about the lxc-users mailing list