Solved Hyper-V TPM issue with Windows 11 on new device


cereberus

Well-known member
Guru
VIP
Local time
11:21 AM
Posts
5,709
OS
Windows 10 Pro + others in VHDs
I transferred by Windows 11 Hyper-V vm configuration files to a new device as I have done a number of times with Windows 10, but I cannot get it to work properly with Windows 11.
The vms work fine if the TPM is switched off, but if on it fails to open them coming up with an error as below:

1683463860991.png

I have tried all sorts e.g. turning off tpm on original device and exporting vm and reimporting etc.

I cannot find the log and lookimg on web does not help (over my head - all sysadmin stuff).

Any help appreciated.
 

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0
@FreeBooter, @Brink, @Kari, @Bree (and other regulars)

I solved the problem. It was fairly easy.

It was a little unclear from the text if I did these command on the Host, or on the Guest, so I tried it on Host, and it worked first time.

Fortunately, I still had my original device cloned in a native boot vhd.


I am not certain if it will work for all my vms - so far I have only tested ones cloned from the host.

Edit: I just quickly fired up each of my vms and they started ok.

So, you only seem to need to export the 2 certificates on the original device, then import them on new device.

I found this guide easier to follow than others.

So here is how it is done.

On device 1:

Step 1 - get Certificate IDs
Code:
certutil -store “Shielded VM Local Certificates”

You get lines like this for certificate 0 and certificate 1

Certificate 0 has a line:- Serial Number: 700d6aee61be9fa141c382ee51a93f47
Certificate 1 has a line:- Serial Number: 1f7c5b3e7055f4b8459939d3a7349bac

Step 2 - Export Certificates
Create a temporary folder on original device

(say) C:\Temp

Now export certificates (remember password SuperDuperPassword!

Export Certificate 0 replace serial number with above
Code:
certutil -exportpfx -p “SuperDuperPassword!” “Shielded VM Local Certificates” 700d6aee61be9fa141c382ee51a93f47 C:\Temp\ShieldedVMEncryption.pfx

Certificate 1 replace serial number with above
Code:
certutil -exportpfx -p “SuperDuperPassword!” “Shielded VM Local Certificates” 1f7c5b3e7055f4b8459939d3a7349bac C:\Temp\ShieldedVMSigning.pfx

You now have a folder c:\temp on original device with 2 files: ShieldedVMEncryption.pfx & ShieldedVMSigning.pfx

Step 3 - Import certificates

Copy the C temp folder to new device/

Export Certificate 0
Code:
certutil -importpfx "Shielded VM Local Certificates" c:\Temp\ShieldedVMEncryption.pfx

You need to enter password here.

Export Certificate 1
Code:
certutil -importpfx "Shielded VM Local Certificates" c:\Temp\ShieldedVMSigning.pfx

You need to enter password here.

Step 4 - Start up VMs
Startup VMs with TPM Enabled, and they now work fine (did for me).

@Brink - maybe a future tutorial?
 
Last edited:

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0
I am not certain if it will work for all my vms - so far I have only tested ones cloned from the host.
It should do. I first ran into that problem a couple of years ago when migrating my VMs from my old host machine to it's Windows 11 replacement. One W11 VM had the issue, all the rest migrated OK.

 

My Computers

System One System Two

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Acer Aspire 3 A315-23
    CPU
    AMD Athlon Silver 3050U
    Memory
    8GB
    Graphics Card(s)
    Radeon Graphics
    Monitor(s) Displays
    laptop screen
    Screen Resolution
    1366x768 native resolution, up to 2560x1440 with Radeon Virtual Super Resolution
    Hard Drives
    1TB Samsung EVO 870 SSD
    Internet Speed
    50 Mbps
    Browser
    Edge, Firefox
    Antivirus
    Defender
    Other Info
    fully 'Windows 11 ready' laptop. Windows 10 C: partition migrated from my old unsupported 'main machine' then upgraded to 11. A test migration ran Insider builds for 2 months. When 11 was released on 5th October it was re-imaged back to 10 and was offered the upgrade in Windows Update on 20th October. Windows Update offered the 22H2 Feature Update on 20th September 2022. It got the 23H2 Feature Update on 4th November 2023 through Windows Update.

    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, supported device running Windows 11 Pro (and all my Hyper-V VMs).

    My SYSTEM FOUR is a 2-in-1 convertible Lenovo Yoga 11e 20DA, Celeron N2930, 8GB RAM, 256GB ssd. Unsupported device: currently running Win10 Pro, plus Win11 Pro RTM and Insider Beta as native boot vhdx.

    My SYSTEM FIVE is a Dell Latitude 3190 2-in-1, Pentium Silver N5030, 4GB RAM, 512GB NVMe ssd, supported device running Windows 11 Pro, plus the Insider Beta, Dev, and Canary builds as a native boot .vhdx.
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Lattitude E4310
    CPU
    Intel® Core™ i5-520M
    Motherboard
    0T6M8G
    Memory
    8GB
    Graphics card(s)
    (integrated graphics) Intel HD Graphics
    Screen Resolution
    1366x768
    Hard Drives
    500GB Crucial MX500 SSD
    Browser
    Firefox, Edge
    Antivirus
    Defender
    Other Info
    unsupported machine: Legacy bios, MBR, TPM 1.2, upgraded from W10 to W11 using W10/W11 hybrid install media workaround. In-place upgrade to 22H2 using ISO and a workaround. Feature Update to 23H2 by manually installing the Enablement Package. Also running Insider Beta, Dev, and Canary builds as a native boot .vhdx.

    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, supported device running Windows 11 Pro (and all my Hyper-V VMs).

    My SYSTEM FOUR is a 2-in-1 convertible Lenovo Yoga 11e 20DA, Celeron N2930, 8GB RAM, 256GB ssd. Unsupported device: currently running Win10 Pro, plus Win11 Pro RTM and Insider Beta as native boot vhdx.

    My SYSTEM FIVE is a Dell Latitude 3190 2-in-1, Pentium Silver N5030, 4GB RAM, 512GB NVMe ssd, supported device running Windows 11 Pro, plus the Insider Beta, Dev, and Canary builds as a native boot .vhdx.
It should do. I first ran into that problem a couple of years ago when migrating my VMs from my old host machine to it's Windows 11 replacement. One W11 VM had the issue, all the rest migrated OK.

Crossed in the post - worked fine.
 

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0
It should do. I first ran into that problem a couple of years ago when migrating my VMs from my old host machine to it's Windows 11 replacement. One W11 VM had the issue, all the rest migrated OK.

I read that old post, and I have done a bit more testing.

On other vm software, when you create a vm, you can select if it has a tpm or not.

With Hyper-V on Windows 11, it always assumes tpm is there as you create a vm, but you can turn it off after the vm is created. However even if you turn it off once vm is created, it seems you still need the certificates if you move vm to a new device.

I booted into Windows 10 and created a vm (in a different location) and installed Window 10. It's default on creation was NO TPM.

I booted into Windows 11, and imported the vm, and now the TPM was on. It started fine with no need to use certificates.

I then went back to Hyper-V in Windows 10, and installed Windows 11 - I had to turn on TPM to do this.

As I expected it, when I imported into Hyper-V on Windows 11, with TPM on, it complained (unwrapping error needing certificates).

Now this is where it gets interesting - I went back to Windows 10, turned off tpm for the windows 11 vm.
I then imported it to W11, and rather to my surprise, it installed fine and started ok!

So it seems Hyper-V in Windows 10 works differently to Windows 11

W10 - TPM off by default
W11 - TPM on by default.

W10 - vms created on W10 (regardless of version) need certificates when exported depending on if vm was saved with No TPM or with a TPM.
W11 - vms created on W11 (regardless of version) always need certificates when exported regardless if vm was saved with No TPM or with a TPM. Note: VMs will run if TPM is switched off

I guess this was to enhance security but it is blinking obscure to say the least. Of course, it could be a bug?

My basic conclusion is if you create vms on W11 and export to another W11 device, you will need to certificates unless you turn off vpm.
As we know, build upgrades to W11 require the TPM to be on by WU, unless you do a manual upgrade with an iso.

Here is the most crucial point if moving vms to a new device - make sure you have exported the (host) certificates before getting rid of old device (always a good plan to have an image backup or vhdx of old device).
 

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0
On my Windows 10 Pro desktop I upgraded the CPU, RAM, and GPU. I had several Hyper-V VMs including Windows 11. None of them would work anymore. If I had exported the (host) certificates before I did the upgrade and then import them after I upgraded the hardware allow the original VMs to work? Was my problem essentially the same as the OPs one?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2
    Computer type
    Laptop
    Manufacturer/Model
    ASUS TUF Gaming A15 (2022)
    CPU
    AMD Ryzen 7 6800H with Radeon 680M GPU (486MB RAM)
    Memory
    Micron DDR5-4800 (2400MHz) 16GB (2 x 8GB)
    Graphics Card(s)
    NVIDIA RTX 3060 Laptop (6GB RAM)
    Sound Card
    n/a
    Monitor(s) Displays
    15.6-inch
    Screen Resolution
    1920x1080 300Hz
    Hard Drives
    2 x Samsung 980 (1TB M.2 NVME SSD)
    PSU
    n/a
    Mouse
    Wireless Mouse M510
    Internet Speed
    1200Mbps/250Mbps
    Browser
    Firefox
    Antivirus
    Malwarebytes
  • Operating System
    Windows 11 Pro 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom build
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    ASUS PRIME X370-PRO
    Memory
    G.SKILL Flare X 32GB (2x16GB) DDR4
    Graphics card(s)
    ASUS ROG-STRIX-RTX3060TI-08G-V2-GAMING (RTX 3060-Ti, 8GB RAM)
    Monitor(s) Displays
    Samsung S23A300B (23-in LED)
    Screen Resolution
    1080p 60Hz
    Hard Drives
    2TB XPG SX8200 Pro (M2. PCIe SSD) || 2TB Intel 660P (M2. PCIe SSD) ||
    PSU
    Corsair RM750x (750 watts)
    Case
    Cooler Master MasterCase 5
    Cooling
    Corsair H60 AIO water cooler
    Mouse
    Logitech K350 (wireless)
    Keyboard
    Logitech M510 (wireless)
    Internet Speed
    1200 Mbps down / 200 Mbps up
    Browser
    Firefox, Edge, Chrome
    Antivirus
    Malwarebytes (Premium)
    Other Info
    ASUS Blu-ray Burner BW-16D1HT (SATA) || Western Digital Elements 12TB USB 3.0 external hard drive used with Acronis True Image backup software || HP OfficeJet Pro 6975 Printer/Scanner
On my Windows 10 Pro desktop I upgraded the CPU, RAM, and GPU. I had several Hyper-V VMs including Windows 11. None of them would work anymore. If I had exported the (host) certificates before I did the upgrade and then import them after I upgraded the hardware allow the original VMs to work? Was my problem essentially the same as the OPs one?
There are several steps you need to do (before upgrade). I learnt all this by trial and error LOL:

1) export all vms to a different folder to get a copy of them

2) export the 2 Host certificates and store on a different drive (even external drive) as per this tutorial

3) delete the vms in Hyper-V virtual machines folder (you need to do this so you can import again). If you try and delete after upgrade, it can get tangled up and things go screwy (I have a few T-shirts on this one LOL). Do not delete the virtual machines.

4) upgrade

5) import the 2 certificates

6) import vms from copies in step 1.

7) Sometimes you need to turn vm off an on a couple of times for it to start.

8) Very occasionally, you may need to repair the boot files on vhdx file - I boot from a Macrium Reflect iso in vm and use its repair boot file option. You need to set Hyper-V to boot from the Reflect iso first.

Unfortunately, you have already upgraded, so it is too late unless you have an image backup of old device. Maybe you can fire up imsage of old device in a virtual machine?

Most important thing is having a safe copy of the vm config files and the certificates (I have them on onedrive).
 

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0
There are several steps you need to do (before upgrade). I learnt all this by trial and error LOL:

1) export all vms to a different folder to get a copy of them

2) export the 2 Host certificates and store on a different drive (even external drive) as per this tutorial

3) delete the vms in Hyper-V virtual machines folder (you need to do this so you can import again). If you try and delete after upgrade, it can get tangled up and things go screwy (I have a few T-shirts on this one LOL). Do not delete the virtual machines.

4) upgrade

5) import the 2 certificates

6) import vms from copies in step 1.

7) Sometimes you need to turn vm off an on a couple of times for it to start.

