Knowledge is power. We love to share it.

News related to Mono products, services and latest developments in our community.

Jasmin

Setting hardware UUID in Hyper-V and ProxMox

01/09/2012Categories: Virtualization
In order to successfully run software that requires hardware ID licensing in a virtual environment, one must be sure to use hardware-assisted virtualization or fully virtual server - as opposed to the paravirtualization (mostly related to Xen). On a Linux system this can be verified by running the following command:

sudo dmidecode | grep UUID

The procedure in a Windows system is a bit more complex, one needs to run some WMI commands. This article explains all the necessary steps.

Although hardware ID licensing software can be installed without problems on fully virtualized machines, the problem occurs when one wants to virtualize an existing physical machine. This can be achieved with various kind of software, like CloneZilla for example, but the newly created virtual machine will have a different ID than the original one. If the virtual environment permits it, one can resolve this by manually setting the original hardware ID and thus overriding the one assigned upon the virtual machine creation.

At Mono Ltd we are using Hyper-V and KVM via ProxMox, which both offer the fully virtualized solution and provide a way to manually set the virtual machine UUID. As for the plain KVM, there is the -uuid argument option when starting the virtual machine. The ProxMox version has a .conf file for every VM, for example:

/etc/qemu-server/101.conf

One can add an uuid argument there, for instance:

args: -uuid 80E44B49-2F0C-DA11-ABB6-72CC4387A395

The Hyper-V procedure again requires the help of the Windows Management Instrumentation. I found the documentation on the net quite scarce about this, here is an article that explains it. The property we are interested in is called BIOSGUID. The article has a link to a ModifyVirtualSystem Method of the Msvm_VirtualSystemManagementService Class MSDN documentation page, which contains a sample vbs script for changing the VM name. One just needs to modify that script a bit (actually modify only 2 lines)  in order to change the VM UUID instead. I attached the modified script, the only 2 lines that need to be changed are the following:

set MyFirstVM = GetComputerSystem("YourVirtualMachineName")

where you obviously need to put your VM name. The second part is further below, in the middle of the script, the line where you put your UUID:

virtualSystemsetting.BIOSGUID = "{494BE480-0C2F-11DA-ABB6-72CC4387A395}"

Simple as that, download the script, change these 2 lines and run it on your Hyper-V server.

Last but not least - if you need to virtualize a Linux system on Hyper-V, UUID is displayed differently on Windows vs Linux. Check again the 2 sample IDs I used for KVM and Hyper-V, it's actually the same UUID, but written differently for KVM on Linux vs Hyper-V on Windows. Here's the general logic:

Linux:     A1B2C3D4-E5F6-G7H8-XXXX-XXXXXXXXXXXX
Windows:   D4C3B2A1-F6E5-H8G7-XXXX-XXXXXXXXXXXX
Rated 2.20, 10 vote(s). 
Hi, if i ve a Linux physical server with software that it licences re related to diferent hardware ids can be virtualized and dont lose the active licence?
Regards
Jasmin
By Jasmin
Well, typically it should work, though it depends on the kind of the software and whether it has other licensing checks apart from the hardware id. It is also a question whether it is legal to do it, the software I used when moving from physical to virtual allowed it in its EULA provided that there is only one instance of the software running, so I used only a single virtual machine and didn't replicate it to multiple instances.
Jasmin i know that its illegal to replicate more than one =) i want to virtualize 1 machine to keep it active and 1 copy as backup, so i need to get p2v that can keep the hardware ids so i dont lose the licence that is a pain to install and ve to done manually and from outside of my country.
Regards
Jasmin
By Jasmin
That's fine, I had a similar virtualization purpose. Why don't you go ahead and try virtualizing, you can test whether your license works before you kill the physical machine.
Jasmin as an update the virtualization was a success I didnt lose the licenses as were grabed to Bios UUID and MAC address and your info helped me a lot Thxz.
Regards
Jasmin
By Jasmin
Great, I'm glad it worked for you.
By Mistra
Jasmin is it Possible To Convert Vmware,VirtualBox & Hyper-V Hardware UUID's To Each Other's Compatible Config Format Like Vmware's uuid.bios , VirtualBox has Machine uuid & Hyper-V Have bios guid etc. i wan't a migrate Windows7 in Vmware,VirtualBox And Hyper-V & That Windows7 Should Have a Same Hardware UUID in Vmware,VirtualBox & Hyper-V is it Possible ?
By Don
Hi Thanks for the great information. Setting the uuid of a proxmox win machine works nicely. I think some software I need to activate needs an IdentifyingNumber set also. Any idea how to do that? If I use args: -IdentifyingNumber it errors on starting the vm. Its a 2008r2 vm.
Some changes are required by the version 2 of the API:

\root\virtualization => \root\virtualization\v2
ModifyVirtualSystem => ModifySystemSettings
comment line: objInParam.ComputerSystem = computerSystem.Path_.Path