Showing posts with label VirtualBox. Show all posts
Showing posts with label VirtualBox. Show all posts

Wednesday, February 2, 2011

Setting up a Mapped Network Drive in VirtualBox

I've set up a Windows XP virtual machine in VirtualBox to do .NET development. I want my work to be backed up by my host machine's backup software, but the 10GB virtual hard drives wreck havoc as the whole thing needs to be uploaded every time a single file on the virtual machine changes. To avoid this, I've set up a shared folder in the VirtualBox VM configuration, and in the VM I've mapped the share to a network drive. this way all the files on that mapped drive are stored on the file system of the host machine and can be backed up separately from the large virtual hard drive.

The steps were as follows:
  1. Create a folder on the host machine to serve as the VM's network share (all mine are under ~/VirtualBox/Shares)
  2. With the WinXP VM powered off, open up it's settings form the VirtualBox main console (right-click -> Settings)
  3. Under 'Shared Folders', click the 'Add Shared Folder' button
  4. Set the Folder Path to the folder you created above, note the Folder Name if you don't change it, and make sure the share is not marked as read-only. Click OK.
  5. Power on the VM.
  6. In Windows Explorer, open the 'Folders' side panel.
  7. Navigate to 'My Network Places -> Entire Network -> VirtualBox Shared Folders' and open the shared folder you configured above.
  8. Note (or copy to clipboard) the UNC path to the network share (probably something like "\\VBOXSVR\[folderName]")
  9. In Windows Explorer, choose "Tools -> Map Network Drive"
  10. Pick a Drive letter, and paste the UNC path from above into the 'Folder' text box. Ensure 'Reconnect at logon' is checked, and click 'Finish'.
Now you can open 'My Computer' and navigate to the drive letter you selected. The mapped drive will be there every time you start the VM.

Update 2/3/2011: Originally I removed the optical drive from the VirtualBox VM configuration so I could add the shared network drive as D: and move the optical to E:. But when I re-added the optical drive, the VM did not add the optical drive and had trouble mounting the network share to D:. After some tinkering, I ended up with the optical drive back on D: and mapped the network drive to E:. No trouble so far.

Friday, January 21, 2011

Hiding the VirtualBox 'Mini Menu' bar in Fullscreen

When you send a VirtualBox client into fullscreen mode [Host + F], there's a small 'Mini Menu' bar pinned to the bottom of the screen that has Devices and Machine menus on it. This gets in the way, and although you can 'un-pin' it so it auto-hides, I keep bumping it in WinXP VMs when I'm mousing around the XP taskbar. Fortunately, the interwebs is our friend, and a kind blogger pointed out that you can move the Mini Menu bar to the top of the screen:
  1. Make sure your VM is not running
  2. Open the Settings for that VM by right-clicking on it in the main VirtualBox GUI
  3. Go to General -> Advanced tab
  4. Check the Mini Menu entry for 'Show at top of screen'
You can also turn the thing off entirely, if so desired.

Wednesday, January 19, 2011

Cloning a Virtual Hard Drive in VirtualBox 3.0

VirtualBox doesn't make it easy to clone/copy the configured virtual machines and their hard drive image files. To create an exact clone of an existing VM, you have to first clone the .vdi disk image file from the command line. Then you create a new VM with the same configuration, but point it to use the cloned .vdi image instead of the original. You'd think this would be provided as a one-click menu option, but it's not.

In Ubuntu, the .vdi files are stored in:
~/.VirtualBox/HardDisks/
and the command to clone a .vdi is:
VBoxManage clonevdi [source .vdi] [new .vdi]
More (and better) info can be found from this article.

Sunday, December 6, 2009

Launch a VirtualBox Virtual Machine from a Shortcut

Found this link about creating a shortcut to launch a VirtualBox machine directly without having to first load the VirtualBox GUI. In short, the linux command-line is:
VBoxManage startvm <your virtual machine name>

Wednesday, November 4, 2009

Installing Ubuntu 9.04 NBR in VirtualBox 3.0

In preparation for setting up our soon-to-arrive (hopefully) new nettop as a home theater PC, I'm experimenting with different media center programs and Linux/Ubuntu variations. I think I've settled on using Ubuntu Netbook Remix (NBR) as the base OS. The large-icon interface seems like it would work well on a TV when viewed from a distance. On top of this I'll install XBMC (or maybe Boxee) and the Linux version of the Hulu Desktop. I started with installing the fresh-out-of-the-oven Ubuntu 9.10 NBR, but found out that XBMC doesn't currently support Karmic (they will when they release their next full version). So for now I'm stuck with Jaunty if I want XBMC.

The first challenge was finding the 9.04 downloads, since 9.10 just came out. I eventually googled my way to this page which contains (at the bottom) links to all variety of 9.04 versions. I grabbed the torrent file for the 9.04 Netbook Remix and queued it up in Transmission, Ubuntu's default BitTorrent client.

The next challenge was being able to mount the downloaded .img file. Why oh why didn't Canonical release an .iso? I first tried converting the .img to a .iso using the ccd2iso console command (didn't work). Then I found this blog post, which explains how to convert a .img to a VirtualBox hard drive file (.vdi) and mount the file as a second hard drive in VirtualBox. The console command to convert is:
VBoxManage convertfromraw -format VDI [filename].img [filename].vdi


This worked like a charm. I've now got a Jaunty NBR install in VirtualBox. Next step is to install XBMC and Hulu Desktop to see how they play together.

Sunday, November 1, 2009

Installing VirtualBox 3.0 in Ubuntu 9.10

I had a whole post outlined with all the steps I went through to manually install VirtualBox 3.0 in Ubuntu 9.04 Jaunty, but decided to wait a couple days until 9.10 Karmic came out before finalizing my system setup. As I hoped, it was a piece of cake in Karmic since VirtualBox 3.0 is now listed in the new Ubuntu Software Center!

I just launched the "Ubuntu Software Center" from the Applications menu. When the Software Center opened, I typed "virtualbox" in the search bar in the upper-right corner. "VirtualBox OSE" was listed. (For reference, I later found it under the Accessories category in the Software Center.) I double-clicked on it to get more info, and confirmed that it's a 3.0+ package (3.0.8 specifically), and clicked the Install button. After entering my password, the Software Center downloaded and installed it without a hitch. Now I can just run Applications -> Accessories -> VirtualBox OSE to launch.

No adding new repositories. No terminal required. It's almost too easy! Good job, Cannonical.