Virtualbox is an extremely powerful (and better yet…) FREE virtualization software that allows you to create a very powerful testing environment on your own computer. It is a MUST HAVE if you are looking to expand your knowledge with new operating systems, testing new configurations, writing your first server scripts, etc. It felt like a yesterday when we had to talk Grandma into getting a new computer so that you could take her old machine and install Ubuntu Server 6 on it. Those days are over and Virtualbox will allow you to use your own machine to create a really sweet test environment.

Well, (like always) we LOVE IT when other people write software to make things a lot more simple. Thankfully, there are developers out there that contribute enough code to make these amazing  utilities free for anyone to use. The only downside is, there is a lot more terminology and time required to make yourself familiar with how virtualization works. Don’t worry though, it is pretty straight forward. Most of the time, people over think things or can’t believe that it is real. Just take your time, think things through and just say “OMG it was that easy!?”.

Why you should use Virtualbox

The thing that I use Virtualbox for is for testing servers. You can take snapshots with it (like all other virtualization software) and make a copy of your server while it is running well. That way if you screw up, you can restore the snapshot of when your server was running okay. By default, it is really easy to get one machine up and running. To get multiple machines running is just another few clicks before it is done. But to get those machines to talk to each other AND still get Internet access at the coffee shop network that locks you down where you cannot use bridge mode… that may take a few more steps and thinking.

For this tutorial, I will show you on how to create a your first virtual guest running Windows Server 2008 R2. I will also create another article where you can

Step 1: Download and Install Virtualbox

Download Virtualbox from their website. Choose the option for either Windows/Mac/Linux. I will be using the Mac version since I run my mobile network on my Macbook Air (so I can work on my stuff in coffee shops), but there shouldn’t be too much of a difference.

Step 2: Create Your First Virtual Machine in Virtualbox

To create your first Virtual Machine, you need to first download your Operating System. Let’s get our server installed first. Download Windows Server 2008 R2 Trial from Microsoft. It will come in an ISO Format. Once that is downloaded, open up Virtualbox. In the upper left, press “New”.

A wizard box will appear that will help you create your first virtual machine. When it asks you for your machine name, choose any name if you want. Lets call it Windows Server 2008 R2 (let’s not make this rocket science). Make sure that the dropdowns below the name are configured correctly (Windows for the OS and Server 2008 64-bit for the version).

When it comes to choosing memory for your guest, it all really depends on your OS. For Windows Vista/2008 or newer, I would definitely do AT LEAST 1024 MB (1 GB) of memory. Type in 1024 in the box and then press Continue. On the next screen, it will prompt you to create a new disk to use. Virtualbox will create a Virtual Disk on your computer. The guest that we are creating will think that it is an actual hard disk, but Virtualbox will actually store the virtual disk in a file on your local host. Accept the defaults to create a new start up disk.

What is really cool about Virtualbox is that you can create the virtual disk in many other virtual formats. Unless if you have a specific reason, lets just stick with the VDI format.  The next screen is where we can choose the virtual disk to be dynamically allocated or fixed. Dynamically allocated allows you to create a virtual disk of whatever size you would like. For example, we can create an 80 GB virtual disk. If our guest only uses 40GB of space, it will only take up 40GB of space on your machine. If we statically set it, it will take up 80 GB no matter what. I would only statically set the size if you need additional performance. For a test environment, dynamically allocated is almost ALWAYS the best option to choose.

Press Dynamically Allocated and press Continue. On the next screen, we can set the size. For Windows Server, I would set it to 50 GB just to be safe. You can also click the folder icon and choose where you want to save your virtual disk. This is extremely important to know if you want to save it to your data drive instead of your solid state. If you need to change it, change it. If not, leave it alone and you should be good (just make sure you have enough space on your drive incase it does hit 50GB). Press Continue when you are completed.

Woo hoo! We are there. Press Create (on both opened windows) to create your first Virtual Machine. You have now prepared your first virtual guest in Virtualbox. It isn’t too exciting if we do not have anything installed on it, so lets get it set up with something!

Even though that we created our virtual guest, we need to adjust a few settings before we get started. Back on the main screen of Virtualbox, right click on your virtual guest and press Settings. We need to add the ISO that we downloaded to our virtual guest. We do this by mounting the ISO file to our virtual DVD-ROM drive. On the settings page, choose the Storage button at the top. Under the IDE Controller, click on Empty (this means that our virtual DVD-ROM is empty). On the right side of the screen, click the CD-ROM logo and select “Choose a virtual CD/DVD-ROM disk file…“. From here, we can browse to our Server 2008 R2 Trial ISO that we downloaded from Microsoft. You will see that the ISO file has now been loaded in our DVD-ROM drive. Press OK to save your changes.

Now you should be back to the main screen of Virtualbox. Right click on the Virtual Guest and choose Start. Your virtual guest will now begin to boot and hopefully it will boot from your ISO right away. If it does not, double check the settings to make sure your ISO is mounted properly.

One thing to remember is that Virtualbox will “capture” your mouse and keyboard. To go back to your host machine, press the button that is labeled in the far lower right of the Virtualbox window.

Now what we want to do is install Windows Server 2008. Luckily, I will save some screen real estate if you do not know how to do this. Be sure to check out our Step By Step Guide on Installing Windows Server 2008 R2 if you are not sure how to install Windows Server 2008 R2. If you already know how, hack away.

Step 3: Install Guest Additions

The final step that you need to do is to install the “Guest Additions” on your Virtual Machine. The guest additions include additional software based off of your operating system that allows the virtual guest to communicate better with your physical host (device compatibility, processor information, etc.). To do this, go to Devices > Install Guest Additions…

Once you click that, check the CD ROM drive under Windows Explorer. In that “CD Drive” (remember it is a virtual CD ROM being mounted, not physical) you should see the Virtual Box Guest Additions software.

9-GuestAdditons

Just double click on this and then run VBoxWindowsAdditions. It will install just like any other software on Windows. Just reboot when finished, and you are ready to rock and roll!

Conclusion

Virtualbox is a very powerful software and this just covers the tip of the iceberg. I hope to have some more advanced stuff so you can start creating virtual environments including networks. More importantly (if you are like me) there are some tips that I have on creating virtual networks that also have internet access (no matter where your computer is). It sounds easy, but when you take your laptop around from network to network… it can become a major pain in the rear to get your networks with an internet connection.

Feel free to post your questions below or find me on Twitter!