3 Jun 2008

Creating a Minimal CentOS 5.1 VE in OpenVZ

These steps are for those with OpenVZ already installed and running.

Move to the templates directory:

# cd /vz/template/cache

Download CentOS 5.1 template:

# wget http://download.openvz.org/template/precreated/contrib/centos-5-i386-minimal.tar.gz

Create the VE:

# vzctl create --ostemplate centos-5-i386-minimal


Set VE's IP address:

# vzctl set --ipadd --save

Set VE's hostname:

# vzctl set --hostname --save

Set root's password:

# vzctl set --userpasswd root:password

Start the VE:

# vzctl start

Trying to enter the VE now I got an error:

# vzctl enter
enter into VE failed
Unable to open pty: No such file or directory


We can solve this with:

# vzctl exec /sbin/MAKEDEV tty
# vzctl exec /sbin/MAKEDEV pty
# vzctl exec /sbin/MAKEDEV ptmx
# vzctl exec /sbin/MAKEDEV random
# vzctl enter

Then we remove udev package like this:

# rpm -qf /etc/udev/makedev.d/50-udev.nodes
udev-095-14.9.el5
# rpm -e udev-095-14.9.el5 –nodeps


Now we can restart the VE and we are ready to go.

No comments: