Archive for the ‘virtualbox’ category

Using shared folders with Windows 7 in VirtualBox on Ubuntu Karmic

January 4th, 2010

VirtualBox allows you to specify “shared folders,” which are folders located on your host that your virtual machine can see. This is different from having a folder shared over the network: anyone on your network can see network shares, but only your VirtualBox instance can see vbox shared folders.

The problem with Windows 7 on VirtualBox is that even if you specify shared folders, there’s no obvious way to access them from the virtual machine. They don’t show up in Network Places.

To access shared folders, you have to type in the following in your address bar:
\\vboxsvr\shared_folder_name

Don’t use your host’s name instead of vboxsvr; you have to say vboxsvr. shared_folder_name is the name of the folder you shared in VirtualBox.

To make your folder easier to access, you can map that shortcut to a network drive in your virtual machine.

Getting localhost to work over HTTP in VirtualBox

December 2nd, 2009

For some reason, VirtualBox doesn’t consistently resolve localhost to the host machine’s IP. Sometimes it’ll work, sometimes it’ll bounce you to the dns error page. To fix this, just add this to your c:\windows\system32\drivers\etc\hosts:

10.0.2.2 [your computer name]

That’s it–you should now be able to do things like http://localhost:8080/

Changing the size of a VirtualBox disk image

November 28th, 2009

I use VirutalBox to virtualize a copy of Windows 7 on my Ubuntu machine. I use it for when I want to test sites in IE/Safari or when I need Visual Studio to do some .NET work. Naturally I want to keep the disk image as small as possible, but I often find that with all of the ginormous service packs that Microsoft is so fond of distributing, my guesses as to what a good size for the hard disk are usually too small.

There’s no easy way to resize a VirtualBox hard disk image, but it’s not that hard to do. Here are the steps:

  1. Get a copy of an Acronis Boot Rescue ISO.
  2. Create a new hard disk image of the size you want using the Virtual Box Virtual Media Manager.
  3. Attach the new hard disk image as a slave to the OS you want to grow.
  4. Boot the VirtualBox OS into the Acronis ISO.
  5. Use the Acronis tools to mirror the master disk into the new slave disk. The tools will automatically expand or contract the partition to match the size of the new disk.
  6. Toss the old disk image and attach the new one as the master. You’re done!