Autopilot Lab Part 1/5 – Setup Hyper-V host and VMPosted on: January 1, 2019, by : Aad Lutgert
- Installation Media (ISO) of Windows 10 (download here)
- Internet Access
- A Computer capable of running a Hypervisor.
Prepare the Hyper-V host
1. Close and Save all your work before you proceed. Your computer needs to restart to enable Microsoft Hyper-V
2. Run Powershell Prompt as Administrator and run the following command to enable Hyper-V on your computer
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
After your computer has rebooted run Powershell as Administrator and proceed.
3. Run the following command to get network adapter with internet access of your computer.
4. Use the following command to create the Networkswith the VM will be using. Replace the name in the switch with your adaptername:
New-VMSwitch -Name Autopilotswitch -NetAdapterName <Name of Network Adapter with internet access> -AllowManagementOS $true
In this example it will be the:
New-VMSwitch -Name AutopilotSwitch -NetAdapterName Wi-Fi -AllowManagementOS $true
Prepare a Windows 10 VM
5. Use the following command to create the Windows 10 VM. Change the NewVHDPath and the Path to the folder where you would like to store VMData.
New-VM -Name Win10-Autopilot -MemoryStartupBytes 2GB -BootDevice VHD -NewVHDPath .\VMs\Win10-Autopilot.vhdx -Path .\VMData -NewVHDSizeBytes 80GB -Generation 2 -Switch AutopilotSwitch
6. Use the following command to mount the windows 10 ISO to the new VM. Change the path to where the iso is stored.
Add-VMDvdDrive -Path <Path to Windows 10 ISO> -VMName Win10-Autopilot
Open the Hyper-V Manager and select Win 10-Autopilot VM -> Settings
When you do not see any vm’s you first need to connect to the local hypervisor.
(Rightclick Hyper-V Manager -> connect to Server -> Local computer)
8. Now we need to change the bootorder. Select “Firmware” (Hardware) and select the “DVD Drive”. Move the DVD-Drive to the top and press “OK” to close the window.
9. Select the VM and press “Connect”
10. power on the vm and boot from the media to start Windows setup.