PTY allocation request failed on channel 0 on Centos

dazza76

Renowned Member
May 25, 2010
41
0
71
Hello ,
i have migrated some servers form 3.4 to 4.1 and am having some issues ,
when I try to ssh to the box i get
"PTY allocation request failed on channel 0"

Does anybody have a solution for this ,
Yes i have tty setup as per https://pve.proxmox.com/wiki/OpenVZ_Console

Config is simple (no changes from default)
cat /etc/pve/lxc/208008020.conf
arch: amd64
cpulimit: 4
cpuunits: 1024
hostname: Server1
memory: 4096
net0: bridge=vmbr0,hwaddr=62:37:64:30:36:63,name=eth0,type=veth
ostype: centos
rootfs: local:208008020/vm-208008020-disk-1.raw,size=32G
swap: 1024



Cheers
D
 
the answer ,
I had been studying this post https://forum.proxmox.com/threads/pty-issue-with-ve-4-containers-converted-from-3.23485/
before and after I posted this .

I found i had to do 2 changes

1:I had to add the following line to the config , for some reason 1024 did not work
echo "lxc.pts=1" >> /etc/pve/lxc/208008020.conf

2: re add the start-ttys.conf and tty.conf ( you will note in the tty.conf i added "--nohangup" as it is a requirement

cat > /etc/init/start-ttys.conf <<EOF
#
# This service starts the configured number of gettys.
#
# Do not edit this file directly. If you want to change the behaviour,
# please create a file start-ttys.override and put your changes there.

start on stopped rc RUNLEVEL=[2345]

env ACTIVE_CONSOLES=/dev/tty[1-6]
env X_TTY=/dev/tty1
task
script
. /etc/sysconfig/init
for tty in $(echo $ACTIVE_CONSOLES) ; do
[ "$RUNLEVEL" = "5" -a "$tty" = "$X_TTY" ] && continue
initctl start tty TTY=$tty
done
EOF


cat > /etc/init/ttys.conf <<EOF
# tty - getty
#
# This service maintains a getty on the specified device.
#
# Do not edit this file directly. If you want to change the behaviour,
# please create a file tty.override and put your changes there.

stop on runlevel [S016]

respawn
instance $TTY
exec /sbin/mingetty --nohangup $TTY
usage 'tty TTY=/dev/ttyX - where X is console id'
EOF




Side note:
If you are running asterisk you need to modify the /usr/sbin/safe_asterisk and change the tty to 2 i.e (TTY=2) or it will not start
DONT FORGET TO REBOOT THE VM

Hope this helps somebody ,
Probably me in a few months

D
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!