Changes

Jump to: navigation, search

Container enter failed

344 bytes added, 19:30, 30 September 2014
no edit summary
'''Problem''': container created succesfully and started.== Symptoms ==But when trying to do
<pre>
vzctl enter 101 </pre>you get<pre>container enter failed(?)error: open pty: No such file or directory
</pre>
== Solutions == === Using strace, you see=== You can use [http://linux.die.net/man/1/strace strace] to analyse the command further:
<pre>
# strace -ff vzctl enter101
....
fstat64(...st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0)...) fail
</pre>
'''Solution''':
Recompile the kernel with the following option:
<pre> CONFIG_LEGACY_PTYS=y<=== LEGACY_PTYS === ==== Temporary fix ====''Note: This is a temporary fix so you can enter the VE.'' * Create the LEGACY_PTYS devices:  vzctl exec 101 /sbin/MAKEDEV tty vzctl exec 101 /sbin/MAKEDEV pty vzctl exec 101 mknod --mode=666 /predev/ptmx c 5 2 vzctl enter 101 ==== Permanent fix with udev ====* For a permanent fix with udev, you will need to force udev to make LEGACY_PTYS:  cat >/etc/udev/makedev.d/51-udev.nodes # These device have to be created manually tty0 tty1 tty2 tty3 .... ttyp0 ttyp1 ttyp2 ttyp3 .... ptyp0 ptyp1 ptyp2 ptyp3 .... ==== Permanent fix without udev ====* Alternatively, you can disable udev: Edit the ''/etc/rc.d/rc.sysinit'' file and comment out the ''/sbin/start_udev'' line Or you can run the following command:  sed -i 's|/sbin/start_udev|#/sbin/start_udev|g' /etc/rc.d/rc.sysinit
''Warning'Other solutions''':Updates to the package which owns this file may revert your changes.
1) enter the ''Note'' This was tested with CentOS VE manually creating the LEGACY_PTYS devices.
<pre>vzctl exec 101 /sbin/MAKEDEV ttyvzctl exec 101 /sbin/MAKEDEV ptyvzctl enter 101</pre>=== Debian only ===
2A) If you want udev in * Enter the VE, manually CTID=101 vzctl exec $CTID "mount -t devpts devpts /dev/pts" save the changes forcing udev to make LEGACY_PTYS:vzctl enter $CTID
<pre>* Remove udev using aptcat > /etc/udev/makedev.d/51 CTID=101 vzctl exec $CTID apt-get remove udev.nodes# These device have to be created manuallytty0tty1tty2tty3....ttyp0ttyp1ttyp2ttyp3....ptyp0ptyp1ptyp2ptyp3....</pre> vzctl restart $CTID
=== Older Slackware ===
2B) If you think Check that /dev/pts is better disable udev in VE, comment out in mounted under the VE the linecontainer as a devpts filesystem:<pre>/sbin/start_udev</pre>in<pre>/etc/rc.d/rc.sysinit</pre>
.. <b>however</b> updates to the package which owns this file may revert your changes, so you must take steps to guard against this.vzctl exec VEID mount
Restart the VE and make the devices with MAKEDEV:<pre>vzctl exec 101 /sbin/MAKEDEV ttyvzctl exec 101 /sbin/MAKEDEV ptyvzctl enter 101</pre>I have used If it is not, try this method also to create zap dummy devices for asterisk in VEimmediate fix:<pre>/dev/zap/ctl/dev/zap/pseudo/dev/zap/channel/dev/zap/timer</pre>
2C) The devices can be setup also with a line in VE configvzctl exec VEID mount /dev/pts
<pre>grep DEV You should now be able to enter the VPS. You will need to fix /etc/vzrc.d/conf/101rc.confDEVNODES="zapS and/ctl:rw zapor /channel:rw zapetc/pseudo:rw zapfstab to ensure that /timer:rw "<dev/pre>pts is mounted in the boot process.
1
edit

Navigation menu