Set up Ubuntu Lucid Server PV DomU at Xen 4.0 (kernel-xen-2.6.34.1-0.0.19.40d88ce) on top of opensuse 11.3

July 31, 2010

Install “kotd” (kernel of the day) via ftp://ftp.suse.com/pub/projects/kernel/kotd/openSUSE-11.3/x86_64/ kernel-xen-2.6.34.1-0.0.19.40d88ce.x86_64.rpm ( supporting udev 157). Next step supposed to be is to upgrade Xen 4.0 to support Lucid Grub2 syntax . What,actually, requires just one back port CS 21188 from xen-4.0-testing.hg, which is not in official 4.0 tarball been used for 11.3. The procedure bellow is pretty much standard and was described by me in details just to compare how much more flexible is patching Xen Hypervisor on Fedoras. In particular, all properly named by version rpms been built from src.rpm gets installed upgrading old ones right away with no questions and no additional zypper (yum) install run.
One more patch has been tested with Suse’s 11.3 version of Xen Hypervisor. It was ZFS 24 support per Mark Johnson ([1]).

# wget http://download.opensuse.org/source/distribution/11.3/repo/oss/suse/src/xen-0.0_21091_05-6.6.src.rpm
# rpm -iv xen-4.0.0_21091_05-6.6.src.rpm
# cd /usr/src/packages/SOURCES

Create 21188-grub2-fix.patch with raw content of CS 21188:-
http://xenbits.xensource.com/xen-4.0-testing.hg?raw-rev/065efaec5e71

# cd ../SPECS

Update xen.spec
……….
Version: 4.0.0_21091_05
# Old one 6.6
Release: 6.7
……….
Patch44: 21188-grub2-fix.patch
……….
%patch44 -p1

:wq

#zypper install LibVNCServer-devel SDL-devel acpica automake bin86 curl-devel dev86 \
graphviz latex2html libjpeg-devel libxml2-devel ncurses-devel openssl openssl-devel \
pciutils-devel python-devel texinfo transfig \
texlive texlive-latex \
glibc-32bit glibc-devel-32bit

# rpmbuild -bb ./xen.spec
# cd ../RPMS/x*
# zypper install xen-4.0.0_21091_05-6.7.x86_64.rpm \
xen-devel-4.0.0_21091_05-6.7.x86_64.rpm \
xen-doc-html-4.0.0_21091_05-6.7.x86_64.rpm \
xen-doc-pdf-4.0.0_21091_05-6.7.x86_64.rpm \
xen-kmp-default-4.0.0_21091_05_k2.6.34.0_12-6.7.x86_64.rpm \
xen-kmp-desktop-4.0.0_21091_05_k2.6.34.0_12-6.7.x86_64.rpm \
xen-libs-4.0.0_21091_05-6.7.x86_64.rpm \
xen-tools-4.0.0_21091_05-6.7.x86_64.rpm \
xen-tools-domU-4.0.0_21091_05-6.7.x86_64.rpm

During first run xen-tools-4.0.0_21091_05-6.6.x86_64.rpm was removed
xen-tools-domU-4.0.0_21091_05-6.7.x86_64.rpm was installed

Second step was

# zypper install xen-tools-4.0.0_21091_05-6.7.x86_64.rpm
what caused removing xen-tools-domU-4.0.0_21091_05-6.7.x86_64.rpm

Finally on working system :-

linux-y4jf:/usr/src/packages/RPMS/x86_64 # rpm -qa|grep xen|grep -v kernel
patterns-openSUSE-xen_server-11.3-22.1.x86_64
xen-doc-pdf-4.0.0_21091_05-6.7.x86_64
xen-libs-4.0.0_21091_05-6.7.x86_64
xen-kmp-default-4.0.0_21091_05_k2.6.34.0_12-6.7.x86_64
xen-devel-4.0.0_21091_05-6.7.x86_64
xen-doc-html-4.0.0_21091_05-6.7.x86_64
xen-kmp-desktop-4.0.0_21091_05_k2.6.34.0_12-6.7.x86_64
xen-tools-4.0.0_21091_05-6.7.x86_64
xen-4.0.0_21091_05-6.7.x86_64

Hence, the last line should be removed from inst.sh for smooth Hypervisor upgrade.
Activated via YAST xend, xendomains, libvirtd and rebooted Xen Host

host : linux-y4jf
release : 2.6.34.1-0.0.19.40d88ce-xen
version : #1 SMP 2010-07-30 10:41:56 +0200
machine : x86_64
nr_cpus : 4
nr_nodes : 1
cores_per_socket : 4
threads_per_core : 1
cpu_mhz : 2833
hw_caps : bfebfbff:20100800:00000000:00000940:0408e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8150
free_memory : 26
free_cpus : 0
max_free_memory : 5533
max_para_memory : 5529
max_hvm_memory : 5508
node_to_cpu : node0:0-3
node_to_memory : node0:26
node_to_dma32_mem : node0:26
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .0_21091_05-6.7
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 : 21091
xen_commandline : vgamode=0x31a vgamode=0x31a
cc_compiler : gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SU
cc_compile_by : root
cc_compile_domain : site
cc_compile_date : Sat Jul 31 16:07:27 MSD 2010
xend_config_format : 4

Now /usr/bin/pygrub suppports Grub2’s syntax of Ubuntu 10.04
Create Ubuntu 10.04 Server HVM DomU :-

virt-install -n LucidHVM -r 2048 --hvm --vnc -f /dev/sdb5 -c /home/user1/lucidSRV.iso --debug

and LucidPVG.xml file to define Lucid Server PV DomU:

<domain type='xen'>
<name>LucidPVG</name>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>1</vcpu>
<bootloader>/usr/bin/pygrub</bootloader>
<bootloader_args>-q</bootloader_args>
<os>
<type>linux</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/sdb5'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:77:0b:94'/>
<source bridge='br0'/>
<script path='/etc/xen/scripts/vif-bridge'/>
<target dev='vif3.0'/>
</interface>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='5900' autoport='yes'/>
</devices>
</domain>






Runtime snapshots OSOL 134 PV DomU been started via virt-manager ( ZFS 24 support )





Back port ZFS 24 support to Suse’s 11.3 Xen Hypervisor
1. Add fsimage-zfs-24.patch ([1]) to /usr/src/packages/SOURCES
2. Change xen.spec as follows :-

