The Perfect Xen 3.0.1 Setup For Debian - Page 3

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Tue, 2006-03-21 18:31. ::

3.2 Installing From The Sources

Run the following commands:

apt-get remove exim4 exim4-base lpr nfs-common portmap pidentd pcmcia-cs pppoe pppoeconf ppp pppconfig
apt-get install iproute bridge-utils python-twisted gcc-3.3 binutils make zlib1g-dev python-dev transfig bzip2 screen ssh debootstrap libcurl3-dev libncurses5-dev

3.2.1 Install Xen

Now download xen-3.0.1-src.tgz from http://www.xensource.com/products/downloads/dl_x30tarball_bt.html with BitTorrent and put it into the /usr/src directory. Then do the following:

cd /usr/src
tar -xvzf xen-3.0.1-src.tgz

cd xen-3.0.1/
make world

Now we compile a dom0 kernel:

cd linux-2.6.12-xen0
ARCH=xen
export ARCH
make oldconfig
make menuconfig

In the kernel comfiguration menu that shows up we enable quota, iptables and the dummy network driver as modules. This is where you enable these modules:

File systems --> [*] Quota support
<M> Old quota format support
<M> Quota format v2 support

Device Drivers ---> Networking support ---> <M> Dummy net driver support

Device Drivers ---> Networking support ---> Networking options ---> [*] Network packet filtering (replaces ipchains) ---> IP: Netfilter Configuration ---> <M> IP tables support (required for filtering/masq/NAT)

[*] means: build into the kernel statically.
<M> means: build as a kernel module.

Next we build and install the dom0 kernel:

cd ..
make
make install

Afterwards we compile a kernel for domU (the virtual machines):

cd linux-2.6.12-xenU
ARCH=xen
export ARCH
make oldconfig
make menuconfig

In the kernel comfiguration menu that shows up we have to enable quota and iptables as modules (it is important that they are modules. I could not get iptables to work in a virtual machine when I compiled it into the kernel statically!). This is where you enable these modules:

File systems --> [*] Quota support
<M> Old quota format support
<M> Quota format v2 support

Device Drivers ---> Networking support ---> Networking options ---> [*] Network packet filtering (replaces ipchains) ---> IP: Netfilter Configuration ---> <M> IP tables support (required for filtering/masq/NAT)

[*] means: build into the kernel statically.
<M> means: build as a kernel module.

After you have left the kernel configuration menu, do the following to build and install the domU kernel:

cd ..
make
make install
mv /lib/tls /lib/tls.disabled

Now Xen is installed. In order to start the Xen services at boot time, do the following:

update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20

3.2.2 Configure The Bootloader And Reboot

Next we add our new kernel to Grub, our bootloader. Edit /boot/grub/menu.lst, and before the line ### BEGIN AUTOMAGIC KERNELS LIST add the following stanza:

vi /boot/grub/menu.lst

title        Xen 3.0.1 / XenLinux 2.6.12-xen0
root (hd0,0)
kernel /xen.gz dom0_mem=65536
module /vmlinuz-2.6-xen0 root=/dev/hda6 ro console=tty0

Make sure that /dev/hda6 is your / partition. Keep in mind what I said about Grub and partitioning in chapter 1!

Now reboot the system:

shutdown -r now

At the boot prompt, Grub should now list Xen 3.0.1 / XenLinux 2.6.12-xen0 as the first kernel and boot it automatically. If your system comes up without problems, then everything is fine!


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Tue, 2006-06-06 20:24.

dont forget install latex package to install xen docs.

bruno taranto
Submitted by Anonymous (not registered) on Mon, 2006-04-17 04:31.

I got this tip from the how to at: http://mark.foster.cc/wiki/index.php/Xen_3.0.x_on_Debian_Sarge

That howto is a little less detailed than yours but is the only one I found that allows large memory systems which I figure are common in the Xen world.

Alternatively, if your box has 4GB or more RAM, you will want to enable PAE so the Xen kernel can see the extra memory. So replace the make world with

 make XEN_TARGET_X86_PAE=y world
and the make install with
 make XEN_TARGET_X86_PAE=y install