Posts tagged: virtualbox

VirtualBox Network with XP Guest in Ubuntu Host

This tip refers to VirtualBox 3.0.8 and Ubuntu 9.04.

If you’re anything like me, you might have need of a WinXP install within Ubuntu. In my case, it’s convenient to have a VirtualBox of Windows running for immediate testing of websites (as I build them) so that I can test the sites functionality and appearance within Internet Explorer.

Unfortunately, the default settings of a guest WinXP install don’t allow for networking “out of the box”. But it’s an easy fix!

First, make sure the virtual machine is not already running. Turn it off if it is.

Next, highlight the WinXP virtual machine within the Sun VirtualBox main screen. Click Settings. Select Network. Change the Adapter Type to Intel PRO/1000 T Server (bunchanumbers) then OK and start the virtual machine.

When you boot into the Windows guest, the network should now work.

VirtualBox Sharing

In my spare (and not so spare) time lately I’ve been playing around with Sun‘s VirtualBox. I’ve been using it for a long time now, but only recently did I decide I wanted to turn on “shared folders”. The thing is, there is no intuitive way of doing so.

More for myself, than anyone else, this is how I managed to share a folder in my Windows host “x:\shared\” and access it from within my virtual (guest) Ubuntu.

Though it is a bit dated, these instructions pretty much sum it up.

From within the VirtualBox launcher, select the Virtual OS that you want to share with. Click the settings button and select “Shared Folders” from the list. Click the little ‘+’ folder on the right side of the “Shared Folders” screen and create a directory that you want to share. Odds are you’ve already done that, which is why you’re here looking for the next step.

Start the Ubuntu VirtualBox and log in.
Open a terminal and type
sudo apt-get install build-essential module-assistant
followed by
sudo m-a prepare

I don’t understand why, but that’s what the instructions say. Now this is where I ran in to trouble (and maybe you did, too). A Google search will result with instructions telling you to “install Guest Additions” but they don’t tell you how. Here’s how.

You already have the virtual Ubuntu running so press the escape key (right-control by default) and you’ll notice along the top of that window is a “Devices” button.

Press the "Devices" button.

At the bottom of the menu that opens is where you’ll find “Install Guest Additions”.

Press "Install Guest Additions..."

For me, nothing seemed to happen. It appears that in the background VirtualBox downloaded a 10MB .iso to the VirtualBox directory.

Press "Mount CD/DVD-ROM" > "CD/DVD-ROM Image..."
Double-Click "VBoxGuestAdditions.iso"
type
sudo sh /media/cdrom0/VBoxLinuxAdditions.run

Though if that last command doesn’t work then you may have to mount it

sudo mount /dev/cdrom

or do what I did and navigate to the /media/cdrom0/ directory within a filebrowser (I used rox) to have it automatically mount the drive. Then try the command again.

Finally, mount the shared folder to a directory in the virtual OS

sudo mkdir /mnt/host
sudo mount -t vboxsf shared /mnt/host

Notice that you omit “x:\shared\” and reference the shared drive simply as “shared”. Now you can read (and write) files to the host folder through /mnt/host

Staypressed theme by Themocracy