..........
Version: 4.0.0_21091_05
# Old one 6.7
Release: 6.9
..........
Patch44: 21188-grub2-fix.patch
..........
Patch704: fsimage-zfs-24.patch
...........
%patch44 -p1
............
%patch704 -p1
............

:wq

# rpmbuild -bb ./xen.spec

This time Hypervisor upgrade has been run as follows :-

linux-y4jf:/usr/src/packages/RPMS/x86_64 # cat inst.sh
zypper install xen-4.0.0_21091_05-6.9.x86_64.rpm \
xen-devel-4.0.0_21091_05-6.9.x86_64.rpm \
xen-doc-html-4.0.0_21091_05-6.9.x86_64.rpm \
xen-doc-pdf-4.0.0_21091_05-6.9.x86_64.rpm \
xen-kmp-default-4.0.0_21091_05_k2.6.34.0_12-6.9.x86_64.rpm \
xen-kmp-desktop-4.0.0_21091_05_k2.6.34.0_12-6.9.x86_64.rpm \
xen-libs-4.0.0_21091_05-6.9.x86_64.rpm \
xen-tools-4.0.0_21091_05-6.9.x86_64.rpm

linux-y4jf:/usr/src/packages/RPMS/x86_64 # ./inst.sh
Loading repository data…
Reading installed packages…
Resolving package dependencies…

The following packages are going to be upgraded:
xen xen-devel xen-doc-html xen-doc-pdf xen-kmp-default xen-kmp-desktop xen-libs xen-tools

8 packages to upgrade.
Overall download size: 14.3 MiB. After the operation, additional 10.0 KiB will be used.
Continue? [y/n/?] (y): y
Retrieving package xen-libs-4.0.0_21091_05-6.9.x86_64 (1/8), 694.0 KiB (2.8 MiB unpacked)
Installing: xen-libs-4.0.0_21091_05-6.9 [done]
Retrieving package xen-kmp-desktop-4.0.0_21091_05_k2.6.34.0_12-6.9.x86_64 (2/8), 738.0 KiB (4.2 MiB unpacked)
Installing: xen-kmp-desktop-4.0.0_21091_05_k2.6.34.0_12-6.9 [done]
Retrieving package xen-kmp-default-4.0.0_21091_05_k2.6.34.0_12-6.9.x86_64 (3/8), 719.0 KiB (4.0 MiB unpacked)
Installing: xen-kmp-default-4.0.0_21091_05_k2.6.34.0_12-6.9 [done]

Retrieving package xen-doc-pdf-4.0.0_21091_05-6.9.x86_64 (4/8), 1.3 MiB (1.5 MiB unpacked)
Installing: xen-doc-pdf-4.0.0_21091_05-6.9 [done]
Retrieving package xen-doc-html-4.0.0_21091_05-6.9.x86_64 (5/8), 190.0 KiB (422.0 KiB unpacked)
Installing: xen-doc-html-4.0.0_21091_05-6.9 [done]
Retrieving package xen-4.0.0_21091_05-6.9.x86_64 (6/8), 6.3 MiB (25.0 MiB unpacked)
Installing: xen-4.0.0_21091_05-6.9 [done]
Retrieving package xen-tools-4.0.0_21091_05-6.9.x86_64 (7/8), 3.6 MiB (16.5 MiB unpacked)
Installing: xen-tools-4.0.0_21091_05-6.9 [done]
Additional rpm output:
Updating etc/sysconfig/xend…
Updating etc/sysconfig/xendomains…

Retrieving package xen-devel-4.0.0_21091_05-6.9.x86_64 (8/8), 867.0 KiB (5.0 MiB unpacked)
Installing: xen-devel-4.0.0_21091_05-6.9 [done]

References
1. http://old.nabble.com/-PATCH–RESUBMIT–sync-up-zfs-boot-support-in-pygrub-p28236835.html


Downgrade udev 157->151 on opensuse 11.3 to bring back to life Xen 4.0 (2.6.34-12-xen)

July 26, 2010

Well known Bugzilla Bug 1612 “Can’t start VM when vif set and udev version is greater than 151” ([1]) is also affecting xenified aka Suse kernel 2.6.34-12-xen. The workaround for the issue might be udev downgrade from 157 to 151. Following bellow is step by step description of this procedure on Opensuse 11.3 successfully fixed “Hotplug scripts not working” error. Appearance virt-install on Suse 11.3 properly working with Libvirt 0.8.1 also was a bit surprising. However, virt-install works only via command line. Virt-manager invokes old style GUI interface, which crashes same way as it did on 11.2. By some reasons 32-bit runtime environment has to be installed before downgrade. I’ve also installed Miscellaneous, LAMP, DNS+DHCP servers, C/C++ development, rpmbuild development .
*****************************************************************************************************
UPDATE 07/29/2010
*****************************************************************************************************
ftp://ftp.suse.com/pub/projects/kernel/kotd/openSUSE-11.3/x86_64/
Download kernel-xen-2.6.34.1-0.0.17.fdda44d.x86_64.rpm
34984 KB 07/28/2010 07:03:00 PM
and install. It provides kernel working with udev 157
*****************************************************************************************************





All two questions during installing 151’s rpms been built should be answered (1) – downgrade, what will result install 2 and downgrade 2 packages. udev-151-1.3.rpm has to be installed separately via “zypper install –force udev-151-1.3.rpm.” The procedure above seems to myself mostly as a hackery.

# rpm -iv udev-157-3.1.src.rpm
# cd /usr/src/packages/SOURCES
# cp ~boris/udev-151.tar.bz2 .
# rm -f udev-157.tar.bz2
# cd ../SP*
# vi udev.spec

Check SOURCES and build udev’s RPM

linux-5abr:/usr/src/packages/SOURCES # ls -l
total 520
-rw-r--r-- 1 root root 135 May 30 17:26 79-kms.rules
-rw-r--r-- 1 root root 24 Oct 6 2009 baselibs.conf
-rw-r--r-- 1 root root 2000 Jul 5 16:00 boot.udev
-rw-r--r-- 1 root root 783 Jul 9 2009 boot.udev_retry
-rwxr-xr-x 1 root root 509815 Jul 26 16:36 udev-151.tar.bz2
-rw-r--r-- 1 root root 298 Jun 23 2009 udev-rpmlintrc

# cd ../SPECS
# zypper install libselinux-devel libsepol-devel libusb-devel libacl-devel gobject-introspection-devel
# rpmbuild -bb ./udev.spec

When done

# cd ../RPMS/x*
linux-5abr:/usr/src/packages/RPMS/x86_64 # ls -l
total 608
-rwxr--r-- 1 root root 182 Jul 26 16:53 inst.sh
-rw-r--r-- 1 root root 35691 Jul 26 16:41 libgudev-1_0-0-151-3.1.x86_64.rpm
-rw-r--r-- 1 root root 27938 Jul 26 16:41 libgudev-1_0-devel-151-3.1.x86_64.rpm
-rw-r--r-- 1 root root 27236 Jul 26 16:41 libudev-devel-151-3.1.x86_64.rpm
-rw-r--r-- 1 root root 65173 Jul 26 16:41 libudev0-151-3.1.x86_64.rpm
-rw-r--r-- 1 root root 458517 Jul 26 16:41 udev-151-3.1.x86_64.rpm

linux-5abr:/usr/src/packages/RPMS/x86_64 # cat inst.sh
zypper install udev-151-3.1.x86_64.rpm \
libgudev-1_0-0-151-3.1.x86_64.rpm \
libgudev-1_0-devel-151-3.1.x86_64.rpm \
libudev-devel-151-3.1.x86_64.rpm \
libudev0-151-3.1.x86_64.rpm

Attempt to run ./inst.sh plus

# zypper install --force udev-151-3.1.x86_64.rpm

Two questions during installing rpms above should be answered (1) – downgrade, what will result install 2 and downgrade 2 packages. udev-151-1.3.rpm has to be installed separately via “zypper install –force udev-151-1.3.rpm.”
Finally :-

linux-5abr:~ # rpm -qa|grep udev
libgudev-1_0-devel-151-3.1.x86_64
libudev0-32bit-157-3.1.x86_64
libudev0-151-3.1.x86_64
libgudev-1_0-0-32bit-157-3.1.x86_64
libgudev-1_0-0-151-3.1.x86_64
udev-configure-printer-1.2.0-1.14.x86_64
udev-151-3.1.x86_64
libudev-devel-151-3.1.x86_64

Reboot into xen environment and run :-

# virt-install -n VFM -r 1024 -p –vnc -f /dev/sdb6 \
-l http://192.168.1.6/f13 –debug
Mon, 26 Jul 2010 19:04:10 DEBUG Launched with command line:
/usr/bin/virt-install -n VFM -r 1024 -p –vnc -f /dev/sdb6 -l http://192.168.1.6/f13 –debug
Mon, 26 Jul 2010 19:04:10 DEBUG Requesting libvirt URI default
Mon, 26 Jul 2010 19:04:10 DEBUG Received libvirt URI xen:///
Mon, 26 Jul 2010 19:04:10 DEBUG Requesting virt method ‘xen’, hv type ‘default’.
Mon, 26 Jul 2010 19:04:10 DEBUG Received virt method ‘xen’
Mon, 26 Jul 2010 19:04:10 DEBUG Hypervisor name is ‘xen’
Mon, 26 Jul 2010 19:04:10 DEBUG Didn’t match keymap ‘english-us,pc104′ in keytable!
Mon, 26 Jul 2010 19:04:10 DEBUG DistroInstaller location is a network source.

Starting install…
Mon, 26 Jul 2010 19:04:10 DEBUG Attempting to detect distro:
Mon, 26 Jul 2010 19:04:10 DEBUG Fetching URI: http://192.168.1.6/f13/.treeinfo
Mon, 26 Jul 2010 19:04:10 DEBUG Saved file to /var/lib/xen/virtinst-.treeinfo.njcEmZ
Retrieving file .treeinfo 100% |=========================| 1.2 kB 00:00
Mon, 26 Jul 2010 19:04:10 DEBUG Fetching URI: http://192.168.1.6/f13/images/pxeboot/vmlinuz
Mon, 26 Jul 2010 19:04:11 DEBUG Saved file to /var/lib/xen/virtinst-vmlinuz.RkdWNg
Retrieving file vmlinuz.. 100% |=========================| 3.3 MB 00:00
Mon, 26 Jul 2010 19:04:11 DEBUG Fetching URI: http://192.168.1.6/f13/images/pxeboot/initrd.img
Retrieving file initrd.im 85% |===================== | 24 MB 00:00 ETA Mon, 26 Jul 2010 19:04:12 DEBUG Saved file to /var/lib/xen/virtinst-initrd.img.4Ak3gd
Retrieving file initrd.im 100% |=========================| 28 MB 00:01
Mon, 26 Jul 2010 19:04:12 DEBUG Auto detected OS type as: linux
Mon, 26 Jul 2010 19:04:12 DEBUG Auto detected OS variant as: fedora13
Mon, 26 Jul 2010 19:04:12 DEBUG Generated install XML:
<domain type=’xen’>
<name>VFM</name>
<currentMemory>1048576</currentMemory>
<memory>1048576</memory>
<uuid>14e26f91-faee-828e-7338-4c84083fc1d4</uuid>
<os>
<type arch=’x86_64′>linux</type>
<kernel>/var/lib/xen/virtinst-vmlinuz.RkdWNg</kernel>
<initrd>/var/lib/xen/virtinst-initrd.img.4Ak3gd</initrd>
<cmdline>method=http://192.168.1.6/f13</cmdline>
</os>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<vcpu>1</vcpu>
<devices>
<disk type=’block’ device=’disk’>
<source dev=’/dev/sdb6’/>
<target dev=’xvda’ bus=’xen’/>
</disk>
<interface type=’bridge’>
<source bridge=’br0’/>
<mac address=’00:16:36:1a:11:46’/>
</interface>
<input type=’mouse’ bus=’xen’/>
<graphics type=’vnc’ port=’-1′ keymap=’en-us’/>
<video>
<model type=’cirrus’/>
</video>
</devices>
</domain>

Creating domain… 0 B 00:01
Mon, 26 Jul 2010 19:04:13 DEBUG Started guest, looking to see if it is running
Mon, 26 Jul 2010 19:04:13 DEBUG Launching console callback
Mon, 26 Jul 2010 19:04:13 DEBUG Generated boot XML:
<domain type=’xen’>
<name>VFM</name>
<currentMemory>1048576</currentMemory>
<memory>1048576</memory>
<uuid>14e26f91-faee-828e-7338-4c84083fc1d4</uuid>
<bootloader>/usr/bin/pygrub</bootloader>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<vcpu>1</vcpu>
<devices>
<disk type=’block’ device=’disk’>
<source dev=’/dev/sdb6’/>
<target dev=’xvda’ bus=’xen’/>
</disk>
<interface type=’bridge’>
<source bridge=’br0’/>
<mac address=’00:16:36:1a:11:46’/>
</interface>
<input type=’mouse’ bus=’xen’/>
<graphics type=’vnc’ port=’-1′ keymap=’en-us’/>
<video>
<model type=’cirrus’/>
</video>
</devices>
</domain>

