|

Setting Up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12

Please refer to for the latest stable Xen Dom0 solution.


In this post, the detailed tutorial for setting up Xen 3.4.1 dom0 on top of Fedora 12 with kernel 2.6.29 will be introduced.

Hardware:

Dom0 hardware platform:

Motherboard: INTEL S5500BC S5500 Quad Core Xeon Server Board
CPU: 2 x Intel Quad Core Xeon E5520 2.26G (5.86GT/sec,8M,Socket 1366)
Memory: 4 x Kingston DDR-3 1333MHz 4GB ECC REG. CL9 DIMM w/Parity & Thermal Sensor
HD: 4 x WD WD10EARS 1 TB, SATA II 3Gb/s, 64 MB Cache

Disk Partitions:

[root@localhost vm0]# df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-LogVol_root
 ext4     50G   12G   38G  23% /
tmpfs        tmpfs    7.9G     0  7.9G   0% /dev/shm
/dev/sda1     ext3    504M  110M  369M  23% /boot
/dev/mapper/VolGroup-LogVol_lhome
 ext4    858G   21G  794G   3% /lhome

Linux:

Fedora 12 x86_64, updated to Apr. 10, 2010.

No xen and libvirt installed:

 # rpm -qa | grep xen
 # rpm -qa | grep virt

And SELinux is diabled.

Packages:

Xen 3.4.1

linux-2.6.29-xen-r4-aka-suse-xenified-2.6.29-62.1: Download here.

download these packages and unzip them.

Build and install Xen

Uncompress xen and put all the source code files of xen to “/usr/src/xen/xen-3.4.1/”:

 # mkdir -p /usr/src/xen/
 # tar -xf xen-3.4.1.tar.gz -C /usr/src/xen/
 # cd /usr/src/xen/xen-3.4.1

Build xen, tools and docs:

# make -j16 dist-xen dist-tools dist-docs

You may need to install some packages that are required and listed.

Install xen:

 # cd dist
 # sh ./install.sh

Build and install Linux kernel

The .config file I used can be downloaded from here:

https://drive.google.com/file/d/0B1qt7fnWrEczQTZkc2JfOFRHXzQ/view

My .config file can be used directly.

Or please use menuconfig to create one:

# make menuconfig

When using “make menuconfig“, some options require special attention:

    Subarchitecture Type (Enable Xen compatible kernel)
    ( ) PC-compatible
    (X) Enable Xen compatible kernel
    ( ) Support for ScaleMP vSMP
    Device Drivers --->
    XEN --->
    [*] Privileged Guest (domain 0)
    <*>Backend driver support
    <*>Block-device backend driver
    <*>Block-device tap backend driver
    <*> Network-device backend driver

After configuration, build and install this Linux kernel:

 # make -j16
 # make modules_install install

Create a grub entry

# vim /boot/grub/grub.conf

Then add this entry:

title Fedora (xen 3.4.1 - 2.6.29-xen-r4)
 root (hd0,0)
 kernel /xen-3.4.1.gz console=vga vga=ask noreboot
 module /vmlinuz-2.6.29-xen-r4 ro root=/dev/mapper/VolGroup-LogVol_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
 module /initramfs-2.6.29-xen-r4.img

The “root=” and other options will be different depending on the partitions of the system.

Configure services

Add xend and xendomains to services that automatically start when system boot.

 # chkconfig --add xend
 # chkconfig --add xendomains
 # chkconfig xend on
 # chkconfig xendomains on
 # chkconfig --list | grep xend
xend            0:off   1:off   2:on   3:on    4:on    5:on    6:off
xendomains      0:off   1:off   2:on   3:on    4:on    5:on    6:off

Disable ksmtuned service.

# chkconfig ksmtuned off

Reboot now

# reboot

After booting the system in the xen environment. the xm command can be used:

[root@localhost ~]# xm info
host                   : localhost.localdomain
release                : 2.6.29-xen-r4
version                : #1 SMP Mon Apr 12 00:41:42 HKT 2010
machine                : x86_64
nr_cpus                : 16
nr_nodes               : 1
cores_per_socket       : 4
threads_per_core       : 2
cpu_mhz                : 2266
hw_caps                : bfebfbff:28100800:00000000:00000340:009ce3bd:00000000:00000001:00000000
virt_caps              : hvm
total_memory           : 16321
free_memory            : 4
node_to_cpu            : node0:0-15
node_to_memory         : node0:4
xen_major              : 3
xen_minor              : 4
xen_extra              : .1
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : unavailable
cc_compiler            : gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC)
cc_compile_by          : root
cc_compile_domain      : localdomain
cc_compile_date        : Mon Apr 12 01:53:45 HKT 2010
xend_config_format     : 4

Then xm can be used to create and manage virtual machines on the server.

[root@localhost ~]# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 15093    16     r-----    228.2
vm0                                          1  1024     2     -b----      4.4

Similar Posts

  • Make changes to sysctl.conf take effect without rebooting Linux?

    I made some changes to /etc/sysctl.conf. I know it will take effect next time Linux boots. However, how to make the changes to sysctl.conf take effect without rebooting Linux? You can force Linux to reload the new configuration in /etc/sysctl.conf by: execute the following command as root: sysctl -p For more details, check the manual…

  • |

    Statically Linking C and C++ Programs on Linux with gcc

    Before statically linking you C and C++ programs, you should be aware of the drawbacks of the static linking especially with glibc. There are some good discussions already: with glibc you’re linking static programs which are not really static and some others here and here. That said, you can choose to statically link C and…

  • MFC程序使用系统风格界面

    VC6默认编译出来的程序在XP下Luma风格下运行也是Windows的经典界面, 有损界面的美观与统一. VC2008默认设置下如果不是使用的unicode也是如此. 本文给出使VC6和VC2008可以编译出使用系统界面风格的解决方案. 1. 使VC6编译出使用系统风格的程序 步骤如下: 1) 创建一个.manifest文件的资源. 在res/文件夹下创建一个跟以程序名加.manifest的文件, 如果程序为test.exe, 则创建test.exe.manifest 文件可由此下载: https://www.systutorials.com/t/g/programming/resultcollector.manifest/ 注意要使用utf-8编码保存。 2) 将新定义的资源加入到.rc2文件中, 类型设为24. 打开res/文件夹下的.rc2文件, 在其中加入如下定义: 1 24 MOVEABLE PURE “res/test.exe.manifest” 其中的文件地址按1)步中修改的设置即可. 之后编译即可, 为了使程序界面可能充分利用系统的界面特性, 可以将界面字体设置为TrueType类型的, 利用Windows XP等系统的屏幕字体平滑特性. 2. 使VC2008编译出使用系统风格的程序 在VC2008下就比较简单了, 如果程序字符集使用unicode则默认就是使用系统界面风格的, 如果选择其它的类型, 则编辑下stdafx.h即可. 最后面部分找到这么一段: #ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,”/manifestdependency:”type=’win32′ name=’Microsoft.Windows.Common-Controls’ version=’6.0.0.0′ processorArchitecture=’x86′ publicKeyToken=’6595b64144ccf1df’ language=’*'””) #elif defined _M_IA64 #pragma comment(linker,”/manifestdependency:”type=’win32’…

Leave a Reply

Your email address will not be published. Required fields are marked *