The physical host server, known as a virtual host, has to run a “hypervisor” such as VMware ESXi or Microsoft Hyper-V Server in order to host the VMs. The hypervisor allows many virtual machines to run on a single physical host. The only limitations are how much CPU, RAM, and hard drive space are available.
At my last job, we had a Dell PowerEdge VRTX chassis with 10 or 15 TB of storage and two “blade” servers that provided the CPU and RAM resources for the virtual machines. We had over 20 servers, all VMs, each with a different purpose (domain controllers, file server, update server, print server, etc.). I was able to spin up new server VMs, configure them, and have them operational in a matter of hours (depending on the server’s purpose) and not have to worry about purchasing or updating a physical machine on which to install the OS. We were usually able to leave the old server running parallel to the new server while we finished the configuration and deployment process. In the case of printer and file servers, this also allowed for a gradual process of moving the users from accessing resources on the old server to accessing the resources on the new. Once the new server VM was configured, we shut down the old VM and deleted it from the host to recover CPU, RAM, and storage resources.
In an effort to stay current and work on additional IT training / certifications, I run several (VMs) on my personal laptop. I was using VMware Workstation v8, but that was released in September 2011 and was several versions out of date. I started having compatibility issues with some of the newer operating systems (OSs). VMware Workstation is a for-pay licensed hypervisor that can run on a server or workstation that already has an OS installed.
I also used Oracle VM VirtualBox occasionally over the last few years. It’s open source and free, so I decided to give the latest version a try. I already had version 5.1.something installed. I downloaded the latest version (5.2.8) from the Oracle VM VirtualBox homepage. (Note: as of this writing v5.2.12 is available.) The installation process allows you to upgrade your current version without “breaking” anything. You can also do a clean install from scratch. After the installation completes, and you launch VirtualBox for the first time, it will prompt you to download and install the VirtualBox Extension Pack.
I created a Win7 Pro (x64) VM several months ago in order to study for Exam 98-349 (Windows Operating System Fundamentals). I got somewhat familiar with VirtualBox’s intricacies. Because it had been so long since I did a blog article, I decided to shut down and delete the VM, start over, and document the process. My intent was also to create Win8.1 and Win10 VMs. That’s what led to my most recent blog posts on installing and configuring those OSs.
One thing I noted with VirtualBox is that it doesn’t hog the full RAM allocation for each running VM. It only uses as much host memory as necessary. VMware desktop took over the full amount of host RAM that was allocated to each running VM. This can cause the host to run sluggishly, depending on how the RAM is allocated and how many VMs are running. When I first started this article several weeks ago, I was running two Win7 VMs simultaneously: one with 4 GB of RAM and the other with only 2 GB. VirtualBox was using less than 200 MB of host RAM for the two, even though one was running Windows Updates and the other was installing the OS.
The first step to creating a VM is to launch VirtualBox and click the “New” button in the upper left. Enter the machine name, identify the OS that you’re installing, set the memory (if you want to change the default), and click “Create”.
The next screen allows you to choose the local storage location for your VM, hard drive size, and hard drive type. The default HDD size for Win7 Pro (x64) is 32 GB, but that gets almost completely used up after installing SP1 and other updates (my ISO is several years old and pre-SP1). I increased the HDD size to 64 GB, left it as a VDI file, and dynamically allocated. I learned on the previous VM that if you choose the VMDK option (which you may be familiar with if you use VMware), you cannot expand the HDD size at a later time. In order to expand the HDD, you have to choose the VDI type. Once you set your options, click “Create”.
At this point, you should have a “bare-bones” VM without an OS installed. The next step is to open the VM’s properties and mount an ISO or optical disc containing the OS image. The easiest way to edit the VM’s properties is to click on the “Machine Tools” button in the upper right, and then click on “Details.
Click on “Storage”, click on the icon for the optical drive, click on the other icon of the optical drive that displays next to the drive controller. If you’ve already created a VM in VirtualBox, you should see a list of already-used ISOs. If not, click on “Choose Virtual Optical Disc File” to navigate to the folder where the ISO is stored. In this case, I’m mounting my pre-SP1 Win7 Pro (x64) ISO that I used before. Click “OK” after you select your ISO.
Power on the VM by clicking the “Start” button (green arrow) in the menu bar. A console window will open to display the VM. Follow the regular OS installation process to allocate the partition, name the machine, create the user account, etc. (See my previous articles for information on installing Win7, Win8/8.1, and Win10.)
After the OS installs and logs you in for the first time, the next step is to install the “Guest Additions”. Installing the “Guest Additions” in VirtualBox or the “VMware Tools” in VMware is analogous to installing the device drivers on a physical computer. Installing these applications in your VM make it compatible with the hardware installed in the host computer. Click on “Devices” the menu bar, and then click on “Install Guest Additions CD Image”.
You may be required to open Windows Explorer / File Manager and manually launch the installer from your optical drive. Click the “Install” button each time you’re prompted to install a new driver. Click “Finish” to reboot the VM after the installation completes.
To enable copy / paste between your host and the VM, click on “Machine” in the menu bar, and then click in “Settings”. Go to “General” > “Advanced”. Change both drop-down menu selections to “Bidirectional”, and then click “OK”.
You may wish to mount folders or drives on your host as network shares on the VM. Click on “Machine” in the menu bar, and then click in “Settings”. Click on “Shared Folders”. Click on “Machine Folders” and then click on the button to the right to add the shared folder. Use the drop down in the “Folder Path” box to navigate to the folder that you want to share. Name the folder accordingly, set the permissions, and click on “OK”. Repeat as necessary.
After creating multiple VMs on my laptop, the HDD was getting lower on space than I’m comfortable with. I have several spare USB HDDs, so I decided to move my VMs to one of those. The main thing to bear in mind when running VMs from an external drive is that there may be some lag, meaning that the VMs may run and respond more slowly than normal, especially if you’re running more than one at a time.
I attached a USB HDD to my laptop via a powered USB hub and assigned drive letter W (my other external HDDs are X and Y). To do this, aunch Windows Explorer / File Manager and click on “Manage” to launch the Computer Management GUI. Then click on “Disk Management”.
Right-clicked in the drive that you want to change the drive letter for, and then left-click on “Change Drive Letter and Paths” on the pop-up menu.
Click on the “Change” button.
Click on the assigned drive letter to open the drop-down menu.
Scroll down and then click on the drive letter that you want to assign. The menu will collapse. Click the “OK” button. You should see a pop-up warning about the impacts of changing your drive letter. If you really want to change it, click “Yes” and the new drive letter will be assigned.
Click the “OK” button again and you’re done changing the drive letter.
The next think I did was navigate to the folder immediately above the folder that my VMs are stored in. In this case, that’s my user folder (C:\Users\[username]). I right-clicked on the “VirtualBox VMs” folder. On the pop-up menu, I left-clicked on “Send to” and “W”. This copied the folder containing all my VMs from my internal HDD to my USB HDD.
The next step was to remove the existing VMs from the VirtualBox console without actually deleting anything. I launched VirtualBox and left-clicked on the first VM to select it. I clicked on “Machine” in the menu bar and then clicked on “Remove” in the pop-up menu. I don’t want to delete the VM files yet, so I clicked on “Remove Only”. I repeated that process until all four VMs were removed.
I then had to change the default folder for where the VMs are to be located. I clicked on “File” and “Preferences”. The first menu page shows the default location for the VMs folder. I changed it from “C:\Users\[username]\VirtualBox VMs” to “W:\VirtualBox VMs”, and then clicked “OK”.
After the VMs files finish copying to the new location, it’s time to add them back into VirtualBox. Click on “Machine” in the menu bar, and then click on “Add”.
Double-click on the folder that contains the VM that you want to add, and then double-click on the .VBOX file to add the VM to the console.
I clicked on the down arrow next to “Tools” and then on “Details” show enable to option to show all of the VM information in the console window. I repeated the process until all four VMs were listed.
At this point, it was just a matter of starting each VM to ensure that they run properly. After running some tests and installing Windows Updates, I was comfortable with the condition of the VMs running from the USB HDD. I opened Windows Explorer, navigated to my user profile folder ((C:\Users\[username]) and deleted the “VirtualBox VMs” folder, thus freeing over 100 GB of space on my HDD.
Some things to keep in mind when working with virtual machines:
- Make sure you have a powerful enough processor (CPU) and that it enables virtualization.
- Make sure you have enough memory (RAM) to run multiple computers; most contemporary versions of Windows require 4 GB to run effectively (even though MS claims that 2 GB is acceptable.
- Make sure you have enough HDD space; VMs will grow over time and the process to shrink them is kind of complex (I’ll get into that in next week’s article on recovering drive space).
- If you run your VMs from an external HDD, understand that there may be lag issues.
- Make sure you have a good USB connection to any external HDDs; losing the connection while a VM is running can corrupt and ruin the VM.
- Bear in mind that all of these issues will be increased if you try to run more than one VM at a time.
If you want to read more, here are some of the sites I used as references and the product information sites for VirtualBox and VMware:
- Wikipedia “Hypervisor"
- Wikipedia “Virtual Machine"
- Oracle VM VirtualBox (https://www.virtualbox.org/)
- VMware ESXi Bare Metal Hypervisor
- VMware Workstation Pro
- Microsoft Hyper-V Server
Here are the direct links to my earlier articles on installing and configuring Windows OSs.
- Installing and Configuring Windows 7
- Installing and Configuring Windows 8/8.1
- Installing and Configuring Windows 10
As always, I'm open to questions and constructive comments. Your feedback is welcome.