Tuesday, October 29, 2013

How to increase your VirtualBox disk size for Windows

A lot of times that I blog, it's made up of things I want to remember for future issues. This is one of those times.

For my Crystal development contracting, I utilize Oracle's VirtualBox. It's a great free tool you can check out here. One of the issues I'd encountered was that, like most people, when I configure a VM I'll usually pick the smallest HD size I think I can get away with, somewhere like 40gb or so. However, that goes away quickly once Windows, MSSQL, Crystal, and the application I develop for are all installed, not including the size of customers' data that I restore for testing.

Today, I had a customer deliver a 33gb database for development. Not huge, by most standards, but very large for this application. I was out of space. Creating a secondary drive wasn't an option, as it needs to be restored to SQL. So, I shut the VM down and got into the settings console.

There was no option to change disc size. Crap. What now? New VM? I'm a fixed-bid contractor, so every extra hour I have to waste on this is money out of my pocket. So, using some Google-fu, I found a few people discussing using the VBoxManage command.

Problem for me was that my VM's are stored on a massive drive, not the OS drive where VirtualBox is installed. So, with some modification, here are the steps and commands I used:
  1. Close your VM. 
  2. Open a command prompt, and cd into the directory where VirtualBox is installed (usually C:\Program Files\Oracle\VirtualBox) cd C:\"Program Files"\Oracle\VirtualBox
  3. run the modify hd function with the new size (this needs to be in MB). You must specify the location of the .vdi file you wish to increase. I choose 70GB (70 * 1024mb = 71600MB)
    VBoxManage.exe modifyhd G:\VirtualBox\VMName\VDIName.vdi --resize 71600
    
  4. VirtualBox will start the process of resizing your hard drive and you will see the a percentage progress bar telling you how far along the process is.
  5. Now start up your Virtual Windows Machine. Right Click on "Computer" and choose "Manage"
  6. Click on the "Disk Management" option on the left panel under Storage. You will notice some "unallocated" black space next to your C:\ drive if everything was done correctly.
  7. Right Click on the C drive and choose "Extend Volume" Follow the Windows wizard and you will have successfully increased the size of your VirtualBox disk.

Mad props to this guy for getting me about 80% of the way.

Saturday, September 28, 2013

Drag and Drop Broken - Windows 7/2008 r2

Ever had drag and drop stop working on you?

Oh yeah? Me either. Until this week. I work on a remote computer for some of my contracting (hence the multiple posts on RDP here), and drag and drop is crucial for what I do. So, when it stops working? Yuck.

Well, with some google-fu and some "I can't believe the fix is this simple", here's the solution:

Left-Click on a file in windows explorer. Hold the left-click. Click Esc. Seriously. That's it.

I love it when fixes are easy.