Maintain Michael Young’s xen-4.0.0-0.2.rc4.fc12.src.rpm in sync with http://xenbits.xensource.com/xen-unstable.hg

February 28, 2010

Michael Young wrote xen-4.0.0-0.2.rc4.fc12.src.rpm for Xen-4-rc4 for Fedora 12 to install Hypervisor (changeset 20950). Schema bellow modifying content of mentioned src.rpm allows to build set of RPMS upgrading Xen Hypersor 4.0 matching current tip CS of http://xenbits.xensource.com/xen-unstable.hg,no matter of rc4 in fact, via hot upgrade without rebuilding development Xen System on top of F12 with recent PVOps kernel 2.6.32.9. Directory gemu-xen.git is only determined by value of QEMU_TAG in Config.mk file under xen-unstable tree clone.
Make a fresh clone of Xen unstable (4.0)

# hg clone http://xenbits.xensource.com/xen-unstable.hg
# cd xen-unstable.hg
# hg log|more

changeset: 20997:b8d2a4134a68
tag: tip
user: Keir Fraser
date: Wed Mar 03 17:41:58 2010 +0000
summary: x86-64: fix hotplug fault handling for 32-bit domains’ M2P range

changeset: 20996:401c0012b827
user: Keir Fraser
date: Wed Mar 03 17:40:48 2010 +0000
summary: xentop: tmem: no stats for non-tmem domains

changeset: 20995:6c338a5830b5
user: Keir Fraser
date: Wed Mar 03 17:40:22 2010 +0000
summary: Fix domain exit actions that contain hyphen

changeset: 20994:71af69a9d393
user: Keir Fraser
date: Wed Mar 03 17:39:22 2010 +0000
summary: Replace config file parser for “xl”

changeset: 20993:4554b305228a
user: Keir Fraser
date: Tue Mar 02 14:05:35 2010 +0000
summary: x86: use key handler scratch buffer in dump_irqs()

changeset: 20992:92984e102687
user: Keir Fraser
date: Tue Mar 02 13:43:48 2010 +0000
summary: x86/acpi: Add a missing CR in printk

changeset: 20991:6430786865e4
user: Keir Fraser
date: Tue Mar 02 13:42:55 2010 +0000
summary: Update Xen version to 4.0.0-rc6-pre
. . . . . . . . . . .
Next step:-

# git clone git://xenbits.xensource.com/qemu-xen-unstable.git qemu-xen.git
# mv qemu-xen.git.tar.gz /root/rpmbuild/SOURCES/qemu-xen.git.xen-4.0.0-rc6.tar.gz
cp: overwrite `/root/rpmbuild/SOURCES/qemu-xen.git.xen-4.0.0-rc6.tar.gz'? y
# cd ..
# cp -R xen-unstable.hg xen-4.0.0
# cp xen-4.0.0.tar.gz /root/rpmbuild/SOURCES/xen-4.0.0.tar.gz
cp: overwrite `/root/rpmbuild/SOURCES/xen-4.0.0.tar.gz'? y


For instance in meantime localqemu-xen.patch should look like:-

[root@fedora12a SOURCES]# cat localqemu-xen.patch
— Config.mk.orig 2010-03-01 19:12:26.003687931 +0300
+++ Config.mk 2010-03-01 19:13:15.140688420 +0300
@@ -147,8 +147,8 @@

# Specify which qemu-dm to use. This may be `ioemu’ to use the old
# Mercurial in-tree version, or a local directory, or a git URL.
-# CONFIG_QEMU ?= ../qemu-xen.git
-CONFIG_QEMU ?= $(QEMU_REMOTE)
+CONFIG_QEMU ?= ../qemu-xen.git
+#CONFIG_QEMU ?= $(QEMU_REMOTE)

QEMU_TAG ?= e5d14857cd67490bf956d97c8888c0be95ed3f78
# Thu Feb 18 15:36:29 2010 +0000

***********
xen.spec
***********
%{!?python_sitearch: %define python_sitearch %(%{__python} -c “from distutils.sysconfig import get_python_lib; print get_python_lib(1)”)}

# Hypervisor ABI
%define hv_abi 4.0

Summary: Xen is a virtual machine monitor
Name: xen
Version: 4.0.0
Release: 0.3.rc6%{?dist}
. . . . . . .
Source40: qemu-xen.git.xen-4.0.0-rc6.tar.gz
. . . . . . .
%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/xencons
%{_sbindir}/xend
%{_sbindir}/xm
%{python_sitearch}/%{name}
%{python_sitearch}/xen-*.egg-info
%{_mandir}/man1/xm.1*
%{_mandir}/man5/xend-config.sxp.5*
%{_mandir}/man5/xmdomain.cfg.5*
# Add this entry to %files secition
/usr/share/xen/create.dtd

To generate RPMS for Hypervisor next upgrade :-

rpmbuild -ba ./xen.spec

Now install and upgrade old ones :-
[root@fedora x86_64]# ls *.rpm
xen-4.0.0-0.3.rc6.fc12.x86_64.rpm xen-hypervisor-4.0.0-0.3.rc6.fc12.x86_64.rpm
xen-debuginfo-4.0.0-0.3.rc6.fc12.x86_64.rpm xen-libs-4.0.0-0.3.rc6.fc12.x86_64.rpm
xen-devel-4.0.0-0.3.rc6.fc12.x86_64.rpm xen-runtime-4.0.0-0.3.rc6.fc12.x86_64.rpm
xen-doc-4.0.0-0.3.rc6.fc12.x86_64.rpm
[root@fedora x86_64]# ls *.rpm > inst.sh
[root@fedora x86_64]# vi inst.sh
[root@fedora x86_64]# chmod u+x inst.sh
[root@fedora x86_64]# ./inst.sh
Loaded plugins: presto, refresh-packagekit
dom0-kernel | 1.9 kB 00:00
dom0-kernel-source | 1.9 kB 00:00
updates/metalink | 5.2 kB 00:00
updates | 4.4 kB 00:00
updates/primary_db | 4.7 MB 00:21
Setting up Install Process
Examining xen-4.0.0-0.3.rc6.fc12.x86_64.rpm: xen-4.0.0-0.3.rc6.fc12.x86_64
Marking xen-4.0.0-0.3.rc6.fc12.x86_64.rpm as an update to xen-4.0.0-0.2.rc6.fc12.x86_64
Examining xen-debuginfo-4.0.0-0.3.rc6.fc12.x86_64.rpm: xen-debuginfo-4.0.0-0.3.rc6.fc12.x86_64
Marking xen-debuginfo-4.0.0-0.3.rc6.fc12.x86_64.rpm as an update to xen-debuginfo-4.0.0-0.2.rc6.fc12.x86_64
Examining xen-devel-4.0.0-0.3.rc6.fc12.x86_64.rpm: xen-devel-4.0.0-0.3.rc6.fc12.x86_64
Marking xen-devel-4.0.0-0.3.rc6.fc12.x86_64.rpm as an update to xen-devel-4.0.0-0.2.rc6.fc12.x86_64
Examining xen-doc-4.0.0-0.3.rc6.fc12.x86_64.rpm: xen-doc-4.0.0-0.3.rc6.fc12.x86_64
Marking xen-doc-4.0.0-0.3.rc6.fc12.x86_64.rpm as an update to xen-doc-4.0.0-0.2.rc6.fc12.x86_64
Examining xen-hypervisor-4.0.0-0.3.rc6.fc12.x86_64.rpm: xen-hypervisor-4.0.0-0.3.rc6.fc12.x86_64
Marking xen-hypervisor-4.0.0-0.3.rc6.fc12.x86_64.rpm as an update to xen-hypervisor-4.0.0-0.2.rc6.fc12.x86_64
Examining xen-libs-4.0.0-0.3.rc6.fc12.x86_64.rpm: xen-libs-4.0.0-0.3.rc6.fc12.x86_64
Marking xen-libs-4.0.0-0.3.rc6.fc12.x86_64.rpm as an update to xen-libs-4.0.0-0.2.rc6.fc12.x86_64
Examining xen-runtime-4.0.0-0.3.rc6.fc12.x86_64.rpm: xen-runtime-4.0.0-0.3.rc6.fc12.x86_64
Marking xen-runtime-4.0.0-0.3.rc6.fc12.x86_64.rpm as an update to xen-runtime-4.0.0-0.2.rc6.fc12.x86_64
Resolving Dependencies
–> Running transaction check
—> Package xen.x86_64 0:4.0.0-0.3.rc6.fc12 set to be updated
—> Package xen-debuginfo.x86_64 0:4.0.0-0.3.rc6.fc12 set to be updated
—> Package xen-devel.x86_64 0:4.0.0-0.3.rc6.fc12 set to be updated
—> Package xen-doc.x86_64 0:4.0.0-0.3.rc6.fc12 set to be updated
—> Package xen-hypervisor.x86_64 0:4.0.0-0.3.rc6.fc12 set to be updated
—> Package xen-libs.x86_64 0:4.0.0-0.3.rc6.fc12 set to be updated
—> Package xen-runtime.x86_64 0:4.0.0-0.3.rc6.fc12 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================
Package Arch Version Repository Size
==================================================================================================================
Updating:
xen x86_64 4.0.0-0.3.rc6.fc12 /xen-4.0.0-0.3.rc6.fc12.x86_64 4.1 M
xen-debuginfo x86_64 4.0.0-0.3.rc6.fc12 /xen-debuginfo-4.0.0-0.3.rc6.fc12.x86_64 7.4 M
xen-devel x86_64 4.0.0-0.3.rc6.fc12 /xen-devel-4.0.0-0.3.rc6.fc12.x86_64 1.4 M
xen-doc x86_64 4.0.0-0.3.rc6.fc12 /xen-doc-4.0.0-0.3.rc6.fc12.x86_64 1.6 M
xen-hypervisor x86_64 4.0.0-0.3.rc6.fc12 /xen-hypervisor-4.0.0-0.3.rc6.fc12.x86_64 10 M
xen-libs x86_64 4.0.0-0.3.rc6.fc12 /xen-libs-4.0.0-0.3.rc6.fc12.x86_64 901 k
xen-runtime x86_64 4.0.0-0.3.rc6.fc12 /xen-runtime-4.0.0-0.3.rc6.fc12.x86_64 7.4 M

