http://www.linux-vserver.org/api.php?action=feedcontributions&user=Olberger&feedformat=atomLinux-VServer - User contributions [en]2024-03-29T01:28:25ZUser contributionsMediaWiki 1.20.2http://www.linux-vserver.org/Installation_on_DebianInstallation on Debian2007-12-04T12:33:01Z<p>Olberger: Adding link to vserver-debiantools</p>
<hr />
<div>This guide is written against Debian Etch (4.0). This release includes kernel '''linux-image-vserver-686''', so no manual patching is needed. Hence, Installation on Debian Etch is pretty easy and straightforward.<br />
<br />
If you need to compile your own kernel, you need to apply the vserver-version.patch. [http://www.kwu.hu/blog.php Details at 2007/Apr/25]<br />
<br />
== Packages installation ==<br />
The packages required by Linux-VServer are:<br />
* '''linux-image-vserver-686''' - This is the actual kernel<br />
* '''util-vserver''' - These are the utilities used to administer the guests<br />
* '''ssh''' - This is probably already installed, but just in case it isn't<br />
<br />
All the packages you need can be obtained via<br />
<pre>apt-get install linux-image-vserver-686 util-vserver ssh</pre><br />
so run this as ''root'' and reboot.<br />
To check out wherever everything went fine you may run<br />
<pre>uname -r</pre><br />
and check that kernel version is something like '''2.6.18-4-vserver-686'''. That's it.<br />
Now let's create a virtual machine.<br />
<br />
Note that the package '''vserver-debiantools''' may also be helpful, as it contains commands like '''newvserver''' which simplifies the creation of the vserver.<br />
<br />
== Guest system creation ==<br />
To build guests, you use <tt>vserver [name] build</tt>. The syntax for this command is:<br /><br />
vserver [name] build -m debootstrap --hostname [hostname] \<br />
--interface [interface]:[IP address]/[CIDR prefix or netmask] \<br />
-- -d [dist] -m [Debian mirror]<br />
''(the backslashes at the end of the lines mean that it continues onto the next line. You may copy it as-is [with the backslashes], or put the whole command on one line [and exclude the backslashes], as is done below.<br />
Also, the -- separate the different parts of the command. First are generic vserver ... build options, the second part are options specific to the chosen method (debootstrap), the third part are options which will be passed directly to debootstrap.)''<br />
<br />
The command line arguments are:<br />
* '''name''' - The name of the guest<br />
* '''hostname''' - The hostname of the guest (eg. test1.domain.tld) <br />
* '''interface''' - Your network interface, if it's not eth0 (eg. eth1).<br />
* '''IP address'''- The IP address for the guest (eg. 10.1.1.7)<br />
* '''CIDR prefix or netmask''' - The CIDR prefix for your local network. For a 10.x.x.x network, this is usually /8. For a 172.16.x.x network, this is usually /16. For a 192.168.x.x network, this is usually /24. If your network is subnetted, this will be different. When in doubt, use /32.<br />
* '''dist''' - The distribution to use. For the purposes of this exercise, we use etch.<br />
* '''Debian mirror''' - The Debian mirror you use (when in doubt, choose ftp://ftp.debian.org/debian) <br />
<br />
So, let's make a test server. The settings for our test guest are like so:<br />
* '''Hostname:''' test1.example.com<br />
* '''IP address:''' 10.1.1.7<br />
* '''CIDR prefix:''' /8<br />
* '''Debian mirror:''' http://ftp.au.debian.org/debian/<br />
* '''Interface:''' eth1<br />
<br />
vserver test1 build -m debootstrap --hostname test1.example.com \<br />
--interface eth1:10.1.1.7/8 -- -d etch -m ftp://ftp.au.debian.org/debian/ \<br />
-- --resolve-deps --arch i386<br />
<br />
For all options to vserver build, see<br />
<br />
vserver - build --help<br />
<br />
In particular, --rootdir gives the desired location of the vserver.<br />
<br />
== Guest system operation ==<br />
To start guest just created, run<br />
<pre>vserver test1 start</pre><br />
To get into it, type<br />
<pre>vserver test1 enter</pre><br />
Again, study --help for more information.<br />
<br />
<br />
== References ==<br />
* Linux-VServer HOWTO by Daniel15: http://howtoforge.com/linux_vserver_debian_etch</div>Olberger