个人工具

“UbuntuHelp:XenVirtualMachine”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(重定向页面到 UbuntuHelp:Xen
 
(未显示同一用户的7个中间版本)
第1行: 第1行:
 +
#REDIRECT [[UbuntuHelp:Xen]]
 
{{From|https://help.ubuntu.com/community/XenVirtualMachine}}
 
{{From|https://help.ubuntu.com/community/XenVirtualMachine}}
 
{{Languages|UbuntuHelp:XenVirtualMachine}}
 
{{Languages|UbuntuHelp:XenVirtualMachine}}
This page is mostly old junk, and the useful parts are being migrated to [http://help.ubuntu.com/community/Xen Xen].
 
 
 
 
 
=== Using loopback-mounted-file ===
 
 
* Generate loopback file as sparse file (not written entirely to disk but filled on demand) (replace 'edgy.ext3' with whatever name you want for it, ie. 'system1.ext3':
 
<pre><nowiki>
 
sudo dd if=/dev/zero of=/usr/local/edgy.ext3 bs=1024k seek=4096 count=0 </nowiki></pre>
 
 
* Create filesystem within (replace 'edgy.ext3' with what the name you used in step 1):
 
<pre><nowiki>
 
sudo mkfs.ext3 /usr/local/edgy.ext3 </nowiki></pre>
 
 
Mkfs will tell you that this is no block device. Since you already know that (do you?) you can tell it to create the filesystem nevertheless. (so say Yes)
 
 
* Loopback mount filesystem (replace 'edgy' and 'edgy.ext3' with the name you used in step 1):
 
<pre><nowiki>
 
sudo mkdir /mnt/edgy
 
sudo mount /usr/local/edgy.ext3 /mnt/edgy -o loop </nowiki></pre>
 
 
 
 
* Install edgy base into it (replace 'edgy' with the release-name (version) of ubuntu you want (dapper, edgy, feisty, etc), replace '/mnt/edgy' with the name you used in step 1):
 
32bit Host O/S & 32bit virtual host <code><nowiki> sudo debootstrap edgy /mnt/edgy </nowiki></code>
 
 
64bit Host O/S & 64bit virtual host <code><nowiki> sudo debootstrap --arch amd64 edgy /mnt/edgy </nowiki></code>
 
 
* Give it the kernel modules (the module name depends on whether you use the desktop or server edition) (this implies you are installing the same release of ubuntu as you are currently running on the system as the host O/S, which is edgy throughout this example) (replace '/mnt/edgy' with what you used in step 1):
 
32bit Host OS & 32bit Virtual host: <code><nowiki>  sudo cp -a /lib/modules/2.6.19-4-generic/ /mnt/edgy/lib/modules/ </nowiki></code>
 
 
64bit Host OS & 64bit Virtual host: <code><nowiki>  sudo cp -a /lib/modules/2.6.19-4-generic-amd64/ /mnt/edgy/lib/modules/ </nowiki></code>
 
 
* Change whatever you want to be changed before the first boot. Examples:
 
 
The network example below is somewhat confusing.  Basically, whatever your Host O/S's (pre-existing) IP address is, put that in for the gateway, and make sure that the 'netmask' and 'address' put the virtual host into the same broadcast group as the host o/s (simpler example: address: 192.168.1.222 netmask: 255.255.255.0 gateway: 192.168.1.111, the 222 is the virtual host, the 111 is the host o/s's actual IP).
 
 
If you followed the directions above regarding the network configuration you can run the following command:
 
 
<code><nowiki> sudo nano /etc/network/interfaces </nowiki></code>
 
 
and enter the following information
 
 
<pre><nowiki>
 
cat /mnt/edgy/etc/network/interfaces
 
auto lo
 
iface lo inet loopback
 
 
auto eth0
 
iface eth0 inet dhcp </nowiki></pre>
 
 
otherwise do the following:
 
 
<pre><nowiki>
 
cat /mnt/edgy/etc/network/interfaces
 
auto lo
 
iface lo inet loopback
 
 
auto eth0
 
iface eth0 inet static
 
address 192.168.44.247
 
netmask 255.255.252.0
 
gateway 192.168.47.254 </nowiki></pre>
 
 
Then configure the rest of the files:
 
 
<pre><nowiki>
 
cat /mnt/edgy/etc/hosts
 
127.0.0.1      localhost
 
127.0.1.1      edgyvm </nowiki></pre>
 
 
<pre><nowiki>
 
cat /mnt/edgy/etc/hostname
 
edgyvm </nowiki></pre>
 
 
<pre><nowiki>
 
cat /mnt/edgy/etc/fstab
 
proc            /proc          proc    defaults        0      0
 
/dev/hda1      /              ext3    defaults,errors=remount-ro 0      1
 
</nowiki></pre>
 
 
* Umount the loopback partition
 
<pre><nowiki>
 
sudo umount /mnt/edgy </nowiki></pre>
 
 
* Configure the guest, create /etc/xen/edgy-guest.cfg
 
<pre><nowiki>
 
kernel = "/boot/vmlinuz-2.6.19-4-generic"
 
ramdisk = "/boot/initrd.img-2.6.19-4-generic"
 
builder='linux'
 
memory = 128
 
name = "edgy-guest"
 
vcpus = 1
 
vif = [ 'bridge=xenbr0' ]
 
disk = [ 'file:/usr/local/edgy.ext3,ioemu:hda1,w' ]
 
root = "/dev/hda1 ro"
 
</nowiki></pre>
 
 
''' Note: Change hda1 by sda1 if you are using some SATA or SCSI Controller '''
 
 
Note that root points to the virtual root partition of the domU and not of dom0. It is recommended to give each domU a swap partition, in such case your cfg-file may look as follows (don't forget to add it to the /etc/fstab of the virtual host, so it mounts it on boot-up):
 
<pre><nowiki>
 
disk = [ 'file:/usr/local/edgy.ext3,ioemu:hda1,w','phy:/dev/hda6,ioemu:hda2,w']</nowiki></pre>
 
 
* Now you can create your xen domain
 
<pre><nowiki>
 
sudo xm create edgy-guest.cfg </nowiki></pre>
 
 
* You can connect to the guest using the command below or any network based access that you install later on (openssh-server, vncserver, remote-X11, ...)
 
<pre><nowiki>
 
sudo xm console edgy-guest </nowiki></pre>
 
 
Use '''crtl + ]''' to get out of console.
 
 
If you logged in via '''putty''' use '''ctrl + 5''' to leave the domu-console.
 
 
 
== Hypervisor and dom0 ==
 
'''The host for virtualized machines and the priviledged first guest'''
 
 
* The Xen kernel packages currently do not create an initrd image when they are installed. (This will probably be changed in the future). To create an initrd image run the following command:
 
<pre><nowiki>
 
sudo mkinitramfs -o /boot/xen0-linux-2.6.17-6-generic-xen0.initrd.img 2.6.17-6-generic-xen0
 
</nowiki></pre>Respectively:
 
<pre><nowiki>
 
sudo mkinitramfs -o /boot/xen0-linux-2.6.17-6-server-xen0.initrd.img 2.6.17-6-server-xen0
 
</nowiki></pre>if you are using the Ubuntu server distribution.
 
 
 
* Now that the kernel and initrd is installed, you have to setup grub. Add the following to your /boot/grub/menu.lst:
 
<pre><nowiki>
 
title XEN/2.6.17
 
root (hd0,0)
 
kernel /boot/xen-3.0-i386-pae.gz
 
module /boot/xen0-linux-2.6.17-6-generic-xen0 root=/dev/xxx ro
 
module /boot/xen0-linux-2.6.17-6-generic-xen0.initrd.img
 
</nowiki></pre>
 
where xxx is the partition where your root is located. Edgy can use a new way of identifying you partitions by UUID. In this case, just use that syntax for root e.g. <code><nowiki>root=UUID=f5cf5b9a-ed1a-4d6a-a707-a606574e2b6f</nowiki></code>.  You can obtain the UUIDs of your partitions using the command <code><nowiki>blkid</nowiki></code> (found in <code><nowiki>/sbin</nowiki></code>). If you are using the server edition, please make sure you select the right terms in the module lines (xen0-linux-2.6.17-6-server-xen0...).
 
Note: On amd64, use xen-3.0-amd64.gz instead of xen-3.0-i386.gz
 
 
Note: kernel and modules may need to have the /boot removed from them to get this to work. ie
 
<pre><nowiki>
 
kernel /xen-3.0-i386.gz
 
</nowiki></pre>
 
 
 
== domU ==
 
''' The guest machines running under the xen hypervisor'''
 
 
Xen-tools can set up Ubuntu, Debian, CentOS systems, and also any other system if you give it a proper tarball.
 
 
A domU guest system can be built using the same kernel image that was used for dom0.
 
* Decide whether to use a '''loopback-mounted''' file or a '''raw partition''' for a clients filesystem.
 
 
=== use loopback-mounted-file ===
 
* In case of loopback, proceed like:
 
*** Generate loopback file as sparse file (not written entirely to disk but filled on demand:
 
<pre><nowiki>
 
sudo dd if=/dev/zero of=/usr/local/diskimage-guest.ext3 bs=1024k seek=4096 count=0 </nowiki></pre>
 
*** Create filesystem within:
 
<pre><nowiki>
 
sudo mkfs.ext3 /usr/local/diskimage-guest.ext3 </nowiki></pre> Mkfs will tell you that this is no block device. Since you already know that (do you?) you can tell it to create the filesystem nevertheless.
 
*** Loopback mount filesystem:
 
<pre><nowiki>
 
sudo mount /usr/local/diskimage-guest.ext3 /mnt -o loop </nowiki></pre>
 
*** Install debootstrap:
 
<pre><nowiki>
 
sudo apt-get install debootstrap </nowiki></pre>
 
*** Install edgy base into it:
 
<pre><nowiki>
 
sudo debootstrap edgy /mnt </nowiki></pre>
 
*** Give it the kernel modules (the module name depends on whether you use the desktop or server edition)
 
<pre><nowiki>
 
sudo cp -a /lib/modules/2.6.17-6-generic-xen0/ /mnt/lib/modules </nowiki></pre>
 
*** Change whatever you want to be changed before the first boot (/mnt/etc/apt/sources.list, /mnt/etc/network/interfaces, /mnt/etc/hostname, /mnt/etc/hosts)
 
*** Unmount
 
<pre><nowiki>
 
sudo umount /mnt </nowiki></pre>
 
*** Configure the guest, create /etc/xen/edgy-guest.cfg
 
<pre><nowiki>
 
kernel = "/boot/xen0-linux-2.6.17-6-generic-xen0"
 
ramdisk = "/boot/xen0-linux-2.6.17-6-generic-xen0.initrd.img"
 
builder='linux'
 
memory = 128
 
name = "edgy-guest"
 
vcpus = 1
 
vif = [ 'bridge=xenbr0' ]
 
disk = [ 'file:/usr/local/diskimage-guest.ext3,ioemu:hda1,w' ]
 
root = "/dev/hda1 ro"
 
</nowiki></pre> Note that root points to the virtual root partition of the domU and not of dom0. It is recommended to give each domU a swap partition, in such case your cfg-file may look as follows:
 
<pre><nowiki>
 
disk = [ 'file:/usr/local/diskimage-guest.ext3,ioemu:hda1,w','phy:/dev/hda6,ioemu:hda2,w']</nowiki></pre>
 
* Give it a try
 
* First start xend if it is not already started:
 
<pre><nowiki>
 
xend start </nowiki></pre>
 
 
* Now you can create your xen domain
 
<pre><nowiki>
 
sudo xm create edgy-guest.cfg </nowiki></pre>
 
* You can connect to the guest using
 
<pre><nowiki>
 
sudo xm console edgy-guest </nowiki></pre> or any network based access that you install later on (ssh or vnc or remote-X11)
 
 
 
=== use raw partition ===
 
 
* In case of a raw partition you want to use we need to create a file-system on it first.
 
*** If e.g /dev/hda6 is our raw unformated partiton create a ext3-filesystem:
 
<pre><nowiki>
 
mkfs -t ext3 /dev/hda6 </nowiki></pre>
 
*** The next step is to create a mountpoint and to mount it:
 
<pre><nowiki>
 
sudo mkdir /media/hda6 && sudo mount /dev/hda6 /media/hda6 </nowiki></pre>
 
*** All what follows now is ''almost'' identical to "use loopback-mounted-file"
 
*** Install edgy base into it:
 
<pre><nowiki>
 
sudo debootstrap edgy /media/hda6 </nowiki></pre>
 
*** Give it the kernel modules:
 
<pre><nowiki>
 
sudo cp -a /lib/modules/2.6.17-6-generic-xen0/ /media/hda6/lib/modules </nowiki></pre>
 
*** Change whatever you want to be changed before the first boot (/media/hda6/etc/apt/sources.list, /media/hda6/etc/network/interfaces, /media/hda6/etc/hostname, /media/hda6/etc/hosts)
 
*** Unmount
 
<pre><nowiki>
 
sudo umount /media/hda6 </nowiki></pre>
 
*** Configure the guest, create /etc/xen/edgy-guest.cfg
 
<pre><nowiki>
 
kernel = "/boot/xen0-linux-2.6.17-6-generic-xen0"
 
ramdisk = "/boot/xen0-linux-2.6.17-6-generic-xen0.initrd.img"
 
builder='linux'
 
memory = 128
 
name = "edgy-guest"
 
vcpus = 1
 
vif = [ 'bridge=xenbr0' ]
 
disk = [ 'phy:/dev/hdX,hda1,w' ]
 
root = "/dev/hda1 ro"
 
</nowiki></pre> Note that root points to the virtual root partition of the domU and not of dom0. It is recommended to give each domU a swap partition, in such case your cfg-file may look as follows:
 
<pre><nowiki>
 
disk = [ 'phy:/dev/hdXX,hda1,w','phy:/dev/hdXY,hda2,w']</nowiki></pre>
 
* Give it a try
 
* First start xend if it is not already started:
 
<pre><nowiki>
 
xend start </nowiki></pre>
 
 
* Now you can create your xen domain
 
<pre><nowiki>
 
sudo xm create edgy-guest.cfg </nowiki></pre>
 
* You can connect to the guest using
 
<pre><nowiki>
 
sudo xm console edgy-guest </nowiki></pre> or any network based access that you install later on (ssh or vnc or remote-X11)
 
 
Especially if you want to set up a larger number of virtual machines, it's strongly recommended to set up LVM and use logical volumes for your virtual machines.
 
 
 
 
 
 
 
== Installing DomU w/ debootstrap ==
 
 
First, setup and configure lvm, create an ext3 and swap partition in lvm, and mount your lvm partition to /xen.
 
 
<code><nowiki>apt-get install debootstrap</nowiki></code>
 
 
I prefer to install from CD, as it's faster. Mount your CD-Rom to /media/cdrom, and mount your future domU root partition to /xen
 
 
<pre><nowiki>
 
debootstrap dapper /xen file:/media/cdrom</nowiki></pre>
 
 
You should see lots of I: messages, and finally the prompt. Change directories to the root directory of your new filesystem.
 
 
=== Xen configuration options ===
 
 
Using your favorite editor (back in Dom0), create /etc/xen/dom1.cfg with the following text
 
 
<pre><nowiki>kernel = "/boot/vmlinuz-2.6-xen"
 
memory = 128
 
name = "dom1"
 
vif = [ '' ]
 
dhcp = "dhcp"
 
disk = ['phy:/dev/xen_lvm/dom1,hda1,w','phy:/dev/xen_lvm/dom1_swap,hdb1,w']
 
root = "/dev/hda1 ro"
 
extra = "4"
 
</nowiki></pre>
 
 
=== Create a DomU ===
 
 
<code><nowiki>xm create dom1.cfg -c</nowiki></code>
 
 
Login with root, no password (you want to change that!)
 
 
=== Changes Necessary on the DomU's Filesystem ===
 
<code><nowiki>mv ./lib/tls ./lib/tls.disabled</nowiki></code>
 
 
in ./etc/network/interfaces (change the relevant numbers)
 
<pre><nowiki>auto lo
 
iface lo inet loopback
 
 
auto eth0
 
iface eth0 inet static
 
address 192.168.3.101
 
netmask 255.255.255.0
 
network 192.168.3.0
 
broadcast 192.168.3.255
 
gateway 192.168.3.1
 
# dns-* options are implemented by the resolvconf package, if installed
 
dns-nameservers 1.2.3.4 1.2.3.5</nowiki></pre>
 
 
 
Copy the Dom0's sources list: <code><nowiki>cp /etc/apt/sources.list ./etc/apt/sources.list</nowiki></code> and edit them if you wish.
 
 
 
In ./etc/fstab
 
 
<pre><nowiki># /fstab: static file system information.
 
#
 
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
 
proc            /proc          proc    defaults        0      0
 
/dev/hda1      /              ext3    defaults,errors=remount-ro 0      1
 
/dev/hdb1      none            swap    sw              0      0</nowiki></pre>
 
 
<code><nowiki>umount /dev/xen_lvm/dom1</nowiki></code> (we don't want two operating systems writing to the same partition!)
 
 
Locale setup:
 
 
The locale isn't set up properly by default. Resolve this by:
 
<pre><nowiki>
 
Install base packages for your language:
 
apt-get install language-pack-en-base
 
 
Install/Reconfigure localeconf via either:
 
apt-get install localeconf
 
dpkg-reconfigure localeconf
 
 
*** Manage locale configuration files with debconf? -> yes
 
*** Please select the default system locale. -> Your locale. Mine is en_US ISO-8859-1 for example.
 
*** Select the environment settings that should override the default locale.  -> Select All
 
*** In the following dialogs always select what you set for your locale above.
 
 
Install/reconfigure locales:
 
apt-get install locales
 
dpkg-reconfigure locales
 
 
*** Here, use the same locale you used in the localeconf setup.
 
</nowiki></pre>
 
 
Setting up your hostname
 
 
<pre><nowiki>
 
Manually edit /etc/hostname with your domU hostname.
 
Manually edit /etc/hosts (If you used debootstrap, you need to set this file up from scratch.)
 
(set the 127.0.0.1 host in /etc/hosts to sync with the host in /etc/hostname)
 
</nowiki></pre>
 
 
At this point you want to set up sshd, so you can log into your new virtual machine remotely!
 
You are ready!
 
 
=== lib tls error ===
 
 
This should only be on older versions of Ubuntu, or on domU guests maybe?
 
 
If you receive a large warning message during boot-up about /lib/tls, you may do one of the following:
 
* <code><nowiki>mv /lib/tls /lib/tls.disabled</nowiki></code> (easy, but the issue may crop up again after an upgrade)
 
* [http://wiki.xensource.com/xenwiki/DebianTlsLibcDiversion Divert Xen using a Script] (This makes sure upgrades don't put /lib/tls back again.
 
* [http://wiki.xensource.com/xenwiki/UbuntuDapperHowTo Build your own glibc] (Instructions from XenSource's Wiki)
 
 
Note: Disabling /lib/tls gives significantly poor performance for glibc. [http://www.mail-archive.com/[email protected]/msg04668.html Find a way to install a Xen-friendly glibc]. Removing /lib/tls is disabling the thread-local storage (tls) handling features of glibc by hiding them.
 
 
=== libcrypto error ===
 
 
Probably only on older versions of Ubuntu.
 
 
If when starting xend, you get the error: blktapctrl: error while loading shared libraries: libcrypto.so.0.9.7: cannot open shared object file: No such file or directory
 
Figure out the version of libcrypto you have:
 
 
<code><nowiki>ls /usr/lib/libcrypto.so.*</nowiki></code>
 
 
for example :
 
 
/usr/lib/libcrypto.so.0.9.8
 
 
Make a symbolic link to it:
 
 
<code><nowiki>ln -s /usr/lib/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.0.9.7</nowiki></code>
 
 
=== ethx missing ===
 
When porting a physical system to a xen image file, eth0 was missing.  Xen assigned eth2 as the first network interface.  To correct this issue comment out  eth0  in /etc/iftab. In fact this also happens if you move an installation to another hardware, because the numbers of the ethernet interfaces are bound to a specific MAC address (in the /etc/iftab table) by the ubuntu installer.
 
 
 
 
 
=== Windows DomU guest ===
 
 
In recent processors, Intel and AMD use an extension that gives xen the ability to run guest machines that are not aware of xen at all. The processor flag is called 'VMX' and is present in alle Core2 and some D9xx processors (called 'Vanderpool' or 'VT') as well as in AM2 processors ('called 'Pacifica').
 
 
With the help of qemu (a processor emulation project), xen is able to provide a complete boot process from bios. The necessary package is installed by <code><nowiki> apt-get install xen-ioemu-3.0 </nowiki></code> from universe repository.
 
 
Here is an example configuration (vmx-guest.cfg) using a bootable cdrom as iso-image under /usr/local/bootimage.iso and a loopback (see above) file /usr/local/diskimage-windows for the later harddisk image:
 
<pre><nowiki>
 
kernel = "/usr/lib/xen-ioemu-3.0/boot/hvmloader"
 
builder='hvm'
 
memory = 384
 
name = "vmx-guest"
 
vcpus=1
 
vif = [ 'bridge=xenbr0' ]
 
disk = ['file:/usr/local/diskimage-windows,ioemu:hda,w','file:/usr/local/bootimage.iso,hdc:cdrom,r']
 
device_model ='/usr/lib/xen-ioemu-3.0/bin/qemu-dm'
 
boot='d'
 
vnc=1
 
vncviewer=1
 
serial='pty'
 
ne2000=0
 
</nowiki></pre>
 
Note the new syntax for cdrom in xen 3.0.3!
 
 
<code><nowiki>boot='d'</nowiki></code> lets the guest boot from the cd image, after finishing installation, the next boot should be launched from disk using <code><nowiki>boot='c'</nowiki></code>
 
 
<code><nowiki>vnc=1</nowiki></code> allows us to connect to the guest after a launch using the vncviewer software:
 
<pre><nowiki>
 
xm create vmx-guest.cfg
 
vncviewer localhost
 
</nowiki></pre>
 
 
 
* You may face problems running other distributions than Edgy as domU, in such cases download the original XENsource archive and use the kernel version out of this packages:
 
<pre><nowiki>
 
wget http://bits.xensource.com/oss-xen/release/3.0.4-1/bin.tgz/xen-3.0.4_1-install-x86_32p.tgz
 
tar zvfx xen-3.0.4_1-install-x86_32p.tgz
 
cd dist
 
sudo ./install.sh</nowiki></pre>
 
* If you need a ramdisk, remember to create one with mkinitramfs before:
 
<pre><nowiki>
 
sudo depmod -v 2.6.16.33-xen
 
cd /boot
 
sudo mkinitramfs -o /boot/initrd.img-2.6.16.33-xen 2.6.16.33-xen</nowiki></pre>
 
 
* You can find ready-to-go distributions at: [http://jailtime.org/]
 
* See also [http://help.ubuntu.com/community/XenOnUbuntuBinaryInstall] for a detailed HowTo.
 
 
== Known Bugs ==
 
 
* The edgy xen kernel is reported to crash if two DomUs are started, see: https://launchpad.net/distros/ubuntu/+source/xen-source-2.6.17/+bug/71348 (believed to be fixed with the feisty xen kernels)
 
 
 
* You should disable hyperthreading in you BIOS else your Xen Kernel will reboot indefinitively.
 
 
 
 
 
==== Steps ====
 
 
* apt-get install ssh bridge-utils gcc make patch binutils zlib1g-dev python-dev libncurses-dev x-dev libssl-dev
 
The packages x-dev and libssl-dev seem to be necessary for building the xen-tools.
 
 
* apt-get install bin86 bcc libc6-dev-i386
 
so you can build the hvmloader as well.
 
 
Download source distribution, unpack, cd to xen-3.0.4_1-src and do
 
 
<pre><nowiki>
 
# make prep-kernels
 
# pico linux-2.6.16.33-xen/Makefile
 
Add -fno-stack-protector to CFLAGS in the makefile above (I added it to line 343) - thanks to Peter Fokkinga for the tip.
 
# make dist
 
</nowiki></pre>
 
Add cciss support to kernel in order for Xen to boot successfully on this HP box:
 
 
<pre><nowiki>
 
# make linux-2.6-xen-config CONFIGMODE=menuconfig
 
check "Device Drivers -> SCSI device support -> SCSI device support" - link statically.
 
check "Device Drivers -> SCSI device support -> SCSI disk support" - link statically.
 
check "Device Drivers -> SCSI device support -> SCSI generic support" - link statically.
 
check "Device Drivers -> Block devices - >Compaq Smart Array 5xxx support" - link statically.
 
# make linux-2.6-xen-build
 
# make install
 
</nowiki></pre>
 
Add this to /boot/grub/menu.lst
 
 
<pre><nowiki>
 
title Xen 3.0.4 / XenLinux 2.6
 
kernel /boot/xen-3.0.gz console=vga
 
module /boot/vmlinuz-2.6-xen root=/dev/cciss/c0d0p1 ro console=tty0
 
savedefault
 
boot
 
</nowiki></pre>
 
and reboot.
 
 
 
Now, if you try to export an LVM partition as "sda1" it will fail with a boot log containing "xen_blk: can't get major 8 with name sd" followed by a guest kernel panic. This is a known problem described in the XenFaq and the solution is to  build a domU kernel w/o SCSI support. These are the steps to be done in directory xen-3.0.4_1-src/:
 
 
<pre><nowiki>
 
# make linux-2.6-xenU-config CONFIGMODE=menuconfig
 
UNcheck "Device Drivers -> SCSI device support -> SCSI device support" completely
 
remember to edit ...xenU/Makefile to get a no-stack-protection compile.
 
# make linux-2.6-xenU-build
 
# cp linux-2.6.16.33-xenU/vmlinuz /boot/vmlinuz-2.6-xenU
 
</nowiki></pre>
 
 
 
 
This config file then works for a Linux PV guest:
 
 
<pre><nowiki>
 
#  -*- mode: python; -*-
 
 
# Kernel image file.
 
kernel = "/boot/vmlinuz-2.6-xenU"
 
memory = 64
 
name = "debian1"
 
vif = [ '' ]
 
disk = [ 'phy:vm-disks/debian1,sda1,w', 'phy:vm-disks/debian1-swap,sda2,w' ]
 
root = "/dev/sda1 ro"
 
extra = "4"
 
</nowiki></pre>
 
 
and
 
 
 
 
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年11月17日 (二) 21:21的最新版本

重定向至: