Cart0

Windows · fix · 8 min read

How to Fix Windows Cannot Read the ProductKey Error in VirtualBox

Updated

How to Fix Windows Cannot Read the ProductKey Error in VirtualBox

Short answer: The VirtualBox product key error comes from a broken answer file. VirtualBox writes it for unattended installs when the key field is empty. Power off the VM, uncheck Floppy in the boot order and delete the files starting with "Unattended". Then boot from the ISO. To prevent it, we'd tick "Skip Unattended Installation".

You click OK on the VirtualBox product key error. The VM restarts, and the same message is back. Again and again. The VirtualBox product key error has nothing to do with your ISO or your license. No reinstall of VirtualBox needed.

  • Delete the generated “Unattended” files and uncheck Floppy.
  • Patch the win_nt6_unattended.xml template.
  • Skip unattended installation.

“Windows cannot read the <ProductKey> setting from the unattend answer file. Clicking OK reboots the machine.”

VirtualBox wrote an answer file for an unattended install, and the key block inside it is empty. Windows Setup can’t read that. Below are the three ways we fix it: delete the generated files, patch the template, or skip unattended mode.

Point What to know
Source of the error VirtualBox’s unattended installation, not the ISO or the license
Quick fix Power off the VM, remove the floppy from the boot order, delete every file starting with “Unattended” in the VM folder, boot from the ISO
Permanent fix Comment out the Key line in win_nt6_unattended.xml, after a backup
Simplest prevention Tick “Skip Unattended Installation” in the New VM wizard, or type a valid key when you create the VM

Which of the three fixes to pick

Situation Fix What it changes
One VM is already stuck in the loop Delete the generated files and uncheck Floppy Only that VM
You create Windows VMs every week Patch the template Every new VM on this host
You’re about to create a single VM Skip unattended installation Nothing; no answer file gets written
You have a key at hand Type it in the wizard The answer file gets a valid Key element

The message shows up before anything is installed. So nothing inside the VM is at risk yet.

Where the VirtualBox product key error comes from

A malformed answer file. Unattended installation is on. The product key field is empty. VirtualBox then generates an XML file whose ProductKey section has no Key element.

Windows Setup can’t parse that section. It shows the error and reboots, and the loop repeats on every boot.

VirtualBox 7.0 moved unattended installation into the New Virtual Machine wizard. The step is switched on whenever you pick a Windows ISO.

Older 6.x builds offered the same feature through a command:

VBoxManage unattended install

The idea is nice: VirtualBox answers the setup screens for you. Leave the key box blank, though, and the generated file comes out broken. It looks something like this:

<UserData>
    <ProductKey>
        <WillShowUI>OnError</WillShowUI>
    </ProductKey>
    <AcceptEula>true</AcceptEula>
</UserData>

See the missing Key tag? Windows reads that, gets confused and throws the error. Reboot. Same thing again.

VirtualBox feeds the file to Setup through a virtual floppy drive. That’s why removing the floppy from the boot order is part of the fix.

How to fix the VirtualBox product key error quickly

Most people are done in about three minutes. No need to reinstall VirtualBox or recreate the VM.

Six numbered steps of the quick fix for the VirtualBox product key error, from powering off the VM to skipping the product key screen.
Illustration: the six-step quick fix that clears the VirtualBox product key error without recreating the VM.
  1. Shut the VM down completely. Right-click it in VirtualBox Manager and choose Stop, then Power Off. The state must read Powered Off, not Saved.
  2. Open Settings, or press Ctrl + S with the VM selected. Go to System, Motherboard and uncheck Floppy in Boot Order. That floppy is where the broken answer file lives.
  3. Open the VM folder on disk. The paths are in the table below.
  4. Delete every file that starts with “Unattended”. Usually there are one to three of them, with timestamps in their names, plus an aux image.
  5. Start the VM. If a warning about a missing medium pops up, click OK. When “Press any key to boot from CD or DVD” appears, press a key quickly.
  6. On the product key screen, click the small link “I don’t have a product key” and finish setup. Add your key later in Settings.
Item Where or what
VM folder on a Windows host C:\Users\YourUsername\VirtualBox VMs\YourVMName\
VM folder on macOS and Linux ~/VirtualBox VMs/YourVMName/
Typical file name Unattended-2025-01-15T10-30-00.xml

“Press any key” flashes past, and the VM drops into the EFI shell? Use Machine, Reset and keep tapping a key as the VM starts. On EFI VMs the prompt lasts only a few seconds.

Stopping the VirtualBox product key error for every new VM

Creating VMs often? Repeating the quick fix gets old fast. The lasting fix is in the template VirtualBox uses to build answer files.

The file is win_nt6_unattended.xml, in the UnattendedTemplates folder. It sits in a different place on each host.

