RE: [Vserver] Building vserver from skeleton

From: <>
Date: Thu 18 May 2006 - 17:43:41 BST
Message-ID: <>

If you are trying to take a physical server and make it a vserver here
are the steps I used. In this case the physical host was a redhat
advanced server 3.0 update 4.

Hope it helps

Creating a vserver from a non-vserver host

    * Clone host1 (non-vserver) to host2:vserver1

calcrs03 --> calvunix02:rhas3template01

ssh calvunix02
sudo /etc/rc.d/rsyncd start
sudo vserver vrhas3template01 build -m skeleton -n vrhas3template01
--context 30 --hostname --interface --netdev eth0 --netmask --initstyle plain

ssh calcrs03
cat /home/sig/rsync-exclude.txt

sudo rsync -avz -e ssh --exclude-from=/home/sig/rsync-exclude.txt /

ssh calvunix02
sudo vi /vservers/vrhas3template01/etc/resolv.conf
sudo vi /vservers/vrhas3template01/etc/fstab
sudo vi /vservers/vrhas3template01/etc/hosts
sudo vi /vservers/vrhas3template01/etc/ssh/sshd_config
X11UseLocalhost no - Needed for vserver x forwarding
sudo vi /vservers/vrhas3template01/etc/sysconfig/network
set hostname
sudo vi /vservers/vrhas3template01/etc/rc.sysinit
remove mtab references
remove tty references
sudo vi /vservers/vrhas3template01/etc/inittab
remove tty references
check over /usr/local/etc/vservers/vrhas3template01/..

sudo vserver vrhas3template01 start
sudo vserver-stat
sudo vserver vrhas3template01 enter

-----Original Message-----
[] On Behalf Of Fareha
Sent: Thursday, May 18, 2006 9:43 AM
Subject: Re: [Vserver] Building vserver from skeleton

Xavier Montagutelli wrote:

>On Wednesday 17 May 2006 16:20, Fareha Shafique wrote:
>>I want to try to build a few vservers from a host template and then
>>unify these vservers. I'm not sure what files I need to include in the
>>template. I tried to create one vserver like this but I cannot start
>>I get the following error:
>># vserver sk start
>>No command given; use '--help' for more information.
>>An error occured while executing the vserver startup sequence; when
>>there are no other messages, it is very likely that the init-script
>>() failed.
>>Common causes are:
>>* /etc/rc.d/rc on Fedora Core 1 and RH9 fails always; the 'apt-rpm'
>> method knows how to deal with this, but on existing installations,
>> appending 'true' to this file will help.
>>Failed to start vserver 'sk'
>What is "sk" ? Your "host template" or the first vserver based on the
>template ?
>Could you tell us more precisely how you created the vserver you call
>"host template" (I suppose it is a normal vserver that you won't run) ?
>think this one should be constructed as a normal vserver, for example
>standard methods (vserver my_template build -m <your_method> ....)
>How do you create the actual vservers from the template : do you use
>vserver-copy, something like ?
Well I found a thread in the mailing list archive that said:
"- reserve space on your /vservers partition for a template
- dump/restore or cp -va or whatever, your existing host system there
- cleanup the template with simple chroot, i.e. remove packages and
stuff you won't need in a guest, adjust the startup/shutdown scripts to
avoid hardware stuff
- clear out /proc and /dev inside the template
now this is only required once, and will save you a lot of space later
to create a new guest, use the 'skeleton' method with all the desired
config options, then copy over the template into the skeleton guest dir"

So what I did was copied my host system into a directory (called it
template). I used the skeleton method to build a guest called sk (with
appropriate interface and hostname given). Then I copied the template
into the guest. I think where I went wrong is the cleanup of the
template, I'm not sure what I should clean out and what I should leave.
I think I have either left some scripts that are not needed or deleted
something that is needed, but I don't understand what.
Any help would be appreciated.


>>I'm using Fedora Core 4 (2.6). I have been able to successfully build
>>vserver using the yum method previously and starts fine.
>>Any help will be appreciated.
Vserver mailing list

Vserver mailing list
Received on Thu May 18 17:47:28 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 18 May 2006 - 17:47:34 BST by hypermail 2.1.8