Aug 17
The way I use VirtualBox
The use case
So what do I actually need VirtualBox for? We (at work) have a product that needs Client-installation (which will install a Windows Service and more). There are several different versions of this product that need to be testet. To not mess with my work laptop's operating system I - and most of my team - use virtual machines (vm) for testing. So among other things we use virtual machines to test the client code. We use vms not only for the client code as you can run different operating systems using VirtualBox (see Guest OSes for a complete list), so we test server installations, too.
The usage
Now what is so special about VirtualBox and VBoxManage and what did my colleague tell me? It is the fact, that you can declare your virtual disks (the hard drive of your virtual machine) as immutable. This means that you can not save changes to the virtual disk. So on a restart of the vm it is as it was when you declared it as immutable. This is espacially useful for testing different versions of client code - you do not have to uninstall and reinstall the software, you get a fresh system on every reboot. Using VBoxManage you can later declare the vm immutable, so if you want software installed on the system you can do that and after the install change the disk type to immutable. In case you want to save something you can take a snapshot and start the vm from that snapshot on the next boot.
The command line
In my case I already had a virtual disk that I wanted to use. If you do not have one, you can create one using the GUI or by using VBoxManage in the command line:
VBoxManage createvm
There are more options required but this command will list the needed ones for you.
As I already had a disk I wanted to use I decided to make a copy of it and use the copy to try out the immutable disk type. To do so, all you need to do is run:
VBoxManage clonehd --format VDI
This will clone the disk to the specified destination name. There is a
--type option, too - which did not work for me. If you need to find the VBoxManage list hdds
for a list of all your disks. As the --type parameter on the clonehd command did not work for me I added the disk to my VirtualBox setup and then used:
VBoxManage modifyhd --type immutable
This changes the type of the disk to immutable and enables me (and my team) to test different sets a bit quicker.
The conclusion
VirtualBox is a nice and powerful tool - and it is free. I am pretty sure there are more functions I do not know about, so please feel free to share hints, insights or your favorite option of VirtualBox in the comments. VirtualBox runs on different OS, too. I have used it on Mac OS X and Win XP so far without any problems.
The find out more section
VirtualBox.orgVirtualBox wiki page
Virtualization wiki page
Virtualization by VMware









blog comments powered by Disqus