Host OS Template folder
Windows C:\Program Files\Oracle\VirtualBox\UnattendedTemplates\
macOS /Applications/VirtualBox.app/Contents/MacOS/UnattendedTemplates/
Linux usually /usr/share/virtualbox/UnattendedTemplates/ (varies between distros)
  1. Copy the file somewhere safe before touching it.
  2. Open it with admin or root rights. On Windows, run Notepad as administrator first, then open the file from inside Notepad.
  3. Find the line that inserts the Key element. It’s the first line in the listing below.
  4. Comment it out, as in the second line.
  5. Save and close.
<Key>@@VBOX_INSERT_PRODUCT_KEY_ELEMENT@@</Key>
<!-- <Key>@@VBOX_INSERT_PRODUCT_KEY_ELEMENT@@</Key> -->

New Windows VMs created without a key then boot to the normal product key screen. No loop.

VirtualBox updates often overwrite the template folder. After upgrading to a new 7.x release, we’d check the line again or copy the edited file back in.

Skipping unattended installation in the New VM wizard

You can. In the New Virtual Machine wizard, choose the Windows ISO and tick “Skip Unattended Installation”.

VirtualBox then writes no answer file and attaches no floppy image. Windows Setup runs exactly as on a physical PC, product key screen included. It costs a few extra clicks and nothing else.

For one VM with no need for automation, we’d call this the cleanest route. Setup asks for language, edition and disk. You click “I don’t have a product key” or type yours.

Settings for a Windows 11 guest

Windows 11 checks for all three. Our Windows 11 hardware requirements guide lists the full set.

Generic keys for test VMs

Microsoft publishes Generic Volume License Keys, GVLKs for short. They let Windows Setup continue without stopping for a key.

Type one in the VirtualBox wizard, and the answer file gets a valid Key element. The error never appears.

A GVLK installs the edition. It activates only against a KMS host on your network, never as a retail license.

EditionGVLK (KMS client setup key)Copy
Windows 11 / Windows 10 ProW269N-WFGWX-YVC9B-4J6C9-T83GX
Windows 11 / Windows 10 EnterpriseNPPR9-FWDCX-D2C8J-H872K-2YT43
Windows Server 2025 StandardTVRH6-WHNXV-R9WG3-9XRFY-MY832
Windows Server 2025 DatacenterD764K-2NDRG-47T6Q-P8T8W-YP6DF
Windows Server 2022 StandardVDYBN-27WPP-V4HQT-9VMD4-VMK7H
Windows Server 2022 DatacenterWX4NM-KYWYW-QJJR4-XV3QB-6VM33

These come from Microsoft’s own KMS client activation keys list, not from a keygen. Without a KMS server, though, the VM stays unactivated.

For a VM you plan to keep and use daily, a retail key is the practical answer. You can switch later in Settings, or from the command line.

Need a key? Our Windows 11 Pro key comes as a genuine license. We email it instantly after payment.

Other errors from the same answer file

Several setup errors share this root cause: a broken or unexpected answer file.

Symptom What’s behind it What to do
“Windows cannot find Microsoft Software License Terms” The same broken XML, a different message Use the fixes above
The VM keeps asking you to press a key and loops EFI boot does this sometimes Press the key fast; still looping, reset the VM from the Machine menu
Windows installed but isn’t activated Expected when you skipped the key Settings > System > Activation, enter the key there
Tried everything, the error still shows Another disc with its own answer file Check Settings > Storage and remove any extra media

For activation codes such as 0xC004F074 or 0xC004C008, see our guide to fixing Windows 11 activation errors.

About that last row. Driver discs and modified ISOs sometimes carry their own autounattend.xml. Setup reads it first.

Windows cannot read the product key outside VirtualBox

Same message, no VM at all. It happens on real PCs too, and the trigger is still an answer file. Just not one VirtualBox wrote.

Setup hunts for Autounattend.xml on its own. Before the first screen, even. Nobody points it there. Full search order? On the Windows Setup automation page on Microsoft Learn, and the part that matters here is short:

  • USB sticks and other writable removable drives. Checked first, root folder only, in drive letter order.
  • Read-only media. A DVD or a mounted ISO, root folder again.
  • The Sources folder of the install media. Custom ISOs love to hide one here.
  • The drive setup.exe runs from. Last stop.

So a stick left over from some old automated install can hijack a perfectly clean Windows USB. Plug both in, boot, and Setup reads the wrong file.

Why an empty Key element breaks Setup

UserData, then ProductKey, then Key. That’s where it lives. The reference page is blunt about blanks: “This string type does not support empty elements.” Empty tag, or no tag at all? Setup stops with the ProductKey message. Physical PC, same restart loop. Feels very familiar.

A valid entry is one 25-character key, five groups of five. Something like this, with your own key in place of the zeros:

<ProductKey>
  <Key>00000-00000-00000-00000-00000</Key>
  <WillShowUI>OnError</WillShowUI>
</ProductKey>

That value only picks the edition. Activation comes later. A generic key from the table above installs Windows and leaves it unactivated.

