A great way to protect yourself from viruses, malware, and spyware is to use a virtual machine to surf the Internet instead of a regular Windows PC. So what is a virtual machine? Basically, it is a complete copy of Windows running inside another copy of Windows called a host.
A virtual version of Windows is just a big file, and the special software running on your Windows computer (virtualization program) acts like a fake computer to keep Windows running. Anything you do in a virtual machine will not affect your host’s operating system. This way, you can download 10 viruses to the virtual machine and your main operating system will be safe.
What’s great about virtual machines is that they can be reset. Therefore, if you get infected with a virus while browsing in a virtual machine, you can simply reset the virtual machine to its default state when you first install it and start over. It’s also a great way to boost your privacy, because you can simply erase whatever you’ve done in the virtual machine.
Before we start, let’s talk about the requirements. There are many software virtualization tools like VMWare, Parallels, VirtualBox, etc., but I’m going to only use Microsoft software. For this to work, you need two things:
- Disk2VHD .is a free tool from Microsoft that will be used to convert any Windows operating system, starting with Windows XP, into a virtual machine file.
- Windows 8.1 Pro or Windows 10 Pro – You will need either Windows 8.1 or Windows 10 Pro versions to complete this process. Both operating systems have a Hyper-V tool that can be used to access the virtual file, created by Disk2VHD
It’s also worth noting that even if you can use Windows XP, Vista and 7 as a virtual machine, it’s best to convert a Windows 8.1 or Windows 10 machine because the maximum resolution Hyper-V supports for these older operating systems is 1600 × 1200. This is really annoying, and I don’t know why Microsoft still hasn’t solved this problem. In any case, this is only a problem for those with high-resolution monitors.
Convert Windows OS to VHD
Let’s start simple: converting the current version of Windows to a virtual machine (VHD or VHDX file). To do this, download the Disk2VHD .tool mentioned above and run the EXE file.
When you run it, you will see a screen similar to the one shown above. There really is nothing to do here other than choosing where you want to store the VHDX file and which volumes you want to include.
If you have a large hard drive, you can simply let it save the file to the same partition as Windows. If not, choose another location such as a second hard drive or a USB external hard drive. By default, it selects all volumes it finds on your computer, which you might not need.
In my case, there are multiple hard drives connected to the computer, so I only want to select the C: volume, which is 37.26 GB in size. Also, you want to select any other volumes that were created during the Windows installation, most likely a boot volume and a system-reserved volume. They are usually really small: in my case the volume reserved by the system is only 34 MB, and the other volume, which has no label, is only 322.08 MB.
It is very important to select these other volumes in addition to the main Windows volume, because otherwise the operating system will not boot when you boot it into Hyper-V. Instead, you will receive a download error message! This is because these two additional volumes tell the system where Windows is located and how to boot it.
The creation of the VHDX file will probably take a while, depending on the size of your Windows partition. When finished, you will have one really large file and two smaller files.
Install Hyper-V in Windows 8.1 / 10
Next, we need to install Hyper-V tools on Windows 8.1 or Windows 10 Pro. If you have Home editions, you will need to upgrade to Pro before you can install Hyper-V. Click “Start” and enter Windows functions.
At the top, click Turn Windows features on or off. A window will appear in which you can mark the additional items that you want to install. Go ahead and check the box for Hyper-V. It should also automatically check the boxes for Hyper-V management tools and Hyper-V platform.
Click OK and let Windows install the components. You will also have to restart your computer. After downloading the backup, click Start, All Apps, and then scroll down to Windows Administration Tools. You should see Hyper-V Manager listed. You can also just click Start and type Hyper-V to search.
Now comes the fun part! Let’s start with Hyper-V. Go ahead and open Hyper-V Manager and you should see a blank workspace.
On the far left is the server, which should be the name of your computer. The middle section contains a list of virtual machines and checkpoints. On the right, you have a dynamic menu that changes depending on which item is selected in the left sections. To get started, select the computer name in the far left corner.
Now, in the far right corner, click Create and then Virtual Machine. This will bring up the new virtual machine wizard. The first step is to give your virtual machine a name.
Next, you need to select a generation for the virtual machine. If you are converting a 64-bit version of Windows to a virtual machine, and your computer hardware supports UEFI, select Generation 2 as it allows for more advanced features. Use generation 1 for 32-bit Windows or if your computer has an older BIOS. Generation 2 also supports widescreen displays when virtualizing Windows 8.1 or Windows 10.
If you don’t understand what all this means, just select Generation 1 just in case. Please note that if the virtual machine does not boot, you can simply delete it and start this process over. Select a different generation and see if it loads correctly. Deleting a virtual machine inside Hyper-V does not delete the original VHDX files.
On the next screen, you need to select the amount of memory that you want to assign to your virtual machine. I left it at the default of 1024 MB, but you can increase it if your host machine has enough RAM.
Go ahead and skip the Network Setup screen for now, because we’ll have to do that later. For now, just leave it “Not Connected”. On the “Connect virtual hard disk” screen, you must select “Use an existing virtual hard disk”.
Click the Browse button and select the VHDX image that represents the real Windows partition. It should be a really large VHDX file. We will have to manually add two other VHDX disks after the wizard, which I show below. At this point, review the summary and click Finish.
You should now see a new item in the list of virtual machines. If you click on it, you’ll see a few more options in the right pane.
To start a virtual machine, select it and click Start. The Status column changes to In Progress. Next, to view the virtual machine, click Connect. If you have done so now, you will see the error message I mentioned at the beginning of the article: Loading error. We still need to add other hard drives.
Select the virtual machine and click Disconnect. Then click the “Settings” link. On the left you should see IDE Controller 0 and IDE Controller 1. First click Controller 0. If you selected Generation 2, you will only see the SCSI controller.
You will see that the first VHDX file we added in the wizard is already listed. Now we need to add the second and third files. Make sure your hard drive is selected and click Add.
The Location field should automatically select 1 as slot 0 is occupied by our first VHDX file. Each IDE controller has only two slots for adding drives. Click on Virtual Hard Disk and select the second VHDX file.
Now click on IDE Controller 1 and then click on the Add button again. Do the same here, but select the third VHDX file.
Now that we have all three VHDX files, we can click OK and start our virtual machine. Hope you get a Windows loading screen this time!
Finally, we need to configure the network for the virtual machine so that you can connect to the local network and to the Internet. To do this, click on Virtual Switch Manager at the top of the right menu.
Click New Virtual Network Switch and then select External from the list. Finally, click on Create Virtual Switch.
Give your virtual switch a name if you like and then select the correct network from the dropdown list. If you have more than one network card, select the one that is connected to the network and the Internet. After your switch is created, we need to tell the virtual machine to use it. To do this, click the virtual machine in Hyper-V Manager and then click the Options link in the right pane.
Click Network Adapter and then select the new virtual switch you created in the previous step. This is it! Now when you start your virtual machine, it should be able to access the network through the host computer.
Hopefully this article helps you convert your current PC into a virtual machine that you can run on the same PC or a different PC if you like. There are many things that can go wrong in this process, so feel free to comment if you run into problems. Enjoy!