8) Very occasionally, you may need to repair the boot files on vhdx file - I boot from a Macrium Reflect iso in vm and use its repair boot file option. You need to set Hyper-V to boot from the Reflect iso first.

Unfortunately, you have already upgraded, so it is too late unless you have an image backup of old device. Maybe you can fire up imsage of old device in a virtual machine?

Most important thing is having a safe copy of the vm config files and the certificates (I have them on onedrive).
I will a note of this for future reference. I forgot the emphasize that I only updated the CPU, RAM, and GPU. The motherboard stayed the same. I didn't reinstall Windows after the hardware upgrades. Since Windows itself was not changed then maybe there was a change in the hardware signature that caused the problem. Does that make any sense?

2023-05-08 16_24_25-Document1 - Word.jpg
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2
    Computer type
    Laptop
    Manufacturer/Model
    ASUS TUF Gaming A15 (2022)
    CPU
    AMD Ryzen 7 6800H with Radeon 680M GPU (486MB RAM)
    Memory
    Micron DDR5-4800 (2400MHz) 16GB (2 x 8GB)
    Graphics Card(s)
    NVIDIA RTX 3060 Laptop (6GB RAM)
    Sound Card
    n/a
    Monitor(s) Displays
    15.6-inch
    Screen Resolution
    1920x1080 300Hz
    Hard Drives
    2 x Samsung 980 (1TB M.2 NVME SSD)
    PSU
    n/a
    Mouse
    Wireless Mouse M510
    Internet Speed
    1200Mbps/250Mbps
    Browser
    Firefox
    Antivirus
    Malwarebytes
  • Operating System
    Windows 11 Pro 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom build
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    ASUS PRIME X370-PRO
    Memory
    G.SKILL Flare X 32GB (2x16GB) DDR4
    Graphics card(s)
    ASUS ROG-STRIX-RTX3060TI-08G-V2-GAMING (RTX 3060-Ti, 8GB RAM)
    Monitor(s) Displays
    Samsung S23A300B (23-in LED)
    Screen Resolution
    1080p 60Hz
    Hard Drives
    2TB XPG SX8200 Pro (M2. PCIe SSD) || 2TB Intel 660P (M2. PCIe SSD) ||
    PSU
    Corsair RM750x (750 watts)
    Case
    Cooler Master MasterCase 5
    Cooling
    Corsair H60 AIO water cooler
    Mouse
    Logitech K350 (wireless)
    Keyboard
    Logitech M510 (wireless)
    Internet Speed
    1200 Mbps down / 200 Mbps up
    Browser
    Firefox, Edge, Chrome
    Antivirus
    Malwarebytes (Premium)
    Other Info
    ASUS Blu-ray Burner BW-16D1HT (SATA) || Western Digital Elements 12TB USB 3.0 external hard drive used with Acronis True Image backup software || HP OfficeJet Pro 6975 Printer/Scanner
I will a note of this for future reference. I forgot the emphasize that I only updated the CPU, RAM, and GPU. The motherboard stayed the same. I didn't reinstall Windows after the hardware upgrades. Since Windows itself was not changed then maybe there was a change in the hardware signature that caused the problem. Does that make any sense?

View attachment 59702
Yeah - all the stuff about copying vms and reimporting was for new devices. I cannot see any obvious reason why your vms did not work after the upgrade.

Maybe all that was needed was to fix the boot entries.

I guess we will never know.
 

My Computer

System One

  • OS
    Windows 10 Pro + others in VHDs
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Vivobook 14
    CPU
    I7
    Motherboard
    Yep, Laptop has one.
    Memory
    16 GB
    Graphics Card(s)
    Integrated Intel Iris XE
    Sound Card
    Realtek built in
    Monitor(s) Displays
    N/A
    Screen Resolution
    1920x1080
    Hard Drives
    1 TB Optane NVME SSD, 1 TB NVME SSD
    PSU
    Yep, got one
    Case
    Yep, got one
    Cooling
    Stella Artois
    Keyboard
    Built in
    Mouse
    Bluetooth , wired
    Internet Speed
    72 Mb/s :-(
    Browser
    Edge mostly
    Antivirus
    Defender
    Other Info
    TPM 2.0

Latest Support Threads

Back
Top Bottom