[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Advice on compiling Xen 4.1.2 on Debian 6.0.4 Kernel 3.1.12



We have similar objectives with different hardware.  Going to share some of my results and answers to a couple of questions, someone else might be better suited or more experienced and knowledgeable.


For the kernel flags "m" stands for module, "y" means built-in (to my understanding).  The default Debian kernel flags for pciback are "m", but I had no luck getting those to work.

If you are going through the hassle of compiling a kernel specially for Xen, you may as well set Xen related flags to "y".


When compiling xen from source it creates a .gz file for booting, and three links to that file in the "/boot/" directory.  The significance eludes me, perhaps different host systems require that.  If you run "ls -l /boot/" you'll see three of the files have no size, and point to the primary.  You can reduce the grub boot options by deleting the links.



If you are not modifying the source pre-compile, I have a suggestion that might be easier.  Debian Wheezy (7.0) will be the new "stable" in less than four months.  You can then install xen hypervisor via aptitude with no effort.  If you make compiled a .deb of your kernel you can port it easily too.


My tests started with an nVidia card, so Windows 7 HVM had a Code 53 in device manager.  I tried patched & compiled source, but still BSOD in W7, since the patches are Windows XP only still.  I bought an AMD card which worked with the default source, and package.  However, my AMD card had a BSOD when I installed the drivers, which I believe was the fault of my motherboard, so I am waiting on a second test board to arrive.


On Fri, Mar 23, 2012 at 2:16 PM, <cyberhawk001@xxxxxxxxx> wrote:
Just for a quick background:
I have tried to get Xen to compile and function on Ubuntu 10.04 last year but never could so gave up. I built a new computer to act as a server and started messing with Xen again about 3 weeks ago and have tried to compile kernel and xen a dozen times but still having problems loading Xen. I have read ever post i can find about this and the steps don't seem very hard in general and I think i have most of the steps down, but still missing something. So, as a result i gave in and figured i ask for some advice on my procedure to get it all working.

I am also still very new to Linux and Xen and so far i find Linux very finicky and quirky. Once simple example is i downloaded the ATI Catalyst drivers as a zip file for Linux86_64 for my card, copied file to FAT32 formatted SD Flash card, later copied the file back to Debian desktop, extracted it, double clicked on "amd-driver-installer.run" file, selected "run", type in password for root access, and than it kept giving me a pop-up message about "You must be logged in as SUPER-USER to run this file" (did that 6 different times). But, once i re-downloaded the file from the ATI website, the file ran fine without that message.

My first message here i will explain things in gory detail, hope no one minds or kills me for it.. :)

Main Goal:
I really just want a server running the latest stable Xen Hypervisor so i can remotely log into it, create VM images of Windows 7, XP, and different Linux flavors, install on Windows VM programs and games to run remotely. This way if i change my server hardware, i don't need to reinstall windows again, all drivers, all programs all over again, each and every time. Done that way too much. It is also important that i get VGA Passthru to work so i can get full video card acceleration and features in things like AutoCAD or games.

I have looked into XCP (Xen Cloud Platform) and it is very promising, but don't seem to be very up to date with xen. Very much like XenServer but they have XenCenter/XenDesktop to manage it, which seems quite a nice program. However, it is not free and can't find a free version of XenCenter to manage XCP. I am sure there are others but still learning. For now just wanted to try a Dom0 with Xen compiled. Finally, i don't even know how VGA Passthru works on XCP or if it even does.

Hardware Setup:
Mobo: AMD Asrock Fatal1ty 990FX Professional
CPU: AMD Phenom II X3 720 Black Edition (Unlocked to x4)
RAM: 16GB DDR3-16000 (4x 4GB)
HDD1: Corsair Force3 60GB SSD
HDD2: Seagate Momentus XT 500GB
Video: ATI FirePro V7900 - Driver name, propitiatory (non-free),  "FirePro_8.911.3.1_Linux_X32X64_132092.xip". Latest on ATI website

- All hardware tested for 3-4 days and all seem very stable

- I choose the ATI FirePro V7900 card as it seemed quite a bad-ass card for AutoCAD and similar, but also has very good support for Linux drivers, so gets rid of my headache of trying to make other Video cards to work.

- HDD1 only has Debian 6.0.4 AMD64 and partitioned as:
/             - 50GB
/tmp      - 4GB
swap    - 1GB

-HDD2 is later going to have LVM volume for VM images (not gotten to it)

