piątek październik 05, 2007
- All
- Linki
- OpenSolaris
- SUN Solaris
- virtualization - EN
- Wirtualizacja - PL
Dance with OpenSolaris and XEN (part #3)
Last time I installed Linux on DomU, now I try to install on XEN OpenSolaris in PV mode.
Installation of OpenSolaris in PV mode is very easy (more easiest than Linux :)) because CD-ROM with OpenSolaris is prepare to install in this mode.
My config file for install looks:
name = 'solaris-pv'
memory = '1024'
vcpus = 4
# for installation
disk = [ 'file:/opt/iso/sol-nv-b75-x86-dvd.iso,6:cdrom,r' , 'file:/opt/xen/disk/solaris.raw,0,w' ]
vif = [ 'mac=00:0e:0c:3e:18:ee' ]
on_shutdown = 'destroy'
on_reboot = 'destroy'
on_crash = 'destroy'
Remember, in Linux systems we use hda to describe disk, in Solaris we must use 0, which means /dev/rdsk/c0t0d0s0.
And we can just type:
xm create solaris-pv.py -c
and we can start install OpenSolaris
After installation we must change line:
disk = [ 'file:/opt/iso/sol-nv-b75-x86-dvd.iso,6:cdrom,r' , 'file:/opt/xen/disk/solaris.raw,0,w' ]
to
disk = ['file:/opt/xen/disk/solaris.raw,0,w' ]
because, we don't want to reinstall systems.
Very helpful are this links.
Posted at 03:50PM paź 05, 2007 by Maciej Browarski in virtualization - EN | Comments[0]
Dance with OpenSolaris and XEN (part #2)
Last time I installed Linux on OpenSolaris in XEN using SUN X4100 with VT processor.
Now I'm going to install Linux on this same machine but our virtual machine will be in PV (paravirtualization) mode.
How we can do this ? Let's start :).
First, we need file disk.raw (whole disk for Virtual Machine) from previous installation, because Debian Linux distribution isn't ready to install in PV mode (but we can find kernel image for XEN, more detail below).
Second, we create new config file named linux-pv.py:
name = 'linux-pv'
memory = '1024'
vcpus = 2
boot='c'
kernel = "/opt/xen/kernel/vmlinuz-2.6.18-xenU"
root = "console=xvc0 root=/dev/hda1"
disk = [ 'file:/opt/xen/disk/disk-pv.img,hda,w' ]
vif = [ '' ]
on_shutdown = 'destroy'
on_reboot = 'destroy'
on_crash = 'destroy'
This config file is smaller than previous, but we've 2 new parameters: kernel (where is kernel) and root (parameter for kernel command line).
You can download kernel image for debian from this link (this is for our server AMD64).
Or we can compile kernel :).
How we can do that ?
We need machine with Linux OS (or we can use Linux from previous installation) and download source code of XEN 3.1.0 from this link.
So now, we unpack and untar and we enter in xen-3.1.0-src directory and type there:
make kernels
This command compiling kernel with defaults settings and also download kernel source code version 2.6.18 from www.kernel.org site.
After that we can configuring our kernel domU:
make linux-2.6-xenU-config CONFIGMODE=menuconfig
So now, we can configure our XenU kernel (don't forget enable XEN->xen version compatibility 3.0.4, because OpenSolaris using XEN version 3.0.4-1).
After configuration is time to compile:
make dist KERNELS=linux-2.6-xenU

And after a good compilation, we can find binary kernel in dist/install/boot directory (file: vmlinuz-2.6.18-xenu) and modules for this kernel are in dist/install/lib directory.
Now we copy Linux kernel to /opt/xen/kernel directory onto our OpenSolaris systems and correct kernel parameter in config file linux-pv.py.
So, it's time to run PV systems. We do that by typing on OpenSolaris:
xm create linux-pv.py -c
Don't forget about '-c' parameter because now output from virtual systems will not be in separated window but in our xterm window.
When we can login as a root to linux, we must copy modules from compilation to /lib/modules directory.

So, now we can play PV Linux on our OpenSolaris system :).
Posted at 03:29PM paź 02, 2007 by Maciej Browarski in virtualization - EN | Comments[0]
Dance with OpenSolaris and XEN
On SUN hardware X4100 (with Intel Processor VT technology) I install OpenSolaris and above it, with new technology XEN, Linux.
Installation of Operating System goes smoothly (with default settings and some free place for virtual disk, I think, 10GB is enough). After reboot, in bootloader GRUB, I have chosen Solaris xVM (second on list menu).
Next I downloaded new Debian distribution net version AMD64 from here (This distro is very small and powerful) and put it on server directory /opt/iso/.
For better understood of configuration this website is very helpful.
Now let's start configuration.
All files I put on /opt/ directory.
On /opt/xen/disk I put file disk.raw which emulate whole disk for virtual machine (I make this file by typing: dd if=/dev/zero of=disk.raw bs=1024k seek=4k count=1 from command line).
And after that I create config file (/opt/xen/config/linux.py), which look like:
name = 'linux'
memory = '1024'
# number of virtual CPU
vcpus = 2
# For normal work change it to boot='c'
boot='d'
#
# virtual devices
# disk, cdrom and network
disk = [ 'file:/opt/iso/debian-40r1-amd64-netinst.iso,hdb:cdrom,r', 'file:/opt/xen/disk/disk.img,hda,w' ]
vif = [ 'type=ioemu, mac=00:0e:0c:3e:18:cd' ]
on_shutdown = 'destroy'
#
# we use destroy on reboot, because after installation we'd like to switch boot='d' to boot='c'
#
on_reboot = 'destroy'
on_crash = 'destroy'
#
# For full hardware virtualization we need this 4 lines
#
kernel = "/usr/lib/xen/boot/hvmloader"
device_model= "/usr/lib/xen/bin/amd64/qemu-dm"
builder='hvm'
sdl = 1
I make whole configuration from my laptop. So now I need to switch output from server console to my X window laptop. We need set up 2 things:
1. Our X server, on laptop, must have opened TCP port 6000 and
2. From root account we must type 'xhost +' to allow open window from remote server.
So, after that, next step is to run virtual machine :).
xm create /xen/opt/config/linux.py
On laptop, I can see new window from virtual machine :).

But, if we've a trouble ?
First thing is to read what error it is. But when we can't find solution, below is my emergency procedure:
1. check that xend is running.
We type a command:
svcs -a | grep xend
It should be running, if not, we try to switch it to online (sometimes reboot is good solution, if not, we try to find error in log file, why xend can't running).
2. Check that our laptop receive connection for X window.
Type:
netstat -na | grep 6000
Return line should contain *.6000 LISTEN, if not, we try configure process called ./X without option -nolisten.
3. Type 'xhost +' from laptop root account to allow remote connection for X.
Posted at 03:40PM paź 01, 2007 by Maciej Browarski in virtualization - EN | Comments[2]