xpath.c:14859: XPath error : NULL context pointer
Mon, 26 Jul 2010 19:36:20 DEBUG Removing /var/lib/xen/virtinst-vmlinuz.RkdWNg
Mon, 26 Jul 2010 19:36:20 DEBUG Removing /var/lib/xen/virtinst-initrd.img.4Ak3gd
Guest installation complete… restarting guest.
Mon, 26 Jul 2010 19:36:23 DEBUG Launching console callback
xpath.c:14859: XPath error : NULL context pointer







Virt-manager appears also to be functional for DomUs created via virt-install



Suse 11.3 and F13 PV Guests running at a time





*********************************************************************************************************************
UPDATE on 07/28/2010
*********************************************************************************************************************
Virt-install HVM hangs attemting to relaunch console and places system into paused state.System
reboot allows to start and run HVM DomU. However, after HVM DomU has been run attempt to start
any other DomU failes. Two kinds of errors came up :-
1.
Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/engine.py”, line 824, in run_domain
vm.startup()
File “/usr/share/virt-manager/virtManager/domain.py”, line 1286, in startup
self._backend.create()
File “/usr/lib64/python2.6/site-packages/libvirt.py”, line 333, in create
if ret == -1: raise libvirtError (‘virDomainCreate() failed’, dom=self)
libvirtError: POST operation failed: xend_post: error from xen daemon:
(xend.err ‘Not enough memory is available, and dom0 cannot be shrunk any further’)
2.
Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/engine.py”, line 824, in run_domain
vm.startup()
File “/usr/share/virt-manager/virtManager/domain.py”, line 1286, in startup
self._backend.create()
File “/usr/lib64/python2.6/site-packages/libvirt.py”, line 333, in create
if ret == -1: raise libvirtError (‘virDomainCreate() failed’, dom=self)
libvirtError: POST operation failed: xend_post: error from xen daemon:
(xend.err ‘Device 0 (vif) could not be connected. Hotplug scripts not working.’)
*************************************************************************************************************************
References
1.http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1612


Install opensuse 11.3 as PV Guest at Xen 4.0.1-rc4 (2.6.32.16 pvops) on top of Ubuntu 10.04 Server

July 20, 2010

The procedure driven by virt-install (libvirt 0.8.2) has been managed via keyboard due to mouse pointer stayed frozen at center of VNC window all the time of installation and finally at Gnome Desktop came up at the end



Get access to text mode console and edit /etc/inittab to switch to initdefault 3



Option 1
Restart DomU and login to created user’s account :-
$ vncserver
and edit .vnc/xstartup as follows :

boris@linux-yonn:~> cat .vnc/xstartup
#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# twm &
/usr/bin/gnome-session &




Restart vncserver and run
# su –
# /sbin/SuSEfirewall2 stop
Tuning firewall for port 5901 would be done latter in graphical mode
Start another terminal session and issue :-
# vncviewer IP-DomU:1



Firewall tuning :-



Option 2
Edit /boot/grub/menu.lst and add “nomodeset” option to xenified kernel menu entry . Restart DomU





Opensuse 11.3 PV guest shows same behavior at Xen 4.0.1-rc4 (2.6.32.16 pvops) on top of Fedora 13 Libvirt 0.7.7. Notice, that 11.2 was impossible to install as PV Guest at all . In meantime problem appears just to bring up vncserver at DomU and properly tune Firewall.
I was also able to start Xvnc service via xinetd and found file /etc/gdm/custom.conf. However, all attempts
to find appropriate “/usr/lib/gdm/gdmgreeter” for [daemon] section of custom.conf to obtain Gnome Login to DomU failed.
Runtime snapshot on F13



*************************************************************************************
Update 07/26/2010 . Set up opensuse 11.3 PV DomU at Xen 4.0.1-rc4 & 2.6.32.16-1.2.108.xendom0.fc13.x86_64 Dom0 on top of F13
*************************************************************************************
Virt-install behaves normal on F13 . Environment :-

[root@fedora13 ~]# xm info
host : fedora13
release : 2.6.32.16-1.2.108.xendom0.fc13.x86_64
version : #1 SMP Fri Jul 23 17:09:30 MSD 2010
machine : x86_64
nr_cpus : 4
nr_nodes : 1
cores_per_socket : 4
threads_per_core : 1
cpu_mhz : 2833
hw_caps : bfebfbff:20100800:00000000:00000940:0408e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8190
free_memory : 2052
node_to_cpu : node0:0-3
node_to_memory : node0:2052
node_to_dma32_mem : node0:1210
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .1-rc4
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
xen_commandline :
cc_compiler : gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC)
cc_compile_by : root
cc_compile_domain :
cc_compile_date : Thu Jul 22 16:41:06 MSD 2010
xend_config_format : 4
[root@fedora13 ~]# virsh version
Compiled against library: libvir 0.8.2
Using library: libvir 0.8.2
Using API: Xen 3.0.1
Running hypervisor: Xen 4.0.0

Next

# mount -o loop,ro openSUSE-11.3-DVD-x86_64.iso /var/www/html/suse
<br>
# virt-install --name SUSE11.3 -p --ram 2048 -f /dev/sdb7 \
> --vnc --location http://192.168.1.4/suse --debug
Mon, 26 Jul 2010 13:27:40 DEBUG Launched with command line:
/usr/sbin/virt-install --name SUSE11.3 -p --ram 2048 -f /dev/sdb7 --vnc --location http://192.168.1.4/suse --debug
Mon, 26 Jul 2010 13:27:40 DEBUG Requesting libvirt URI default
Mon, 26 Jul 2010 13:27:40 DEBUG Received libvirt URI xen:///
Mon, 26 Jul 2010 13:27:40 DEBUG Requesting virt method 'xen', hv type 'default'.
Mon, 26 Jul 2010 13:27:40 DEBUG Received virt method 'xen'
Mon, 26 Jul 2010 13:27:40 DEBUG Hypervisor name is 'xen'
Mon, 26 Jul 2010 13:27:40 DEBUG DistroInstaller location is a network source.

