Step-by-Step Guide to Setting Up Windows 11 Hyper-V Virtual Machines

Although virtual machines (VMs) feel like an old concept, Microsoft only introduced Hyper-V, its virtualization technology, with Windows Server 2008. It wasn’t until the technical preview of Windows 8 in May 2012 that Hyper-V VMs were available on a Windows desktop OS.

Since their introduction, Hyper-V VMs have grown to account for about 10% of all VMs in use worldwide—a significant figure considering the extensive deployment of VMs in cloud environments.

For users and administrators of Windows 11, there are numerous advantages to running VMs on personal computers, though on a much smaller scale compared to cloud setups. Here are several reasons:

For creating Hyper-V VMs in Windows 11, Microsoft offers two specific tools. This guide will provide insights into these tools, their applications, and the limitations associated with them.

Hyper-V represents a type of hypervisor, which is software capable of creating, operating, and overseeing multiple virtual machines on a single physical machine. This hypervisor provides a setting in which one can set up various VMs, defining each one’s specific technical elements.

These elements encompass virtual processors, memory, storage, network capabilities, and an operating system that is virtualized. Such virtual resources allow VMs to execute commands and operate software independently within their own distinct, segregated operational environments.

Within a VM, Windows will appear and perform identically to how it does on a standalone computer. Externally, the hypervisor manages how the VM interacts with the host’s operating system, converting the VM’s virtual resources to the physical resources provided.

Computers equipped with the Hyper-V Manager (Windows’ integrated hypervisor) or other virtual machine platforms like VMware Workstation, are regarded as host computers. Here, the virtual machines are treated as clients of the hypervisor.

Because a Windows VM is a virtual instance of the Windows operating system, Windows 11 VMs must adhere to the system requirements of Windows 11. Hyper-V introduces a few extra requirements noted with an asterisk:

There are two methods to establish a Hyper-V VM in Windows 11: the conventional method and a more developer-focused approach. The conventional method involves using Hyper-V Manager to set up and manage VMs. On the other hand, since April 2024, the developer-focused method has utilized a Microsoft tool called Dev Home (Preview), which you can download from the Microsoft Store.

This new developer-centric approach is generally easier and avoids many of the challenges associated with the traditional one. However, it does come with some limitations that will be discussed in the Dev Home section.

Even though Hyper-V is a part of recent Windows versions, it does not come activated by default. You need to enable it via the Windows Features menu in Control Panel (Control Panel > Programs and Features > Turn Windows features on or off).

Click the top-level Hyper-V item. By selecting this, you activate both the Hyper-V platform itself (Hyper-V Platform) and the Hyper-V Management Tools which are essential for operating VMs through the Hyper-V Manager or any external access tool like the Remote Desktop Connection, also known as mstsc.exe.

It is also advisable to activate the Windows Hypervisor Platform, as this component is critical too. After making your selections, click OK to have Windows configure and enable these features for you.

The adjustments include turning on both the top-level Hyper-V and the Windows Hypervisor Platform features.

Windows Features will initiate the setup and activation of necessary components for running Hyper-V Manager and its associated VMs. Once complete, Windows Features notifies with “Windows completed the requested changes” and advises a reboot to finalize the setup.

To utilize the Hyper-V platform, restarting the PC is required. This can be readily accomplished by selecting the “Restart now” option.

By clicking “Restart now”, you prepare your PC for Hyper-V VM operations.

After restarting your computer, entering “hyper” in the Start menu search will prominently display Hyper-V Manager, ready for use.

Once your system has rebooted, Hyper-V Manager is set to launch.

Launching Hyper-V Manager from the desktop of its host—often referred to as a local startup—is typically the most straightforward method for setting up a Hyper-V VM. Initially, when Hyper-V Manager is opened for the first time, it displays no Virtual Machines (VMs) as none are configured yet. The main panels within Hyper-V Manager will indicate “No VMs” or “No item.”

Figure 4: When run for the first time, Hyper-V Manager shows precisely nothing.

If you click Quick Create, the top item in the right-hand menu you can soon remedy this situation. By default, Microsoft provides pointers to various predefined runtime environments, including evaluation versions of Windows 10 and 11 aimed at developers and (until early July) three different Long Term Servicing (LTS) branches for Ubuntu Linux (which may be freely offered to anyone who’s interested).

