Clone and resize a VirtualBox Windows virtual machine keeping its activation
Problem
A while ago I created a genuine Windows 10 VM, assigning it what I thought it might be a sufficient disk space.
Sadly, over time, the available disk space had become so largely insufficient to eventually preventing me from installing Windows updates.
The obvious solution to the issue is to resize the VM.
Sadly, over time, the available disk space had become so largely insufficient to eventually preventing me from installing Windows updates.
The obvious solution to the issue is to resize the VM.
You can resize a VirtualBox machine from command line, only provided you don't have any saved snapshots.
Sadly, I had saved a snapshot I couldn't get rid of.
Solution
The easiest way to solve this problem is to clone the machine by selecting Current Machine State option, so that the previous snapshots will not be carried over to the clone machine.
Though this approach solves the problem related to removing the snapshots, it presents another challenge: cloning the machine will cause the VM to lose its Windows activation.
Keeping Windows activation
In order to keep our Windows activation, we need to perform two steps, after creating the clone.
BEFORE starting the clone VM:
BEFORE starting the clone VM:
- View the hardware uuid of the original machine, through the command VBoxManage showvminfo "Original VM name" (in my case "Windows 10". NOTE: If the VM name contains spaces, you need to enclose within quotes).
- Copy that hardware UUID to the newly cloned machine, through the command VBoxManage modifyvm "Cloned VM name" --hardwareuuid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (the way this command looks like in my case is shown below).
Resizing the virtual hard drive
From command line, we need to run VBoxManage modifyhd <path to the vdi file> —resize <size in MB>, which in my case looks as follows:
If we check back the properties for our virtual disk drive, nothing seems to have changed.
We need to start our new VM and go to Disk Management.
The command we performed created a large unallocated space, which wasn't added to our system partition.
Therefore, we need to right-click our C: partition and choose extend in order to to use the unallocated space and enlarge our system partition.
This solution solves the disk space issue by maintaining, at the same time, our activation status.
External sources
External sources
Comments
Post a Comment