Editing Container enter failed

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
== Symptoms ==
+
'''Problem''': container created succesfully and started.
 
+
But when trying to do
 +
<pre>
 +
vzctl enter 101
 +
</pre>
 +
you get
 
<pre>
 
<pre>
error: open pty: No such file or directory
+
container enter failed(?)
 
</pre>
 
</pre>
  
== Solutions ==
+
Using strace, you see:
 
 
=== Using strace ===
 
 
 
You can use [http://linux.die.net/man/1/strace strace] to analyse the command further:
 
 
<pre>
 
<pre>
# strace -ff vzctl enter 101
+
# strace -ff vzctl enter
 
....
 
....
 
fstat64(...st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0)...) fail
 
fstat64(...st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0)...) fail
Line 17: Line 17:
 
</pre>
 
</pre>
  
 +
'''Solution''':
 
Recompile the kernel with the following option:
 
Recompile the kernel with the following option:
CONFIG_LEGACY_PTYS=y
+
<pre>
 +
CONFIG_LEGACY_PTYS=y
 +
</pre>
  
=== LEGACY_PTYS ===
+
'''Other solutions''':
  
==== Temporary fix ====
+
1) enter the VE manually creating the LEGACY_PTYS devices
''Note: This is a temporary fix so you can enter the VE.''
 
  
* Create the LEGACY_PTYS devices:
+
<pre>
 +
vzctl exec  101 /sbin/MAKEDEV tty
 +
vzctl exec 101 /sbin/MAKEDEV pty
 +
vzctl enter 101
 +
</pre>
  
  vzctl exec 101 /sbin/MAKEDEV tty
+
2A) If you want udev in VE, save the changes forcing udev to make LEGACY_PTYS:
vzctl exec 101 /sbin/MAKEDEV pty
 
vzctl exec 101 mknod --mode=666 /dev/ptmx c 5 2
 
vzctl enter 101
 
  
==== Permanent fix with udev ====
+
<pre>
* 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
 +
....
 +
</pre>
  
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 ====
+
2B) If you think is better disable udev in VE, comment out in the VE the line:
* Alternatively, you can disable udev:
+
<pre>
 +
/sbin/start_udev
 +
</pre>
 +
in
 +
<pre>
 +
/etc/rc.d/rc.sysinit
 +
</pre>
  
Edit the ''/etc/rc.d/rc.sysinit'' file and comment out the ''/sbin/start_udev'' line
+
.. <b>however</b> updates to the package which owns this file may revert your changes, so you must take steps to guard against this.
 
 
Or you can run the following command:
 
 
 
sed -i 's|/sbin/start_udev|#/sbin/start_udev|g' /etc/rc.d/rc.sysinit
 
 
 
''Warning'' Updates to the package which owns this file may revert your changes.
 
 
 
''Note'' This was tested with CentOS VE.
 
 
 
=== Debian only ===
 
 
 
* Enter the VE manually
 
CTID=101
 
vzctl exec $CTID "mount -t devpts devpts /dev/pts"
 
vzctl enter $CTID
 
 
 
* Remove udev using apt
 
CTID=101
 
vzctl exec $CTID apt-get remove udev
 
vzctl restart $CTID
 
 
 
=== Older Slackware ===
 
 
 
Check that /dev/pts is mounted under the container as a devpts filesystem:
 
 
 
vzctl exec VEID mount
 
 
 
If it is not, try this immediate fix:
 
 
 
vzctl exec VEID mount /dev/pts
 
 
 
You should now be able to enter the VPS. You will need to fix /etc/rc.d/rc.S and/or /etc/fstab to ensure that /dev/pts is mounted in the boot process.
 
  
 +
Restart the VE and make the devices with MAKEDEV:
 +
<pre>
 +
vzctl exec  101 /sbin/MAKEDEV tty
 +
vzctl exec 101 /sbin/MAKEDEV pty
 +
vzctl enter 101
 +
</pre>
  
 
== See also ==
 
== See also ==

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: