Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Most guides for installing Windows on VirtualBox to act as a template for quick Windows jobs tell you to take a few steps to prepare the Virtual Machine before installing Windows (the best guide I found: grahamrhay.wordpress.com; another fairly good guide: www.windowstablettv.com). Unfortunately, I didn't read these guides before installing and activating Windows on the VM I wanted to use as a template.

I want to know how to clone my already-active VM in such a way that would not require re-activation from Windows.

Looking in the template VM Definition file (the VBOX or XML file for the VM), the /VirtualBox/Machine/Hardware (XPath ID) node has no uuid attribute. But, if I try to use VBoxManage modifyvm <uuid|name> --hardwareuuid <uuid> to set a new UUID for the template VM, then the template VM loses its activation status! (Thankfully, I had made a backup of the template.) So, to accomplish my aim, I can't just follow those guides pretending that I haven't installed Windows yet.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Thankfully, I noticed something about all of my Virtual Machines that I hadn't prepared as those guides had outlined.

I ran VBoxManage showvminfo <uuid|name> and noticed that the UUID valued matched the Hardware UUID value, leading me to surmise that if any VM Definition didn't have a uuid attribute in the /VirtualBox/Machine/Hardware node, then the VM would use the "Machine UUID" value as the "Hardware UUID" value. So, for my template VM, it did have a "Hardware UUID" that I could use; I just had to find how to transfer it to any clones I would make.

To ensure that the UUID transfers, you can take one of two approaches:

  • You can edit the template VM Definition file directly. The "Hardware UUID" will only transfer to clones if the /VirtualBox/Machine/Hardware has the uuid attribute. So, copy the /VirtualBox/Machine uuid attribute and add it to the /VirtualBox/Machine/Hardware uuid attribute. You probably want to re-initialize the VirtualBox machine database after this, by closing/killing any VirtualBox process you're running. (VBoxSVC sometimes lingers on Windows; you may have to kill it from the Task Manager.)
  • You can clone your template and make a new template VM, and then use VBoxManage modifyvm <uuid|name> --hardwareuuid <uuid> to set the new template's "Hardware UUID" to the original template's "Machine UUID"/"Hardware UUID". I say you have to clone the VM to create a new template VM because if you try to set the "Hardware UUID" with this command on the original template, it won't add the uuid attribute to the /VirtualBox/Machine/Hardware node, since it can still imply it from the "Machine UUID", and thus won't copy this value to any clone it makes.
share|improve this answer
    
It's not clear of which VM you're talking about in first point; also it's better to use VBoxManage modifyvm --hardwareuuid <uuid> –  CharlesB Apr 15 at 7:35
1  
The modifyvm command will not set the /VirtualBox/Machine/Hardware node uuid attribute if you pass a UUID with the same value as the VM's /VirtalBox/Machine node uuid attribute. You must edit the VBOX file directly. –  palswim Apr 15 at 17:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.