Wednesday 23 September 2015

Resizing a VM and Windows Licencing

vs

I have a number of VMs on SSD.  The Windows 7 VMs in particular have bloated over time and I had gotten into the bad habit of expanding their disk size to accommodate all the junk the Windows OS seems to accumulate and hoard.

Finally running out of disk space, I decided to clean them up.  Getting rid of the Windows junk is another story, there's lots of help around and make sure you check out this tool PatchCleaner.

After freeing up tens of gigabytes I wanted to reduce the size of the VM disk.  I use VMWare Workstation and unfortunately this task is far from simple.  Turns out you need to download the VMWare vCenter Converter tool and it copies your old VM across to a new VM with the reduced disk size.

And that's where the trouble starts, fire up Windows and it'll start demanding that you active Windows.

This is frustrating as the old VM had a legit, activated copy of Windows.  The type of licence seems to lock it to the old VM.  However, I'm not trying to game Microsoft here, the old VM was deleted and I have no other way of shrinking the VM disk than using the above technique.  All I'm really doing is the virtual equivalent of replacing a disk drive in a physical machine - that doesn't trigger a licence violation.

Windows licencing seems to use a formula to lock licences to machines.  Generally you can swap/add drives and memory, but you can't, say, switch motherboards.  So what was causing the issue in the VM?  After a little experimentation I found the "scsi0.sasWWID" setting in the VMX file to be important.  The new VM had a different value, when I changed it to the value from the old VMX file Windows booted up without demanding activation.

BTW, I don't know the full ramifications of changing the VM SCSI SAS Id so be extremely careful if you do tinker with it.