Page 5 of 11

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 17. Dec 2010, 00:46
by abye180
JEGERT wrote:I was working on activation for Win7 this past weekend and found some helpful notes for anyone new to VBox
First off, if you change even one character in the machine UUID, reactivation occurs but the hard disk UUID did not matter (thanks Sasquatch and mpack)

If you want to save off a Win 7 activated environment, follow these steps (do not use the Export Appliances)
1) Backup the VDI file by just copying it or use CloneVDI and make sure to use "Keep old UUID" (you're the best mpack! This tool works great)
2) copy the machine's XML file and keep it with the VDI/VHD (C:\Users\Administrator\.VirtualBox\Machines\Win7\Win7.xml where Administrator is the user you are logged in with and Win7 is the VBox name)
You should have the VDI/VHD file and XML now (2 files)

Now to restore a Win 7 environment, here goes:
1) Create a new VBox machine entry from scratch including the HardDisk (does not matter what the settings are here since the XML file will overlay it anyway)
2) Copy the backed up XML file to the new VBox machine's directory (i.e. C:\Users\Administrator\.VirtualBox\Machines\NewWin7\NewWin7.xml) and overwrite the one already there (NOTE: You need to close VirtualBox as it will probably have this file opened)
3) Copy the VDI/VHD file and overlay the one you created in step 1. The reason I do this is because if you import the VDI, it WILL change the UUID on the hard disk
4) Edit the VBox XML file and change the Machine UUID and hard disk UUID to match the file in step 2 above (i.e. C:\Users\Administrator\.VirtualBox\VirtualBox.XML). Make sure there are no duplicates or VBox will crash on COM registration!

Now run the VBox machine and you should not be asked to reactivate the OS

Thanks everyone!


Thanks Jegert. I have tried this approach and it worked. But what interests me is that why not also simply repalce the VirtualBox.XML? What information in the VirtualBox.XML triggers the activation? It seems to me that NewWin7.xml contains much more information than VirtualBox.XML does.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 17. Dec 2010, 01:02
by abye180
Sasquatch wrote:First off, the disk UUID does NOT change when you import it. It's written in the VDI file and only a "VBoxManage internalcommands sethduuid <vdi file>" will change it (or using the cloneVDI tool from mpack).
Second, the HD UUID does NOT trigger an activation, only the VM UUID. So all you have to do, is keep that UUID near the W7 VDI. You can even give a different machine UUID than it's own UUID to the VM OS. See the manual for more information on that (VBoxManage modifyvm [--hardwareuuid <uuid>]). This means that you can still clone your W7 VM, get a new VM UUID, but let it send the original UUID to the OS.


Hello Sasquatch,
I can totally understand the first point, however not the second.
1. When you say "VM UUID", you are refering to the <MachineEntry uuid> in the VirtualBox.xml, right?
2. What does modifyvm do? I tried it. It simply adds the modified uuid after <Hardware version="2"> node in the machine.xml . I don't see how it helps with preventing reactivation.
3. By the method privided by Jegert, I am able to copy a guest machine and migrate it to another host without causing activation issue. Are we able to do it on the same host? I.e., to have two identical guest on a same host. I think the answer is no, because I can't register the VM UUID twice in the VirtualBox.xml.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 17. Dec 2010, 13:32
by mpack
abye180 wrote:2. What does modifyvm do? I tried it. It simply adds the modified uuid after <Hardware version="2"> node in the machine.xml.

Answering that requires that you understand the background. The UUID (whether a hard disk or a VM UUID) serves two purposes.

The primary purpose is to allow VirtualBox itself to identify its own hard disk objects, virtual machine objects, and so forth.

A secondary purpose is that VBox uses these UUIDs as defaults when a modern OS interrogates the hardware for signatures of various sorts. These UUIDs are already being used as identifiers and hence are naturals to use as default signatures. However, if you don't like the default you can usually change it, using commands such as "VBoxManage modifyvm". Doing so does not change any UUID (as already mentioned, VBox needs these to ID its own objects), but it does add additional strings to the VM xml which if present is what VBox sends to the guest OS on demand.

I hope that's somewhat clearer.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 17. Dec 2010, 17:55
by abye180
mpack wrote:
abye180 wrote:2. What does modifyvm do? I tried it. It simply adds the modified uuid after <Hardware version="2"> node in the machine.xml.


A secondary purpose is that VBox uses these UUIDs as defaults when a modern OS interrogates the hardware for signatures of various sorts.

I hope that's somewhat clearer.


Hi mpack, thanks for getting back.

If I understand your explanation correctly, by default the VM UUID serves such interrogating purpose, so changing the VM UUID triggers the guest OS to reactivate. That is to say, by the modifyvm command, we can intentionaly give the cloned guest machine an "alias" UUID that is identical with the original VM UUID, so that the cloned guest use this alias to interrogate the hardware and thus don't triggers any activation.

Sorry that I made a typo in my original question, what I mean is I don't see how the modifyvm command helps with preventing reactivation of a cloned guest.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 17. Dec 2010, 18:09
by mpack
Re your second para, you seem to understand my explanation ok.