Transaction Summary
==================================================================================================================
Install 0 Package(s)
Upgrade 7 Package(s)

Total size: 33 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : xen-libs-4.0.0-0.3.rc6.fc12.x86_64 1/14
Updating : xen-hypervisor-4.0.0-0.3.rc6.fc12.x86_64 2/14
Updating : xen-runtime-4.0.0-0.3.rc6.fc12.x86_64 3/14
Stopping xenconsoled daemon: [ OK ]
Starting xenconsoled daemon: [ OK ]
Updating : xen-debuginfo-4.0.0-0.3.rc6.fc12.x86_64 4/14
Updating : xen-devel-4.0.0-0.3.rc6.fc12.x86_64 5/14
Updating : xen-doc-4.0.0-0.3.rc6.fc12.x86_64 6/14
Updating : xen-4.0.0-0.3.rc6.fc12.x86_64 7/14
Stopping xend daemon: [ OK ]
Starting xend daemon: [ OK ]
Cleanup : xen-runtime-4.0.0-0.2.rc6.fc12.x86_64 8/14
Cleanup : xen-debuginfo-4.0.0-0.2.rc6.fc12.x86_64 9/14
Cleanup : xen-devel-4.0.0-0.2.rc6.fc12.x86_64 10/14
Cleanup : xen-doc-4.0.0-0.2.rc6.fc12.x86_64 11/14
Cleanup : xen-libs-4.0.0-0.2.rc6.fc12.x86_64 12/14
Cleanup : xen-hypervisor-4.0.0-0.2.rc6.fc12.x86_64 13/14
Cleanup : xen-4.0.0-0.2.rc6.fc12.x86_64 14/14

Updated:
xen.x86_64 0:4.0.0-0.3.rc6.fc12 xen-debuginfo.x86_64 0:4.0.0-0.3.rc6.fc12
xen-devel.x86_64 0:4.0.0-0.3.rc6.fc12 xen-doc.x86_64 0:4.0.0-0.3.rc6.fc12
xen-hypervisor.x86_64 0:4.0.0-0.3.rc6.fc12 xen-libs.x86_64 0:4.0.0-0.3.rc6.fc12
xen-runtime.x86_64 0:4.0.0-0.3.rc6.fc12

Complete!
[root@fedora x86_64]#
Now reboot in updated Xen Environment :-

host : fedora
release : 2.6.32.9-1.2.89.xendom0.fc12.x86_64
version : #1 SMP Thu Mar 4 13:04:28 MSK 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 : 8162
free_memory : 131
node_to_cpu : node0:0-3
node_to_memory : node0:131
node_to_dma32_mem : node0:127
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .0-rc6-pre
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.2 20091222 (Red Hat 4.4.2-20) (GCC)
cc_compile_by : root
cc_compile_domain :
cc_compile_date : Sat Mar 6 14:22:20 MSK 2010
xend_config_format : 4




Syncing with new tip CS:21006:8dada4c897c9