Clearing it on a USB install

  1. Unplug every USB drive except the Windows one. Spare sticks first.
  2. On another PC, open the Windows stick. Root folder.
  3. Autounattend.xml there? Rename it, or move it off the stick.
  4. Check the Sources folder too. Same file name, same treatment.
  5. Boot again. Setup should now stop at the normal product key screen.

Want a stick with nothing extra on it? We’d rebuild it with the Windows 11 Media Creation Tool instead of fixing a downloaded image by hand. Our bootable USB guide walks through it.

Which VirtualBox versions get the product key error

Every version that offers unattended installation of Windows can produce the error when the key field is left empty.

Release How unattended mode is reached
6.x Through VBoxManage
7.0, 7.1 and 7.2 In the wizard, switched on by default
Builds without unattended installation Can’t trigger the error at all

Users have reported the problem on the VirtualBox forums and on Microsoft Q&A for years. The workarounds have stayed the same across releases.

Rarely does an update change the template behaviour. So assume the bug is still there until you’ve tested your own build.

We’d not stay on an old release just to dodge it. Newer versions bring the TPM 2.0 and Secure Boot support that Windows 11 guests need.

Avoiding the VirtualBox product key error next time

Give the wizard what it expects.

  • Have a key ready. With a key in the wizard, VirtualBox writes a valid Key element. The install runs hands-free.
  • No key? Skip unattended. It takes maybe five extra minutes and works every time.
  • Get the ISO from Microsoft. We use the Windows 11 Media Creation Tool as the clean source. Modified ISOs from random sites often have answer files baked in.
  • Turn on EFI for Windows 11. In the VM settings, enable EFI, then Secure Boot and TPM 2.0, before the first boot.
  • Attach no other discs. One ISO, nothing else.
Download Since What it fetches
Windows 11 Media Creation Tool September 29, 2026 Windows 11 version 26H2, build 26300

Is the fix safe

It is, for the VM and for the host. The files you delete are temporary answer files and an aux image. They hold no disk data.

VirtualBox regenerates them only when you run another unattended install.

Editing the template affects new VMs only. Your backup copy restores the original in seconds if anything looks wrong.

This error looks scary. It’s just VirtualBox writing a bad config file. Once you know what’s wrong, the whole thing takes about five minutes.

Typical cases of the setup loop

The loop on a fresh Windows 11 VM

A new VM and a Windows 11 ISO. The wizard stays on its defaults. The first boot ends in the ProductKey message, and so does every boot after it. Three files deleted, floppy unchecked, and Setup starts normally.

The evaluation ISO

A Windows Server evaluation ISO needs no key. The wizard still writes the broken block. Skipping unattended mode gets the server installed.

The second disc

The unattended files are gone, and the error is still there. A driver disc is attached next to the Windows ISO. It carries its own answer file. With the disc removed, Setup behaves.

The template that came back

The template was patched months ago. After a VirtualBox upgrade the loop returns on a new VM. The update had replaced the file, and the backup copy fixes it again.

VirtualBox versions and guests this guide covers

Item Covered
VirtualBox 7.0, 7.1 and 7.2
Hosts Windows, macOS and Linux
Windows 11 guests Home and Pro, versions 24H2, 25H2 and 26H2
Windows 10 guests Home and Pro 22H2
Server guests Windows Server 2022 and Windows Server 2025, including evaluation ISOs
Media ISOs from Microsoft

FAQ

Why does Windows say it cannot read the ProductKey setting in VirtualBox?

VirtualBox writes an answer file with an empty ProductKey section when you use unattended installation without a key. Windows Setup can't parse that section. It shows the error and reboots. The ISO isn't at fault, and we'd blame the VirtualBox template.

Can I install Windows in VirtualBox without a product key?

Yes. Skip unattended installation and run setup manually. On the product key screen, click "I don't have a product key" and continue. You can activate later in Settings, under System, Activation.

Which files should I delete to stop the reboot loop?

Every file that starts with "Unattended" in the VM's folder. Usually there are one to three of them, with long timestamp names. They hold no disk data.

Will reinstalling VirtualBox fix the product key error?

Nope. The problem sits in the VM's generated answer file, not in VirtualBox itself. Delete the unattended files and uncheck Floppy in the boot order. We'd expect that to fix it without reinstalling anything.

Do Windows Server evaluation ISOs hit the same error?

They can. Evaluation editions need no key, yet VirtualBox may still generate the broken XML. Skip unattended mode or enter the matching generic setup key. We'd comment out the Key line in the template for a lasting fix.

Where is the VirtualBox template file I need to edit?

Look for win_nt6_unattended.xml in the UnattendedTemplates folder of the VirtualBox installation. On Windows that's under Program Files, Oracle, VirtualBox. On a Mac it sits inside the VirtualBox app bundle, and on Linux typically under the shared VirtualBox folder. Edit it with admin rights, and we'd keep a backup.