Tuesday, May 20, 2008

Solaris xVM (xen on Solaris)

Xen comes along with Solaris Community Express Edition(SCXE).
I am using Nevada version 87 (SNV b87).

In the grub, it has Solaris, Solaris xVm, Solaris Failsafe. If no, you can follow the instructions on the page: http://opensolaris.org/os/community/xen/docs/setupsoldom0/
Facility bootadm will help you to operate on menu.lst
# bootadm list-menu = cat /boot/grub/menu.lst
# bootadm -m upgrade = automatically search the boot directory and modify the menu.lst

It is using this one as below, so it is 64bit xen compatible
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris xVM
kernel$ /boot/$ISADIR/xen.gz
module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix [*]
module$ /platform/i86pc/$ISADIR/boot_archive
#---------------------END BOOTADM--------------------


Note: in solaris 2008.5 released version, xen doesn't come along with it. But you can install the package using the package management application. However, bootadm doesn't work.

Once it is booted from Solaris xVM, you can use the command xm list to see dom0 is working as below:

Next is to create a Solaris domU. The instruction is on the page:http://opensolaris.org/os/community/xen/docs/virtinstall/

First, I am trying to create a Solaris guest in paravirtual mode. I found only the command below works:


machine:root> virt-install --nographics -n SolarisUU --paravirt -f /xvm/SolarisU.img -r 1024 --mac=aa:ff:bb:aa:28:16 -s 8 -l /export/home/newbie/sol-nv-b87.iso



  • --nographics

installation has no graphic mode, purely in console command mode

  • -n SolarisUU

the guest domain name will be SolarisUU

  • --paravirt

the guest will be created in paravirt mode
Note: on the webpage, the option paravirt is missing 'a'

  • -f /SolarisU.img

the guest will be in a file, the filename is SolarisU.img created in the root directory

  • -r 1024

the guest domain will use 1024M memory

  • --mac=aa:ff:bb:aa:28:16

the guest domain's network mac address is aa:ff:bb:aa:28:16

  • -s 8

the file size is 8G

  • -l /export/home/newbie/sol-nv-b87.iso

the guest domain will install from iso image

The rest is to follow the solaris installation process and it will automatically reboot and run the guest domain. Finally, you will see the guest domain is running as below. The guest ip is 128.153.144.100. So far, I didn't find anywhere to choose the guest domain network mode. The default is bridge mode. I didn't find where the virt-install has put the guest configure file.


Comments:

1) when creating paravirt guest, it will complain libvir: Xen Daemon error : GET operation failed:

2)Simple command # virt-install doesn't work.

3) The command for VNC doesn't work. It claims that authentication failed.

# svccfg -s xvm/xend setprop \
config/vncpasswd = astring: \"somepwd\"

# svcadm refresh xvm/xend; svcadm restart xvm/xend

4)virt-manager can be installed in xVM, but I can not have it to display the guest or create the guest. So I am doubt about it. Here are the instructions to install virt-manager in xVM

The page for virt-manager project is at http://opensolaris.org/os/project/jds/tasks/virt-manager/.
1)Download the binary package for SNV83 or later on the page http://opensolaris.org/os/project/jds/tasks/virt-manager/virt-manager-0.4.0-04-09.tar.gz.
2)Untar it and in the directory pkgs-04-09 and use the package installation command bash-3.2# pkgadd -d. SUNWvirt-manager to install.
Note: it has a dot right after -d and no space between them.
3) on the command line, type virt-manager, it will show up as below

TODO list:

1. Figure out where the configure file are stored by virt-install

2. Figure out how to run an existed guest

3. Make VNC works

4. Create HVM guest: solaris and windows

5. Create paravirt Fedora guest

----------------------------------------------------ADDON-----------------------------------------------------------------------------------
virt-install is a tool that works and can create both para and HVM domU images, but after OS installation and image creation, it doesn't provide a configuration file for the guest to run. So the user need to make up one for their own. Here is the one I am using and you can also refer to http://opensolaris.org/os/community/xen/docs/install-solaris-domu-iso.htm
and
http://blogs.sun.com/mrj/entry/installing_opensolaris_on
http://bderzhavets.blogspot.com/2008/03/install-solaris-0108-hvm-domu-64-bit-at.html\

a python configuration script pv.py

name = "solarisU"
vcpus = 1
memory = "1024"
disk = ['file:/solarisU.img,0,w']
vif = ['']
on_shutdown = "destroy"
on_reboot = "restart"
on_crash = "destroy"


Note: in the disk option, you need to specify where your guest image is.

To run the guest once you have the image and the configuration file, you can use the command below to boot and connect to it.
#xm create -c pv.py
If you wants to get out of the domU, you can use the combination keys ctrl+] (same as linux xen) to exit the guest. But if you already have the guest running, but outside of it, you can use the command below to get into it by specifying its domain name or domain ID.
#xm console solarisU

7 comments:

Boris Derzhavets said...

man virsh
man pkgadd

Boris Derzhavets said...

svccfg -s application/x11/x11-server \
add display1
svccfg -s application/x11/x11-server:display1 \
addpg options application
svccfg -s application/x11/x11-server:display1 \
addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display1 \
addpropvalue options/server_args astring: '"SecurityTypes=None"'

# Configure dtlogin to start it

mkdir -p /etc/dt/config
cp /usr/dt/config/Xservers /etc/dt/config/Xservers
echo " :1 Local local_uid@none root /usr/X11/bin/Xserver :1" \
>> /etc/dt/config/Xservers
pkill -HUP dtlogin

useradd -m -d /export/home/user1 -s /bin/bash user1
chown -R user1:other /export/home/user1
passwd -r files user1

Connect from another terminal session with:
vncviewer IP-ADDREES-DomU:1
and verify you see the login screen and can
login to a desktop session as user1.

Boris Derzhavets said...

Sorry, how to run existing
guest:-
# xm start SolarisPV
# xm console SolarisPV
Login
# ifconfig -a
If Sun Xnvs has been setup.Open one more terminal session
# vncviewer IP-DomU:1

Kingdom of Freedom said...

I think it should be

xm create SolarisPV

Boris Derzhavets said...

That's a mistake.
Domain is present in
xm list
after virt-install succeeded (same
way as on RHEL 5.X)

Kingdom of Freedom said...

your instructiions are quite good!

Thanks for sharing and posting.

Unknown said...

Every single topic related to races is my passion!
Some years ago, I used to run many events, it was such a nice time in my life, so thanks a lot for bringing me good memories.
Nowadays, I just run to Buy Viagra