The right-hand side of Figure 5 shows the details for the “Windows 11 dev environment” item, an evaluation copy worth installing as a short-lived example. Select the OS you want to install and click Create Virtual Machine.

Figure 5: Select Windows 11 dev environment (left), then click Create Virtual Machine (lower right).

This downloads a ~21GB Windows image file. (On my Lenovo P16 Mobile Workstation, a 12th-Gen x86 platform, that took about 5 minutes to complete, including image verification.) Then, Hyper-V Manager creates a VM, extracts the virtual boot/system disk, verifies the image again, and completes (this takes another 5 minutes or so), as announced in Figure 6. Click Connect to hook up the new test VM inside Hyper-V Manager.

Figure 6: VM successfully created. Next step: click Connect.

What happens next is that Hyper-V Manager opens a virtual machine window. You must start the VM to turn it on, as shown in Figure 7. If you were using an ISO (covered in a moment), this is when the process of installing Windows inside the VM would occur.

Before you can interact with a VM, you must start it up: click Start!

But because Microsoft has so kindly provided us with a predefined, ready-to-run VM for this development environment, clicking Start launches a boot-up screen (“Getting ready”) that grinds away for a minute or so. After that you’ll be able to log in to a Windows 11 desktop (account name User, no password). There’s your first Hyper-V VM!

Though this takes at least 15 minutes to work through, it’s about as fast and easy as creating a VM ever gets. Figure 8 shows the VM running inside a Hyper-V Virtual Machine Connection window (see the legend on the title bar for confirmation).

Figure 8: The Windows 11 Dev Environment VM start menu shows a developer focus.

Creating a Virtual Machine (VM) from an already existing virtual hard disk (.vhdx file) and its associated settings is straightforward. It essentially involves activating a pre-configured VM that’s ready for use.

An alternative method for setting up VMs is depicted in the mentioned Figure 5. Here, one can click the button at the bottom-left corner of the “Create Virtual Machine” window to access a “Local installation source.” This allows the user to browse through local storage to select an ISO file—a type of digital media storage file format often used for Windows operating systems. For trustworthy download sources, visit “The best places to find Windows ISOs.”

This ISO method permits the selection of any desired Windows version. However, it tends to be more time-intensive as it entails installing the OS onto a new VM, requiring meticulous configuration efforts.

By choosing the Local Installation source as illustrated and directing it to the E: drive where a specific Windows 11 Insider Preview ISO is stored (dated May 30), I set it as a source for creating a Hyper-V VM. The results of this can be viewed in Figure 9, which requires the user to click Create Virtual Machine at the lower right to continue with the installation from a local ISO.

By targeting an ISO through File Explorer, you open VM creation options accessible to the file system.

This time, by clicking Create Virtual Machine, the Hyper-V wizard operates utilizing the ISO. Since I accepted the default settings, this VM is listed as “New Virtual Machine” in the Hyper-V Manager. I right-clicked this label in the top center pane under “Virtual Machines” and chose Rename from the dropdown menu to rename it to “Win11.26100.” It is displayed as such following the change.

Renamed to Win11.26100, indicative of its primary Windows 11 build number, the new VM now requires installation.

When dealing with an ISO file for installation, immediate action is required post-launch. After selecting Connect and pressing the Start button, quickly press any key to initiate the installation. Delay can result in a PXE boot message, halting further progress. Promptness is crucial.

Successful initialization will bring up the “Select language settings” screen of the Windows 11 setup. From there, you will proceed through the installation steps. Note that a valid product key is necessary for the version of Windows being installed.

However, a common issue might arise where a message displays: “This PC doesn’t currently meet Windows 11 system requirements.” This typically stems from the Hyper-V Manager Quick Create not activating the Trusted Platform Module (TPM) by default, which is essential for securing sensitive system data.

Turn off the VM (click Action in the top menu, then click Turn off). In the main Hyper-V Manager screen, select the VM you’re installing (in this case, Win11.26100), then click the Settings option at the lower right. This opens the Settings page for the Win11.26100 VM. Click on Security. In the Security pane, you will see that while Secure Boot is enabled, TPM is not. Check the Enable Trusted Platform Module checkbox. Then click Apply and then OK.

