Running VirtualBox - A few Tips!
By Saloni Arya on Jun 26, 2008
If you are new to VirtualBox and are searching for a reference to get you started, I believe my other blog entry on "Running OpenSolaris 2008.05 inside VirtualBox on a Solaris x86 host" is the right place for you.
If you are already done with the initial installation of VirtualBox and your guest OS, then I believe this is the place for you. Getting started with VirtualBox, there are a few things that I think one should know.
The "Network" tab under the Settings of a virtual machine lets you decide how the VirtualBox presents a Virtual NIC to the VM. There are four options for the network card.
- AMD PCNet PCI II;
- AMD PCNet FAST III (the default);
- Intel PRO/1000 MT Desktop;
- Intel PRO/1000 T Server.
When you start your Guest VM, the VirtualBox enables one of these by default for you and enables the NAT mode for it. This way, the guest VM can connect to the outside world. AMD PCNet FAST III is the default because it is supported by almost all operating systems.
For any serious and interactive use, the VirtualBox Guest Additions will make your life much easier by providing closer integration between host and guest and improving the interactive performance of guest systems. Guest additions is basically a set of drivers which provide the following features:
1. Mouse Pointer Integration: With guest additions, there is no need to Capture and release the mouse to switch between the host and the guest. It provides seamless mouse support without any need of the host key.
2. Better Video Support: The custom video drivers that are installed with the Guest Additions provide you with extra high and non-standard video modes as well as accelerated video performance.
3. Shared Folders: This provides a way to share files between the Host and the Guest OS. You can specify a folder on the Host as shared for the Guest and VirtualBox will make it available to the guest OS as a network share.
4. Shared Clipboard: With Guest additions installed, the clipboard of your guest OS can be shared with your host OS.
There are many more features provided by Guest Addditions. Refer to the User Manual of VirtualBox for them.
Installing Guest Additions
In order to install guest additions, go to the devices tab. There, select "Install Guest Additions" option. This will automatically mount the VBoxGuestAdditions.iso
Alternatively, go to the Mount CD/DVD ROM option. In that, select the CD/DVD ROM image. In the window that opens, browse to the directory containing VBoxGuestAdditions.iso. It will be /opt/VirtualBox for Solaris host.
After mounting, the VirtualBox provides the ISO image as a CD to the Guest OS. Now, run the following command:
pkgadd -d /media/VBOXADDITIONS_1.6.2_31466/VBoxSolarisAdditions.pkg
Here, VBOXADDITIONS_1.6.2_31466 is the name of the CD which gets mounted in /media.
After the installation is complete, you need to relogin to the XServer on the guest to enable the X11 Guest Additions.
Enabling Shared Folders
In order to share a folder between the host and the guest, you have to first create a folder on the host OS exactly the way you want it on the guest. Then, in the guest OS, go to devices -> shared folders. The window below opens.
In this window, there are two options: Machine Folders and Transient Folders. The Machine folder option defines shared folders that are available only to the VM for which they have been defined. The transient folder option defines shared folders which can be added or removed at runtime and do not persist after a VM has stopped.
In the Machine Folader option, browse to the folder to be shared on the host and give it a name by which it will be visible in the Guest OS. Now, the shared folder will be available for mount like a normal network share.
In order to mount, type
mount -t sharename mountpath
where sharename is the name given to the shared folder and mountpath is the path where you want ot mount the folder.