Blog entry [1] was written by John Levon and supposed to help community users to install OSOL 2008-11 DomU at Xen 3.1 Dom0 on top of Fedora 8. It’s core technique utilizes virsh , so is supposed to be applicable to current release of Libvirt as well. However , /usr/bin/xenstore-read fails to obtain IP address for OSOL DomU via XenStore at Xen 3.4.2 Dom0. Posting bellow fixes this issue and provide an option to build via virsh the most recent OSOL PV DomU at Xen 3.4.2 Dom0 & Libvirt 0.7.1-15 on Fedora 12.
Create installation profile osol127-install.xml :-
<domain type='xen' id='1'>
<name>OS127</name>
<uuid>cced9a1b-e36d-b93a-45fb-fe28f484503a</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>1</vcpu>
<bootloader>/usr/bin/pygrub</bootloader>
<bootloader_args>--kernel=/platform/i86xpv/kernel/amd64/unix --ramdisk=/boot/amd64/x86.microroot</bootloader_args>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/osol127.iso'/>
<target dev='xvdc' bus='xen'/>
<readonly/>
</disk>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/sdb10'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:2a:0b:28'/>
<source bridge='eth0'/>
<script path='/etc/xen/scripts/vif-bridge'/>
<target dev='vif1.0'/>
</interface>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target port='0'/>
</console>
</devices>
</domain>
For OSOL 1002-128a :-
<bootloader_args>--kernel=/platform/i86xpv/kernel/amd64/unix --ramdisk=/platform/i86pc/amd64/boot_archive </bootloader_args>
Start install
# virsh create osol127-install.xml
# virsh console OS127
1. Arabic 12. Hungarian 2. Catalan 13. Indonesian 3. Chinese - Simplified 14. Italian 4. Chinese - Traditional 15. Japanese 5. Czech 16. Korean 6. Dutch 17. Polish 7. English 18. Portuguese - Brazil 8. French 19. Russian 9. German 20. Slovak 10. Greek 21. Spanish 11. Hebrew 22. Swedish To select desktop language, enter a number [default is 7]: User selected: English Configuring devices. Mounting cdroms Reading ZFS config: done. opensolaris console login: jack Password: Sun Microsystems Inc. SunOS 5.11 snv_127 November 2008 jack@opensolaris:~$ Dec 2 07:02:07 opensolaris in.routed[1502]: route 0.0.0.0/8 --> 0.0.0.0 nexthop is not directly connected jack@opensolaris:~$
At this point /usr/bin/xenstore-read fails to obtain IP address for DomU
as suggested in [1] for Fedora 8 ( Xen 3.1 Dom0) and we have to look how to read IP address from XenStore. Domain ID for OSOL in this particular case is equal 1 ( domid=`virsh domid OS127`) :-
# /usr/bin/xenstore-ls /local/domain/1/guest
vnc = ""
passwd = "jDQFrE2t"
port = "5900"
ipv4 = ""
default-link = "xnf0"
0 = ""
address = "192.168.1.41"
[root@fedora12sda ~]# /usr/bin/xenstore-ls /local/domain/1/guest/ipv4
default-link = "xnf0"
0 = ""
address = "192.168.1.41"
[root@fedora12sda ~]# /usr/bin/xenstore-ls /local/domain/1/guest/ipv4/0
address = "192.168.1.41"
# /usr/bin/xenstore-read /local/domain/1/guest/ipv4/0/address
192.168.1.41
Hence, script for VNC connection to OSOL 1002-127 DomU should look like:-
domid=`virsh domid OS127`
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
Create runtime profile os127.xml for OSOL 1002-127 as follows :-
<domain type='xen' id='7'>
<name>OS127</name>
<uuid>df7eab17-4d15-2aff-cd62-d44c6093c00b</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>1</vcpu>
<bootloader>/usr/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/sdb10'/>
<target dev='xvda' 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>
# virsh define os127.xml
Domain OS127 defined from os127.xml
# virsh start OS127
Domain OS127 started
# virsh console OS127
Connected to domain OS127
Escape character is ^]
v3.4.2 chgset ‘unavailable’
SunOS Release 5.11 Version snv_127 64-bit
Copyright 1983-2009 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: opensolaris
Configuring devices.
Loading smf(5) service descriptions: 162/162
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_127 November 2008
boris@opensolaris:~$ pfexec ifconfig -a
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.43 netmask ffffff00 broadcast 192.168.1.255
ether 0:16:3e:10:93:61
lo0: flags=2002000849 mtu 8252 index 1
inet6 ::1/128
xnf0: flags=2004841 mtu 1500 index 2
inet6 fe80::216:3eff:fe10:9361/10
ether 0:16:3e:10:93:61
Setup VNC via GDM configuration file at OSOL DomU
# vi /etc/X11/gdm/custom.conf
# GDM Custom Configuration file.
# overrides: /usr/share/gdm/defaults.conf
[daemon]
RemoteGreeter=/usr/lib/gdmgreeter
[security]
DisallowTCP=false
# AllowRoot=true
# AllowRemoteRoot=true
[xdmcp]
Enable=true
[gui]
[greeter]
[chooser]
[debug]
[servers]
Restart services :-
# svcadm disable xvnc-inetd gdm
# svcadm enable xvnc-inetd gdm
Been started via virt-manager OSOL 127 DomU may be connected via vncviewer :-
# cat vnc_runtime.sh
domid=`virsh domid OS127`
ip=`/usr/bin/xenstore-read /local/domain/$domid/guest/ipv4/0/address`
echo $ip
vncviewer $ip:0
References
1. OpenSolaris 2008.11 guest domain on a Linux dom0
You can certainly see your skills within the work you write.
The world hopes for even more passionate writers like you who aren’t afraid to mention how
they believe. Always follow your heart.
I’m gone to inform my little brother, that he should also pay a quick visit this web site on regular basis to get updated from most recent reports.