WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Building from Source

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Building from Source
From: Franz Regensburger <Franz.Regensburger@xxxxxxxx>
Date: Thu, 23 Oct 2008 10:00:33 +0200
Delivery-date: Thu, 23 Oct 2008 01:01:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <87e5962c.1c934e0.1d33127.6eef@xxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <87e5962c.1c934e0.1d33127.6eef@xxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.1
Hello Nathan,

yesterday I managed to compile Xen 3.3 from the sources on Debian Etch.
I am not a XEN specialist myself but maybe my notes will help you since they 
say that Ubuntu is closely related to Debian.

Especialy note the hints about configuring the XEN kernel below.

cd /usr/src/xen-3.3.0
make linux-2.6-xen-config CONFIGMODE=menuconfig

That may let you configure the
VMXASSIST=n

Regards,

Franz

##########################

Howto build Xen 3.3 from the sources on Debian Etch
---------------------------------------------------

Base: Debian Etch 4.0R4a netinst for AMD64/Intel64

Hints on the WEB say that we need a newer mercurial (V 0.9.5 or newer).
Newer than the standard V0.9.1 that is provided via Debian Etch

Problem: from where do we get the newer mercurial?

mkdir -p /usr/src/XEN_3.3.0
cd /usr/src/XEN_3.3.0

wget 
http://packages.debian.org/etch-backports/all/mercurial-common/download/mercurial-common_1.0.1-5.1~bpo40+1_all.deb

wget \ 
http://www.backports.org/debian/pool/main/m/mercurial/mercurial_1.0.1-5.1~bpo40+1_amd64.deb

dpkg -i ./mercurial-common_1.0.1-5.1~bpo40+1_all.deb
dpkg -i ./mercurial_1.0.1-5.1~bpo40+1_amd64.deb

#####################
# Download other build tools:
# Attention: the apt-get will also deinstall packages
# Use aptitude instead to see the conflicts etc
# The problem is the 'hotplug'
# It conflicts with udev, kde and many others.
# The xen Readme states that we need hotplug OR udev
# --> we stay with udev and its dependent packages

# apt-get install iproute bridge-utils hotplug python libz-dev python-dev gawk 
pciutils-dev
# apt-get install graphviz texlive-latex-base texlive-latex-pdfetex transfig
# apt-get install build-essential libssl-dev gettext python-dev libncurses5-dev 
xorg-dev bcc

aptitude install iproute
aptitude install bridge-utils
# !!!! NO; do not install: aptitude install hotplug
aptitude install python
aptitude install libz-dev
aptitude install python-dev
aptitude install gawk
aptitude install pciutils-dev
aptitude install graphviz

# this install texlive and de-installs our normal tetex!

apt-get install tex-common texlive-base texlive-base-bin texlive-common \
        texlive-doc-base texlive-doc-de texlive-lang-german \
        texlive-latex-base texlive-pdfetex preview-latex-style \
        texlive-latex-extra texlive-pictures texlive-fonts-recommended
# aptitude install texlive-latex-pdfetex ???
apt-get install texlive-latex-recommended
aptitude install texinfo

aptitude install transfig
aptitude install build-essential
aptitude install libssl-dev
aptitude install gettext
aptitude install python-dev
aptitude install libncurses5-dev
aptitude install xorg-dev
aptitude install bcc

#####################
# Get the Xen sources
# We download a tar ball of Xen 3.3 and clone the kernel tree
#####################

mkdir -p /usr/src/XEN_3.3.0
cd /usr/src/XEN_3.3.0

# Get Xen 3.3.0 sources
# Goto
#       http://www.xen.org/download/index.html
# and download
#       http://bits.xensource.com/oss-xen/release/3.3.0/xen-3.3.0.tar.gz

wget http://bits.xensource.com/oss-xen/release/3.3.0/xen-3.3.0.tar.gz

# Get the xen kernel tree
## DEPRECATED: instead we clone ourselves (see below)
# wget 
http://bits.xensource.com/oss-xen/release/3.3.0/linux-2.6.18-xen-3.3.0.tar.gz

### cleanup
cd /usr/src
rm -rf xen-3.3.0
rm -rf linux-2.6.18-xen.hg

# unpack xen sources
cd /usr/src
tar xzf XEN_3.3.0/xen-3.3.0.tar.gz

# Get the xen kernel tree via cloneing

cd /usr/src
hg clone http://xenbits.xensource.com/linux-2.6.18-xen.hg

################################################
# Now, let's compile that Xen

cd /usr/src/xen-3.3.0

make KERNELS=linux-2.6-xen world

# Note: the option 'CONFIGMODE=menuconfig' is meant to be used with other 
targets (see below)
#       make linux-2.6-xen-config CONFIGMODE=menuconfig
#
# It works at least if we run 'make KERNELS=linux-2.6-xen world' once
# See the addon at the end down below.