- I wanted to RAID0 two Seagate Momentus XT hard drives to speed up loading VM images, but from what i read, setting up RAID in linux is quite a pain. It is better to get a dedicated SATA RAID card, but those are expensive and spent enough on this setup (video card being the most expensive).

Software Install Procedure:
- Installed Debian 6.0.4 CD1 from USB
- Selected to install Kernel 2.6.32-5-amd64
- Remove CD-ROM from repository source list

Installed dependent packages
- sudo apt-get install bcc bin86 binutils bison bridge-utils build-essential bzip2 coreutils debootstrap dkms e2fslibs-dev fakeroot flex gawk gcc git-core grep gzip iasl initramfs-tools iproute kernel-package libbz2-dev libc6-dev libconfig-inifiles-perl libcurl3 libcurl4-openssl-dev libfile-slurp-perl libjpeg62-dev libncurses5-dev libsdl1.2-dev libtext-template-perl libvncserver-dev libx11-dev make mercurial mawk module-init-tools ocaml ocaml-findlib patch pciutils-dev python python-dev python-twisted subversion texinfo texlive-fonts-extra texlive-fonts-recommended texlive-latex-base texlive-latex-recommended tgif transfig uuid-dev zlib1g-dev

Needed for "xconfig"
- sudo apt-get install qt4-dev-tools

For 64bit version of Debian/Ubuntu you need these
- sudo apt-get install gcc-multilib xz-utils

I read on one site that if using version "kernel-package 12.036+nmu1", have to install a patch "linuxv3.diff". Don't know anything about it, but was following it here: http://users.wowway.com/~zlinuxman/Kernel.htm
- sudo cp ./Desktop/KERNEL_BUILD/linuxv3.diff /usr/share/kernel-package
- cd /usr/share/kernel-package
- sudo patch -p1 <linuxv3.diff
- sudo rm linuxv3.diff

Downloaded linux-3.2.12.tar.bz2 from Kernel.org
- cd ./Desktop/KERNEL_BUILD/Kernel
- tar xjf linux-3.2.12.tar.bz2
- cd linux-3.2.12

Make config for new kernel
- make menuconfig (just ran that, saved and exited)

I read that even if you use xconfig should at least run menuconfig as it needs to create something.
- make xconfig

Than edited the config to include these changes: (I just used gedit as it seemed faster to use search function for all of these)
CONFIG_DEBUG_INFO=n

CONFIG_PARAVIRT=y
CONFIG_XEN=y
CONFIG_PARAVIRT_GUEST=y
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_HVC_DRIVER=y
CONFIG_HVC_XEN=y
CONFIG_XEN_FBDEV_FRONTEND=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_XEN_PCIDEV_FRONTEND=y
CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
CONFIG_XEN_FBDEV_FRONTEND=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_SAVE_RESTORE=y
CONFIG_XEN_GRANT_DEV_ALLOC=m
CONFIG_XEN_TMEM=y
CONFIG_CLEANCACHE=y
CONFIG_FRONTSWAP=y
CONFIG_XEN_SELFBALLOONING=y

QUESTION1: None of the kernel config files i have looked at had CONFIG_FRONTSWAP in there. Not 3.2.12, 3.2.11, 3.1.10, 3.0.25, going back to 2.6.32.59. Where can you find that option and do you really need it? I read this link, http://www.phoronix.com/scan.php?page=news_item&px=MTA0MjM, and said "Cleancache was merged into the Linux kernel last May for the 3.0 release, but the Frontswap support is still missing in action as the work is more controversial..etc". BUT i can't find any kernel config that even has it.

CONFIG_X86_IO_APIC=y
CONFIG_ACPI=y
CONFIG_ACPI_PROCFS=y
CONFIG_XEN_DOM0=y
CONFIG_PCI_XEN=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XENFS=y
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_GNTDEV=y
CONFIG_XEN_BACKEND=y
CONFIG_XEN_NETDEV_BACKEND=m
CONFIG_XEN_BLKDEV_BACKEND=m
CONFIG_XEN_PCIDEV_BACKEND=m
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_XEN_DEV_EVTCHN=y
CONFIG_XEN_GNTDEV=y

QUESTION2: I noticed that 4 items above are set to compile as module "=m", do they really must be set to "=m" or can they be set to "=y". I read on a few sites that they started to compile all XEN options into kernel instead of module. I have done that a few times during my trial and error, but don't understand if it MUST be "=m" or "=y".

First time around i had config exactly as listed above. Everything else i left alone as menuconfig generated.