TPM must be enabled before Windows 11 may be installed. Hyper-V Manager neglects to do this by default, so you must do so manually.

Now when you click Connect and get into the installer, it should run to the end.

Once the process is complete (it took another 40 minutes or so on my beefy P16 Mobile Workstation), you’ll see a typical Windows in a VM window. There you are: another VM for your Hyper-V collection.

In addition to the Quick Create option, Hyper-V Manager also offers a New > Virtual Machine option, as shown in the illustration. This provides more direct access to the various settings and selections possible when creating a Hyper-V VM.

The New > Virtual Machine action provides more control over details when creating a new VM.

Using this option opens a New Virtual Machine Wizard that walks you through the entire VM specification process. It allows you to specify a name, choose a file system location, select a VM generation, assign memory, and manage networking, virtual hard disk, and installation details. However, the TPM setting must still be managed manually, as mentioned previously.

The New Virtual Machine Wizard guides users through the VM creation process, covering each setting step-by-step.

In the following examples, I’ll demonstrate creating a new Windows 11 VM for version 24H2 (Build 26100.863), obtained from the Insider Preview downloads page. The Specify Name and Location screen is where I’ve labeled the VM Win11.24H2, utilizing the default storage location for a virtual hard disk file.

Figure 14: The VM name is set to Win11.24H2, after which you click Next to continue.

By default, all Hyper-V VMs are designated Generation 1. Since Generation 1 doesn’t support Windows 11 VM requirements, you must select the Generation 2 radio button to install a Windows 11 VM, as shown in Figure 15.

Figure 15: Click the Generation 2 radio button to meet Windows 11 VM requirements.

The subsequent step involves allocating 8GB (8,192MB) of RAM, which is double the default amount, for the Win11.24H2 virtual machine.

Please increase the defaults to 8GB from the usual 4GB this time.

The next step is to select the Default Switch option for the Connection field under the Configure Networking heading. It’s crucial to understand that the default setting is “Not connected,” which prevents the VM from accessing any networks. Using the Default Switch allows the VM to tap into the same networks the host PC uses. If there are other switches set up in your host environment, they will be available in the dropdown list for selection during this VM configuration.

Figure 17 illustrates the use of the Default Switch to enable network and internet connectivity for the VM.

The following action involves connecting a virtual hard disk for the VM’s use, sticking with the default location previously mentioned. Other available choices include “Use an existing virtual hard disk,” which in this case utilizes the setup from an earlier described development environment, and “Attach a virtual hard disk later,” allowing for the completion of the VM configuration without immediately assigning or connecting a virtual hard drive. Refer to Figure 18 for additional information on Win11.24H2.vhdx.

Figure 18: This represents the default allocation (127GB) for Hyper-V VM virtual hard disks.

Next comes the fun part: providing a file system link to an ISO and electing how (or if) to install that image. This reads “Installation Options” on the left-hand side. In this case, we’ll link to the ISO I downloaded from the Insider Preview downloads page, and tell it to install the OS from that file, as shown in Figure 19.

Figure 19: The selected radio button instructs the installer to find a specific Windows 11 ISO file.

At this point, the wizard is finished, so click Summary on the left to show your work so far. It will show all the settings you’ve made. Click Finish to complete the VM creation process. Then, you’ll return to Hyper-V Manager, where you now see a VM named Win11.24H2 in the upper center “Virtual Machines” pane, as shown in Figure 20.

Figure 20: The new VM, Win11.24H2, is turned off. That’s good!

You could try to start the installation of Win11.24H2 now, but there’s an additional step — you need to enable TPM in the security settings of the new virtual machine, as we mentioned earlier beside Figure 11. Once that’s set, you’re ready to begin the installation of this Windows 11 OS image, as previously outlined in our discussion.

The introduction to using Hyper-V Manager and setting up virtual machines is complete. Let’s move on to the more intricate details.