# From the /usr/src/xen-3.3.0/README that contains all instruction for 
building/installing!
# In /usr/src/xen-3.3.0 use
#  make help
# to learn more about the targets.
#
# 5. To rebuild a kernel with a modified config:
#
#    # make linux-2.6-xen-config CONFIGMODE=menuconfig     (or xconfig)
#     # make linux-2.6-xen-build
#     # make linux-2.6-xen-install
#    Other systems may requires the use of 'mkinitramfs' to create the
#    ram disk.
#     # depmod 2.6.18-xen
#     # mkinitramfs -o initrd-2.6.18-xen.img 2.6.18-xen

# cleanup old xen-tools and kernels
make uninstall

make install

depmod 2.6.18.8-xen

# prepare the initrd config
## cp /etc/initramfs-tools/modules /etc/initramfs-tools/modules.orig
cat > /etc/initramfs-tools/modules <<HERE
#  for Xen
md_mod
raid1
sd_mod
HERE

mkinitramfs -k -o /boot/initrd-2.6.18.8-xen.img 2.6.18.8-xen

# edit the grub menu
susi:/boot/grub# tail menu.lst

### END DEBIAN AUTOMAGIC KERNELS LIST

title           Xen 3.3.0 / kernel 2.6.18.8-xen
root            (hd0,0)
kernel          /xen-3.3.0.gz console=vga
module          /vmlinuz-2.6.18.8-xen root=/dev/mapper/RootVG-root ro 
console=tty0
module          /initrd-2.6.18.8-xen.img
savedefault

OR as a refined test for HVM
# Note: Adding the pciback.hide to the kernel options did not work as pciback is
# only compiled as a module by default.
# If we compile it as non-module (see below for instructions) it works

# no pciback.hide
title           Xen 3.3.0 / kernel 2.6.18.8-xen no-backhide
root            (hd0,0)
kernel          /xen-3.3.0.gz console=vga noreboot max_loop=128 dom0_mem=1024M
module          /vmlinuz-2.6.18.8-xen root=/dev/mapper/RootVG-root ro 
console=tty0
module          /initrd-2.6.18.8-xen.img
savedefault

# with pciback.hide and iommu for VT-d
title           Xen 3.3.0 / kernel 2.6.18.8-xen backhide the ATI Radeon
root            (hd0,0)
#kernel          /xen-3.3.0.gz console=vga noreboot max_loop=128 dom0_mem=1024M 
iommu=1
kernel          /xen-3.3.0.gz console=vga noreboot max_loop=128 dom0_mem=1024M
module          /vmlinuz-2.6.18.8-xen root=/dev/mapper/RootVG-root ro 
console=tty0 pciback.hide=(01:00.
0)(01:00.1)
module          /initrd-2.6.18.8-xen.img
savedefault


### link xen rc script

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

############################################
# Reboot your box and boot the Xen kernel


##########
# Add on, from http://wiki.xensource.com/xenwiki/VTdHowTo
# Compile PCI backend hide fixed into the kernel

How to turn on VT-d in Xen
1 ) cd xen-unstable.hg
2 ) make install
3 ) make linux-2.6-xen-config CONFIGMODE=menuconfig
4 ) change XEN->"PCI-device backend driver" from "M" to "*".
5 ) make linux-2.6-xen-build
6 ) make linux-2.6-xen-install
7 ) depmod 2.6.18.8-xen
8 ) mkinitrd -v -f --with=ahci --with=aacraid --with=sd_mod --with=scsi_mod 
initrd-2.6.18-xen.img 2.6.1
8.8-xen
9 ) cp initrd-2.6.18-xen.img /boot
10) lspci - select the PCI BDF you want to assign to guest OS
11) "hide" pci device from dom0 as following sample grub entry:
title Xen-Fedora Core (2.6.18-xen)
        root (hd0,0)
        kernel /boot/xen.gz com1=115200,8n1 console=com1 iommu=1
        module /boot/vmlinuz-2.6.18.8-xen root=LABEL=/ ro xencons=ttyS 
console=tty0 console=ttyS0, pcib
ack.hide=(01:00.0)(03:00.0)
        module /boot/initrd-2.6.18-xen.img
12) reboot system
13) add "pci" line in /etc/xen/hvm.conf for to assigned devices
        pci = [ '01:00.0', '03:00.0' ]
15) start hvm guest and use "lspci" to see the passthru device and
    "ifconfig" to see if IP address has been assigned to NIC devices.

##
# Try that on our xen host

cd /usr/src/xen-3.3.0
make linux-2.6-xen-config CONFIGMODE=menuconfig
        change XEN->"PCI-device backend driver" from "M" to "*".
make linux-2.6-xen-build
make linux-2.6-xen-install
depmod 2.6.18.8-xen
mkinitramfs -k -o /boot/initrd-2.6.18.8-xen.img 2.6.18.8-xen

Boot .... and pciback.hide works as a kernel parameter



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users