util-vserver:Setup CentOS Guest

From Linux-VServer

Jump to: navigation, search

Create a CentOS Guest

  • Create the guest
vserver myserver1 build -m yum --interface eth0:192.168.0.1/24 --hostname=myserver1 -- -d centos4
  • Start the guest
vserver myserver1 start
  • Copy the nameserver config from the host
cp /etc/resolv.conf /vservers/myserver1/etc/resolv.conf
  • Install elementary packages on the guest
vyum myserver1 -- install -y openssh openssh-server vim-minimal passwd mtr rsync screen
  • Login into the guest
vserver myserver1 enter
  • Edit ssh to allow login
vi /etc/ssh/sshd_config
  • Modify UsePAM yes to:
UsePAM no
  • Restart ssh
service sshd restart
  • Set passwd
passwd
  • Exit the guest
exit

Internalize Package Management

  • Install yum and rpm
vyum myserver1 -- install -y yum 
  • Internalize package management
vserver myserver1 pkgmgmt internalize
  • create the correct system vars for yum
vserver myserver1 exec bash -c "rm -f /var/lib/rpm/__db*; rpm --rebuilddb"
Personal tools