By nature, accessing any virtual machine (VM) is a remote process – meaning there are no physical devices like a mouse, keyboard, or monitor directly connected to it. Interactions with a VM involve mapping virtual components to actual hardware, including not just peripherals but also CPUs, RAM, storage, and networking among others. It’s crucial to remember that one of the advantages of using VMs is their capability to support remote access through any network to a main hypervisor system.

However, using the Windows remote desktop protocol (RDP) through Remote Desktop Connection or the Remote Desktop app in conjunction with Hyper-V can introduce some complexities. I will outline these challenges, which include difficulty initiating the Windows Installer for an ISO-based setup and the necessity of enabling TPM for the installation process to function properly.

For starters, you can’t start a new Windows 11 VM from inside an RDP session, as it attempts to load and initialize the designated Windows 11 ISO to execute its Setup.exe. Oddly, this is only successful when performed through a local login on the host PC, not over an RDP session. If you attempt to commence the setup by clicking the Start button referenced as Figure 7 within an RDP session, the VM will fail to boot and commence Setup.exe.

If you click Start, a black screen will appear in the VM window rather than initiating the Windows 11 installation process. You must first shut down the VM (select Action in the top menu, then Turn off). You should then activate the Start button indicated in Figure 7 directly from the host PC, utilizing the local mouse or keyboard. After Setup.exe is operational, the VM can be accessed through an RDP session as typical, displaying the initial Windows 11 installation interface.

Once Setup.exe is active, you have the option to connect to the VM via RDP, as per your preference.

The next challenge arises after you select the Install now option. At this point, you’ll realize that it’s impossible to copy and paste a Windows activation key into the Activate Windows dialogue as shown in a sample figure. This limitation exists because such functionality is only available in an enhanced session within RDP, which is not accessible until after Windows 11 has been installed. Overcoming this issue involves adjusting the Windows Hello login settings, which are initially enabled by default but incompatible with enhanced sessions that allow clipboard sharing from outside to within the RDP session.

At the key input stage in the Activate Windows screen, you will find that manual input is your only option as text copying and pasting is disabled.

You must manually type the 25-character mix of letters and numbers of your chosen Windows key. Alternatively, you could opt for the 30-day evaluation version of the Windows 11 developer environment, which requires no activation key but offers limited access duration.

But there’s one more RDP complication to tackle: you’re unable to log into your new desktop unless you deselect the “Enhanced session” option in the View menu for the RDP session. After doing this and logging in, navigate to Settings > Accounts > Sign-in options, and disable the toggle located under “Additional settings” that states For improved security…. Following these steps allows you to reactivate the enhanced session and log in utilizing a password or PIN.

Note that the “Enhanced session” in the View menu up top should be unchecked. Disable the toggle under “Additional settings.” Afterward, you can reactivate that option which enables cut and paste functionality in RDP.

With our prior steps in this story, you now have functioning Windows 11 VMs, primarily set up using the default settings in Hyper-V Manager. By establishing the standard, default Win11.26100 VM through Quick Create and the slightly altered Win11.24H2 VM via the New Virtual Machine Wizard, you gain insights into the workings of VMs, including provisioning defaults.

Those defaults will change according to the configuration of the host physical PC on which Hyper-V Manager runs. That is, machines with fewer cores, less RAM, and less storage will produce default VMs with fewer cores, less RAM, and less storage than those machines with more cores, more RAM and more storage, like the formidable Lenovo P16 Mobile Workstation I used as my test machine, with 24 cores, 64GB RAM, and ~4 TB total storage, 2 TB on the boot/system drive.

In most cases, the defaults that Hyper-V Manager chooses for the VMs it creates on your behalf work reasonably well. For those already familiar with Hyper-V, feel free to change values up or down. IMO, reducing values from their defaults doesn’t make too much sense except perhaps for special cases (or underwhelming physical PCs).

For more info on Hyper-V and VMs: Microsoft Learning offers a free 45-minute module entitled Configure and Manage Hyper-V virtual machines for those who want more details. Also, there’s a series of tutorials at Windows 11 Forum under its Virtualization heading (54 in all, across a range of VM topics) for those who really want all the minutiae.

