Getting around Windows Activation when Virtualizing

(Time required = 30 minutes) Scroll down to Setting up Automatic Activation to see the process if you are not interested in the background.
Background
When I first setup my VMware Server to run an existing Windows Install from a physical partition, I was asked to reactivate Windows XP before I could use it as a guest OS. All this required was to enter the product key, request verification and within a couple seconds everything ran fine. I received a lot of complaints from people saying that they were then again asked to reactivate Windows again once they booted back into Windows natively, and then again under VMware and so on every time the OS was booted in a different environment. I wasn’t sure what to tell readers and a web search brought up an endless number of forums with the same problem but no answers. My favorite answer had to be this one from a Microsoft tech saying “Running a virtual machine counts as running two copies of Windows”. Really? Maybe he should have read the user’s question more carefully. Regardless, I couldn’t really help since I couldn’t reproduce the problem.; that was until I upgraded my hard drive this week.
I found myself experiencing the same problem others had mentioned; I would boot natively and be asked to reactivate, it would work fine until I booted the VM and was again asked to reactivate. Remember that WPA (Windows Product Activation) typically allows you to reactivate twice through the internet and after that it requires you to call in. This meant that I was calling up MS every time I wanted to boot in a different environment; hardly practical considering it takes 10 minutes each time activating over the phone.
Reading up on WPA I learned that there are two files used to store the hardware info along with WPA data, WPA.dbl and WPA.bak (These files reside in C:\Windows\System32). If you go through the activation process in Windows natively as well as under VMware you will notice that the file size changes each time you reactivate. This means that if you replace the WPA files prior to booting based on whether you’re using VMware or booting natively you won’t have to reactivate. You will have WPA files for your native hardware and WPA files for your virtual hardware, just swap prior to boot.
I set out to write a script in Linux to perform this but ran into a much simpler solution that a Mac user developed. Linux users can follow the steps below to achieve the same results.
Setting up Automatic Activation
Step 1:
Boot into Windows XP natively. You will be prompted to activate your copy of Windows (if already activated, skip activation and just copy the files). Go ahead and reactivate your copy, this can be as simple as doing it through the web or going through a 10 minute phone call with Microsoft’s automated machine. Once Windows is activated:
-Navigate to C:\Windows\System32
-Create a new folder and name it “nativeboot”
-Copy and paste wpa.dbl and wpa.bak from C:\Windows\System32 into the new “nativeboot” folder
Step 2:
Boot into Linux. Run VMware and boot into Windows XP. You will be prompted to activate your copy of Windows. Go ahead and reactivate your copy, this can be as simple as doing it through the web or going through a 10 minute phone call with Microsoft’s automated machine. Once Windows is activated:
-Navigate to C:\Windows\System32
-Create a new folder and name it “vmware”
-Copy and paste wpa.dbl and wpa.bak from C:\Windows\System32 into the new “vmware” folder
Step 3:
You now have a copy of the WPA info for both your physical and virtual hardware! The next step is to guide Windows to use the right set of files when booting. The easiest way to do this is to setup a script that will be run when Windows boots:
-Open Notepad
-Copy and paste the following code:
@echo off
ipconfig /all | find "VMware" > network.tmp
for /F "tokens=14" %%x in (network.tmp) do set vmware=%x
del network.tmp
if defined vmware (
echo VMware
copy C:\\Windows\\System32\\vmware\\wpa.* C:\\Windows\\System32
) else (
echo Native Boot
copy C:\\Windows\\System32\\nativeboot\\wpa.* C:\\Windows\\System32
)
-Save the file as “activation.bat” in C:\
-Go Start>>Run>>gpedit.msc>>[enter]>>Computer Configuration>>Windows Settings>>Scripts>>Startup>>Add
-Choose “activation.bat” as the script to add.
Done!
Windows should now automatically choose the right WPA files and not require activation as you restart or change from physical to virtual hardware.
Additional Thoughts
Nevertheless, the fact that users need to go through this process to get their systems working is beyond stupid. WPA has in no way eliminated piracy and problems like this many times lead users to ditch legal software and go the route of pirated software which isn’t infested and crippled with WPA. It’s clear that Microsoft did not foresee these problems and still fails to address them. The fact that a call to MS tech support will result in them telling you that you will need two copies of Windows when virtualizing shows a lack of understanding as well as a lack of a clear solution. Even if you were to pay MS an additional $300 you would still be where you started if you are trying to virtualize a physical partition, you would just be out $300. This is because each copy of Windows can only handle one WPA file and can only be installed on one PC. When you switch environments, WPA thinks you are completely changing computers and requires reactivation. MS will try to tell you that virtualization requires two copies of Windows and that you are violating the EULA by virtualizing the same copy. THIS IS NOT TRUE. You only installed Windows once, it’s all the same set of files, and you’re still technically running it on the same original hardware since you are using the same CPU, Mobo, HDD, RAM, NIC, etc. What you are doing is not in violation of the EULA and don’t let Microsoft’s limitations in software design limit your options and your computer’s functionality.
james said,
July 12, 2007 @ 12:48 pm
why does this surprise anybody?
microsoft wants you to pay twice for running the same copy of software.
this isn’t something the overlooked it is designed this way. they are out to keep their stockholders happy.
to keep feeding the company money when there is linux available is isanity. I just quit buying their products and am strictly using linux and will never look back. bye bye microsoft - my data is my data and I want to store my data in a truely open format like ODF.
Conrad said,
July 12, 2007 @ 1:33 pm
The code sample above is missing backslashes.
kev said,
July 12, 2007 @ 1:51 pm
I think there might be some backslashes missing in your script. I assume that WordPress’s code formatting is to blame :).
Really smart script, though… I thank you for your contribution.
Mohammad Azimi said,
July 12, 2007 @ 4:17 pm
Thanks for catching that guys, it is WordPresss formatting the code, a simple double slash fixed the problem. Let me know if I missed any.
James, thanks for the comment. I understand MSFT wanting you to purchase two separate copies if you were doing a new install on a virtual disk. But this should not be the case when virtualizing a physical partition since Windows is not being installed again. Moreover, buying a second copy for installing on a virtual disk will fix your WPA problems but buying a second copy will not fix your WPA problems for booting a physical partition. The fact that they tell customers with this problem to buy a second copy is just plain stupid. There is nothing that I would love more than to run only Linux but that is not a feasible solution for me or others as you can see from the comments. The software market being what it is, there are certain applications that are only available in Windows and sometimes for school or work you just need to use them.
Top Posts « WordPress.com said,
July 12, 2007 @ 4:59 pm
[...] Getting around Windows Activation when Virtualizing [image] (Time required = 30 minutes) Scroll down to Setting up Automatic Activation to see the process if you are not […] [...]
john said,
July 12, 2007 @ 6:05 pm
do you know if this works in vista?
Mohammad Azimi said,
July 13, 2007 @ 5:40 am
Haven’t tried it, but from what I’ve read Vista uses a totally different WPA process. You can always give it a try and find out.
Youvin said,
July 15, 2007 @ 1:22 am
Thanks for article
for more information about windows and linux support:
http://www.youvin.com/forums
County Pyr said,
July 23, 2007 @ 8:32 am
Hi Mohammad
Your effort is greatly appreciated. Could you please let us know where the missing \\ (backslashes) are to be placed?
Thanks
County
Mohammad Azimi said,
July 24, 2007 @ 7:56 pm
County Pyr, I have already replaced the missing backslashes, the script should work in its current form.
Malik M Junaid said,
July 25, 2007 @ 4:25 pm
Salam M Azimi,
I am thankful for your articles on using Virtual Machines in different ways, Could you please write a small article on how can i easily use a Virtual Machine created in Windows in Linux Host OS and vice versa.
many thanks.
Malik M Junaid
John Eckman said,
August 6, 2007 @ 1:50 pm
I’ve tried to follow the above, but don’t seem to have a WPA.dbl - I have a wpa.bak file, but not the wpa.dbl.
Any ideas?
WindowsXP Professional, Version 2002, Service Pack 2 (Dell OEM)
John Eckman said,
August 6, 2007 @ 1:53 pm
Nevermind - it is there now.
(Maybe it only appears after the first restart after activation? Myabe I just didn’t hit view by name and refresh?)
Scottie said,
September 25, 2007 @ 2:08 pm
Hi Mohammad,
thanks for the script.
Any Idea if this works also for “Microsoft Office 2003″ or is there a similar mechanism?
I’ll have to reactivate Office, but i don’t know i which environment to start with..and what to backup..
Andrew said,
October 1, 2007 @ 4:19 am
I’ve read the answers given by Microsoft techies about this problem. It’s quite a feat to be so obtuse about a simple matter. They don’t even try to understand what the customer is saying (despite the provided links). Their own arguments show that User profiles in Windows is a scam. That exchange would have made a perfect script for a Buster Keaton movie. It’s no wonder that Microsoft produces shoddy software despite hiring legions of talented people.
One way out of this mess would be for companies like Adobe to start releasing *nix versions of their applications, the way Oracle does.
Windows Experience Index on the MacBook Pro 15″ 2GHz compared » DamienG said,
December 5, 2007 @ 3:04 pm
[...] When I installed Leopard on my machine I took the opportunity to carve out a dedicated 20GB partition again to put a fresh install of Vista on. As well as being able to boot natively this also now means I can run my single Windows partition switching between native, Parallels or VMware at will which admittedly drives Windows Activation crazy. [...]
Ben said,
January 8, 2008 @ 2:44 am
And don’t forget to take into account “Fast Logon Optimization feature” http://support.microsoft.com/kb/q305293/ i.e. to remove it, for script to work at startup
william said,
January 11, 2008 @ 4:29 pm
idk if its my copy of windows or what… maybe its because i dont have any updates past SP2 (i have SP2 installed but nothing after) but i cannot open gpedit.msc…
ill do a google search on it
Lukas said,
January 15, 2008 @ 5:58 pm
I have XP Home Edition SP2..I’m so glad others running VMs understand our problem. But anyways, I don’t have the wpa.bak file.
Do i really need it? (i have a wpabln file)