Starting install...
Mon, 26 Jul 2010 13:27:40 DEBUG Attempting to detect distro:
Mon, 26 Jul 2010 13:27:40 DEBUG HTTP hasFile: didn't find http://192.168.1.4/suse/.treeinfo
Mon, 26 Jul 2010 13:27:40 DEBUG HTTP hasFile: didn't find http://192.168.1.4/suse/Fedora
Mon, 26 Jul 2010 13:27:40 DEBUG HTTP hasFile: didn't find http://192.168.1.4/suse/Server
Mon, 26 Jul 2010 13:27:40 DEBUG HTTP hasFile: didn't find http://192.168.1.4/suse/Client
Mon, 26 Jul 2010 13:27:40 DEBUG HTTP hasFile: didn't find http://192.168.1.4/suse/RedHat
Mon, 26 Jul 2010 13:27:40 DEBUG HTTP hasFile: didn't find http://192.168.1.4/suse/CentOS
Mon, 26 Jul 2010 13:27:40 DEBUG HTTP hasFile: didn't find http://192.168.1.4/suse/SL
Mon, 26 Jul 2010 13:27:40 DEBUG Detected a Suse distro.
Mon, 26 Jul 2010 13:27:41 DEBUG Fetching URI: http://192.168.1.4/suse/boot/x86_64/vmlinuz-xen
Mon, 26 Jul 2010 13:27:41 DEBUG Saved file to /var/lib/xen/virtinst-vmlinuz-xen.KZ8rOT
Retrieving file vmlinuz-xen... | 6.7 MB 00:00 ...
Mon, 26 Jul 2010 13:27:41 DEBUG Fetching URI: http://192.168.1.4/suse/boot/x86_64/initrd-xen
Mon, 26 Jul 2010 13:27:41 DEBUG Saved file to /var/lib/xen/virtinst-initrd-xen.iAjenrB/s | 26 MB --:-- ETA
Retrieving file initrd-xen... | 56 MB 00:00 ...
Mon, 26 Jul 2010 13:27:41 DEBUG Auto detected OS type as: linux
Mon, 26 Jul 2010 13:27:41 DEBUG Generated install XML:
<domain type='xen'>
<name>SUSE11.3</name>
<currentMemory>2097152</currentMemory>
<memory>2097152</memory>
<uuid>c41a3e59-6e97-6c01-488d-5d02eeb374b9</uuid>
<os>
<type arch='x86_64'>linux</type>
<kernel>/var/lib/xen/virtinst-vmlinuz-xen.KZ8rOT</kernel>
<initrd>/var/lib/xen/virtinst-initrd-xen.iAjenr</initrd>
<cmdline>method=http://192.168.1.4/suse</cmdline>
</os>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<vcpu>1</vcpu>
<devices>
<disk type='block' device='disk'>
<source dev='/dev/sdb7'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='br0'/>
<mac address='00:16:36:0b:89:08'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
<video>
<model type='cirrus'/>
</video>
</devices>
</domain>
Creating domain... | 0 B 00:01
Mon, 26 Jul 2010 13:27:43 DEBUG Started guest, looking to see if it is running
Mon, 26 Jul 2010 13:27:43 DEBUG Launching console callback
Mon, 26 Jul 2010 13:27:43 DEBUG Generated boot XML:
<domain type='xen'>
<name>SUSE11.3</name>
<currentMemory>2097152</currentMemory>
<memory>2097152</memory>
<uuid>c41a3e59-6e97-6c01-488d-5d02eeb374b9</uuid>
<bootloader>/usr/bin/pygrub</bootloader>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<vcpu>1</vcpu>
<devices>
<disk type='block' device='disk'>
<source dev='/dev/sdb7'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='br0'/>
<mac address='00:16:36:0b:89:08'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
<video>
<model type='cirrus'/>
</video>
</devices>
</domain>
Mon, 26 Jul 2010 13:46:29 DEBUG Removing /var/lib/xen/virtinst-vmlinuz-xen.KZ8rOT
Mon, 26 Jul 2010 13:46:29 DEBUG Removing /var/lib/xen/virtinst-initrd-xen.iAjenr
Guest installation complete... restarting guest.
Mon, 26 Jul 2010 13:46:38 DEBUG Launching console callback

After switching Suse 11.3 DomU to “nomodeset” . VNC console at localhost:5900 behaves normal





Adding “VHD & ZFS 24” support to Xen 4.0.*.rc* source & kernels packaged for Ubuntu Virtualusr’s Blog

July 16, 2010

To test NexentaStor-3.0.2.xen.tar.bz2 at Xen 4.0.1-rc3 & 2.6.32.16 pvops Dom0 on top of Ubuntu 10.04 Server. Apply patch bellow to packageXen40x.sh.Notice , that 4.0.1 doesn’t support either ZFS 24 or VHD disk devices by default.
Two patches mentioned bellow ( for VHD support, ZFS 24 support) may be applied as usual to clone of http://xenbits.xensource.com/xen-4.0-testing.hg for straightforward Xen & Tools build and install.

--- packageXen40x.sh.orig	2010-07-16 15:33:03.756414641 +0400
+++ packageXen40x.sh	2010-07-16 15:40:31.546289159 +0400
@@ -35,6 +35,8 @@
 [ -r mk_ub_pgk_source.sh ] && sh mk_ub_pgk_source.sh $SDSC
 
 # Retreive latest release tag if not specified
+cp fsimage-zfs-24.patch1 $WRKD
+cp blktap2_ctrl_func.patch-xen-testing-4.x.patch1 $WRKD
 cd $WRKD
 [ ! -d $REPOS -a -d ../$REPOS ] && ln -sv ../$REPOS .
 if [ -z "$LREL" ]; then
@@ -43,7 +45,7 @@
 	[ -d $REPOS ] || hg clone $REPURL #http://xenbits.xensource.com/$REPOS
 	cd $WRKD/$REPOS
 	LREL=$(hg tags | sed '/^tip\b /d' | sed -n '1 s/  *.*//p')      # RELEASE-4.0.0
-	hg pull; hg update
+	hg pull; hg update;
 fi
 RELTAG=$(echo $LREL | sed 's/^RELEASE-//;s/-\([^-]*\)$/\1/')	# 4.0.0
 
@@ -66,6 +68,9 @@
 cd $WRKD/$DEBDIRNAM
 echo Info: Patch with debian diff $UDIFNAME ...
 zcat $STARTDIR/$UDIFNAME | patch -p1
