Tested on Debian Lenny
= Create =
Make alias for interface (in /etc/network/interfaces):
auto eth0:0
iface eth0:0 inet static
address 192.168.0.10
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
Update: A better way is with ip addr add, see:
http://wiki.hetzner.de/index.php/Zusätzliche_IP-Adressen_Debian
create a new vserver (replace $name with name, use own ip)
sudo vserver $name build -n $name --hostname test.example.at --interface eth0:$ip/24 -m debootstrap -- -d lenny
or better using newvserver with vserver-debiantools
sudo newvserver --vsroot $name --hostname www --domain example.com --ip $ip/$n
= Start default =
To let the vserver also start when the hosts starts up
echo default | sudo tee /etc/vservers/$vserver/apps/init/mark
fstab /tmp 16m enough?
= Start =
sudo vserver test start
sudo vserver test enter
= Initial Setup =
/etc/resolv.conf evt. anpassen
aptitude update
aptitude install curl vim-nox zsh openssh-server screen locales sudo htop etckeeper
OR
EXTRA_PACKAGES="curl,vim-nox,zsh,openssh-server,screen,locales,sudo,htop,etckeeper"
in /etc/vservers/newvserver-vars
.zshrc .screenrc kopieren:
curl http://www.markus-raab.org/Info/Config/vimrc.txt > .vimrc
curl http://www.markus-raab.org/Info/Config/zshrc.txt > .zshrc
curl http://www.markus-raab.org/Info/Config/screenrc.txt > .screenrc
eventuell build-essential
= Mount =
to mount something from outside you can use mount --bind
to e.g. get usb hardware into the vserver, you may do:
sudo mount --bind /dev/usb/ /var/lib/vservers/printer/dev/usb
leads to a fstab enty:
/dev/usb /var/lib/vservers/printer/dev/usb none rw,bind 0 0
you need to restart the vserver to let the change take affect.
= Limits =
== Memory ==
See http://linux-vserver.org/Memory_Limits
Will invoke OOM killer, which is not a good idea, so better not set it
(if the vservers are your own and important services run on it)
== Disc ==
== Hashify ==
Saves disc space to hardlink same files:
sudo mkdir /etc/vservers//apps/vunify
sudo vserver hashify
(for hashify the server must run)