How to setup a virtual machine in Windows 10

Virtual machines in Windows 10 allow you to quickly test another operating system without losing your Windows 10 installation. Find out what else virtual PCs are good for and How to setup a virtual machine in Windows 10.

how to setup a virtual machine

In the following article, we explain what is a virtual machine? For what purposes the use of a VM is suitable? And which free virtualizers you should know for using a virtual machine under Windows 10.

What is a virtual machine?

A virtual machine is basically an independent virtual PC inside a real PC. The virtual machine can emulate a computer with real existing hardware or hypothetical hardware. The virtual replica of the systems is executed directly on the processor of the actual computer.

For many years, there have been so-called “virtualizers,” adequately called hypervisors, for Windows, Mac OS, and Linux. These programs allow a virtual machine (VM) to run on a host system in isolation as if it were on a physical computer.

The virtual machine runs like any other program on the desktop. Inside the virtual machine, you can install anything executable on the real hardware. Whether it’s an old Windows XP, Linux, BSD, Solaris, OS/2, MacOS X, or the latest Insider build of Windows 10. All operating systems run in a virtual machine as if they were installed on a real system.

Why do I need a virtual machine?

You may be asking yourself why you need a virtual machine at all. This is a fair question since you have a real computer. The advantage of a virtual PC is that you can test things without worrying about breaking anything.

For example, if you want to test a new operating system, you can first run it in a virtual machine on Windows 10 without any problems. Linux on Windows 10? No problem with a virtual machine.

Another problem that a virtual PC can help you with is incompatible or old software. Some useful programs are only exclusive to certain operating systems. For example, Linux users often have problems running Windows programs. Instead of emulating the programs on Linux, users could choose to run Windows as a virtual machine in Linux and use the programs in it. This would be extremely close to running the programs on a real Windows operating system.

Finally, you can test all those things on a virtual PC in Windows 10 that would be too risky on a actual system. Want to open a suspicious email attachment? Just open it inside the virtual machine. It is completely isolated from your system, and there is no danger for your PC. Now we’ll explain how to setup a virtual machine in Windows 10.

How to setup a virtual machine

Windows 10 has its Hyper-V tool, which you can use to setup a virtual machine. However, Hyper-V is not installed by default and must first be activated in the Windows Features. You can find the “Windows Features” menu item in the classic control panel under the point Programs and Features. The fastest and most direct way to get there is to enter “Windows Features” in the search bar.

To install Hyper-V, simply check the box next to the entry with the same name and confirm with OK. It will activate the feature, and you must restart your computer to apply the changes to the system.

Once your PC has restarted, enter “Hyper-V” in the search and click on the Hyper-V Manager.

In Hyper-V Manager, click on “Virtual Switch Manager” on the right side of the Actions window. Then select the “External” option and click on “Create a virtual switch.”

Now, you can give the virtual switch a name. Make sure that “External network” is selected for the connection type. And Allow sharing of this network adapter for the management operating system” is enabled. Confirm with “OK.” Confirm the subsequent warning about network connectivity with “Yes.”

Setup the virtual machine

After the preparation, you can setup your virtual machine in Windows 10. To do so, click on “New” > “Virtual Machine…” in the Actions window.

Then click through the various sub-items and configure your virtual PC as you wish. First, enter a name. The option “Save virtual machine to different location” allows you to save the virtual machine data to the desired file path. Otherwise, it will use the default path. Then click “Next.” When selecting the generation, “Generation 1” is the right choice for most users; click “Next” after that.

Now specify how much memory the virtual PC should have. Remember to select the amount of memory according to your intentions with the virtual machine. You should also enable the “Use dynamic memory for this virtual computer” option. Click “Next” again. Now select the switch you created in step 5 as the connection and confirm again by clicking “Next.”

Specify the size of the virtual hard disk and its storage path. Again, make sure that the size is appropriate for your needs. In the next step, you can install the desired operating system on the virtual machine. Have the desired operating system ready as an ISO file or on DVD.

To start the virtual PC, select the virtual computer in the Hyper-V Manager and click “Connect” in the Actions window. Here you can also shut down the virtual machine later.

Setup virtual machine: The Microsoft Hyper-V

Hyper-V is a free virtualizer from Microsoft and has already been included in the operating system since Windows 8 as Hyper-V technology. Also included in Windows 10 or Windows Server 2016 or Windows Server 2019. Another requirement is a 64-bit processor with Second Level Address Translation (SLAT), which all modern processors support.

Hyper-V only from the Pro editions: Microsoft’s desktop operating systems are available in different editions. Hyper-V is one of the features that Microsoft only makes available from Windows 10 Pro.

How to setup Hyper-V on Windows 10

