VirtualBox is a cross-platform virtualization application. It installs on your existing computer (and operating system) and extends the capabilities of your existing computer so that it can run multiple operating systems (inside multiple virtual machines) at the same time.
This article goes straight to the installation and VM setup process. We shall be creating a Windows Server 2012 VM on a Windows 7 host machine. For some more background info, See my previous post – VirtualBox and Virtualization: An Introduction.
Install VirtualBox On Windows 7
Go to the VirtualBox Downloads page and get the latest version of VirtualBox for Windows hosts (version 4.2.18 as of this writing).
Double click to run the installer and click through the install screens. The default settings are usually fine. You may be asked multiple times to install “device software” or “drivers”. Hit “Install” in each case.
Create A Windows Server 2012 Virtual Machine
Launch VirtualBox and press the “New” button on the toolbar. The New Virtual Machine Wizard is displayed in a new window. Enter the name of the Guest machine as you desire and choose the Operating System and version that you are planning to install as displayed below. Click “Next”.
The next screen asks for memory. VirtualBox will recommend a minimum amount, based on the OS you said you were installing (2048MB in our case). You can definitely override the default settings here. Remember that allocating too much memory to the guest will slow down your host machine. Use common sense. In this case, I’m increasing the default guest memory allocation to 8GB. My host machine has 16GB. Click “Next”.
On the next screen, select “Create a virtual hard drive now”. Press “Create” and you will be asked to select a virtual hard drive file type. I usually choose “VHD” for compatibility with Virtual PC (Virtual PC is another virtualization tool like VirtualBox and VMware. It is built specifically for Windows). The “VDI” option (default) works fine too. Press “Next”.
You will be asked to choose a dynamically expanding image or a fixed-size storage. This depends on how much space you’re willing to give your virtual OS. If you just have say 40GB you want to give over, and don’t want it reaching past that, choose the fixed-size option, set a size amount in gigabytes. Or you can choose “dynamically expanding” which, just like it sounds, allots only a little bit of space at first, but will re-report itself to the virtual system as bigger if the OS needs a bit more space. I like the dynamic option. Press “Next”.
Even for a dynamically allocated drive, you have to enter a maximum size. It is easy to wrongly assume that the size should increment infinitely when required. This is not the case. The size will increment dynamically up to the maximum size you specify on this next screen. I have set this maximum at 500GB. Press “Create”.
A new “Virtual Machine” is created. It’s state is “Powered Off”.
Install Windows Server 2012 In The New Virtual Machine
Since we want to install an operating system in the virtual machine, we need to make sure the virtual machine can access the installation media.
To do this, we edit the virtual machine settings. In Oracle VM VirtualBox Manager, select the virtual machine and then in the toolbar click the Settings button. The Settings window is displayed. In the navigation on the left, select Storage as shown in the next image.
In the Storage Tree section, select Empty below the IDE Controller. The CD/DVD Drive attributes are displayed. Click the CD/DVD icon next to the CD/DVD Drive drop-down list and select the location of the installation media, as follows:
- To connect the virtual CD/DVD drive to the host’s physical CD/DVD drive, select Host Drive
- To insert an ISO image in the virtual CD/DVD drive, select Choose a virtual CD/DVD disk file and browse for the ISO image.
We have inserted an ISO image in the virtual CD/DVD drive.
Click “OK” to apply the storage settings. The Settings window is closed. If you connected the virtual machine’s CD/DVD drive to the host’s physical CD/DVD drive, insert the installation media in the host’s CD/DVD drive now. You are now ready to start the virtual machine and install the operating system.
In Oracle VM VirtualBox Manager, select the virtual machine and click the “Start” button in the toolbar. A new window is displayed, which shows the virtual machine booting up using the ISO image we selected.
We will now perform all the normal steps for installing the operating system. Follow the usual prompts and install Windows – the process is pretty straightforward and regular. When the OS installation is complete, activate Windows.