Re your third para, I don't know if you still don't understand something.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 18. Dec 2010, 17:10
by Sasquatch
abye180 wrote:2. What does modifyvm do? I tried it. It simply adds the modified uuid after <Hardware version="2"> node in the machine.xml . I don't see how it helps with preventing reactivation.

abye180 wrote:Sorry that I made a typo in my original question, what I mean is I don't see how the modifyvm command helps with preventing reactivation of a cloned guest.

Odd, you seam to understand the UUID thing, that it has to do with the activation, yet you don't understand what it has to do with reactivation. You're contradicting yourself. Stating you understand something, but actually you don't.
It's explained by Mpack and myself a couple of times here already, it's of little use to explain it again. Read Mpacks last explanation (the one you seem to understand) and think about reactivation. What is reactivation and what does it mean? Why does it happen? When you answer that, you will probably get a "oh, that's how it works" moment.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 18. Dec 2010, 20:13
by mpack
I'd like to clarify one thing though: activation messages are caused by whatever Microsoft decides they will be caused by, and this can vary from one Windows version to another. For example, Win7 cares about your VM UUID, but XP didn't. I think XP cared about the boot drive UUID, but there was several flavours of XP, so this is hard to pin down.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 22. Dec 2010, 16:34
by abye180
Oh, that's how it works. Now I understand and can clone win7 without triggering activation.
Thanks mpack and sasquatch, for having explained thingd very clear and your patience.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 9. Mar 2011, 02:45
by lagerdalek
Hi,

This appears to have changed since this was last updated (I am running 4.0.4)

For a start I cannot find indiviual machine XML files, and the VirtualBox.xml does not appear to be changed by the modifyvm command. Changing the machine uuid in the VirtualBox.xml does not appear to have any effect.

Any further thoughts or updates to this?

Thanks

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 9. Mar 2011, 11:53
by mpack
lagerdalek wrote:For a start I cannot find indiviual machine XML files, and the VirtualBox.xml does not appear to be changed by the modifyvm command. Changing the machine uuid in the VirtualBox.xml does not appear to have any effect.

Since v4.0.0 the VM xml files now have a ".vbox" extension. However this is not the forum to describe whats new in the VirtualBox v4 release. I'm sure you can find that elsewhere if you try.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 11. Mar 2011, 03:59
by casolorz
Hopefully this will help someone in the future since its the answer we were unable to find.

Windows 7 appears to use the uuid of your VM for activation. When you first make your VM, there will be a uuid giving the machine a unique id. It can be found on the machine xml element. If you activate Windows 7 at this point, it will use that id. This means as long as that id is registered in VirtualBox, to clone that VM you will need a new id and it will trigger a reactivation. To get around this, before activating Windows 7 (one of our tests even showed you had to install it like that, but further tests didn't), you want to add a hardware id, this is done by adding a uuid to the hardware xml element. I did it by registering the VM, then using the modifyvm command. I am guessing it can be done by hand but I didn't do it that way. Once you've done that, if Windows activates or reactivates (probably), it will use the hardware uuid instead of the machine one. Now you can safely clone the VM, change the machine uuid, but keep the hardware uuid identical and your Windows 7 will not need to be reactivated. Obviously you should still comply with Microsoft licensing.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 11. Mar 2011, 21:15
by Sasquatch
Casorolz, that's exactly what I said in the beginning of this thread ;).

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 11. Mar 2011, 21:30
by casolorz
Sasquatch wrote:Casorolz, that's exactly what I said in the beginning of this thread ;).


Well not exactly, a lot of posts here point you towards the right solution but honestly no one tells you the exact process. Your first post for example doesn't talk about the hardware uuid. Other posts talk about it but they don't make it clear when to add it, etc. And of course there are a lot of posts talking about how people aren't asking the right question instead of just helping them. So my post was just a way to help people so they don't waste their time trying to decipher all the other posts, it was by no means a way to offend anyone, just trying to be helpful. We've had several people read the entire 5 pages of posts and it was obviously not clear as to how to achieve VM cloning without reactivating, so I just wanted to spell it out. For all I know my post isn't clear either, I don't mind if people ask me to explain further.

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 18. Mar 2011, 18:36
by DWade
Let get real.

Some times the explanation seem to be plain and simple; but they are not.

What is needed are those steps done like this:

Step One -- Do this

Step two -- do that. Short or Long way.

For instance I hadn't played with a Mac for awhile and there were all kinds of post about redoing permissions..... What is that??
Oh you go to the Disk Utlity an reapply permission. Ok, what is the disk utlilty? ..

Ok .. i.e. GA ?? oh Guest Additions....

Re: Which changes trigger reactivation in a Windows guest?

PostPosted: 18. Mar 2011, 18:55
by Perryg
DWade,
That is what the MAC forums are for. You go there with MAC specific questions and here for VirtualBox specific questions.
I am sure they know what the utility is and can give you a step-by-step guide on it's use.