To use Hyper-V, it must first be installed as an optional feature. The easiest way to do this is to enter “Windows Features” in the Windows 10 Start menu.

The search returns the “Activate or deactivates Windows features” section of the control panel. Which you would otherwise have to access via the settings under Apps. You will find the text link “Programs and Features” in the “Apps & Features” section on the right.

This will take you to the classic Control Panel in the “Programs and Features” section. You will then also find links to “Activate or deactivate Windows features.

Here you can activate Hyper-V under Windows 10

Error message with VMware Workstation and other virtualizers: If you activate Hyper-V under Windows. It collides with other virtualizers such as VMware Workstation or VirtualBox. The only workaround is to either disable Hyper-V or the other virtualizer. As our tip VMware Workstation and other virtualizers are not compatible with Device/Credential Guard describes or to temporarily disable Hyper-V with the Hyper-V Switch tool as long as you want to use another virtualizer.

Setup with Hyper-V

You can use the Hyper-V Quick Setup to select a new virtual system. The wizard only shows a Windows 10 development environment based on the evaluation version of Windows 10 Enterprise and two Ubuntu versions.

However, you can also select ISO images from other systems via “Local installation source.” The following systems are supported as guest operating systems in Hyper-V: Windows Vista and later, as well as Ubuntu, FreeBSD, SUSE, CentOS, and Red Hat Enterprise Linux. You can also install other systems, but there is no guarantee of error-free execution.

One annoyance already during setup is that Hyper-V cannot mount ISO images that are not stored locally. ISO files from network drives are accepted, but the setup terminates with an error message.

For this setup, especially Windows 10, is very fast. After creation, you can still edit the settings for the VM.

Configuring the virtual machine

A unique feature of Hyper-V is dynamic memory management. Here, you specify a minimum and maximum value. Hyper-V then uses the memory dynamically and does not block it directly when the VM is started. This is particularly practical if you are running several VMs at the same time. The available, total memory is thus not completely taken from the host system.

Network management is more complex than VMWare Workstation Player and VirtualBox. You can only use the virtual switch, which is the same as NAT technology. If you want to setup other network connections, such as a bridge connection, you first create a new, virtual switch via the Hyper-V Manager.

The use of the VMs is kept simple. You can start, stop and suspend the VM via an icon bar. Snapshots are checkpoints in Hyper-V, but they also serve to create intermediate steps of the system, to which you can return at any time.

You can exchange files and content via shares, drag and drop and even the clipboard. The Hyper-V supports this for the guest system.

The administration console of the Hyper-V Manager, on the other hand, takes a bit of getting used to. You can clearly see that the application comes from the server area and to run many different VMs at the same time.

In contrast to VMWare Workstation Player or VirtualBox, Hyper-V’s solution for using additional devices via USB is rather uncomfortable. First, you have to activate the extended session mode for the server and the VM. In the second step, you have to select the local resources to be used in the VM via options when connecting to the VM.

Troubleshoot possible error messages when starting Hyper-V

After installation, you will find the Hyper-V Manager and the Hyper-V Quick Start in the Windows 10 Start menu.

If you have installed Hyper-V and the management tools for it, as described above, but Hyper-V is still missing from the Start menu. Please enter the following command in the PowerShell of Windows 10 as administrator (WIN+X):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

After a reboot, Hyper-V should then be available.

If you get an error message when starting a VM with Hyper-V that the hypervisor is not running, an entry in the Windows 10 boot loader is missing. To fix this, start the command line CMD as administrator and then enter the following command:

bcdedit /set hypervisorlaunchtype auto

After a reboot, Hyper-V should then work.

How does a virtual machine works?

In most cases, an operating system is installed on a PC, and programs are executed. If you now want to install another operating system, a Linux distribution, or another version of Windows. A boot manager must be set up, which offers a choice of which operating system to start when the system boots. The whole procedure is not only time-consuming and error-prone but also no longer necessary.

How the hypervisor works

The hypervisor uses the computing power and memory of the host system. So, that there are hardly any significant performance disadvantages compared to execution on a real system. You can still adjust the CPU power and RAM allocation provided in the virtualizers.

Only the graphics interface is a bottleneck, so the use of virtual machines is not suitable for graphically complex games.

Adapt the hardware of a virtual machine

Each of the virtualizers offers many options for adapting the virtual machine’s equipment to one’s own needs. You can use a separate partition as a disk drive or a virtual disk, which is just a file on the hard disk. Many file formats of virtual hard disks of the various virtualizers are compatible with each other.

VirtualBox uses the VDI file format, VMDK is VMWare’s file format, and Hyper-V relies on VHD, which even Windows uses for virtual hard disks. VMWare can read VHD disks. But there are also converters like the Starwind V2V Converter, which can convert VHD to VMDK and vice versa.

Create virtual disks on SSD: Virtual disks of VMs feel particularly comfortable on an SSD under Windows. Since a possible file fragmentation does not mean a loss of performance, and SSDs inherently read and write much faster than regular hard disks.

Changes to the file system are managed in snapshots if desired. For example, if you want to test new programs in a VM, create a snapshot before installation. After the test, you can restore the operating system in the VM to the snapshot, which discards any changes made afterward.

Optical disks can be used in a VM in the same way as virtual disks in the form of ISO files. Which are often offered for download for live systems of various Linux distributions. And allow a finished Linux to be used directly without time-consuming installation.

USB devices plugged into the host system can be passed on to the virtual machine during operation and can be used there without any problems.

Networks with virtual machines

For the network connection, you can select in the virtualizers whether:

  • The guest system should not receive any network connection.
  • Only network communication between the guest system and the host system is possible.
  • The network connection of the guest system is done via “NAT,” and thus, the client does not receive its IP to the outside.
  • A “bridge mode” is set up, in which the guest system behaves like a regular PC, i.e., it receives its IP address from the router and acts like any other PC in the network.

Depending on the application, you can use these network settings to determine how the VM is connected to the network.

Our tip: “NAT” should be the right choice for most use cases. If, on the other hand, you want to integrate the operating system within the VM into the network like a full-fledged PC, for example, you also want to run server services (web server, mail server, game server) on the virtual PC, “Bridge Mode” is the better choice. You can also test more complex network scenarios in this mode without having multiple actual PCs.

A shared folder facilitates data exchange between the virtual machine and the host system. You can use it to specify a local folder, which will be made available in the virtual system as a network folder. You can also set up access to the folder from the existing system to be “read only,” for example, to prevent a virus from the guest system from attacking the host system.

Areas of application for a virtual machine

Multiple operating systems simultaneously

The most common use case for virtual machines is probably running multiple operating systems, even simultaneously. You can use it to install a Linux distribution as another operating system from within Windows 10 or to run the ISO image of a live system directly in a VM, which saves you from installing the operating system.

This way, it is possible to safely try out and work with many different operating systems under Windows 10 without much effort.

Running older Windows systems like Windows XP

Another area of application is the virtualization of older Windows versions. In this way, you can continue to use programs you have grown fond of, which no longer run on newer versions such as Windows 10.

For example, you can install Windows XP on a virtual machine and use the programs that would no longer run under newer Windows versions. Older USB hardware such as scanners, printers, or an ISDN telephone system can also be brought back to life in this way in some cases by simply installing the driver software in the old virtual system.

Clone existing system for virtual use: There are several free programs that clone the current operating system to continue to be used in a virtual machine. This is especially practical if you want to upgrade to a new operating system but want to keep the previous system. We have had very good experiences with the free VMware vCenter Converter, which supports the formats of the manufacturer VMware itself and VirtualBox or Hyper-V.

Testing new Windows 10 builds

Conversely, you can also safely test new Windows versions, such as the feature upgrades of Windows 10 that are released every six months, in a virtual machine before having the latest build of Windows 10 installed on the existing system.

The trial versions of Windows 10 or Windows Server offered by Microsoft free of charge can be tested in a virtual machine for a limited period of time without any problems.

Are multiple uses legal? A Windows license may only be installed on one system, regardless of whether it is an actual or virtual system. Therefore, older Windows licenses that you no longer use as an existing system can be legally run virtually. However, it would not be legal to use a license key of Windows for a virtual and a current system. If you still try to do this, you may encounter activation problems. Some reputable dealers sell licenses of used Windows versions at low prices in this case.

Safe testing of new software

A virtual Windows offers you the possibility to test new programs or such of unknown origin from the Internet first safely in a virtual environment. The snapshot function of the virtualizers helps you to do this. If you create a snapshot before installation, all changes are discarded after resetting the system to the snapshot.

With this test method, you do not run the risk of the actual system being damaged in any way by the installation or of any remnants remaining after the uninstallation.

Protection against virus attacks

Even for “forays through dark corners of the Internet,” a VM offers sufficient protection if configured correctly (NAT, no exchange folder with write permissions). Every virtualizer is configured so that changes to the system are discarded on exit if you do not agree to a takeover.

PC-Welt has tested how secure a virtual PC is and whether it is possible for viruses to “break out” onto the host system. Their conclusion is: the virtualizer itself is updated, and the VM is completely sealed off; a virus jumping from the guest system to the host system should be very unlikely.

Moreover, it will restore an infected virtual operating system to its pre-boot state at the user’s request upon shutdown, and it will discard changes of any kind.

Get Guidance and Tech, Tools Information