How to Recover Windows 10 Product Key on Ubuntu
windows ubuntu product-key recovery hivex linux
Recover Windows 10 product key from a hard drive mounted in Ubuntu using hivex tools
Recovering Windows 10 Product Key from Ubuntu
If you need to recover a Windows 10 product key from an old hard drive, you can do this by mounting the drive in Ubuntu and using the hivexget tool to extract the key from the Windows registry.
Step 1: Mount the Windows Hard Drive
Remove the hard drive from the old computer and connect it to your Ubuntu system. Then mount it:
sudo mount /dev/sdX /mnt/{$SomeFolder}
Replace /dev/sdX with the actual device name (e.g., /dev/sdb1) and {$SomeFolder} with your preferred mount point name.
Step 2: Install hivex Tools
Install the necessary tools to read Windows registry hives:
sudo apt install libhivex-bin
Step 3: Navigate to the Mounted Drive
Change to the mounted Windows drive:
cd /mnt/{$SomeFolder}
Step 4: Extract the Product Key
Use hivexget to read the product key from the Windows registry:
hivexget Windows/System32/config/SOFTWARE '\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform' BackupProductKeyDefault
This command:
- Reads from the Windows
SOFTWAREregistry hive - Extracts the
BackupProductKeyDefaultvalue from the Software Protection Platform key - Returns the Windows 10 product key
Important Notes
- Ensure you have read access to the mounted drive
- The drive should be from a working Windows 10 installation
- This method works for both OEM and retail product keys
- Make sure to unmount the drive safely when finished:
sudo umount /mnt/{$SomeFolder}
Alternative Methods
If this method doesn’t work, you can also try:
- Using
produkeytool in Windows - Checking the product key sticker on the computer case (for OEM installations)
- Using PowerShell commands:
wmic path SoftwareLicensingService get OA3xOriginalProductKey