Compile Kernel
- make-kpkg clean
- sudo fakeroot make-kpkg -j5 --initrd kernel_image kernel_headers

Install Kernel
- cd ..
- sudo dpkg -i linux-headers-3.2.2.12_3.2.12-10.00.Custom_amd64.deb
- sudo dpkg -i linux-image-3.2.2.12_3.2.12-10.00.Custom_amd64.deb

Edit "/etc/default/grub"
- Uncomment #GRUB_DISABLE_LINUX_RECOVERY="true" to disable generation of recovery mode menu entries. (Only did that as there were too many menuentries generated after xen was installed)
- Added GRUB_DISABLE_OS_PROBER=true to the end of file

- sudo update-grub2

REBOOTED INTO KERNEL 3.2.12

At this point, it boots into kernel 3.2.12 just fine, nothing i can tell comes up on screen, gets into login screen and all seems perfectly ok, SO onto compiling Xen.

Download current stable Xen 4.1.2
- cd ./Desktop/KERNEL_BUILD/Xen
- tar xf xen-4.1.2.tar.gz
- cd xen-4.1.2

Make Xen
- make -j5 xen
- make -j5 tools
- make -j5 stubdom

Install Xen
- sudo make install-xen
- sudo make install-tools PYTHON_PREFIX_ARG=
- sudo make install-stubdom

Updated /etc/modules to read
--------------------------------------------------------------------------
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

firewire-sbp2
loop max_loop=64

#The following itmes were added for Xen to run
xen-evtchn
xen-gntdev
xen-netback
xen-blkback
xenfs
blktap
--------------------------------------------------------------------------

Update contents of file /etc/grub.d/40_custom
--------------------------------------------------------------------------
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'Debian Linux 3.2.12 with XEN 4.1.2' --class debian --class gnu-linux --class gnu --class os --class xen {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod part_msdos
    insmod ext2
    search --no-floppy --fs-uuid --set=root b465ee5c-d6ab-4475-a15f-9115a0799b17
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root b465ee5c-d6ab-4475-a15f-9115a0799b17   
    echo    'Loading Linux upd3.2.12 ...'
    multiboot /boot/xen-4.1.2.gz placeholder
    module    /boot/vmlinuz-3.2.11 placeholder root=UUID=b465ee5c-d6ab-4475-a15f-9115a0799b17 dom0_mem=1024M ro nomodeset
    echo    'Loading initial ramdisk ...'
    module    /boot/initrd.img-3.2.12
}
--------------------------------------------------------------------------
Update Grub
- sudo update-grub2

QUESTION3: When you run update-grub2, WHY does xen create SO many menuentries? For xen.gz, xen4.gz, xen4.1.gz, xen4.1.2.gz and syms-xen4.gz or something like that? DO YOU really need all of those? Can you get rid of them or hide them from "update-grub2" adding them to the boot menu?


REBOOTED INTO "Debian Linux 3.2.12 with XEN 4.1.2"

Computer loads grub, i select that menuentry above, it loads the linux part, but when it gets to the xen, i get a black screen. The only thing i can see on there is a cursor at the top left hand corner blinking rapidly, barely visible.

NOW, throughout all of this, i never installed any additional drivers for my ATI Video card. However, when i start to install it at different times in the above process, i get different results. Once i get the black screen with blinking cursor, i reboot into Kernel 3.2.12, install ATI drivers, than reboot into Xen again, BUT THIS time i get nothing on the screen, just all black. I have done this several times, even with Kernel 3.2.11 and still black. I have not messed with Serial Console Output for debugging, as i have no cable to second computer, nor would I know how to read the output messages.

I have installed ATI drivers right after a fresh install of Debian 6.0.4, than i apt-get install all above packages, than ATI drivers seem to no longer provide 3D acceleration as the graphics seems sluggish. I re-run the ATI installer, reboot and it is all fine again. Yet, if i still compile kernel and xen, Xen still wont load.

I did get xen to load just ONCE, with Kernel 3.2.11 when i got the rapidly blinking cursor screen, i rebooted into plain Kernel 3.2.11, installed the previously mentioned ATI driver, than xen loaded. But, i wanted to redo it again, and could never reproduce what i did and Xen so far has not loaded for me.

All steps seem OK and reasonable to follow, but I am missing something(s), not doing something in the right order, etc. I have read the WIKI pages and many others, and keep compiling and trying.
-----------------------------------------------------------------------------

I know this was a LONG description, but hopefully someone can advice or give input on anything i wrote here. See what i missed and need to do different. Thank you very much to any and all.



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.