We currently migrate to MediaWiki from our old installation, but not all content has been migrated yet. Take a look at the Wiki Team page for instructions how to help or browse through our new wiki at wiki.linux-vserver.org to find the information already migrated.

Warning: This is a work in progress. It will take some time before it will be finished.

The contents of this document isn't checked by other people. {hmm, is that so? ;}

(Thanks Herbert!)

Don't use this documentation to configure a production system.

Credits

This document is based on other linux-vserver documentation and mailinglist posting.

Some documentation regarding to the configuration of vservers is taken from the vskel documentation.

A. Introduction

In this document we will try to provide system administrator a guide for installing, configuring and maintaining virtual servers using the linux-vserver project.

The linux-vserver project lets you run virtual linux servers on top of a linux machine. It uses a patch kernel and an tools package.

B. Installation

1. Requirements

  • alpha
  • i386 and higher (and compatible)
  • ia32 / ia64
  • mips / mips64
  • parisc (HP PA-RISC)
  • ppc / ppc64
  • sparc / sparc64
  • x86_64 (AMD64)
  • uml

2. Download

3. Patching the kernel

After downloading the linux kernel and the vserver kernel patch, you have can apply the patch to the kernel source and build you own kernel.

3.1. Standard kernel compile

3.2. Debian

You can install a kernel as described in previous section, our you can use some of the debian tools. Debian contains a tool, kernel-package, which lets you build a kernel an put it in a debian package.
In case you use the kernel source included in the debian distribution, you can download a linux-vserver patch for it [here]
In case you have many servers, you should look at the kernellab tool to manage you kernel configurations.

3.3. Redhat

3.4.

C. Configuration host server

After installing a customized kernel and the vserver or util-vserver tools, you can find the configuration options in the file:

/etc/vservers.conf

configuration options:

D. Virtual hosts

1. Installation

The script newvserver is used to create a new vserver. Some distribution specific packages include customized version of this tool (we know the debian package of vserver does include a customised version).

Run newvserver -h or newvserver --help to get the help.

2. Configuration

2.1. Configuration file

Each virtual server has one configuration file controlling its behavior. The configuration is located in /etc/vservers and has the name of the vserver followed by the extension .conf.

This is a pseudo shell script where variable are setup using shell assignment (VAR=value). The script is simply sourced by the vserver(8) utility. Here are the various variables you can set:

You don't have to set all of these options (only hostname, domain and IP-number are required)

The syntax is: [device[.vlan]:]IP[/netmask]
The netmask may be specified in quad notation (255.255.255.0) or by telling the number of bits assigned to the network part (A class C network is a /24 network with 24 bits assigned to identify the network and 8 (32-24) bits assigned to identify the host.
If the device is omitted, the IPROOTDEV devices is used. If the netmask is omitted, the device netmask is used.
Examples:
IPROOT="1.2.3.4"
IPROOT="1.2.3.4 2.3.4.5"
IPROOT="eth0:1.2.3.4 eth1:2.3.4.5"
IPROOT="eth0:10.1.2.3/255.255.255.0 eth0:10.1.3.12/255.255.255.128"
(see http://vserver.13thfloor.at/Stuff/VServer-IP-Setup-0.1.txt for details, e.g. how to not create an alias at all)

2.2. Startup scripts

To run a command on the host server at startop or shutdown of a vserver, you can put a script in /etc/vservers/.

You have to give it the same name as your vserver and .sh as extention. (call it vserver1.sh for you server1)

example:

This script lets you map a directory on a other disk in you vserver (you can use it to share a directory between virtual servers.

(you have to put a #!/bin/sh on the first line of the script)

case $1 in

pre-start)

mount --bind /home2/home /vservers/server1/home
;;
post-start)
;;
pre-stop)
;;
post-stop)
umount /vservers/server1/home
;;
esac

E. Administation of linux-vserver

1. The tools

2. Configuration files and startup scripts.

3. Daemons

F. References