One of the things that I always miss in OpenSolaris is text install and the primary reason for using this is in VirtualBox where I want to install just enough OpenSolaris to do a particular task with it like Database Server, Drupal, Java Application Server, etc (but more server like tasks). I really don’t need GNOME or any other desktop utilities and it is primary a waste of space if I really have to do it for multiple VMs.
I have created a new OVF image which is less than 270MB size and can be used to play with the OpenSolaris kernel in VirtualBox 2.2 and if you like it can install the rest of the OpenSolaris Desktop to get to the default full blown installation of OpenSolaris 2008.11
Download the OpenSolaris App OVF image, unzip it and just use VirtualBox->File->Import Appliance to import the image into a new VirtualBox VM and you are ready to boot into OpenSolaris kernel. The preset login information is user: root with password: opensolaris.
TIP: If you like this minimal install and would like to try out the full fledge Desktop install just execute the following command
# pkg install slim_install
This will take a long time since it installs packages of another 600MB on top of the installation. But it will be pretty much the same set of packages that comes with OpenSolaris 2008.11 CD. (Actually I expected "# pkg install entire" to do the intended task but unfortunately it just installed "entire" and not its dependencies. Must be a bug somewhere with "entire". )
If you are interested in your own custom OVF image, here is how I have created the image:
- For the time being this requires the OpenSolaris 2008.11 CD image (650+ MB) only to execute my script create_solaris_appliance.sh which is about 5KB.
- Download Virtualbox and install it
- Create a New Virtual Box VM with following parameters in the Wizard Screen
- Call it My OpenSolaris Appliance
- Select OS Type "OpenSolaris"
- Base Memory 768MB or increase it to 1GB if you can spare your RAM for it
- Create a New Dynamic Expanding Image with exactly 16.00 GB (Any other size may not work)
- Once the VM is created, immediately click the blue Network link and modify it to select a "Bridged Network" (in the setup make sure it is connected to the active host interface – wired or wireless depending on the host system)
- Also Click the CD-ROM image and point it to the osol-200811.iso image that you downloaded earlier
- Boot up the VM and select the first LiveCD option in the Grub Menu options
- Select through the defaults to get the full Gnome Desktop
- Open Firefox in the VM and make sure your VM has internet access
- Open a terminal window and execute the following commands in sequence
- wget "http://blogs.sun.com/jkshah/resource/create_solaris_appliance.sh"
- time pfexec sh -x create_solaris_appliance.sh
- pfexec halt
- At this point stop the VM and disconnect the CD image connected to the VM and use VirtualBox->File->Export Appliance Wizard to export the image
It takes about 12 minutes to create an image of about 270MB using the above steps with a decent internet connection and decent desktop.
If you want to own customized Image, take a look at create_solaris_appliance.sh and create_pg_appliance.sh and create your own versions of it for say Drupal, Ruby, Glassfish, etc.
April 10, 2009 at 2:10 am |
I was looking for the past 3 days for something similar and today I stumbled upon your awesome post.
THANK YOU!
April 10, 2009 at 1:01 pm |
This is a great article and a very educational script. Thanks for writing both!
I needed a small Opensolaris installation to play with and this appliance is exactly what I had in mind.
April 10, 2009 at 6:46 pm |
That’s not a bug with ‘entire’; it’s an incorporation, not a group package, and exists only to tie the packages that make up the OpenSolaris release train together so that updates maintain a consistent, working system. slim_install is the package that’s equivalent to the old primary language CD, while babel_install is equivalent to the global CD, which is the only one that will be shipped for 2009.06.
April 13, 2009 at 8:21 am |
Nice educational script … replace the hardcoded fmthard with these 4 lines to handle different disk sizes …
SecCnt=`prtvtoc /dev/rdsk/${INSTALLDISK}p0 | awk ‘/sectors\/cylinder/ { print $2 }’`
LastSect=`prtvtoc /dev/rdsk/${INSTALLDISK}p0 | awk ‘$1 == "2" { print $5 }’`
LastSect=`expr $LastSect – $SecCnt`
fmthard -d 0:2:00:${SecCnt}:${LastSect} /dev/rdsk/${INSTALLDISK}p0
# #fmthard -d 0:2:00:48195:33447330 /dev/rdsk/${INSTALLDISK}p0
April 13, 2009 at 8:56 am |
Hi Vikram,
Thanks for the workaround.
I am of the opinion that fmthard should have an option -B like fdisk does to just do what we expected to do.
I have file a new RFE 6829475 to request such an option. Use http://bugs.opensolaris.org to add interest for such an option if you think it makes life easier.
Thanks
April 15, 2009 at 1:04 am |
Cool!
May 8, 2009 at 4:51 am |
Hi Vikram,
Very useful. How does the size/pkgs differ from the OpenSolaris JeOS project?
http://wikis.sun.com/display/Appliance/OpenSolaris+JeOS+VM+Images
thanks
Jason
May 8, 2009 at 4:51 am |
Hi Jignesh,
Very useful. How does the size/pkgs differ from the OpenSolaris JeOS project?
http://wikis.sun.com/display/Appliance/OpenSolaris+JeOS+VM+Images
thanks
Jason
May 11, 2009 at 2:23 am |
Hi Jignesh,
I try since yesterday evening to download the OpenSolaris App OVF image, but every time i do it (3 or 4 times till now) after downloading about 99% of it, the system is displaying "still a few seconds to wait" and the download doesn’t finish.
Any idea? Thanks
May 12, 2009 at 9:57 am |
Thank you for your extremely useful script!
I’ve made two enhancements that might be of general interest:
If you replace the fmthard commando with these lines:
vtocBegin=$(prtvtoc -h /dev/rdsk/${INSTALLDISK}p0 | grep "^[[:space:]]*8" | awk ‘{ print $5 }’)
vtocSectors=$(prtvtoc -h /dev/rdsk/${INSTALLDISK}p0 | grep "^[[:space:]]*2" | awk ‘{ print $5 }’)
vtocCount=$((${vtocSectors} – ${vtocBegin}))
fmthard -d "0:2:00:$vtocBegin:$vtocCount" /dev/rdsk/${INSTALLDISK}p0
Then you’re no longer bound to 16GB but you can define any size you like.
Further, if you include SUNWahci in your package list, you can use SATA controllers as harddisks.
Again, thank you very much. I think Sun oughta provide a minimal/server edition of OpenSolaris for convience, but in the meantime, this does very nicely
May 12, 2009 at 10:01 am |
LOL
Guess I should’ve read the comments more thoroughly… Sorry Vikram
May 23, 2009 at 4:33 am |
Is there a trick to getting the desktop to install?
> pkg install slim_install
executes ok but the new build env wont mount afterwards and I can’t get the desktop to start.
thanks
Jason
June 30, 2009 at 10:19 am |
Any updates for 2009.06?
There is at least one problem with the browsercfg (from the missing SUNWfirefox package) call failing and halting the installation (OpenSolaris defect #5558).