# cd xen-4.0.0
# hg log |more

changeset: 21006:8dada4c897c9
tag: tip
user: Keir Fraser
date: Sat Mar 06 13:31:42 2010 +0000
summary: xenstore: Resolve gcc4.5 type error

changeset: 21005:0d85c05b1554
user: Keir Fraser
date: Sat Mar 06 13:31:03 2010 +0000
summary: blktap: provide a variant of __RING_SIZE() that is an integer constant expression

changeset: 21004:b82dd03944e0
user: Keir Fraser
date: Fri Mar 05 14:42:25 2010 +0000
summary: xend: XenAPI does not support pvSCSI multipath

changeset: 21003:8f98581c2dd1
user: Keir Fraser
date: Fri Mar 05 14:40:19 2010 +0000
summary: Fix Makefile targets that generate several files at once

changeset: 21002:87ed57b6e4cd
user: Keir Fraser
date: Fri Mar 05 14:39:25 2010 +0000
summary: pygrub: Fix grub2 support when config is on a separate /boot partition

changeset: 21001:f0777eafb73b
user: Keir Fraser
date: Fri Mar 05 14:35:44 2010 +0000
summary: xl: Fix undefined behaviour when pci not specified in input file

changeset: 21000:3138b3885999
user: Keir Fraser
date: Fri Mar 05 14:35:09 2010 +0000
summary: Commit output from flex for benefit of prehistoric people

[root@fedora x86_64]# ./inst.sh
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Examining xen-4.0.0-0.7.rc6.fc12.x86_64.rpm: xen-4.0.0-0.7.rc6.fc12.x86_64
Marking xen-4.0.0-0.7.rc6.fc12.x86_64.rpm as an update to xen-4.0.0-0.5.rc6.fc12.x86_64
Examining xen-debuginfo-4.0.0-0.7.rc6.fc12.x86_64.rpm: xen-debuginfo-4.0.0-0.7.rc6.fc12.x86_64
Marking xen-debuginfo-4.0.0-0.7.rc6.fc12.x86_64.rpm as an update to xen-debuginfo-4.0.0-0.5.rc6.fc12.x86_64
Examining xen-devel-4.0.0-0.7.rc6.fc12.x86_64.rpm: xen-devel-4.0.0-0.7.rc6.fc12.x86_64
Marking xen-devel-4.0.0-0.7.rc6.fc12.x86_64.rpm as an update to xen-devel-4.0.0-0.5.rc6.fc12.x86_64
Examining xen-doc-4.0.0-0.7.rc6.fc12.x86_64.rpm: xen-doc-4.0.0-0.7.rc6.fc12.x86_64
Marking xen-doc-4.0.0-0.7.rc6.fc12.x86_64.rpm as an update to xen-doc-4.0.0-0.5.rc6.fc12.x86_64
Examining xen-hypervisor-4.0.0-0.7.rc6.fc12.x86_64.rpm: xen-hypervisor-4.0.0-0.7.rc6.fc12.x86_64
Marking xen-hypervisor-4.0.0-0.7.rc6.fc12.x86_64.rpm as an update to xen-hypervisor-4.0.0-0.5.rc6.fc12.x86_64
Examining xen-libs-4.0.0-0.7.rc6.fc12.x86_64.rpm: xen-libs-4.0.0-0.7.rc6.fc12.x86_64
Marking xen-libs-4.0.0-0.7.rc6.fc12.x86_64.rpm as an update to xen-libs-4.0.0-0.5.rc6.fc12.x86_64
Examining xen-runtime-4.0.0-0.7.rc6.fc12.x86_64.rpm: xen-runtime-4.0.0-0.7.rc6.fc12.x86_64
Marking xen-runtime-4.0.0-0.7.rc6.fc12.x86_64.rpm as an update to xen-runtime-4.0.0-0.5.rc6.fc12.x86_64
Resolving Dependencies
–> Running transaction check
—> Package xen.x86_64 0:4.0.0-0.7.rc6.fc12 set to be updated
—> Package xen-debuginfo.x86_64 0:4.0.0-0.7.rc6.fc12 set to be updated
—> Package xen-devel.x86_64 0:4.0.0-0.7.rc6.fc12 set to be updated
—> Package xen-doc.x86_64 0:4.0.0-0.7.rc6.fc12 set to be updated
—> Package xen-hypervisor.x86_64 0:4.0.0-0.7.rc6.fc12 set to be updated
—> Package xen-libs.x86_64 0:4.0.0-0.7.rc6.fc12 set to be updated
—> Package xen-runtime.x86_64 0:4.0.0-0.7.rc6.fc12 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================
Package Arch Version Repository Size
==================================================================================================================
Updating:
xen x86_64 4.0.0-0.7.rc6.fc12 /xen-4.0.0-0.7.rc6.fc12.x86_64 4.1 M
xen-debuginfo x86_64 4.0.0-0.7.rc6.fc12 /xen-debuginfo-4.0.0-0.7.rc6.fc12.x86_64 7.4 M
xen-devel x86_64 4.0.0-0.7.rc6.fc12 /xen-devel-4.0.0-0.7.rc6.fc12.x86_64 1.4 M
xen-doc x86_64 4.0.0-0.7.rc6.fc12 /xen-doc-4.0.0-0.7.rc6.fc12.x86_64 1.6 M
xen-hypervisor x86_64 4.0.0-0.7.rc6.fc12 /xen-hypervisor-4.0.0-0.7.rc6.fc12.x86_64 10 M
xen-libs x86_64 4.0.0-0.7.rc6.fc12 /xen-libs-4.0.0-0.7.rc6.fc12.x86_64 901 k
xen-runtime x86_64 4.0.0-0.7.rc6.fc12 /xen-runtime-4.0.0-0.7.rc6.fc12.x86_64 7.4 M

Transaction Summary
==================================================================================================================
Install 0 Package(s)
Upgrade 7 Package(s)

Total size: 33 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : xen-libs-4.0.0-0.7.rc6.fc12.x86_64 1/14
Updating : xen-hypervisor-4.0.0-0.7.rc6.fc12.x86_64 2/14
Updating : xen-runtime-4.0.0-0.7.rc6.fc12.x86_64 3/14
Stopping xenconsoled daemon: [ OK ]
Starting xenconsoled daemon: [ OK ]
Updating : xen-debuginfo-4.0.0-0.7.rc6.fc12.x86_64 4/14
Updating : xen-doc-4.0.0-0.7.rc6.fc12.x86_64 5/14
Updating : xen-devel-4.0.0-0.7.rc6.fc12.x86_64 6/14
Updating : xen-4.0.0-0.7.rc6.fc12.x86_64 7/14
Stopping xend daemon: [ OK ]
Starting xend daemon: [ OK ]
Cleanup : xen-libs-4.0.0-0.5.rc6.fc12.x86_64 8/14
Cleanup : xen-debuginfo-4.0.0-0.5.rc6.fc12.x86_64 9/14
Cleanup : xen-doc-4.0.0-0.5.rc6.fc12.x86_64 10/14
Cleanup : xen-devel-4.0.0-0.5.rc6.fc12.x86_64 11/14
Cleanup : xen-4.0.0-0.5.rc6.fc12.x86_64 12/14
Cleanup : xen-hypervisor-4.0.0-0.5.rc6.fc12.x86_64 13/14
Cleanup : xen-runtime-4.0.0-0.5.rc6.fc12.x86_64 14/14

Updated:
xen.x86_64 0:4.0.0-0.7.rc6.fc12 xen-debuginfo.x86_64 0:4.0.0-0.7.rc6.fc12
xen-devel.x86_64 0:4.0.0-0.7.rc6.fc12 xen-doc.x86_64 0:4.0.0-0.7.rc6.fc12
xen-hypervisor.x86_64 0:4.0.0-0.7.rc6.fc12 xen-libs.x86_64 0:4.0.0-0.7.rc6.fc12
xen-runtime.x86_64 0:4.0.0-0.7.rc6.fc12
Complete!
Reboot Xen system and make sure changeset: 21002:87ed57b6e4cd

user: Keir Fraser
date: Fri Mar 05 14:39:25 2010 +0000
summary: pygrub: Fix grub2 support when config is on a separate /boot partition

gets applied now . View Line 383 /usr/bin/pygrub :-

else:
cfg_list = map(lambda x: (x,grub.GrubConf.GrubConfigFile),
["/boot/grub/menu.lst", "/boot/grub/grub.conf",
"/grub/menu.lst", "/grub/grub.conf"]) + \
map(lambda x: (x,grub.GrubConf.Grub2ConfigFile),
["/boot/grub/grub.cfg", "/grub/grub.cfg"]) + \
map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
["/boot/isolinux/isolinux.cfg",
"/boot/extlinux.conf"])

if not fs:

Coming up:-
Comprehension of building Xen Hypervisor SRC RPM for Fedora allows go ahead keeping your local Xen in sync with xen-unstable mercurial tree without touching qemu-common-0.11.0-12.fc12.x86_64, qemu-mg-0.11.0-12.fc12.x86_64,virt-manager-0.8.2-1.fc12.noarch, virt-viewer-0.2.0-1.fc12.x86_64, libvirt-0.7.1-15.fc12.x86_64, libvirt-client-0.7.1-15.fc12.x86_64, libvirt-python-.7.1-15.fc12.x86_64,python-virtinst-0.500.1-2.fc12.noarch.
Hot Hypervisor upgrades taking each 10 minutes keeps your system in shape all the way trough.


Set up Ubuntu Karmic Server (Grub2) PV Guest at Xen 4.0-rc4 Dom0 (2.6.32 pvops) on top of Fedora12

February 21, 2010

Due to recent set of Change Sets for GRUB 2 Support written by Ian Campbell usual sharing image devices between Ubuntu Karmic Koala Server HVM and PV Guests appears available at Xen-4.0 Linux Dom0. Fedora 12 has been selected due to presence of Libvirt 0.7.1 providing virt-install and virt-manager utilities.

Activate rpmbuild via:-
# yum install transfig texi2html libaio-devel dev86 glibc-devel.i686 e2fsprogs-devel gitk mkinitrd iasl

1.Setup Xen Environment.

1.Install Xen Hypervisor
# wget http://myoung.fedorapeople.org/dom0/src/xen-4.0.0-0.2.rc4.fc12.src.rpm
# rpm -iv xen-4.0.0-0.2.rc4.fc12.src.rpm
# cd rpmbuild/SPEC
# rpmbuild -bb ./xen.spec
# cd ../RPMS/x86_64
yum install xen-4.0.0-0.2.rc4.fc12.x86_64.rpm \
xen-debuginfo-4.0.0-0.2.rc4.fc12.x86_64.rpm \
xen-devel-4.0.0-0.2.rc4.fc12.x86_64.rpm \
xen-doc-4.0.0-0.2.rc4.fc12.x86_64.rpm \
xen-hypervisor-4.0.0-0.2.rc4.fc12.x86_64.rpm \
xen-libs-4.0.0-0.2.rc4.fc12.x86_64.rpm \
xen-runtime-4.0.0-0.2.rc4.fc12.x86_64.rpm

2.Install Libvirt
# yum install libvirt libvirt-python python-virtinst \
virt-manager virt-viewer

3.Install kernel
# 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 origin/xen/next -b xen/next
# make menuconfig ( setup Xen Dom0 support)
# make -j(x)(number_of_kernels)
# make modules_install install

Reboot into Xen Environment :-
[root@fedora ~]# xm info
host : fedora
release : 2.6.32
version : #2 SMP Sun Feb 21 17:28:46 MSK 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 : 8160
free_memory : 2049
node_to_cpu : node0:0-3
node_to_memory : node0:2049
node_to_dma32_mem : node0:127
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .0-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.2 20091222 (Red Hat 4.4.2-20) (GCC)
cc_compile_by : root
cc_compile_domain :
cc_compile_date : Sun Feb 21 00:27:00 MSK 2010
xend_config_format : 4

[root@fedora ~]# brctl show
bridge name bridge id STP enabled interfaces
eth0 8000.90e6ba2d11eb no peth0
virbr0 8000.000000000000 yes

Virt-install Karmic HVM DomU:-
# virt-install -n KarmicHVM -r 1024 –hvm –vnc -f /dev/sdb6 -c /root/isos/karmic.iso –debug



When done define domain via XML profile:-
[root@fedora ~]#cat KarmicPV.xml
<domaintype=’xen’id=’4′>
<name>KarmicPV</name>
<uuid>956f366a-95d0-6e67-7100-4a84671b2ae8</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>1</vcpu>
<bootloader>/usr/bin/pygrub</bootloader>
<bootloader_args>-q</bootloader_args>
<os>
<type>linux</type>
<cmdline>root=/dev/xvda1</cmdline>
</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/sdb6’/>
<target dev=’xvda’ bus=’xen’/>
</disk>
<interface type=’bridge’>
<mac address=’00:16:3e:64:7e:d1’/>
<source bridge=’eth0’/>
<script path=’/etc/xen/scripts/vif-bridge’/>
<target dev=’vif4.0’/>
</interface>
<console type=’pty’ tty=’/dev/pts/2′>
<source path=’/dev/pts/2’/>
<target port=’0’/>
</console>
<input type=’mouse’ bus=’xen’/>
<graphics type=’vnc’ port=’5900′ autoport=’yes’/>
</devices>
</domain>
# virsh define KarmicPV.xml
# virsh start KarmicPV
# vncviewier localhost:0
Install Ubuntu Desktop via tasksel






Setup OSOL PV Guests (build<=132) via virsh on Xen 3.4.3 Dom0 on top of Ubuntu 9.10 Server

February 5, 2010

This posting is actually responding recent entry in Martin’s Blog
OpenSolaris 2009.06 domU on opensuse 11.2 dom0
Martin states:-
Then I tried out a number of current linux distributions, but except for openSuSE none had a dom0 kernel out of the box which really is a shame. Seems I need to look more closely into KVM with virtio support.

Article bellow tries to explain that due to efforts of Jan Beulich and Andy Lyon xenified aka Suse Kernel 2.6.31.8(9) may be built on any Linux and along with the most recent stable Xen Hypervisor (3.4.2 and higher) port provide Xen Environment supporting OpenSolaris PV Guests , including the most recent unstable builds like 129,130,131 ( i mean vncserver behavior on OSOL PV DomU and GDM/VNC setup ). I also choosed Ubuntu Karmic Koala Server with Libvirt 0.7.0 capabilities, actually virsh capabilities, been connected to Xen 3.4.3 Hypervisor one more time reproduce nice schema of John Levon of OSOL PV Guest install at Linux Dom0.

Install Libvirt 0.7.0 along with KVM creates environment with default Hypervisor QEMU . Two steps in procedure bellow make Xen default Hypervisor on Ubuntu 9.10 . First is commenting out (xend-unix-server yes) in /etc/xen/xend-config.sxp , second export variable

export VIRSH_DEFAULT_CONNECT_URI="xen:///"

in root’s .bashrc.
1. Then Install KVM with no intend to work with it
# apt-get install ubuntu-virt-server ubuntu-virt-mgmt
# adduser $USER kvm
2. Build Xen 3.4.3-rc2-pre.
First – install on Uubuntu 9.10 Server all packages required for Xen build:-

apt-get install libcurl4-openssl-dev \
xserver-xorg-dev \
python2.6-dev \
mercurial gitk \
build-essential \
libncurses5-dev \
uuid-dev gawk \
gettext texinfo bcc

Second step :-

# cd /usr/src
# hg clone http://xenbits.xensource.com/xen-3.4-testing.hg
# cd xen-3.4-testing.hg
Set in Config.mk
PYTHON = python
PYTHON_PREFIX_ARG =
# make xen
# make tools
# make install-xen
# make install-tools

Tuning Config.mk results Xen packages to be placed into /usr/local/lib/python2.6/dist-packages due to Changeset 19594 in xen-3.4-testing.hg. Otherwise, Xen packages would go to /usr/lib/python2.6/site-packages, which is not default location for python 2.6 on Ubuntu 9.10

3. Edit xend-config.sxp set (xend-unix-server yes) .
4. Patch 2.6.31.9 kernel via

http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.31-10.tar.bz2

Untar linux-2.6.31.9.tar.bz2 and apply patches.

# cd /usr/src/build/
# bzcat linux-2.6.31.9.tar.bz2 | tar xf -
# mkdir -p xen-patches-2.6.31-10
# cd xen-patches-2.6.31-10
# bzcat ../xen-patches-2.6.31-10.tar.bz2 | tar xf -
# cd ../linux-2.6.31.9

Run script

#!/bin/bash
for P in `ls ../xen-patches-2.6.31-10/6*.patch1 | sort `
do
patch -p1 -s -i $P
if [ $? = 0 ]; then
echo $P applied
else
echo "Error processing "$P
exit 1
fi
done

5.Edit Makefile and set EXTRAVERSION=.9-xen. Build kernel , previously tuned to support Xen at Dom0 , with built-in static command line (root=/dev/sdb11 ro console=tty0) and install.
Create /boot/grub/grub.cfg entry:-

menuentry "Xen 3.4 / Ubuntu 9.10 kernel 2.6.31.9 xenified" {
insmod ext2
set root=(hd1,10)
multiboot (hd1,10)/xen-3.4.gz
module (hd1,10)/vmlinuz-2.6.31.9-xen
module (hd1,10)/initrd-2.6.31.9-xen.img
}

Reboot the system