+echo "Info: ZFS & VHD patching"
+        patch -p1 -s -i $WRKD/fsimage-zfs-24.patch1;
+        patch -p1 -s -i $WRKD/blktap2_ctrl_func.patch-xen-testing-4.x.patch1;
 echo Info: Tag change log with the version: $RELTAG-0ubuntu1
 test "$RELTAG" != "4.0.0" && \
 	dch -b --newversion $RELTAG-0ubuntu1 "Automated rebuild atempt for new upstream version."

Run ./packageXen40x.sh 4.0.1-rc3 will result building debian packages
root@ServerLDX:/usr/src/build/xen40-lucid# ls -l *.deb

-rw-r--r-- 1 root root  279808 2010-07-16 14:53 libxen4_4.0.1rc3-0ubuntu1_amd64.deb
-rw-r--r-- 1 root root  398908 2010-07-16 14:53 libxen4-dev_4.0.1rc3-0ubuntu1_amd64.deb
-rw-r--r-- 1 root root 1051920 2010-07-16 14:53 python-xen-4.0_4.0.1rc3-0ubuntu1_amd64.deb
-rw-r--r-- 1 root root 2592098 2010-07-16 14:53 xen-docs-4.0_4.0.1rc3-0ubuntu1_all.deb
-rw-r--r-- 1 root root  685676 2010-07-16 14:53 xen-hypervisor-4.0_4.0.1rc3-0ubuntu1_amd64.deb
-rw-r--r-- 1 root root 5874246 2010-07-16 14:53 xen-utils-4.0_4.0.1rc3-0ubuntu1_amd64.deb

which been installed would build Hypervisor with required features , not present by default in Xen 4.0.1.

exeCooler’s blktap2_ctrl_func.patch-xen-testing-4.x.patch

diff -r 2c3495f3ca84 tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py	Fri Jun 04 10:50:55 2010 +0100
+++ b/tools/python/xen/util/blkif.py	Sun Jun 06 23:48:50 2010 +0400
@@ -87,7 +87,7 @@
                 fn = "/dev/%s" %(fn,)
                
         if typ in ("tap", "tap2"):
-            (taptype, fn) = fn.split(":", 1)
+            (taptype, fn) = fn.split(":", 2)[1:3]
     return (fn, taptype)
 
 def blkdev_uname_to_file(uname):
diff -r 2c3495f3ca84 tools/python/xen/xend/XendBootloader.py
--- a/tools/python/xen/xend/XendBootloader.py	Fri Jun 04 10:50:55 2010 +0100
+++ b/tools/python/xen/xend/XendBootloader.py	Sun Jun 06 23:48:50 2010 +0400
@@ -38,10 +38,15 @@
         msg = "Bootloader isn't executable"
         log.error(msg)
         raise VmError(msg)
-    if not os.access(disk, os.R_OK):
-        msg = "Disk isn't accessible"
-        log.error(msg)
-        raise VmError(msg)
+    attempt = 0
+    while True:
+        if not os.access(disk, os.R_OK) and attempt > 3:
+            msg = "Disk isn't accessible"
+            log.error(msg)
+            raise VmError(msg)
+        else:
+            break
+        attempt = attempt + 1
 
     if os.uname()[0] == "NetBSD" and disk.startswith('/dev/'):
        disk = disk.replace("/dev/", "/dev/r")
diff -r 2c3495f3ca84 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Fri Jun 04 10:50:55 2010 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py	Sun Jun 06 23:48:50 2010 +0400
@@ -3269,7 +3269,7 @@
                     log.info("Unmounting %s from %s." %
                              (fn, BOOTLOADER_LOOPBACK_DEVICE))
 
-                    dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
+                    dom0.destroyDevice(devtype, BOOTLOADER_LOOPBACK_DEVICE, force = True)
 
             if blcfg is None:
                 msg = "Had a bootloader specified, but can't find disk"


References
1. http://old.nabble.com/-PATCH–RESUBMIT–sync-up-zfs-boot-support-in-pygrub-p28236835.html
2. http://virtualusr.wordpress.com/2010/07/14/xen-4-0-rc-source-kernels-packaged-for-ubuntu/


exeCooler’s patch for Xen 4.1-unstable

July 11, 2010
diff -r a672af698bc3 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py	Fri Jul 09 12:35:58 2010 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py	Sun Jul 11 17:16:39 2010 +0400
@@ -3261,6 +3261,7 @@
 
             taptype = blkdev_uname_to_taptype(disk)
             mounted = devtype in ['tap', 'tap2'] and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev
+            mounted_vbd_uuid = 0
             if mounted:
                 # This is a file, not a device.  pygrub can cope with a
                 # file if it's raw, but if it's QCOW or other such formats
@@ -3276,7 +3277,8 @@
 
                 from xen.xend import XendDomain
                 dom0 = XendDomain.instance().privilegedDomain()
-                dom0._waitForDeviceUUID(dom0.create_vbd(vbd, disk))
+                mounted_vbd_uuid = dom0.create_vbd(vbd, disk);
+                dom0._waitForDeviceUUID(mounted_vbd_uuid)
                 fn = BOOTLOADER_LOOPBACK_DEVICE
 
             try:
@@ -3286,8 +3288,9 @@
                 if mounted:
                     log.info("Unmounting %s from %s." %
                              (fn, BOOTLOADER_LOOPBACK_DEVICE))
-
-                    dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
+                    _, vbd_info = dom0.info['devices'][mounted_vbd_uuid]
+                    dom0.destroyDevice(dom0.getBlockDeviceClass(vbd_info['devid']), 
+                                       BOOTLOADER_LOOPBACK_DEVICE, force = True)
 
             if blcfg is None:
                 msg = "Had a bootloader specified, but can't find disk"
diff -r a672af698bc3 tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py	Fri Jul 09 12:35:58 2010 +0100
+++ b/tools/python/xen/util/blkif.py	Sun Jul 11 12:13:34 2010 +0400
@@ -87,7 +87,10 @@
                 fn = "/dev/%s" %(fn,)
                
         if typ in ("tap", "tap2"):
-            (taptype, fn) = fn.split(":", 1)
+            if fn.count(":") == 1:
+                (taptype, fn) = fn.split(":", 1)
+            else:
+                (taptype, fn) = fn.split(":", 2)[1:3]
     return (fn, taptype)
 
 def blkdev_uname_to_file(uname):

Set up Xen 4.1-unstable & 2.6.32.16 pvops Dom0 on top of Ubuntu 10.04 Server

