Change Virtual Machine UUID - NOT disk UUID

Allgemeine Diskussionen über den Einsatz von VirtualBox.
Locked
speefak
Posts: 3
Joined: 12. Jan 2015, 18:54

Change Virtual Machine UUID - NOT disk UUID

Post by speefak »

hello, ich use phpvirtualbox an a script to manage virtualmachines an connect via rdp. it is nt a linux or windows specific issu so i post my questeion here. I am using virtualbox 4.3.10 and phpvirtualbox on the apache webserver. i read the vboxmanage mannual, search the web and try o lot of parameters to change the virtualmachine UUID. i get a solution but its not really easy and its an admin nightmare when addig new vms

to change UUID of virtual machine edit the master file ~/.config/Virtualbox/VirtualBox.xml and change MachineEntry uuid :
=> <MachineEntry uuid="{00000000-0000-0000-0000-000000000001}" src="/home/vbox/.VirtualBox_VMs/VM_FIXED_DISK_1/VM_FIXED_DISK_1.vbox"/>
after that change each virtual machine config file which is located in /<VIRTUAL_MACHINES_PATH/VIRTUAL_MACHINE/
=> nano ~/.VirtualBox_VMs/VM_FIXED_DISK_1/VM_FIXED_DISK_1.vbox
change entry => <Machine uuid="{00000000-0000-0000-0000-000000000001}" name="VM_FIXED_DISK_7" OSType="Debian" snapshotFolder="Snapshots" las$
both entries in ~/.config/Virtualbox/VirtualBox.xml and ~/.VirtualBox_VMs/VM_FIXED_DISK_1/VM_FIXED_DISK_1.vbox have to be matched
the vboxmanage command doesn work correctly : VBoxManage modifyvm "VM_FIXED_DISK_1" --hardwareuuid 00000000-0000-0000-0000-000000000001
the command above change an UUID entry in the vm machine folder config file, but the change does not have any effekt when i read out the UUIDs via vboxmanage list vms .
any suggestions whoch command works correctly ?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Change Virtual Machine UUID - NOT disk UUID

Post by mpack »

Your comment is a strange mix of German and English, (then posted in the German language forum). I'll comment in English.

The VBoxManage command to change the hardwareuuid does indeed work correctly. Your error was to assume that the VM-UUID and the hardwareuuid was the same thing - they are not, they just both happen to default to the same initial value. VM-UUID is how VirtualBox host processes identify a VM. The hardwareuuid is the "motherboard signature" which the guest OS sees. E.g. Win7 activation uses hardwareuuid, not VM-UUID.

I'm not sure that you understood that the VM-UUID stored in VirtualBox.xml is a reference (a link), not an assignment. The assignment is done in the .vbox file only.
speefak
Posts: 3
Joined: 12. Jan 2015, 18:54

Re: Change Virtual Machine UUID - NOT disk UUID

Post by speefak »

i think i understand the differences between the VM UUID. I want to change the VirtualBox.xml reference link to manage the virtualmachines via vboxmanage using the UUID ( its necessary that the VM-UUID are continuous numbered ) The VM Guest UUID for the hardrive oder mainbord etc. doesnt matter. I look for the command to cahnge the VM-UUID which is used for VirtualBox host processes. Does such a command exist ?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Change Virtual Machine UUID - NOT disk UUID

Post by mpack »

I didn't mention the hard disk UUID. Obviously we both should understand that to be irrelevant. I responded to your comment that "modifyhd --sethardwareuuid" has no effect: I pointed out that it does work, but was never intended to change the VM UUID.

I'm not aware of any method using VBoxManage to change the VM identifier. Except of course to clone it, which creates a new VM. The only method I know is to edit the .vbox file. Then of course you would have to correct any links to that VM from VirtualBox.xml, and any scripts that identify VMs using the UUID.
speefak
Posts: 3
Joined: 12. Jan 2015, 18:54

Re: Change Virtual Machine UUID - NOT disk UUID

Post by speefak »

mhhh ok, then i have to edit the 2 files for chaning the VM UUID ;/
qiping
Posts: 6
Joined: 3. Jul 2020, 17:39

Re: Change Virtual Machine UUID - NOT disk UUID

Post by qiping »

speefak wrote:mhhh ok, then i have to edit the 2 files for chaning the VM UUID ;/
I have the same issue, I need to change machine UUID.
Based on the discussion above, I modify the Machine uuid in *.vbox and copy the changed harddisk uuid to HardDisk uuid, I successfully create an another VM by copying an existing VM.
Thanks!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Change Virtual Machine UUID - NOT disk UUID

Post by mpack »

qiping wrote:I modify the Machine uuid in *.vbox and copy the changed harddisk uuid to HardDisk uuid
I'm not entirely sure what you're saying there. Simple cloning the VM will change all VM UUIDs. You should never edit .vbox files directly if it can be avoided - that way lies unsupportable error conditions.
isalsberg
Posts: 4
Joined: 3. Jan 2012, 00:22
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: windows, linux, OS x

Re: Change Virtual Machine UUID - NOT disk UUID

Post by isalsberg »

qiping wrote:
speefak wrote:mhhh ok, then i have to edit the 2 files for chaning the VM UUID ;/
I have the same issue, I need to change machine UUID.
Based on the discussion above, I modify the Machine uuid in *.vbox and copy the changed harddisk uuid to HardDisk uuid, I successfully create an another VM by copying an existing VM.
Thanks!
Thanks for your tip qiping. It worked perfectly and makes all the sense to me since I am backing up the VM's using a batch thru the OS instead of cloning each VM.
Locked