9

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.

Tedd Hansen
  • 654
  • 4
  • 8
  • 17

2 Answers2

8
VBoxManage internalcommands sethduuid "filename" "newUUID"

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

user9517
  • 114,104
  • 20
  • 206
  • 289
joe
  • 239
  • 1
  • 2
  • 1
    One doesn't need the "newUUID" paramenter. A new one will be generated automatically. `Usage: VBoxManage internalcommands [command arguments]` and `sethduuid []` – T. Junghans Jan 31 '13 at 09:55
1

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

Goyuix
  • 3,164
  • 5
  • 28
  • 37