July 8, 2010

Due to presence CSs 21556 (blktap2: Fix tapdisk disktype issues) , 21167 (Port latest grub zfs boot code to pygrub) Xen instance been created bellow would provide an option to test NexentaStor-Community-3.0.2-xen.tar.bz2 . In meantime new service xencommons should be configured for successful xend startup and network bridge configuration has to be performed manually vs 4.0.1. Service xencommons
actually starts xenstored and xenconsoled services before xend.

apt-get install libcurl4-openssl-dev \
xserver-xorg-dev \
mercurial gitk \
build-essential \
libncurses5-dev \
uuid-dev gawk \
gettext texinfo bcc \
libncurses5-dev dpkg-dev debhelper \
kernel-package fakeroot \
iasl texinfo bridge-utils bison flex
apt-get build-dep xen-3.3

Now git clone and checkout branch xen/stable-2.6.32.x

cd /usr/src
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
cd linux-2.6-xen
git checkout -b xen/stable-2.6.32.x origin/xen/stable-2.6.32.x

Build kernel in Debian way

# export CONCURRENCY_LEVEL=(number_of_cores) + 1
# make menuconfig # Enabled the dom0 support and the Xen backend as usual
# make-kpkg clean
# fakeroot make-kpkg --initrd --append-to-version=-xen kernel-image kernel-headers
# dpkg -i ../linux-image*2.6.32.16-xen*.deb
# update-initramfs -c -k 2.6.32.16-xen

In case configuring kernel (1)
<M> Xen /dev/xen/evtchn device
echo “xen-evtchn” >> /etc/modules
In case configuring kernel (2)
<*> Xen /dev/xen/evtchn device
/etc/modules shouldn’t be touched.

With config bellow there is no need to touch /etc/modules at all.
Option “userspace grant access device driver is set to” <*> to make virt-install handy at Xen guests
installs



Set up Xen 4.1-unstable Hypervisor
************************************************************************************************************
As of July 11 2010 exeCooler’s blkpat2_pygrub.patch
should be applied before build until corresponding CS will be committed to xen-unstable.hg
*************************************************************************************************************

# cd /usr/src
# hg clone http://xenbits.xensource.com/xen-unstable.hg
# cd xen-unstable.hg
# make xen
# make tools
# make install-xen
# make install-tools PYTHON_PREFIX_ARG=

Set up xencommons,xend,xendomains,watchdog-xen to run as services

update-rc.d xencommons defaults 19 18
update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20
update-rc.d xen-watchdog defaults 22 23

You should also have configure bridge for xen DomUs manually via /etc/network/intefaces :-

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
# auto eth0
# iface eth0 inet dhcp
auto br0
iface br0 inet static
address 192.168.1.7
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth0
bridge_stp on
bridge_maxwait 0

Reboot in Xen with grub entry

menuentry "Xen 4.1 / Ubuntu 10.04 kernel 2.6.32.16-xen" {
insmod ext2
set root='(hd1,9)'
multiboot (hd1,9)/boot/xen.gz dummy=dummy
module (hd1,9)/boot/vmlinuz-2.6.32.16-xen dummy=dummy nopat root=/dev/sdb9 ro console=tty0
module (hd1,9)/boot/initrd.img-2.6.32.16-xen
}

Verify Xen environment :-

root@ServerLSX:~# xm info
host : ServerLSX
release : 2.6.32.16-xen
version : #10 SMP Wed Jul 7 22:17:57 MSD 2010
machine : x86_64
nr_cpus : 4
nr_nodes : 1
cores_per_socket : 4
threads_per_core : 1
cpu_mhz : 2833
hw_caps : bfebfbff:20100800:00000000:00000940:0408e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8190
free_memory : 2048
free_cpus : 0
xen_major : 4
xen_minor : 1
xen_extra : -unstable
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 : Mon Jul 05 08:40:26 2010 +0100 21719:9d965ac1b0db
xen_commandline :
cc_compiler : gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
cc_compile_by : root
cc_compile_domain :
cc_compile_date : Wed Jul 7 21:21:02 MSD 2010
xend_config_format : 4

root@ServerLSX:~# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.90e6ba2d11eb yes eth0
virbr0 8000.000000000000 yes

Test Xen installation via creation NexentaStor 3.0.2 Xen PV Guest. Download sample via
# wget http://genunix.org/dist/nexenta/NexentaStor-Community-3.0.2-xen.tar.bz2
and uncompress tar.bz2 archive :-

root@ServerLSX:~/NexentaStor-Community-3.0.2# ls -l
total 2439888
-rw-r–r– 1 root root 21017088 2010-07-08 16:48 data_disk1.img
-rw-r–r– 1 root root 5120 2010-05-24 15:36 data_disk2.img
-rw-r–r– 1 root root 5120 2010-05-24 15:36 data_disk3.img
-rw-r–r– 1 root root 2573 2010-07-08 16:17 nexentastor-community-3.0.2-xen.cfg
-rw-r–r– 1 root root 1262 2010-05-24 16:15 readme.txt
-rw-r–r– 1 root root 2477388288 2010-07-08 16:48 syspool.img

# cat nexentastor-community-3.0.2-xen.cfg

work_dir = '/root/NexentaStor-Community-3.0.2'
# Names of disks
disk_1_name = 'syspool.img'
disk_2_name = 'data_disk1.img'
disk_3_name = 'data_disk2.img'
disk_4_name = 'data_disk3.img'
# Bootloader for boot DomU
bootloader = "/usr/local/bin/pygrub"
# Memory for DomU, in MB
memory = 1024
# Name of DomU
name = "NexentaStor-3.0.2"
# Network interfaces for DomU
# You can change the mac address of your own needs.
# mac=00:16:3E:xx:xx:xx
vif = [
'mac=00:16:3E:00:00:01',
'mac=00:16:3E:00:00:02'
]
disk = [
'tap2:tapdisk:vhd:' + work_dir + '/' + disk_1_name + ',xvda,w',
'tap2:tapdisk:vhd:' + work_dir + '/' + disk_2_name + ',xvdb,w',
'tap2:tapdisk:vhd:' + work_dir + '/' + disk_3_name + ',xvdc,w',
'tap2:tapdisk:vhd:' + work_dir + '/' + disk_4_name + ',xvde,w',
]
on_reboot = 'destroy'
on_crash = 'destroy'
on_poweroff = 'destroy'

Start Nexenta DomU :-

