Set up virt-install to work with Xen 4.0 guests on top of Ubuntu 10.04 Server

Set up Xen 4.0 Dom0 with pvops kernel 2.6.32.12 on top of Ubuntu 10.04 Server ([2]) . Install packages

# 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) .
Another option just to patch virt-install on 10.04

--- virt-install.orig 2010-05-02 23:52:23.105726451 +0400
+++ virt-install 2010-05-05 15:55:10.025151535 +0400
@@ -675,9 +675,8 @@

def vnc_console(dom, uri):
- args = ["/usr/bin/virt-viewer"]
- if uri is not None and uri != "":
- args = args + [ "--connect", uri]
+ args = ["/usr/bin/virt-viewer"]
+ args = args + [ "--connect", "xen:///"]
args = args + [ "--wait", "%s" % dom.ID()]
child = os.fork()
if not child:

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@ServerLnx:~# virsh version
Compiled against library: libvir 0.7.5
Using library: libvir 0.7.5
Using API: Xen 3.0.1
Running hypervisor: Xen 4.0.0

Now run :

root@ServerLnx:/home/boris/lnx# virt-install --connect xen:/// -n LucidLNX -r 1024 --hvm --vnc -f /dev/sda8 -c /home/boris/lnx/LucidSRV.iso --debug
Tue, 04 May 2010 20:16:05 DEBUG Launched with command line:
/usr/bin/virt-install --connect xen:/// -n LucidLNX -r 1024 --hvm --vnc -f /dev/sda8 -c /home/boris/lnx/LucidSRV.iso --debug
Tue, 04 May 2010 20:16:05 DEBUG Requesting libvirt URI xen:///
Tue, 04 May 2010 20:16:05 DEBUG Received libvirt URI xen:///
Tue, 04 May 2010 20:16:05 DEBUG Requesting virt method 'hvm', hv type 'default'.
Tue, 04 May 2010 20:16:05 DEBUG Received virt method 'hvm'
Tue, 04 May 2010 20:16:05 DEBUG Hypervisor name is 'xen'
Tue, 04 May 2010 20:16:05 DEBUG Could not open "/etc/sysconfig/keyboard" [Errno 2] No such file or directory: '/etc/sysconfig/keyboard'
Tue, 04 May 2010 20:16:05 DEBUG Could not open "/etc/X11/xorg.conf": [Errno 2] No such file or directory: '/etc/X11/xorg.conf'
Tue, 04 May 2010 20:16:05 DEBUG DistroInstaller location is a local file/path: /home/boris/lnx/LucidSRV.iso
Starting install...
Tue, 04 May 2010 20:16:05 DEBUG Creating guest from:
<domain type='xen'>
<name>LucidLNX</name>
<currentMemory>1048576</currentMemory>
<memory>1048576</memory>
<uuid>37592841-82ee-2ba7-28de-3801683758d3</uuid>
<os>
<type arch='x86_64'>hvm</type>
<loader>/usr/lib/xen-default/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<features>
<acpi/><apic/><pae/>
</features>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<vcpu>1</vcpu>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<source dev='/dev/sda8'/>
<target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<source file='/home/boris/lnx/LucidSRV.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
<source bridge='eth0'/>
<mac address='00:16:36:7a:e4:2f'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
<console type='pty'/>
</devices>
</domain>
Creating domain... 0 B 00:01
Tue, 04 May 2010 20:16:07 DEBUG Created guest, looking to see if it is running
Tue, 04 May 2010 20:16:07 DEBUG Launching console callback
Tue, 04 May 2010 20:16:07 DEBUG Saving XML boot config:
<domain type='xen'>
<name>LucidLNX</name>
<currentMemory>1048576</currentMemory>
<memory>1048576</memory>
<uuid>37592841-82ee-2ba7-28de-3801683758d3</uuid>
<os>
<type arch='x86_64'>hvm</type>
<loader>/usr/lib/xen-default/boot/hvmloader</loader>
<boot dev='hd'/>
</os>
<features>
<acpi/><apic/><pae/>
</features>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<vcpu>1</vcpu>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<source dev='/dev/sda8'/>
<target dev='hda' bus='ide'/>
</disk>
<disk type='block' device='cdrom'>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
<source bridge='eth0'/>
<mac address='00:16:36:7a:e4:2f'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
<console type='pty'/>
</devices>
</domain>






