Installing OpenSolaris 2008.05 domU on Debian Linux Xen dom0

This blogpost describes installation of OpenSolaris 2008.05 on dom0 running x86_64 Debian/Etch Linux.

debian-dom0:~# uname -a
Linux debian-dom0 2.6.18-6-xen-amd64 #1 SMP Sun Feb 10 18:02:52 UTC 2008 x86_64 GNU/Linux

Obtaining installation image / media

Live CD default passwords

Login: jack
Password: jack

Login: root
Password: opensolaris

Installation

  • Create disk image (at least 4GB)
debian-dom0:~# dd if=/dev/zero of=/xen/os1/opensolaris_disk.img
bs=1M count=4096
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB) copied, 146.047 seconds, 29.4 MB/s
  • Copy OpenSolaris 2008.05 ISO file in /xen/os1/os200805.iso
  • Mount the ISO file or CD and copy these 2 files in /xen/os1/ on dom0
  • platform/i86xpv/kernel/amd64/unix
  • boot/x86.microroot
  • Create config file /etc/xen/os1.cfg with this content:
name = 'os1'
memory = '1024'
vif = [ '' ]

# Install
disk = [ 'file:/xen/os1/os200805.iso,6:cdrom,r', 'file:/xen/os1/opensolaris_disk.img,0,w' ]
kernel = '/xen/os1/unix'
ramdisk = '/xen/os1/x86.microroot'
extra = '/platform/i86xpv/kernel/amd64/unix -B console=ttya,livemode=text'
on_shutdown = 'destroy'
on_reboot = 'destroy'
on_crash = 'destroy'
  • Boot the system and login as jack/jack:
debian-dom0:~# xm create -c os1.cfg
Using config file "/etc/xen/os1.cfg".
Started domain os1
v3.0.3-1 chgset 'Tue Oct 17 22:09:52 2006 +0100 '
WARNING: Found hypervisor version: v3.0.3-1 but need at least version
v3.0.4
SunOS Release 5.11 Version snv_86 64-bit
Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: opensolaris
Remounting root read/write
Probing for device nodes ...
NOTICE: xdf@6: failed to read feature-barrier
NOTICE: xdf@0: failed to read feature-barrier
Preparing live image for use
Done mounting Live image
USB keyboard
 1. Albanian                      22. Latvian
 2. Belarusian                    23. Macedonian
 3. Belgian                       24. Malta_UK
 4. Bulgarian                     25. Malta_US
 5. Croatian                      26. Norwegian
 6. Czech                         27. Polish
 7. Danish                        28. Portuguese
 8. Dutch                         29. Russian
 9. Finnish                       30. Serbia-And-Montenegro
10. French                        31. Slovenian
11. French-Canadian               32. Slovakian
12. Hungarian                     33. Spanish
13. German                        34. Swedish
14. Greek                         35. Swiss-French
15. Icelandic                     36. Swiss-German
16. Italian                       37. Traditional-Chinese
17. Japanese-type6                38. TurkishQ
18. Japanese                      39. TurkishF
19. Korean                        40. UK-English
20. Latin-American                41. US-English
21. Lithuanian
To select the keyboard layout, enter a number [default 41]:

1. Chinese - Simplified
2. Chinese - Traditional
3. English
4. French
5. German
6. Italian
7. Japanese
8. Korean
9. Portuguese - Brazil
10. Russian
11. Spanish
12. Swedish
To select the desktop language, enter a number [default 3]:
Configuring devices.
Mounting local partitions/cdroms
Reading ZFS config: done.

opensolaris console login: jack
Password:
Sun Microsystems Inc. SunOS 5.11 snv_86 January 2008
jack@opensolaris:~$
  • Wait 1-2 minutes for all daemons and networking to start
  • In case you want to use static IP, you need to configure it manually:
jack@opensolaris:~$ su -
Password:
May 9 03:04:15 opensolaris su: 'su root' succeeded for jack on
/dev/console
Sun Microsystems Inc. SunOS 5.11 snv_86 January 2008
-bash-3.2# ifconfig -a
lo0: flags=2001000849<up,loopback,running,multicast,ipv4,virtual> mtu
8232 index 1
inet 127.0.0.1 netmask ff000000
xnf0: flags=201004843<up,broadcast,running,multicast,dhcp,ipv4,cos> mtu
1500 index 2
inet 0.0.0.0 netmask ff000000
ether 0:16:3e:38:7:c
lo0: flags=2002000849<up,loopback,running,multicast,ipv6,virtual> mtu
8252 index 1
inet6 ::1/128
-bash-3.2# ifconfig xnf0 192.168.1.100 netmask 255.255.255.0
-bash-3.2# route add default 192.168.1.1
add net default: gateway 192.168.1.1
-bash-3.2# cp /etc/nsswitch.dns /etc/nsswitch.conf
-bash-3.2# echo "nameserver 192.168.10.1" > /etc/resolv.conf
-bash-3.2# logout
jack@opensolaris:~$
  • Start vncserver:
jack@opensolaris:~$ mkdir .vnc;cp .Xclients .vnc/xstartup
jack@opensolaris:~$ vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth: creating new authority file /jack/.Xauthority

New 'opensolaris:1 ()' desktop is opensolaris:1

Starting applications specified in /jack/.vnc/xstartup
Log file is /jack/.vnc/opensolaris:1.log

jack@opensolaris:~$
  • Connect to VNC server and install OpenSolaris same way as if you boot from CD:

  • Before you click on the “Reboot” button, you need to put these files in /xen/os1/ on your Debian dom0:

  • /a/platform/i86xpv/kernel/amd64/unix
  • /a/platform/i86pc/amd64/boot_archive
  • On the final installation screen click on the “Reboot” button and wait for OpenSolaris domU shutdown.

debian-dom0:~# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 837 2 r----- 35598.4
os1 60 1024 1 -b---- 1110.8

debian-dom0:~# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 837 2 r----- 35599.8

Post-install configuration

  • Modify config file /etc/xen/os1.cfg:
name = 'os1'
memory = '1024'
vif = [ '' ]

# Normal boot
disk = [ 'file:/xen/os1/opensolaris_disk.img,0,w' ]
kernel = '/xen/os1/unix'
ramdisk = '/xen/os1/boot_archive'
extra = '/platform/i86xpv/kernel/amd64/unix -B zfs-bootfs=rpool/27'
on_shutdown = 'destroy'
on_reboot = 'destroy'
on_crash = 'destroy'
  • Boot the system and login with your username. In case you are using static IP address, follow the steps above.
debian-dom0:~# xm create -c os1.cfg
Using config file "/etc/xen/os1.cfg".
Started domain os1
v3.0.3-1 chgset 'Tue Oct 17 22:09:52 2006 +0100 '
WARNING: Found hypervisor version: v3.0.3-1 but need at least version
v3.0.4
SunOS Release 5.11 Version snv_86 64-bit
Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
NOTICE: xdf@0: failed to read feature-barrier
Hostname: os1
Reading ZFS config: done.
Mounting ZFS filesystems: (6/6)
WARNING: No randomness provider enabled for /dev/random. Use
cryptoadm(1M) to enable a provider.

os1 console login: plnt
Password:
Sun Microsystems Inc. SunOS 5.11 snv_86 January 2008
-bash-3.2$ bash
plnt@os1:~$ mkdir .vnc
plnt@os1:~$ echo \#\!\/bin\/bash > .vnc/xstartup;echo >> .vnc/xstartup
plnt@os1:~$ echo "exec /usr/bin/dtstart jds" >> .vnc/xstartup
plnt@os1:~$ chmod +x .vnc/xstartup
plnt@os1:~$ vncserver

You will require a password to access your desktops.

Password:
Verify:

New 'os1:1 ()' desktop is os1:1

Starting applications specified in /export/home/plnt/.vnc/xstartup
Log file is /export/home/plnt/.vnc/os1:1.log

plnt@os1:~$
  • Connect to VNC server

  • OpenSolaris 2008.05 is up and running ;-)

Nice howto for network configuration is here.

Thanks to Mark Johnson for OpenSolaris Xen howto. I had to make few changes to make it work on Debian but it was a great starting point.

References

Written on May 9, 2008