root@ServerLSX:~/NexentaStor-Community-3.0.2# xm create -c nexentastor-community-3.0.2-xen.cfg
Using config file “./nexentastor-community-3.0.2-xen.cfg”.
Started domain NexentaStor-3.0.2 (id=1)
WARNING: Cannot extract revision on this hypervisor version: v-unstable, unexpected version format
v4.1-unstable chgset ‘Mon Jul 05 08:40:26 2010 +0100 21719:9d965ac1b0db’
SunOS Release 5.11 Version NexentaOS_134d 64-bit
Loading Kernel…
Hostname: myhost
Reading ZFS config: done.
Mounting ZFS filesystems: (6/6)

ZFS Open Storage Appliance (v3.0.2)

myhost console login: root
Password:
Last login: Sat Jul 10 00:31:02 on console
nmc@myhost:/$ show
Option ? network
Option ? interface
==== Interfaces ====
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
xnf0: flags=1004843 mtu 1500 index 2
inet 192.168.1.4 netmask ffffff00 broadcast 192.168.1.255
ether 0:16:3e:0:0:1
xnf1: flags=1000842 mtu 1500 index 3
inet 0.0.0.0 netmask 0
ether 0:16:3e:0:0:2
lo0: flags=2002000849 mtu 8252 index 1
inet6 ::1/128
nmc@myhost:/$









Set up Libvirt 0.8.1 along with with all related packages via Daniel Baumann PPA https://launchpad.net/~dnjl/+archive/virtualization. It seems to provide virt-install utility working OK under Xen 4.1-unstable with 2.6.32.16 pvops kernel, regardless “virsh” fails to work properly with xenstore and consequently virt-manager 0.8.4 is useless for 4.1

root@ServerLX:~# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D18C7A1DF6E6BED2
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys D18C7A1DF6E6BED2
gpg: requesting key F6E6BED2 from hkp server keyserver.ubuntu.com
gpg: key F6E6BED2: public key "Launchpad ppa" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
root@ServerLX:~# apt-get update
Hit http://us.archive.ubuntu.com lucid Release.gpg
Get:1 http://ppa.launchpad.net lucid Release.gpg [307B]
Ign http://ppa.launchpad.net/dnjl/virtualization/ubuntu/ lucid/main Translation-en_US
Hit http://ppa.launchpad.net lucid Release.gpg
Hit http://security.ubuntu.com lucid-security Release.gpg
Ign http://us.archive.ubuntu.com/ubuntu/ lucid/main Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/main Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/restricted Translation-en_US
Ign http://us.archive.ubuntu.com/ubuntu/ lucid/restricted Translation-en_US
Ign http://ppa.launchpad.net/gwibber-daily/ppa/ubuntu/ lucid/main Translation-en_US
Get:2 http://ppa.launchpad.net lucid Release [57.3kB]
Ign http://security.ubuntu.com/ubuntu/ lucid-security/universe Translation-en_US
Ign http://security.ubuntu.com/ubuntu/ lucid-security/multiverse Translation-en_US
Hit http://security.ubuntu.com lucid-security Release
Ign http://us.archive.ubuntu.com/ubuntu/ lucid/universe Translation-en_US
Hit http://ppa.launchpad.net lucid Release
Ign http://us.archive.ubuntu.com/ubuntu/ lucid/multiverse Translation-en_US
Hit http://security.ubuntu.com lucid-security/main Packages
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://ppa.launchpad.net lucid/main Sources
Hit http://us.archive.ubuntu.com lucid-updates Release.gpg
Hit http://security.ubuntu.com lucid-security/restricted Packages
Hit http://security.ubuntu.com lucid-security/main Sources
Hit http://security.ubuntu.com lucid-security/restricted Sources
Hit http://security.ubuntu.com lucid-security/universe Packages
Ign http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main Translation-en_US
Hit http://ppa.launchpad.net lucid/main Packages
Hit http://security.ubuntu.com lucid-security/universe Sources
Hit http://security.ubuntu.com lucid-security/multiverse Packages
Hit http://security.ubuntu.com lucid-security/multiverse Sources
Ign http://us.archive.ubuntu.com/ubuntu/ lucid-updates/restricted Translation-en_US
Ign http://us.archive.ubuntu.com/ubuntu/ lucid-updates/universe Translation-en_US
Ign http://us.archive.ubuntu.com/ubuntu/ lucid-updates/multiverse Translation-en_US
Hit http://us.archive.ubuntu.com lucid Release
Hit http://us.archive.ubuntu.com lucid-updates Release
Hit http://us.archive.ubuntu.com lucid/main Packages
Hit http://us.archive.ubuntu.com lucid/restricted Packages
Hit http://us.archive.ubuntu.com lucid/main Sources
Hit http://us.archive.ubuntu.com lucid/restricted Sources
Hit http://us.archive.ubuntu.com lucid/universe Packages
Hit http://us.archive.ubuntu.com lucid/universe Sources
Hit http://us.archive.ubuntu.com lucid/multiverse Packages
Hit http://us.archive.ubuntu.com lucid/multiverse Sources
Hit http://us.archive.ubuntu.com lucid-updates/main Packages
Hit http://us.archive.ubuntu.com lucid-updates/restricted Packages
Hit http://us.archive.ubuntu.com lucid-updates/main Sources
Hit http://us.archive.ubuntu.com lucid-updates/restricted Sources
Hit http://us.archive.ubuntu.com lucid-updates/universe Packages
Hit http://us.archive.ubuntu.com lucid-updates/universe Sources
Hit http://us.archive.ubuntu.com lucid-updates/multiverse Packages
Hit http://us.archive.ubuntu.com lucid-updates/multiverse Sources
Fetched 308B in 5s (55B/s)
Reading package lists... Done

root@ServerLX:~# apt-get install virtinst python-virtinst virt-viewer
It’s important to specify “–connect xen:///” inside virt-install command line to succeed with VNC console launching (vs 9.10) . Variable VIRSH_DEFAULT_CONNECT_URI exported via .bashrc in my case caused virt-install to crash.Comment out (xend-unix-server yes) in /etc/xen/xend-config.sxp and export variable

export VIRSH_DEFAULT_CONNECT_URI="xen:///"

in root’s .bashrc. Then reboot Xen Host.

root@ServerLX:~# virsh version
Compiled against library: libvir 0.8.1
Using library: libvir 0.8.1
Using API: Xen 3.0.1
Running hypervisor: Xen 4.1.0