Difference between revisions of "Container enter failed"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(new solutions)
Line 23: Line 23:
 
</pre>
 
</pre>
  
'''Another solution''':
+
'''Other solutions''':
  
enter the VE  manually creating the LEGACY_PTYS devices
+
1) enter the VE  manually creating the LEGACY_PTYS devices
  
 
<pre>
 
<pre>
Line 33: Line 33:
 
</pre>
 
</pre>
  
To save the changes force udev to make LEGACY_PTYS:
+
2A) If you want udev in VE,  save the changes forcing udev to make LEGACY_PTYS:
  
 
<pre>
 
<pre>
Line 42: Line 42:
 
tty2
 
tty2
 
tty3
 
tty3
tty4
+
....
tty5
 
tty6
 
tty7
 
tty8
 
tty9
 
 
ttyp0
 
ttyp0
 
ttyp1
 
ttyp1
 
ttyp2
 
ttyp2
 
ttyp3
 
ttyp3
ttyp4
+
....
ttyp5
 
ttyp6
 
 
ptyp0
 
ptyp0
 
ptyp1
 
ptyp1
 
ptyp2
 
ptyp2
 
ptyp3
 
ptyp3
ptyp4
+
....
ptyp5
+
</pre>
  
 +
 +
2B) If you think is better disable udev in VE, comment out in the VE the line:
 +
<pre>
 +
/sbin/start_udev
 +
</pre>
 +
in
 +
<pre>
 +
/etc/rc.d/rc.sysinit
 +
</pre>
 +
 +
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>
 +
I have used this method also to create zap dummy devices for asterisk in VE:
 +
<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 config
 +
 +
<pre>
 +
grep DEV /etc/vz/conf/101.conf
 +
DEVNODES="zap/ctl:rw zap/channel:rw zap/pseudo:rw zap/timer:rw "
 
</pre>
 
</pre>
  

Revision as of 16:04, 27 March 2008

Problem: container created succesfully and started. But when trying to do

vzctl enter 101 

you get

container enter failed(?)

Using strace, you see:

# strace -ff vzctl enter
....
fstat64(...st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0)...) fail
....

Solution: Recompile the kernel with the following option:

CONFIG_LEGACY_PTYS=y

Other solutions:

1) enter the VE manually creating the LEGACY_PTYS devices

vzctl exec  101 /sbin/MAKEDEV tty
vzctl exec 101 /sbin/MAKEDEV pty
vzctl enter 101

2A) If you want udev in VE, save the changes forcing 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
....


2B) If you think is better disable udev in VE, comment out in the VE the line:

/sbin/start_udev

in

/etc/rc.d/rc.sysinit

Restart the VE and make the devices with MAKEDEV:

vzctl exec  101 /sbin/MAKEDEV tty
vzctl exec 101 /sbin/MAKEDEV pty
vzctl enter 101

I have used this method also to create zap dummy devices for asterisk in VE:

/dev/zap/ctl
/dev/zap/pseudo
/dev/zap/channel
/dev/zap/timer

2C) The devices can be setup also with a line in VE config

grep DEV /etc/vz/conf/101.conf
DEVNODES="zap/ctl:rw zap/channel:rw zap/pseudo:rw zap/timer:rw "


See also