Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I change the UUID of a VHD-file?

My problem is that VirtualBox won't accept the VHD-file if it has already been added. But I am moving VHD disks between work/home and cloning them (and keeping them as VHD, not VDI) "at random".

The export/import feature won't work for me because 1) it changes the file to VDI and 2) it takes too damn long, can't wait for it to export+import a 60GB disk every morning/afternoon when I switch locations.

It is important to keep it as VHD so its compatible with HyperV.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted
VBoxManage internalcommands sethduuid "filename" "newUUID"

Type VBoxManage internalcommands to see the other less documented features available.

share|improve this answer
    
One doesn't need the "newUUID" paramenter. A new one will be generated automatically. Usage: VBoxManage internalcommands <command> [command arguments] and sethduuid <filepath> [<uuid>] –  TJ. Jan 31 '13 at 9:55
add comment

You can do two things:

1) The storage manager keeps track of where the files are, but not necessarily the files themselves. If you just replace the file on disk (rather than import/export) things should "just work"™ - if you are taking the virtual disks between computers, just copy them over the top of the existing files.

2) If you absolutely need to change the UUID for whatever reason you can run the following command to clone the VHD, which will give it a new UUID:

VBoxManage clonehd source.vhd destination.vhd

You should be able to import the cloned drive and assign it to a machine as you normally would. Here is the relevant info for the clonehd command: http://www.virtualbox.org/manual/ch08.html#vboxmanage-clonevdi

share|improve this answer
add comment

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.