Solaris Express 06/06 on a Strato rootserver

This article might be useful to people from outside Germany, so I used the chance to write something up in English again.

My old rootserver has gotten a little out of date lately with its 1.2GHz Celeron CPU, 40GB harddrive and, worst of all, only 256MB of RAM, things were getting a little crammed there. It was time to rent a new server and Strato was one of the first providers to include unlimited traffic in their offers and therefore got the deal.

So, having that box set up nicely by Strato was a nice idea(they even mirror the harddisks for you), but I rented this machine with a friend who plans to run some Java applications on it and in my opinion, you can't beat Java on Solaris. It might just be my very subjective impression, but I've always had the feeling, Java applications run a little "smoother" on Solaris machines, especially when there's a SPARC CPU in it.

So, I wanted to try out Solaris on my new rootserver and first of all, I've had a look if someone already did it.. Installing operating systems without the ability to insert or change CDs isn't always easy, but I haven't found any decent guide on how to do this, only someone who started one, but didn't finish or even include the nasty bits.

Then an idea struck me: Why not install Solaris in a virtual machine..

With XEN mentioned everywhere and remote console access, it should even make a nice way to load up CDs, power on and off the Solaris "machine" with a serial administration console to a non-networked XEN installation and the network routed to the Solaris domain.

But that was a no-go, because Solaris cannot handle XEN block devices (yet).
To cut this short: VMware server was just released with the possibility to assign a physical disk to the virtual machine, use ISO images and.. install Solaris(and discard VMWare afterwards).

And this is what I did..

WARNING: This is not for the faint of heart! If you fumble up with one of these steps, you will probably have to have your server re-installed, because there is no easy way to edit Solaris slices(Suns equivalent to partitions) from within the rescue system. So you either get all the way through or it's back to square one and do not repeat the mistakes you've made. I've had to give it four or five tries until my server worked properly, but I guess, ZFS alone is worth the effort ;-)

And now, on with the show.


1. Harddisk preparation

My Strato machine was installed with a software-RAID1 set which isn't quite useful, because I'm about to install Solaris to one of the disks and boot off it.
So I had to break up the mirror to get to single disks, one of which is unused by the running Linux system:


mdadm --set-faulty /dev/md0 /dev/hdc1
mdadm --set-faulty /dev/md1 /dev/hdc3
mdadm --remove /dev/md0 /dev/hdc1
mdadm --remove /dev/md1 /dev/hdc3


As you can see, the system had three partitions configured(root, boot and swap), but only two of them were mirrored(root and boot), the two swap spaces were
simply configured as independent volumes.

In order to stop Linux from autoconfiguring the RAID1 again at the next reboot, just start cfdisk /dev/hdc and delete all the partitions on the second disk. It's going to be erased by the installation process anyway.

Reboot, just to make sure.

Now we have a clean disk(hdc) we can use with VMware.




2. VMWare installation

My rootserver was pre-installed with Debian Sarge, but in order to be able to install VMWare Server, I had to install a few additional packages. Installing these packages and all of their dependencies worked fine for me:


xlibs
xterm
make
gcc
kernel-headers-2.6.8-3-686 (or whatever other kernel you're running)
unzip
wget


Download the VMWare Server packages from VMWare and not
only the server, but also the Linux client and the Management
User Interface packages(VMWare-server, VMWare-server-console and
VMWare-mui).


VMware-mui-1.0.0-28343.tar.gz
VMware-server-1.0.0-28343.tar.gz
VMware-server-console-1.0.0-28343.tar.gz


The console tar.gz comes from a zipfile of the same name.


Installing these is pretty easy. Just unarchive them and start
the "vmware-install.pl" script in the newly created directory.
Just say yes to all the defaults in the script except for the
location of the kernel headers.
Enter "/usr/src/kernel-headers-2.6.8-3-686/include" here.

After you installed all three VMWare packages, run the freshly
installed "vmware-config.pl" again, just to make sure everything's
properly set up.



3. Solaris installation

Before starting this, check on the available disk space. You'll need enough room to house at least five ISO images.
Eventually, you might have to create a new partition and filesystem taking up the rest of the space on your bootdisk.

This might be a good time to download the Solaris ISO images
to the local harddisk. I got the Solaris Express images directly
from Sun, but maybe you want to use an OpenSolaris distribution.
It shouldn't make any big difference, so just go ahead and download
whatever Solaris distribution you want.

And while you're at it, installing screen might make it easier to
start more than download at a time(and be able to log off during
transfer.. even a dedicated server takes some time to download
those 5 CDs).

Download and install the VMWare server console on your local workstation
and connect to your VMware server, using root and root's password
for the credentials.

Now create a new virtual machine using custom settings and accept all the
defaults for a Solaris 10 machine. The only exceptions here are these:
Choose to use a physical disk instead of a disk image and select /dev/hdc and
use the first ISO image for the CD-ROM drive.

Now power up your virtual machine and install Solaris just as you would on a normal machine.
Accept all the defaults, I chose not to use networking at this stage of installation, because the network adapter would be a different one
on the real machine. I didn't even enable networking in VMWare.

After the installation finished, don't rush into things and reboot your machine with "the real thing", there are still some things to be done in order to make the installation work
on the bare iron. First of all, adjust the GRUB configuration to redirect all output to the serial console or you won't be able to boot into failsafe mode.
Add these lines to the general configuration(the Strato console server runs at 57600bps, keep that in mind):


serial --unit=0 --speed=57600
terminal serial


and add a few parameters to the kernel boot options as well:


#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris Nevada snv_40 X86
kernel /platform/i86pc/multiboot -B console=ttya,ttya-mode="57600,8,n,1,-"
module /platform/i86pc/boot_archive
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris failsafe
kernel /boot/multiboot -B console=ttya,ttya-mode="57600,8,n,1,-" kernel/unix -s
module /boot/x86.miniroot-safe
#---------------------END BOOTADM--------------------



So you've set up the serial console for the boot process, but not for the operating system itself. You wouldn't be able to log onto your newly installed machine and as it hasn't got any network configuration yet, you'll have a hard time changing anything.

Change the console to use the right speed as well and change this line in /etc/ttydefs


console:9600 hupcl opost onlcr:9600::console


into this


console:57600 hupcl opost onlcr:57600::console


now you're set for using the serial console.

But there's still one thing missing in the configuration: A network card driver.
My server was equipped with a Broadcom NetXtreme Gigabit Ethernet BCM95705A3 and basically, it should work with the BGE driver included with Solaris Express 06/06. I gave it a quick try, I didn't succeed so I just went on and downloaded the appropiate driver from Broadcom.

Make a little ISO image containing the zipfile, mount it in VMWare and copy it to the Solaris harddisk for later use.


Ok, now it's showtime, we'll boot into the new system, do we?

No we don't.



4. Preparing for first boot

Just figure this: In the virtual machine, we installed Solaris on the FIRST harddisk.

In real life, we installed it on the SECOND one.
GRUB might be able to boot a kernel, but Solaris will be having trouble running from that disk, so we have to move all data from /dev/hdc to /dev/hda.

Up to this point, you still have a working Linux installation and the possibility to cancel this whole thing and live happily with your pre-configured machine and
all the safety nets provided for by your provider.

If you're feeling adventurous, reboot your server into the recovery console(that's what the people at Strato call their RAMdisk based rescue system).

I you haven't already done that, gather all necessary network configuration data you'll need to manually set up networking under Solaris(like defaultrouter, hostname, ip address, DNS server addresses and things).

Now use dd to copy every single bit of data from the second disk to the first(they're sold to be used as mirrored disks, so they should be identical):

dd if=/dev/hdc of=/dev/hda bs=15M


Choosing a custom blocksize speeds things up a bit, but expect it to run an hour or so.


After that command finished, reboot into the normal system again and you should see Solaris booting on the serial console and after that, you'll be able to log in and configure things.. Like the last part I'm going to explain to you...

5. Networking

Usually, Strato rootservers are configured via DHCP and with Linux, it just works fine.
But Solaris seems to have some difficulties with the link based routing data it's provided with. So sacrificing access to a few hosts in the same network segment at Strato,
I just configured the network manually with a very small netmask.

First of all, make sure your hostname is listed in /etc/hosts and it's showing the correct IP address.

Then, echo the IP address of the default gateway to /etc/defaultrouter, echo "hXXXXXX netmask 255.255.240.0" to /etc/hostname.bcme0(I use bcm0, because that's what my broadcom gigabit interface is called. You may have to choose a different name. And replace "hXXXXXX" with your actual hostname as listed in /etc/hosts).

Add a netmask for your "local" network to /etc/netmasks. You may try to replace the rightmost byte of your IP address with a "0" and assign a 255.255.240.0 netmask to it or you might use and IP calculator or pencil and paper, whatever suits you most.

Add the IP addresses of some DNS servers to /etc/resolv.conf and change /etc/nsswitch.conf to include "dns" for "hosts" lookups.

Finally, install the network card driver and then, reboot and see if things are working out correctly.


Et voila, you should have a networked rootserver running the latest and greatest Solaris release by now.

Comments

Display comments as (Linear | Threaded)

  1. Sebastian Maus says:

    *This is great. High goal, nice idea to achieve it, "know your tools" and use your brain, well documented and overall well written. Thank you!


Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Pavatar/Gravatar/Favatar/MyBlogLog author images supported.