Difference between revisions of "Installation on Debian"

From Linux-VServer

Jump to: navigation, search
(Virtual machine operation)
(Expanded)
Line 1: Line 1:
This guide is written against Debian Etch (4.0). This release includes kernel '''linux-image-vserver-686''', so no manual patching is needed. The consequence is pretty easy and satrightforward.
+
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.
  
 
== Packages installation ==
 
== Packages installation ==
 +
The packages required by Linux-VServer are:
 +
* '''linux-image-vserver-686''' - This is the actual kernel
 +
* '''util-vserver''' - These are the utilities used to administer the guests
 +
* '''vserver-debiantools''' - These are special Vserver tools for Debian, used to create and duplicate Debian guest systems.
 +
* '''ssh''' - This is probably already installed, but just in case it isn't
 +
 
All the packages you need can be obtained via
 
All the packages you need can be obtained via
 
<pre>apt-get install linux-image-vserver-686 util-vserver vserver-debiantools ssh</pre>
 
<pre>apt-get install linux-image-vserver-686 util-vserver vserver-debiantools ssh</pre>
Line 11: Line 17:
  
 
== Virtual machine creation ==
 
== Virtual machine creation ==
<pre>newvserver --vsroot /var/lib/vservers/ --hostname sample --domain example.com --ip 10.1.1.1/8 --dist etch --mirror http://ftp.debian.org/debian/ --interface eth1</pre>
+
On a Debian system, creation of guests is done via the <tt>newvserver</tt> command. The syntax for this command is:<br />
Check vserver --help for more info on this.
+
newvserver --vsroot /var/lib/vservers/ --hostname [Hostname] \
 +
--domain [Domain] --ip [IP Address]/[CIDR Range] \
 +
--dist etch --mirror [Debian Mirror] --interface [Net Interface]
 +
''(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 I do below)''
 +
 
 +
The command line arguments are:
 +
* '''vsroot''' - This is where the files for the guests are kept. On a default installation, this will be at /var/lib/vservers. Alternatively, some people create a separate partition for their vservers.
 +
* '''Hostname''' - The hostname of the system (eg. test1)
 +
* '''Domain''' - The domain of the system. This is usually the same as the domain you chose for the host system (eg. dan-network.local. This doesn't need to be real, it's only used internally.)
 +
* '''IP Address'''- The IP address for the guest system (eg. 10.1.1.7)
 +
* '''CIDR Range''' - The CIDR Range 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, choose /8 :)
 +
* '''Dist''' - The distribution to use. For the purposes of this exercise, we use etch.
 +
* '''Debian Mirror''' - The Debian mirror you use (when in doubt, choose ftp://ftp.debian.org/debian)
 +
* '''Interface''' - Your network interface, if it's not eth0 (eg. eth1).
 +
 
 +
So, let's make a test server. The settings for our test guest are like so:
 +
* '''Hostname:''' test1
 +
* '''Domain:''' example.com
 +
* '''IP Address:''' 10.1.1.7
 +
* '''CIDR Range:''' /8
 +
* '''Debian Mirror:''' http://ftp.au.debian.org/debian/
 +
* '''Interface:''' eth1
 +
 
 +
newvserver --vsroot /var/lib/vservers/ --hostname test1 --domain example.com --ip 10.1.1.7/8 --dist etch --mirror http://ftp.au.debian.org/debian/ --interface eth1
 +
 
  
 
== Virtual machine operation ==
 
== Virtual machine operation ==
 
To start VM just created, run
 
To start VM just created, run
<pre>vserver sample start</pre>
+
<pre>vserver test1 start</pre>
 
To get into it, type
 
To get into it, type
<pre>vserver sample enter</pre>
+
<pre>vserver test1 enter</pre>
 
Again, study man for more information.
 
Again, study man for more information.
 +
 +
 +
== References ==
 +
* Linux-VServer HOWTO by Daniel15: http://howtoforge.com/linux_vserver_debian_etch

Revision as of 05:55, 11 December 2006

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.

Contents

Packages installation

The packages required by Linux-VServer are:

  • linux-image-vserver-686 - This is the actual kernel
  • util-vserver - These are the utilities used to administer the guests
  • vserver-debiantools - These are special Vserver tools for Debian, used to create and duplicate Debian guest systems.
  • ssh - This is probably already installed, but just in case it isn't

All the packages you need can be obtained via

apt-get install linux-image-vserver-686 util-vserver vserver-debiantools ssh

so run this as root and reboot. To check out wherever everything went fine you may run

uname -r

and check that kernel version is something like 2.6.17-2-vserver-686. That's it. Now let's create a virtual machine.

Virtual machine creation

On a Debian system, creation of guests is done via the newvserver command. The syntax for this command is:

newvserver --vsroot /var/lib/vservers/ --hostname [Hostname] \
--domain [Domain] --ip [IP Address]/[CIDR Range] \
--dist etch --mirror [Debian Mirror] --interface [Net Interface]

(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 I do below)

The command line arguments are:

  • vsroot - This is where the files for the guests are kept. On a default installation, this will be at /var/lib/vservers. Alternatively, some people create a separate partition for their vservers.
  • Hostname - The hostname of the system (eg. test1)
  • Domain - The domain of the system. This is usually the same as the domain you chose for the host system (eg. dan-network.local. This doesn't need to be real, it's only used internally.)
  • IP Address- The IP address for the guest system (eg. 10.1.1.7)
  • CIDR Range - The CIDR Range 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, choose /8 :)
  • Dist - The distribution to use. For the purposes of this exercise, we use etch.
  • Debian Mirror - The Debian mirror you use (when in doubt, choose ftp://ftp.debian.org/debian)
  • Interface - Your network interface, if it's not eth0 (eg. eth1).

So, let's make a test server. The settings for our test guest are like so:

newvserver --vsroot /var/lib/vservers/ --hostname test1 --domain example.com --ip 10.1.1.7/8 --dist etch --mirror http://ftp.au.debian.org/debian/ --interface eth1


Virtual machine operation

To start VM just created, run

vserver test1 start

To get into it, type

vserver test1 enter

Again, study man for more information.


References