Installation on Ubuntu

From Linux-VServer

Revision as of 00:30, 31 December 2007 by Lemsx1 (Talk | contribs)

Jump to: navigation, search

Contents

Check Ubuntu's Wiki

There are howtos on Ubuntu's site that describe how to download pre-built, Ubuntu-specific kernels.

  http://help.ubuntu.com/community/VServer

More detailed instructions on the u32 kernel can be found on http://wiki.u32.net/Ubuntu-VServer

Vserver Kernel on Ubuntu Dapper with grsecurity

Prerequisites

  • 32 Bit Ubuntu Dapper.
  • installed packages:
apt-get install build-essential gcc make g++ libncurses5-dev

Howto Devel 2.6.17.14-vs2.0.2.1-grsec2.1.9

Get the Kernel

cd /usr/src/ && mkdir kernel && cd kernel
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.14.tar.bz2
wget http://people.linux-vserver.org/~harry/patch-2.6.17.14-vs2.0.2.1-grsec2.1.9.diff
tar xfjv linux-2.6.17.14.tar.bz2
cd linux-2.6.17.14

Patch the Kernel

cat ../patch-2.6.17.14-vs2.0.2.1-grsec2.1.9.diff | patch -p1
cp /boot/vmlinuz-2.6.15-26-server
make oldconfig
make menuconfig

Make the Kernel

make # this will take a long time
make install
make modules_install
mkinitramfs -o /boot/initrd.img-2.6.17.14-grsec2.1.9-vs2.0.2.1 2.6.17.14-grsec2.1.9-vs2.0.2.1
vi /boot/grub/menu.lst

The Boot entry should look like this

title           Ubuntu, 2.6.17.14-vs2.0.2.1-grsec2.1.9
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.17.14-grsec2.1.9-vs2.0.2.1 root=/dev/sda1 ro quiet splash
initrd          /boot/initrd.img-2.6.17.14-grsec2.1.9-vs2.0.2.1
savedefault
boot

Test the Kernel

  • boot Kernel
  • uname -r should show
2.6.17.14-grsec2.1.9-vs2.0.2.1

Alternate Method

This is based on UbuntuVserverHowTo on the old wiki, updated with new links that work as of December 2006.

This is NOT COMPLETE -- remove this message when you get it to work!

Get the Kernel

apt-get install linux-source-2.6.17 kernel-package linux-kernel-devel
cd /usr/src
tar xjvf linux-source-2.6.17.tar.bz2

Patch the Kernel

cd linux-source-2.6.17/
wget http://vserver.13thfloor.at/Experimental/OLD-2.0/patch-2.6.17.13-vs2.0.2.1.diff
patch -p1 < *diff
vi Makefile
fix the EXTRAVERSION to be -vs2.0.2
cp /boot/config-2.6.17-10-generic .config
# take all the defaults
yes  |  make oldconfig

Make the Kernel

time make    # this will take quite a while
make-kpkg --initrd binary

Problems

When you recieve a 'Segmentation fault' error running vserver-utils try useing latest dietlibc

wget http://www.fefe.de/dietlibc/<insert version here>
tar jxvf dietlibc*
cd dietlibc
more README

Or alternatively, use debian packages. The binaries are staticly linked as far as I known so it doesn't matter. Feity and up gcc version won't let you compile correctly dietlibc yet.


Ubuntu Gutsy Information

This is a note on creating Ubuntu Gutsy as a guest on an Ubuntu Gutsy host. To create the Ubuntu Gutsy host, follow the combination of the Installation on Linux 2.6 wiki page and the Installation on Ubuntu wiki page.

To create the guest system, do these commands:

  1. apt-get install debootstrap
  2. vserver vserver1 build -m debootstrap --hostname=vserver1.mydomain.com --interface eth0:192.168.1.10/24 -- -d gutsy -m http://ftp.ubuntu.com/ubuntu
  3. vserver vserver1 start
  4. vserver vserver1 enter

To get networking work on the guest, try the tips from www.unixshell.com/wiki/index.php/creating_and_using_vserver_virtual_servers.

Useful Links

Personal tools