When Microsoft released v0.13 of its Dev Home (Preview) developer toolbox on April 23, 2024, I noticed they added support for “Environments” as something new. Microsoft explains that environments provide the ability to create, manage, and configure Hyper-V VMs and Microsoft Dev Boxes (see the GitHub Dev Home Preview v0.13 release notes).

Many may overlook the benefits of Dev Boxes, a service provided by Azure designed to boost developer productivity by offering self-service access to preconfigured, cloud-based development environments. This service requires an Azure subscription. For those interested in using Hyper-V VMs, it’s important to remember that these require Windows 11 22H2 or later versions.

Having experienced various obstacles with VM creation and use via Hyper-V Manager, I was curious to try out Dev Home (Preview) to see if it offered a smoother experience. I accessed Dev Home remotely using an RDP session on another computer. Within Dev Home, I navigated to the Environments option, identifiable by a small blue highlight bar on its left.

Here, I found a display of existing VMs and an option to create a “New Virtual Machine.”

Dev Home successfully displayed all VMs previously configured on the P16, indicating their statuses such as Stopped, Running, or Saved. It appears these are considered “Environments” by the application. Notably, by clicking the Create Environment button located at the upper right, the process to set up a new Hyper-V VM is expedited:

This description highlights that the source for the new VM is the Microsoft-provided “Windows 11 dev environment.”

After initiating the creation of the environment by pressing the Create Environment button, be ready for a significant wait time. Dev Home needs to download the large Windows 11 dev environment file, which is over 20GB, then proceed to unpack the files it contains. On the P16 Mobile Workstation, this process took about 15 minutes. During the download, Dev Home provides updates on the progress, as observed in a display showing the download at 76% completion.

Progress in downloading the ISO for the Windows 11 dev environment stands at 76%.

When the extraction process ends, the ISO is mounted and the VM ready to launch. You’ll see Environment information for your new VM (NewVM2, in this case) like that shown in the next figure. You must click the Launch button (far right) to start the VM installation process.

Click the Launch button to fire off the Windows installer for the VM’s OS.

When you do that, a small VM window opens to present you with a Start button to fire things off. Click that Start button!

Click the Start button to put Setup.exe to work to install the VM’s OS.

This starts the VM, which fires off the ISO image’s Setup.exe, at which point you’ll see a larger VM window labelled Hyper-V and a circular progress indicator. Then, you’ll be asked to size the VM window for further display (I recommend at least 1680 x 1050). At this point, a login window for a generic “User” (no password) appears. Remarkably, this took two minutes or less to complete. Click Sign in to get to the desktop.

Because the predefined User account requires no password, click “Sign in” and you’re done.

The next thing you’ll see is the NewVM2 desktop, a mostly bare-bones Windows 11 install that also includes Visual Studio 2022 and Ubuntu on Windows. It’s running the current build as I write this for an Enterprise Evaluation (22621.3447) version. I also checked: you cannot use a valid Windows 11 Enterprise key to activate this install (it rejects all keys).

But here we are, having installed a working Hyper-V VM for Windows 11 from start to finish inside an RDP session! Thus, the Dev Home approach completely sidesteps all gotchas one encounters when using Hyper-V manager, to wit:

There’s just one problem: Dev Home environments don’t let you grab an arbitrary local ISO on a drive. You can only use Environments that Microsoft makes available (these are essentially the same as the “gallery images” shown in Figure 9 earlier in this story).

For any other Windows images you might want to run as VMs, you must use Hyper-V Manager and its quick or slow create processes — that is, unless Microsoft responds to my feature request to add access to local ISOs to Dev Home’s existing image options when creating a VM.

What I learned from digging into Dev Home and its capabilities — especially when using RDP — is that it’s entirely possible for Microsoft to update and rationalize its Hyper-V VM creation process. Whether or not they choose to do so is up to them. I certainly hope they’ll figure this out, and do just that.

Ideally, Microsoft would update Hyper-V Manager to be compatible and user-friendly with Windows 11. Additionally, incorporating local ISO access for image selection in Dev Home would be beneficial. I would appreciate any one of these updates, as modifications to a VM created in Dev Home can still be made in Hyper-V Manager through various settings options. While it would be excellent to see both enhancements, my expectations are tempered.


Posted

in

by

Tags: