Sun xVM VirtualBox and Host Interface Networking – OpenSolaris 2008.05 as Host OS

The Sun xVM VirtualBox allows you to tun run unmodified OS as virtual machine. The current version available is 1.6.2. You can get it from here. It redirects you to Sun Download Center.

The Sun xVM VirtualBox is Type-II hypervisor which means you install it on top of the base OS – often called Host OS. You can then create virtual machines – often called Guest OS. If you are not familiar with the hypervisor concepts and terms used in the Server virtulization topic, you may want to look at this Sun Blueprint Article by Chien-Hua Yen

One of the cool thing about Sun xVM VirtualBox is that, it support all major operating systems as Guest and Host OS.

Networking & Guest OS:

NAT(Network Address translation) is the quickest and easiest way to get access to external network from the virtual machines(Guest OS). This access method is transparent to the users as it does not require any changes on Host OS or the Guest OS.

If you require access to the Guest OS from external network (e.g. remote access using SSH, NFS, Windows Share etc) NAT method is not sufficient. In such cases, you may want to look at “Host Interface Networking”. More information on this is available in the user manual for virtual box available here.

In nut shell, this process involves creating a virtual network interface and use of  "network bridge" concept. The steps below are for Sun xVM VirtualBox running on OpenSolaris 2008.05 as Host OS and Solaris 10 07/08 as Guest OS. Installing “Sun xVM VirtualBox” , and “Creating and installing Solaris Virtual Machine” steps are not included. I must admit, steps for installing Virtualbox on OpenSolaris and creating virtual machine with Solaris Guest were quite straight forward.

My observations is that, on some of the OpenSolaris Builds, the “setup scripts” don't work out of the box. You can use the below given steps for MANUALLY configuring the host based networking for your Guest OS. In this case, the Guest OS is Solaris 05/08 .The same should work for other Guest OS.(Host Configuration Steps remain the same)

Manually Configuring the Host based Networking:

Step 1: You need a MAC address for the virtual NIC to be created. One way to generate this is to Click on Virtual Machine Settings, Network Tab, Generate MAC. Note down the MAC address.

Step 2: Create the Virtual NIC on the HOST OS

-bash-3.2# uname -a

SunOS hasham-pc 5.11 snv_86 i86pc i386 i86pc

-bash-3.2# /usr/lib/vna nge0 00:e0:81:5b:a8:a9        <= Provide MAC Address from earlier Step

Verify the Virtual NIC is created.

-bash-3.2# dladm show-link


nge0 phys 1500 up --

vnic0 vnic 1500 unknown nge0

Step 3: In order for this configuration to persist across reboot, create a startup script. You can use the simple script as given below. If you plan create multiple VNIC OR already have VNIC, this script can be enhanced to handle specific VNIC. Currently it deals with “vnic0” by default

-bash-3.2# cat /etc/rc3.d/


/usr/lib/vna nge0 00:e0:81:5b:a8:a9

Step 4: Go to Virtual Machine Settings(In this case Solaris 05/08), Network Tab and provide the details of the Virtual NIC. As shown in the picture below. Note that attached to default to NAT, it has been changed to “Host Interface”

Step -5: Boot your Guest OS – In this case, Solaris 05/08, and configure the Network Interface as DHCP or Static IP address. In this case, the Virtual NIC is as seen by Guest OS is e1000g0. One of the easy way to re-configure your network and system configuration FOR Solaris is to use “sys-unconfig” command. Note that this revert system system's configuration to an "as-manufactured" state, ready to be re-configured again including host name, networking, TZ, root password etc. I prefer configuring it bye editing/creating the configuration files.

You should be able use the VNIC in the same way for ANY other Guest OS. I have tested this with Windows XP as Guest OS and works fine. No changes in the HOST OS configuration steps. On Windows XP Guest OS, network configuration was changes to use DHCP. Based on your Network Interface card, you may be required to install driver for it in the Guest OS. 

See screen shots below for making changes to the Virtual Machine Configuration to use Host based Networking.

Windows XP Virtual Machine Screen shot - Intel NIC Listed under "My Network". Also access to/from other systems on the network works.


Hi -

nice article, but in the manual, it states you have to ifconfig vnicxxx plumb - plumb the interface.
I also see that you are using the intel pro virtual network card.

It's just i am having an issue - configured a computer at home Opensoalris Host - w2k guest - worked fine - network connectivity greate, got the cifs(samba) server working).

Brought into work, and the guest and the host cannot ping eachother - the host is seen on the network, and other computers can see the cifs share??

Any ideas

Posted by Matthew on July 29, 2008 at 11:58 AM IST #

Hi Mathew,
Thanks for your comments.
One observation. For Solaris Guest OS, the ping to/from Host OS worked out of the box.
For Windows, I needed to turn off the Windows Firewall. No changes on Virtual Box side were required. You may want to look at your windows settings.


Posted by Hasham on July 30, 2008 at 01:25 AM IST #

thanks for this, came in quite handy! Works as specified, I just have it plumb the interface as well.

Posted by Jack on August 11, 2008 at 11:00 PM IST #

Thanks a lot Hacham, your article has proven very useful and has come at a time of great frustration!
Great relief to finally have this working.

Posted by arnaud on August 13, 2008 at 07:05 PM IST #

Post a Comment:
Comments are closed for this entry.

Hashamkha Pathan


« July 2016