Configure a VM for a lab Intune
Context
I wanted to enroll a virtual machine (VM) for my lab Intune.
To do this, I chose to use Hyper-V to familiarize myself with this tool instead of continuing with VMware Workstation, which I always used at IPI school.
Key Takeaway
Hyper-V is a native virtualization solution integrated into Windows, ideal for professional environments and virtual machine testing. Hyper-V is free with Windows Pro/Enterprise, whereas VMware Workstation requires a paid license.
Prerequisites
To use Hyper-V on my PC, the following prerequisites are required:
- A PC running one of the following versions of Windows: Windows 10/11 Enterprise, Windows 10/11 Education, or Windows 10/11 Pro.
- A 64-bit processor that supports Second Level Address Translation (SLAT).
- A processor compatible with virtualization extensions, such as Intel VT-x.
- At least 4 GB of RAM, though 8 or 16 GB is recommended for better performance.
Enable Hyper-V using optionalfeatures.exe
I ran PowerShell as Administrator to execute the following command, which forces Windows' Boot Configuration Data (BCD) to load the hypervisor automatically at startup.
Next, I ran the optionalfeatures.exe
command to enable Hyper-V and restarted my PC.
Check systeminfo
Before starting, I ran the systeminfo
command to ensure everything was ready on my PC.
Hyper-V Manager
After rebooting, I could see the Hyper-V Manager.
Configure a Virtual Network Switch
Hyper-V offers three types of virtual switches, each with specific use cases:
-
External Virtual Switch
This type of switch allows the virtual machine to use one of the physical network adapters on my PC (RJ45 Ethernet or Wi-Fi). This gives the VM access to the same network connection as my PC, including Internet access. -
Internal Virtual Switch
With this type of switch, the virtual machine can communicate with the Hyper-V host (my PC) and other virtual machines connected to the same switch. However, it will not have access to the external network connection of my PC. -
Private Virtual Switch
This switch offers a higher level of isolation. Virtual machines connected to this type of switch can only communicate with each other, without interaction with the Hyper-V host or the external network.
To enroll my virtual machine, it needs Internet access.
So, I created an "External" virtual switch.
I selected my network adapter (RJ45).
Then I applied the changes.
Creating a VM for my lab Intune
Instead of using the "Quick Create" feature in Hyper-V, I preferred to manually download the ISO from Microsoft and perform the installation myself.
Then, I clicked on "New > Virtual Machine."
I named the VM.
I chose Generation 2.
For RAM, I allocated 4 GB and unchecked the dynamic memory option because I didn’t want the VM to use more than 4 GB, as I fixed this value.
I selected the switch I created earlier.
I created the VHDX and allocated 70 GB for storage.
Very important: Windows 11 requires a minimum of 64 GB. Otherwise, it won’t work.
I selected the ISO I downloaded and clicked "Finish."
Before starting the VM, I enabled Secure Boot + Trusted Platform Module; otherwise, the installation wouldn’t proceed.
Starting the VM
Once the VM was created, I started it and pressed a key continuously to boot from the ISO.
I selected the AZERTY keyboard layout.
I clicked "Install Windows 11" and checked the box.
On the product key request page, I chose "I don't have a product key" since this is a test VM.
I selected the Pro version. If I kept the Home version, I wouldn’t be able to enroll the VM in my lab Intune.
I clicked "Accept."
I clicked "Next."
Finally, I clicked "Install."
After a coffee break, I arrived at the country selection page.
This is the page where I can start a Windows Autopilot!
Very important: First, take a snapshot with "Ctrl + N." If needed, you can always return to this "fresh" state.