openvz Server refused to allocate pty solution
By Ruben on Oct 16, 2007 | In Linux Hosting, OpenVZ | Send feedback »
SSH returns: "Server refused to allocate pty" upon login.
OR:
"enter into VE 101 failed
Unable to open pty: No such file or directory"
This solution is for CentOS VE's.
Solution #1
At the HN (hardware node) enter (replace 101 with your VE-id / CT-id):
$ vzctl exec 101 /sbin/MAKEDEV tty
$ vzctl exec 101 /sbin/MAKEDEV pty
Then enter the VE/CT:
$ vzctl enter 101
And make sure the udev rpm is gone:
...else the problem comes back after a VE reboot.
$ rpm -e --nodeps udev
Solution #2
If the problem persists try this:
$ vzctl exec 101 rpm -e --nodeps udev
$ nano -w /var/lib/vz/root/101/etc/rc.sysinit
or...
$ nano -w /vz/root/101/etc/rc.sysinit
Find:
/sbin/start_udev
Replace by:
#/sbin/start_udev
/sbin/MAKEDEV tty
/sbin/MAKEDEV pty
$ vzctl restart 101
Solution #3
If the problem persists after reboot, repeat the steps above and create the following file within the VE/CT:
/etc/udev/makedev.d/51-udev.nodes
...with these contents:
# These device have to be created manually
tty0
tty1
tty2
tty3
ttyp0
ttyp1
ttyp2
ttyp3
ptyp0
ptyp1
ptyp2
ptyp3
Solution #4
Sometimes the problem can be very persistent. If none helps, the following solution might help. It copies devices from the hostnode to the container.
Create and edit /etc/vz/conf/101.mount likewise:
#!/bin/bash
VEID=`basename $0 | sed -e 's/\(.*\)\..*/\1/g'`
rm -f /var/lib/vz/private/${VEID}/dev/*
rsync -a /dev/* /var/lib/vz/private/${VEID}/dev
$ chmod 700 /etc/vz/conf/101.mount
$ vzctl restart 101
References:
http://forum.openvz.org/index.php?t=msg&goto=14953
http://wiki.openvz.org/Container_enter_failed
http://linuxhostingsupport.net/blog/tag/sbinmakedev-pty
No feedback yet
Comments are closed for this post.
« OpenVZ server crash CentOS5 when iptables changes | bash_history not working in VE (virtual environment) of openvz » |