root@ServerKoala:~# export VIRSH_DEFAULT_CONNECT_URI="xen:///"
root@ServerKoala:~# virsh version
Connecting to uri: xen:///
Compiled against library: libvir 0.7.0
Using library: libvir 0.7.0
Using API: Xen 3.0.1
Running hypervisor: Xen 3.4.0

Create XML startup file for OSOL 131 PV Guest:

<domain type='xen'>
<name>OSOL131</name>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>2</vcpu>
<bootloader>/usr/local/bin/pygrub</bootloader>
<bootloader_args>--kernel=/platform/i86xpv/kernel/amd64/unix --ramdisk=/platform/i86pc/amd64/boot_archive </bootloader_args>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<disk type='block' device='cdrom'>
<driver name='phy'/>
<source dev='/dev/loop0'/>
<target dev='xvda' bus='xen'/>
<readonly/>
</disk>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/sdb8'/>
<target dev='xvdb' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:34:0b:18'/>
<source bridge='eth0'/>
<script path='/etc/xen/scripts/vif-bridge'/>
<target dev='vif6.0'/>
</interface>
<console type='pty' tty='/dev/pts/2'>
<source path='/dev/pts/2'/>
<target port='0'/>
</console>
</devices>
</domain>

Then issue :-
# virsh create OSOL131.xml
# virsh console OSOL131
Now follow John Levon run script adopted for Xen 3.4.3 to open VNC connection to DomU

domid=`virsh domid OSOL131`
ip=`/usr/bin/xenstore-read /local/domain/$domid/guest/ipv4/0/address`
echo $ip
port=`/usr/bin/xenstore-read /local/domain/$domid/guest/vnc/port`
echo $port
/usr/bin/xenstore-read /local/domain/$domid/guest/vnc/passwd
vncviewer $ip:$port

Start Caiman installer and complete PV Guest installation.





Following XML is used to define created OSOL 131 DomU

<domain type='xen'>
<name>OSOL131</name>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<bootloader>/usr/local/bin/pygrub</bootloader>
<os>
<type>linux</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/sdb8'/>
<target dev='xvdb' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:10:93:61'/>
<source bridge='eth0'/>
<script path='/etc/xen/scripts/vif-bridge'/>
<target dev='vif7.0'/>
</interface>
<console type='pty' tty='/dev/pts/2'>
<source path='/dev/pts/2'/>
<target port='0'/>
</console>
</devices>
</domain>

Now issue :-
# virsh define OSOL-131-DEF.xml
# virsh start OSOL131
# virsh console OSOL131
Login into DomU
# vncserver
and run script bellow to open vnc connection

domid=`virsh domid OSOL131`
ip=`/usr/bin/xenstore-read /local/domain/$domid/guest/ipv4/0/address`
echo $ip
vncviewer $ip:1




Setup VNC via GDM configuration file at OSOL 132 DomU

root@ServerKoala:/home/boris/132# virsh define os132-def.xml
Connecting to uri: xen:///
Domain OS-132 defined from os132-def.xml

root@ServerKoala:/home/boris/132# virsh start OS-132
Connecting to uri: xen:///
Domain OS-132 started

root@ServerKoala:/home/boris/132# virsh console OS-132
Connecting to uri: xen:///
Connected to domain OS-132
Escape character is ^]
v3.4.3-rc2-pre chgset 'Wed Feb 03 09:53:37 2010 +0000 19878:35a62fbdb74d'
SunOS Release 5.11 Version snv_132 64-bit
Copyright 1983-2010 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: opensolaris
Configuring devices.
Loading smf(5) service descriptions: 165/165
svccfg import warnings. See /var/svc/log/system-manifest-import:default.log .
Reading ZFS config: done.
Mounting ZFS filesystems: (6/6)
Creating new rsa public/private host key pair
Creating new dsa public/private host key pair

opensolaris console login: boris
Password:
Sun Microsystems Inc. SunOS 5.11 snv_132 January 2010
boris@opensolaris:~$

root@opensolaris:~# cat /etc/gdm/custom.conf
# GDM configuration storage
[daemon]
RemoteGreeter=/usr/lib/gdmgreeter
[security]
DisallowTCP=false
# AllowRoot=true
# AllowRemoteRoot=true
[xdmcp]
Enable=true
[gui]
[greeter]
[chooser]
[debug]
[servers]

root@opensolaris:~# svcadm disable xvnc-inetd gdm
root@opensolaris:~# svcadm enable xvnc-inetd gdm




Follow

Get every new post delivered to your Inbox.