Building Xen 4.1.2-rc(X) for Ubuntu 11.10.

In meantime 4.1.2-rc1 is tagged. I will start with short description preparing package to upload to Launchpad, presuming that you have PGP signature, regardless there is ready 4.1.2-rc1 to install from my PPA “Build Xen 4.1.2-rc1 for Ubuntu 11.10″

$ hg clone -r 4.1.2-rc1 http://xenbits.xen.org/hg/xen-4.1-testing.hg/
$ cp -R xen-4.1-testing.hg xen-4.1.2~rc1
$ git clone git://xenbits.xensource.com/qemu-xen-4.1-testing.git qemu
$ tar -zcvf xen_4.1.2~rc1.orig-qemu.tar.gz ./qemu/*
$ tar -zcvf xen-4.1.2~rc1.tar.gz ./xen-4.1.2~rc1/*
$ cd xen-4.1.2~rc1
$ dh_make -e bderzhavets@yahoo.com -f ../xen-4.1.2~rc1.tar.gz
$ tar -zxvf ../xen_4.1.2~rc1.orig-qemu.tar.gz
$ cd ..
$ wget https://launchpad.net/ubuntu/+archive/primary/+files/xen_4.1.1-2ubuntu2.debian.tar.gz
$ tar -zxvf xen_4.1.1-1ubuntu1.debian.tar.gz
Update debian/patches/series. Remove all (4) unstable* patches
$ cp -R debian ./xen-4.1.2~rc1
Update changelog
$ debuild -sa -S -k'PGPKEY'
$ dput ppa:yoursname/xen-4.1.2-rc1 package-name.changes

Then build @Launchpad

If you just want to get ready Xen, e.g. desired revision has been already uploaded by somebody else.
**************************************************************************
Install version ready to go via PPA “Build Xen 4.1.2-rc1 for Ubuntu 11.10″
**************************************************************************
Now run :-
# apt-add-repository ppa:bderzhavets/xen-next
# apt-get update
# apt-get install synaptic
Install Xen 4.1.2-rc1 Hypervisor (xen-4.1.2~rc1-0ubuntu1) and tools via Synaptic



Add to /etc/modules :-

xen-gntdev
xen-blkback
xen-netback

Reboot into Xen Host and check environment :-

root@boris-P5Q-E:~# xl info
host : boris-P5Q-E
release : 3.0.0-9-generic
version : #14-Ubuntu SMP Tue Aug 23 17:03:26 UTC 2011
machine : x86_64
nr_cpus : 2
nr_nodes : 1
cores_per_socket : 2
threads_per_core : 1
cpu_mhz : 2999
hw_caps : bfebfbff:20100800:00000000:00000940:0008e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8191
free_memory : 1660
free_cpus : 0
xen_major : 4
xen_minor : 1
xen_extra : .2-rc1
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 : placeholder
cc_compiler : gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-7ubuntu2)
cc_compile_by : bderzhavets
cc_compile_domain : yahoo.com
cc_compile_date : Fri Aug 26 05:09:16 UTC 2011
xend_config_format : 4

root@boris-P5Q-E:~# virsh version
Compiled against library: libvir 0.9.2
Using library: libvir 0.9.2
Using API: Xen 3.0.1

Also make sure :-

root@boris-System-P5Q3:~# ls -l /dev/xen
total 0
crw——- 1 root root 10, 55 2011-07-25 10:31 evtchn
crw——- 1 root root 10, 56 2011-07-25 10:31 gntdev
root@boris-System-P5Q3:~# lsmod | grep xen

xen_evtchn 13172 1
xenfs 18311 1
xen_blkback 23177 0 [permanent]
xen_netback 27854 0 [permanent]
xen_gntdev 17676 0

If you are missing at least one device under /dev/xen or lsmod doesn’t
show all mentioned drivers, yours system won’t be functional.

Next to activate Libvirt 0.9.2 and virtinst tools :-

# apt-get install virtinst virt-viewer virt-manager

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 restart xend service
Attempt to run :-

# virt-install –connect xen:/// –debug -n LynxHVM –hvm -r 1024 –vcpus=1 \
-f /dev/sda7 –vnc \
-c /root/Downloads/ubuntu-10.04.3-desktop-amd64.iso

Generates an error

Mon, 25 Jul 2011 10:58:45 ERROR Domain not found: xenUnifiedDomainLookupByName
Mon, 25 Jul 2011 10:58:45 DEBUG Traceback (most recent call last):
File “/usr/bin/virt-install”, line 1079, in start_install
dom = guest.start_install(conscb, meter, wait=wait_on_console)
File “/usr/lib/pymodules/python2.7/virtinst/Guest.py”, line 1187, in start_install
start_xml, final_xml, is_initial)
File “/usr/lib/pymodules/python2.7/virtinst/Guest.py”, line 1246, in _create_guest
dom = self.conn.createLinux(start_xml or final_xml, 0)
File “/usr/lib/python2.7/dist-packages/libvirt.py”, line 1686, in createLinux
if ret is None:raise libvirtError(‘virDomainCreateLinux() failed’, conn=self)
libvirtError: Domain not found: xenUnifiedDomainLookupByName

/var/log/xen/qemu-dm-LNX.log reports

/usr/lib64/xen/bin/qemu-dm: error while loading shared libraries: libxenctrl.so: cannot open shared object file: No such file or directory

To fix this failure :

root@boris-System-P5Q3:/usr/lib64/xen-4.1# cp -R lib /usr/lib64/xen
root@boris-System-P5Q3:/usr/lib64/xen-4.1# cp -R boot /usr/lib64/xen
root@boris-System-P5Q3:/usr/lib64/xen-4.1# cp -R bin /usr/lib64/xen

About these ads

9 Responses to Building Xen 4.1.2-rc(X) for Ubuntu 11.10.

  1. [ivan] says:

    Great article, thumbs up.. some questions I’d like to ask:
    – What kernel do you use? compiled or debs?
    – Does it support blktap/blktap2-based image?
    I’ve been wondering how to make it work.. Thx!

  2. dbaxps says:

    - What kernel do you use? compiled or debs?
    Stock kernel 3.0.0.9-generic
    – Does it support blktap/blktap2-based image?
    3.0 mainline doesn’t have blktap support.
    It was planned for 3.1

  3. dbaxps says:

    Does disk=[' file:/bla/bla,........' ] work ?
    I believe it’s supported by xen-blkback driver .
    phy:
    file:
    Should work i guess

  4. Jay says:

    Hello,
    I followed this procedure:
    1) # apt-add-repository ppa:bderzhavets/xen-hg
    2) # apt-get update
    3) # apt-get install synaptic
    4) Install Xen 4.1.1 Hypervisor (4.1.1-1ubuntu3) and tools via Synaptic Manager.

    5) Add to /etc/modules :-
    xen-gntdev
    xen-blkback
    xen-netback
    6) Reboot into Xen environment

    After reboot I executed “xl info” and this is the result:
    $ sudo xl info
    WARNING! Can’t find hypervisor information in sysfs!
    xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error
    libxl: error: libxl.c:55:libxl_ctx_init cannot open libxc handle: No such file or directory
    cannot init xl context

    Do you’ve any idea what I’m missing?
    I’d really appreciate your help.
    Br, Jay

  5. dbaxps says:

    Install regular Xen. Ubuntu fixed error a while ago.
    Work as root.

  6. Jay says:

    thank you dbaxps: but I still get

    WARNING! Can’t find hypervisor information in sysfs!
    xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error
    libxl: error: libxl.c:55:libxl_ctx_init cannot open libxc handle: No such file or directory
    cannot init xl context

  7. akshay says:

    libvirtError: POST operation failed: xend_post: error from xen daemon: (xend.err ‘Device 768 (vbd) could not be connected.\nDevice /dev/sda8 is mounted in the privileged domain,\nand so cannot be mounted by a guest.’)

    i got the above error using the virt-install command
    help!!!!!!!!

  8. Good day! I know this is kinda off topic however
    I’d figured I’d ask. Would you be interested in exchanging links or maybe guest authoring a blog
    post or vice-versa? My site discusses a lot of the same subjects as yours and I feel we could greatly
    benefit from each other. If you’re interested feel free to send me an email. I look forward to hearing from you! Terrific blog by the way!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: