Difference between revisions of "Installation on Debian"

From Linux-VServer

Jump to: navigation, search
(Packages installation)
(link to building guest systems)
Line 15: Line 15:
 
<pre>uname -r</pre>
 
<pre>uname -r</pre>
 
and check that kernel version is something like '''2.6.18-4-vserver-686'''. That's it.
 
and check that kernel version is something like '''2.6.18-4-vserver-686'''. That's it.
Now let's create a virtual machine.
 
  
== Guest system creation ==
+
Now that the host system is ready, you can proceed with [[Building Guest Systems|building guests]].
To build guests, you use <tt>vserver [name] build</tt>. The syntax for this command is:<br />
+
vserver [name] build -m debootstrap --hostname [hostname] \
+
--interface [interface]:[IP address]/[CIDR prefix or netmask] \
+
-- -d [dist] -m [Debian mirror]
+
''(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.
+
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.)''
+
 
+
The command line arguments are:
+
* '''name''' - The name of the guest
+
* '''hostname''' - The hostname of the guest (eg. test1.domain.tld)
+
* '''interface''' - Your network interface, if it's not eth0 (eg. eth1).
+
* '''IP address'''- The IP address for the guest (eg. 10.1.1.7)
+
* '''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.
+
* '''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)
+
 
+
So, let's make a test server. The settings for our test guest are like so:
+
* '''Hostname:''' test1.example.com
+
* '''IP address:''' 10.1.1.7
+
* '''CIDR prefix:''' /8
+
* '''Debian mirror:''' http://ftp.au.debian.org/debian/
+
* '''Interface:''' eth1
+
 
+
vserver test1 build -m debootstrap --hostname test1.example.com \
+
--interface eth1:10.1.1.7/8 -- -d etch -m ftp://ftp.au.debian.org/debian/ \
+
-- --resolve-deps --arch i386
+
 
+
For all options to vserver build, see
+
 
+
vserver - build --help
+
 
+
In particular, --rootdir gives the desired location of the vserver.
+
 
+
== Guest system operation ==
+
To start guest just created, run
+
<pre>vserver test1 start</pre>
+
To get into it, type
+
<pre>vserver test1 enter</pre>
+
Again, study --help for more information.
+
 
+
== Usual Problems ==
+
a problem that is almost certain to occur on debian is described here [http://linux-vserver.org/Frequently_Asked_Questions#When_I_try_to_ssh_to_the_guest.2C_I_log_into_the_host.2C_even_if_I_installed_sshd_on_the_guest._What.27s_wrong_here.3F]
+
 
+
where users try to ssh to the guest but get the host instead.
+
  
 
== References ==
 
== References ==
 
* Linux-VServer HOWTO by Daniel15: http://howtoforge.com/linux_vserver_debian_etch
 
* Linux-VServer HOWTO by Daniel15: http://howtoforge.com/linux_vserver_debian_etch

Revision as of 01:58, 7 May 2008

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.

If you need to compile your own kernel, you need to apply the vserver-version.patch. Details at 2007/Apr/25

Packages installation

The packages required by Linux-VServer are:

  • linux-image-vserver-686 - This is the current kernel
  • util-vserver - These are the utilities used to administer the guests
  • 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 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.18-4-vserver-686. That's it.

Now that the host system is ready, you can proceed with building guests.

References

Personal tools