Also make sure that CONFIG_GNT_DEV=y in .config file of pvops kernel . Snapshot bellow



Otherwise virsh start will hang and /var/log/xen/qemu-dm-DomainName.log will report

ERROR Internal error: Could not open grant table interface (22 = Invalid argument)
xen be core: xen be core: can't open gnttab device can't open gnttab device

Virt-install F12 PV DomU:-

root@ServerLnx:~# virt-install --connect xen:/// --name VF12P --ram 2000 -f /dev/sda7 --vnc --location http://192.168.1.38/f12 --debug
Tue, 04 May 2010 20:55:09 DEBUG Launched with command line:
/usr/bin/virt-install --connect xen:/// --name VF12P --ram 2000 -f /dev/sda7 --vnc --location http://192.168.1.38/f12 --debug
Tue, 04 May 2010 20:55:09 DEBUG Requesting libvirt URI xen:///
Tue, 04 May 2010 20:55:09 DEBUG Received libvirt URI xen:///
Tue, 04 May 2010 20:55:09 DEBUG Requesting virt method 'default', hv type 'default'.
Tue, 04 May 2010 20:55:09 DEBUG Received virt method 'xen'
Tue, 04 May 2010 20:55:09 DEBUG Hypervisor name is 'xen'
Tue, 04 May 2010 20:55:09 DEBUG Could not open "/etc/sysconfig/keyboard" [Errno 2] No such file or directory: '/etc/sysconfig/keyboard'
Tue, 04 May 2010 20:55:09 DEBUG Could not open "/etc/X11/xorg.conf": [Errno 2] No such file or directory: '/etc/X11/xorg.conf'
Tue, 04 May 2010 20:55:09 DEBUG DistroInstaller location is a network source.
Starting install...
Tue, 04 May 2010 20:55:09 DEBUG Attempting to detect distro:
Tue, 04 May 2010 20:55:09 DEBUG Fetching URI: http://192.168.1.38/f12/.treeinfo
Tue, 04 May 2010 20:55:09 DEBUG Saved file to /var/lib/libvirt/boot/virtinst-.treeinfo.LJOzek
Retrieving file .treeinfo 100% |=========================| 1.2 kB 00:00
Tue, 04 May 2010 20:55:09 DEBUG Fetching URI: http://192.168.1.38/f12/images/pxeboot/vmlinuz
Tue, 04 May 2010 20:55:09 DEBUG Saved file to /var/lib/libvirt/boot/virtinst-vmlinuz.Rir_53
Retrieving file vmlinuz.. 100% |=========================| 3.3 MB 00:00
Tue, 04 May 2010 20:55:09 DEBUG Fetching URI: http://192.168.1.38/f12/images/pxeboot/initrd.img
Tue, 04 May 2010 20:55:09 DEBUG Saved file to /var/lib/libvirt/boot/virtinst-initrd.img.Ynt0bl
Retrieving file initrd.im 100% |=========================| 22 MB 00:00
Tue, 04 May 2010 20:55:09 DEBUG Auto detected OS type as: linux
Tue, 04 May 2010 20:55:09 DEBUG Auto detected OS variant as: fedora12
Tue, 04 May 2010 20:55:09 DEBUG Creating guest from:
<domain type='xen'>
<name>VF12P</name>
<currentMemory>2048000</currentMemory>
<memory>2048000</memory>
<uuid>e50a231c-a64f-58ee-8c85-b9aca3143222</uuid>
<os>
<type arch='x86_64'>linux</type>
<kernel>/var/lib/libvirt/boot/virtinst-vmlinuz.Rir_53</kernel>
<initrd>/var/lib/libvirt/boot/virtinst-initrd.img.Ynt0bl</initrd>
<cmdline>method=http://192.168.1.38/f12</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/sda7'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='eth0'/>
<mac address='00:16:36:63:94:49'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
</devices>
</domain>
Creating domain... 0 B 00:01
Tue, 04 May 2010 20:55:11 DEBUG Created guest, looking to see if it is running
Tue, 04 May 2010 20:55:11 DEBUG Launching console callback
Tue, 04 May 2010 20:55:11 DEBUG Saving XML boot config:
<domain type='xen'>
<name>VF12P</name>
<currentMemory>2048000</currentMemory>
<memory>2048000</memory>
<uuid>e50a231c-a64f-58ee-8c85-b9aca3143222</uuid>
<bootloader>/usr/lib/xen-default/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/sda7'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='eth0'/>
<mac address='00:16:36:63:94:49'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
</devices>
</domain>








