Change uuid of harddrive

Discussions related to using VirtualBox on Windows hosts.
daverage
Posts: 4
Joined: 22. Feb 2008, 11:01

Change uuid of harddrive

Post by daverage »

I just got the following error when trying to mount a copy ofa vmdk file.
A hard disk with UUID {55b773b8-cbcb-42ea-9a44-1368b30ed823} or with the same properties ('V:\VBOX\VDI\XP_Work_Template_20GB.vmdk') is already registered.

Is it possible to change the uuid of a drive image?
JshWright
Volunteer
Posts: 119
Joined: 13. Sep 2007, 00:33
Primary OS: Debian Lenny
VBox Version: OSE self-compiled
Guest OSses: Many...

Post by JshWright »

Dunno how (or even if you can) you would do it with a vmdk, but VBoxManage clonevdi is how you get a copy of a .vdi with a unique UUID.

~JW
tadak
Posts: 2
Joined: 12. Jun 2008, 01:24

Found an undocumented command.

Post by tadak »

I am sure you have went passed this issue, but just in case other people may need it.

To set a UUID of a hard drive run this

VBoxManage internalcommands setvdiuuid disk2.vdi

Have a good one
torentash
Posts: 51
Joined: 19. Apr 2008, 10:21

Post by torentash »

Tadak,

THANKS A LOT!!! It works flawlessly.
Murz
Posts: 16
Joined: 20. Aug 2008, 13:36

Re: Found an undocumented command.

Post by Murz »

tadak wrote:I am sure you have went passed this issue, but just in case other people may need it.

To set a UUID of a hard drive run this

VBoxManage internalcommands setvdiuuid disk2.vdi

Have a good one
Can I set with this command UUID for disk manually?
I have several disks (VDI) with different UUID but I mount it from remote machines to host machine only one per session. And want to use one VirtualBox machine configurations for all drives. But each VDI have his own UUID and every time I need to readd VDI drives in Virtual Disk Manager.
I want to set same UUID for all disks.
How I can set UUID for already exists disk manually?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Found an undocumented command.

Post by Sasquatch »

Murz wrote:
tadak wrote:I am sure you have went passed this issue, but just in case other people may need it.

To set a UUID of a hard drive run this

VBoxManage internalcommands setvdiuuid disk2.vdi

Have a good one
Can I set with this command UUID for disk manually?
I have several disks (VDI) with different UUID but I mount it from remote machines to host machine only one per session. And want to use one VirtualBox machine configurations for all drives. But each VDI have his own UUID and every time I need to readd VDI drives in Virtual Disk Manager.
I want to set same UUID for all disks.
How I can set UUID for already exists disk manually?
This is not advised. You will be able to only register one disk at a time. If you want to have all disks in the Disk Manager, they must have a different UUID.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Murz
Posts: 16
Joined: 20. Aug 2008, 13:36

Re: Found an undocumented command.

Post by Murz »

Sasquatch wrote:
Murz wrote:
tadak wrote:I am sure you have went passed this issue, but just in case other people may need it.

To set a UUID of a hard drive run this

VBoxManage internalcommands setvdiuuid disk2.vdi

Have a good one
Can I set with this command UUID for disk manually?
I have several disks (VDI) with different UUID but I mount it from remote machines to host machine only one per session. And want to use one VirtualBox machine configurations for all drives. But each VDI have his own UUID and every time I need to readd VDI drives in Virtual Disk Manager.
I want to set same UUID for all disks.
How I can set UUID for already exists disk manually?
This is not advised. You will be able to only register one disk at a time. If you want to have all disks in the Disk Manager, they must have a different UUID.
I have only one disk at a time, because I mount folders from other computers in local network only one per session to the same path.
Now I solve this problem with VBoxManage scripts (remove and readd the disk):

Code: Select all

VBoxManage modifyvm vmachine -hda none
VBoxManage unregisterimage disk /mnt/drive1/vbox/image.vdi
VBoxManage modifyvm vmachine -hda /mnt/drive1/vbox/image.vdi
VBoxManage startvm vmachine
terran.priest
Posts: 11
Joined: 25. Aug 2007, 13:00
Location: Ogden, UT
Contact:

Re: Change uuid of harddrive

Post by terran.priest »

AWESOME!

just what i was looking for.

running on a linuxmint 6 host, i wanted to copy my VBOX win2k hdds to another file for use in a 2nd vm for win2k to use limewire in.

hehe, this helped.

Thank you!
Terran Priest
MarkWagner
Posts: 1
Joined: 9. Jun 2010, 16:13
Primary OS: MS Windows 2008
VBox Version: OSE other
Guest OSses: Windows Server 2008, Windows Server 2008 R2

Re: Change uuid of harddrive

Post by MarkWagner »

The command appears to be successful when using it on a VHD formatted disk, but does not actually update the UUID. Running the dumphdinfo still shows the original UUID.
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Change uuid of harddrive

Post by frank »

Code: Select all

VBoxManage internalcommands sethduuid
is perhaps what you are searching for.
demosthenesk
Posts: 3
Joined: 24. Aug 2010, 08:52
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Change uuid of harddrive

Post by demosthenesk »

hi,

i try to find a solution for the following problem:

i have software that needs to work the uuid of hard drive that was activated.

If i clone the vdi disk a new uuid is placed in vdi file and the software needs re-activation.
The solution to this issue is if i could to clone the vdi file but after that to set a specific uuid.

is there any way to set a specific uuid and not a random one with setvdiuuid ?

i would like to do something like that,

VBoxManage internalcommands setvdiuuid 55b773b8-cbcb-42ea-9a44-1368b30ed823 disk2.vdi
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Change uuid of harddrive

Post by frank »

demosthenesk wrote:hi,
i would like to do something like that,

VBoxManage internalcommands setvdiuuid 55b773b8-cbcb-42ea-9a44-1368b30ed823 disk2.vdi
Yes, VBoxManage internalcommands sethduuid disk2.vdi 55b773b8-cbcb-42ea-9a44-1368b30ed823 will work.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Change uuid of harddrive

Post by mpack »

demosthenesk wrote:The solution to this issue is if i could to clone the vdi file but after that to set a specific uuid.
Surely a simpler solution is to clone the vdi without changing the UUID? Which is what you would get if you simply copied the vdi file using the host OS. You can also clone it using CloneVDI, with the "Keep UUID" option set. CloneVDI is intended for Windows hosts, it will also run on Wine. I notice that your profile says you are using an Ubuntu host, though you are asking this question in the Windows Hosts forum.
demosthenesk
Posts: 3
Joined: 24. Aug 2010, 08:52
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Change uuid of harddrive

Post by demosthenesk »

oh! now i saw where i post it!

sorry.

anyway thanks for the help i ll try your advices.
demosthenesk
Posts: 3
Joined: 24. Aug 2010, 08:52
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Change uuid of harddrive

Post by demosthenesk »

1) well at command line i get
user@ubuntu-laptop:~/.VirtualBox/HardDisks$ VBoxManage internalcommands sethduuid WindowsXPHome2.vdi 1831a6f9-e507-4301-b773-e4b7afd928a4
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.

Usage: VBoxManage internalcommands <command> [command arguments]

Commands:

sethduuid <filepath>
Assigns a new UUID to the given image file. This way, multiple copies
of a container can be registered.

WARNING: This is a development tool and shall only be used to analyse
problems. It is completely unsupported and will change in
incompatible ways without warning.

Syntax error: Not enough parameters
2) with CloneVdi all is fine under linux with wine. Works perfectly

this is my feedback from the advices i tried.

Oh! And if any admin could transfer my posts to a linux thread it would be nice, if they bother here...

Thanks a lot for the help!
Post Reply