- 论坛徽章:
- 0
|
LS 的有一些总结吗,你的意思使用最新的 kernel,比如 2.6.36 也可以编译成 dom0 和 domU 吗,需要和 Xen ...
Godbach 发表于 2010-12-24 16:37
没写完的记录,你参考下
xen 4.0 and kernel 2.6.34.1 on Debian lenny 5.0 安装记录
1、安装编译相关软件
# apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive-fonts-recommended pciutils-dev mercurial build-essential make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev iasl libbz2-dev e2fslibs-dev git-core uuid-dev ocaml libx11-dev
因为是64位系统,所以必须安装gcc-multilib
# apt-get install gcc-multilib
2、编译安装xen、tools、stubdom
# wget http://bits.xensource.com/oss-xen/release/4.0.0/xen-4.0.0.tar.gz
# tar zxvf xen-4.0.0.tar.gz
# cd xen-4.0.0
# make xen tools stubdom
# make install-xen install-tools install-stubdom
3、编译安装dom0
# wget http://gentoo-xen-kernel.googlec ... es-2.6.34-1.tar.bz2
# mkdir xenpatch
# tar xjvf xen-patches-2.6.34-1.tar.bz2 -C xenpatch
# cd /usr/src/
# wget http://www.kernel.org/pub/linux/ ... ux-2.6.34.1.tar.bz2
# tar xjvf linux-2.6.34.1.tar.bz2
# cd linux-2.6.34.1
# for i in `ls ../xenpatch/`; do patch -p1 < ../xenpatch/"$i"; done
# cp /boot/config-2.6.26-2-amd64 .config
# make menuconfig
Processor type and features --->
Enable Xen compatible kernel
Networking support --->
Networking options --->
<*> 802.1d Ethernet Bridging
Device Drivers --->
XEN --->
Privileged Guest (domain 0)
<*> Backend driver support
<*> Block-device backend driver
<*> Block-device tap backend driver
<*> Block-device tap backend driver 2
<*> Network-device backend driver
( Maximum simultaneous transmit requests (as a power of 2)
[ ] Pipelined transmitter (DANGEROUS)
<*> Network-device loopback driver
<*> PCI-device backend driver
PCI Backend Mode (Virtual PCI) --->
[ ] PCI Backend Debugging
<M> TPM-device backend driver
<M> SCSI backend driver
<M> USB backend driver
<*> Block-device frontend driver
<*> Network-device frontend driver
<M> Network-device frontend driver acceleration for Solarflare NICs
<M> SCSI frontend driver
<M> USB frontend driver
Taking the HCD statistics (for debug)
[ ] HCD suspend/resume support (DO NOT USE)
<*> User-space granted page access driver
<*> Framebuffer-device frontend driver
<*> Keyboard-device frontend driver
Disable serial port drivers
<*> Export Xen attributes in sysfs
(256) Number of guest devices
Xen version compatibility (3.2.0 and later) --->
Place shared vCPU info in per-CPU storage Xen driver support --->
Scrub memory before freeing it to Xen
<*> Xen /dev/xen/evtchn device
# make
# make install
# make moudles_install
# depmod -a 2.6.34.1
# update-initramfs -c -k 2.6.34.1
4、修改grub启动项
修改/boot/grub/menu.lst
title Xen 4.0/2.6.34.1
root (hd0,0)
kernel /xen-4.0.gz dom0_mem=512M dom0_max_vcpus=2
module /vmlinuz-2.6.34.1 root=/dev/mapper/vg1-root ro console=tty0
module /initrd.img-2.6.34.1
5、设定xen开机自动启动
#for i in 2 3 4 5
do
ln -s /etc/init.d/xend /etc/rc$i.d/S21xend
ln -s /etc/init.d/xendomains /etc/rc$i.d/S21xendomains
done
#for i in 0 1 6
do
ln -s /etc/init.d/xend /etc/rc$i.d/K79xend
ln -s /etc/init.d/xendomains /etc/rc$i.d/K79xendomains
done
6、建立hvm DomU虚拟客户机
#lvcreate -L 15G -n xp-orig vg1
建立DomU xp-orig的配置文件
# cat /etc/xen/xp_orig.cfg
kernel='/usr/lib64/xen/boot/hvmloader'
builder='hvm'
name='xp-orig'
device_model='/usr/lib64/xen/bin/qemu-dm'
disk=['phy:/dev/vg1/xp_orig,hda,w','phy:/dev/loop0,hdc:cdrom,r']
boot='dc'
#boot='c'
memory='512'
shadow_memory='8'
vcpus=1
#vif=['type=ioemu,model=e1000,mac=00:21:41:e2:31:04,bridge=eth0']
#vif=['type=ioemu,mac=00:21:41:e2:31:04,bridge=eth0']
vif=['']
on_poweroff='destroy'
on_reboot='restart'
on_crash='restart'
vnc=1
vnclisten='0.0.0.0'
vncdisplay=0
vncunused=1
vncpasswd='pass'
sdl=0
usb=1
usbdevice='mouse'
# losetup -f en_winxp_pro_with_sp3_vl.iso
# losetup -a
/dev/loop0: [fc01]:188602 (en_winxp_pro_with_sp3_vl.iso)
开机安装
#xm create xp_orig.cfg
利用vnc远程连接Dom0p_orig,开始安装xp,当xp安装完成之后,安装xenWindowsGplPv驱动
These drivers allow Windows to make use of the network and block backend drivers in Dom0, instead of the virtual PCI devices provided by QEMU. This gives Windows (in theory) a substantial performance boost, and most of the testing that has been done confirms that.
比如说Gbit网卡的支持(不要用ioemu模拟网卡),再比如说xm shutdown DomU,没有安装这个驱动之间,关机不会保留工作状态。
Downloading
Recent binaries are available from http://www.meadowcourt.org/downloads/
There is now one download per platform/architecture, named as follows:
gplpv_<chk/fre>_<platform>_<arch>_<version>.msi
chk is a 'checked' build which contains debug info (please use these if you want any assistance in fixing bugs)
fre is a 'free' build which contains no debug info
platform is 'wxp' for XP, 'wnet' for 2003, and 'wlh' for Vista/2008
arch is 'x86' for 32 bit and 'AMD64' for 64 bits
我们把xp_orig作为xp模板,利用此模板创建多个xpDomU
#lvcreate -L15G -s -n xp_snap1 /dev/vg1/xp_orig
#cat /etc/xen/auto/xp_snap1.cfg
kernel='/usr/lib64/xen/boot/hvmloader'
builder='hvm'
name='xp-snap1'
device_model='/usr/lib64/xen/bin/qemu-dm'
disk=['phy:/dev/vg1/xp_snap1,hda,w']
boot='c'
memory='512'
shadow_memory='8'
vcpus=1
vif=['']
on_poweroff='destroy'
on_reboot='restart'
on_crash='restart'
vnc=1
vnclisten='0.0.0.0'
vncdisplay=0
vncunused=1
vncpasswd='pass'
sdl=0
usb=1
usbdevice='mouse'
#xm create auto/xp_snap1.cfg |
评分
-
查看全部评分
|