Starting Domain :-
root@ServerLnx:~# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 6855 4 r----- 501.8
LucidLNX 1024 1 10.3
VF12P 2000 1 34.6
VF12PV 1000 1 15.4
root@ServerLnx:~# virsh start VF12P
Domain VF12P started

root@ServerLnx:~# vncviewer localhost:0
Connected to RFB server, using protocol version 3.8
No authentication needed
Authentication successful
Desktop name "Xen-VF12P"
VNC server default format:
32 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Using default colormap which is TrueColor. Pixel format:
32 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Same machine: preferring raw encoding



References
1.http://librenix.com/?inode=14285
2.http://www.linuxtoday.com/high_performance/2010043000735OSS

About these ads

5 Responses to Set up virt-install to work with Xen 4.0 guests on top of Ubuntu 10.04 Server

  1. [...] to the detailed posts on http://bderzhavets.wordpress.com/ [A, B, C ] virt-manager is running xen 4.0 on ubuntu 10.04 (installation of ubuntu server plus apt-get [...]

  2. BlergoGeori says:

    Search Engine Optimization, the so referred to as SEO, is a worthy technique to get your web page into the “Top 10″ of the foremost search engines like Google, Yahoo and Bing. Deciding to employ a SEO specialist is a giant footstep, given that it can truly improve your place! On the other hand, remember the probable jeopardy. Roughly performed SEO work can harm your internet pages standing!
    SEO is a great deal more than merely inserting a few search terms to your website! The effort of Search Engine Optimizers begins already with the website outline, in view of the fact that numerous elements can change the value of your website, like extended loading time as a consequence of large imagery or text, that is different from your websites category. Of course there are really a lot of more minor things that require to be taken care of.
    A high-quality SEO specialist like Accurate Solutions presents alot of different services and takes care of all of these mostly very main details and shall give your website a supercharge to direct it up the first page of your SERP in support of your search phrases.
    Several SEO Experts from Fort Worth TX help you to get into the primary Page of the major search engines. With more than 14 years of experience! they Review your websites text and organization, give you technical information on website improvement, develop text for you, administer your campaigns, do keyword examination and supplementary significant SEO methods.

    Accurate Solutions is here for your SEO needs!

  3. Hi friends!
    I am Johnathan and I participate in this community forum now a long time and I should declare, it is certainly a fantastic spot to stay.
    Up to now I was always the one looking for assistance and info here and I have the impression it is time to pay a little back

    A while ago I experienced a lot of problems with my roof and I really looked for help. Many times it is altogether overpriced or the quality is awfully bad. My search finished, as I found this fantastic company. See below and if you have trouble with your roof, just call them. They do remarkable work!

    Experienced In House Staff

  4. dbaxps says:

    Not sure the comment above is in any way connected with my blog.

  5. sandyverden says:

    hi.. really you done install xen 4.0 in ubuntu 10.04?

    is xen 4 support both para and Full Virtualization ??

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.