John Liu Blog

Every drop counts

Hyper-v: Convert Generation 1 VM to Generation 2 VM

If you have VM in Generation 1 format, you might want to convert it to Generation 2 format to utilise new futures. For example, Windows11 requires the VM in Gen2 format to be able to enalbe Secure Boot and Trusted Platform Module (TPM). To check if your VM is Gen1 or Gen2, run following PowerShell command. Get-VM | select vmname, generation We can’t directly convert Gen1 VM to Gen2 VM.

Hyper-v: Connect Host and Guest

To have network connectivity between Hyper-v host and guest, do the following steps: In Hyper-v Manager, click on Virtual Switch Manager, and create a new (if not already) Internal virtual switch. Enable VLAN ID. In the VM guest setting, configure a Network Adapter to use this Internal virtual switch. In host computer, in Control Panel, configure IPV4 address for the Internal netowrk created above step 1. No default gateway setting required.

Run VMWare and Docker on the same computer

You can install VMWare Workstation (v15.4 or earlier) and Docker on the same computer, but they can’t be run at the same time due to VMWare and Hyper-V can’t be run at the same time. Docker depends on Hyper-V. To run VMWare Workstation, turn off Windows features “Virtual Macine Platfrorm” and “Microsoft-Hyper-V-All” and then restart computer. PS C:\> Disable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-All" -NoRestart PS C:\> Disable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform" To run Docker, turn on Windows feature “Virtual Macine Platfrorm” and “Microsoft-Hyper-V-All” and then restart computer.