Couple of hacks for VirtualBox on OpenSolaris

Installed VirtualBox on a OpenSolaris Desktop. The OpenSolaris build of VirtualBox is still in beta, so you may need a couple of hacks to keep you going.

First, download and install the package as root user. The package gets installed in /opt and you don’t have a choice to keep it somewhere else, unless you tweak a couple of things. The installation is a fairly simple process.

bash-3.00# gunzip VirtualBox-opensolaris-amd64-1.5.51-r28040-beta1.gz
bash-3.00# pkgadd -d VirtualBox-opensolaris-amd64-1.5.51-r28040-beta1

The wrapper script for Solaris is not fully baked yet. So if I run the VBox.sh, it will fail with errors.

bash-3.00# sh -vx /opt/VirtualBox/VBox.sh
#!/bin/bash
.
.
.
.
+ which ./VBox.sh
APP=./VBox.sh
APP=${APP##/*/}
./VBox.sh: bad substitution
bash-3.00#

Running /opt/VirtualBox/VirtualBox will fail too, for the want of qt libraries, etc. So set LD_LIBRARY_PATH and then run the command.

bash-3.00# export LD_LIBRARY_PATH=/opt/VirtualBox:/opt/VirtualBox/qtgcc/lib:$LD_LIBRARY_PATH
bash-3.00# /opt/VirtualBox/VirtualBox

Don’t play with the tool yet, unless you have a few GB of spare space in your root partition. By default, the tool will create a .VirtualBox directory in the user’s home directory (in this case, it would be /) and keep all the configurations and OS images in the form of .vdi (Virtuo Disk Image) files. Like this:

bash-3.00# find /.VirtualBox/
/.VirtualBox/
/.VirtualBox/VirtualBox.xml
/.VirtualBox/xpti.dat
/.VirtualBox/compreg.dat
/.VirtualBox/VDI
/.VirtualBox/VDI/CentOS5.vdi
/.VirtualBox/Machines
/.VirtualBox/Machines/CentOS5
/.VirtualBox/Machines/CentOS5/CentOS5.xml
/.VirtualBox/Machines/CentOS5/Logs
/.VirtualBox/Machines/CentOS5/Logs/VBox.log
/.VirtualBox/Machines/CentOS5/Logs/VBox.log.1
bash-3.00#

So unless you have a few tens of GB in / partition, don’t go further. Use the following hack instead.

Find a partition that has reasonable space and create a hardlink from root partition. In my case, I have ample space in /export/home, so I did this.

bash-3.00# mkdir /export/home/VirtualBox
bash-3.00# ln -s /export/home/VirtualBox /.VirtualBox

Now you can start playing by executing /opt/VirtualBox/VirtualBox . All the best!

By Raju Alluri

Blogging on my personal site since 2006, I try to cover both personal and work related events and thoughts in this blog. You can reach me on Instagram, Facebook or Twitter.

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.