Как изменить uuid virtualbox

I am trying to create a new virtual machine with Oracle VirtualBox, using an already-existing hard disk. When I try to select the existing hard disk file, a .vhd file, it displays an error saying the

I am trying to create a new virtual machine with Oracle VirtualBox, using an already-existing hard disk. When I try to select the existing hard disk file, a .vhd file, it displays an error saying the virtual hard disk cannot be used because the UUID already exists.

So I tried the following command to change its UUID.

VBoxManage internalcommands sethduuid /home/user/VirtualBox VMs/drupal/drupal.vhd

I get this error.

Syntax error: Invalid UUID parameter

How can I resolve this?

apaderno's user avatar

apaderno

27.9k16 gold badges76 silver badges87 bronze badges

asked Jul 23, 2013 at 6:55

CJAY's user avatar

1

The correct command is the following one.

VBoxManage internalcommands sethduuid "/home/user/VirtualBox VMs/drupal/drupal.vhd"

The path for the virtual disk contains a space, so it must be enclosed in double quotes to avoid it is parsed as two parameters.

apaderno's user avatar

apaderno

27.9k16 gold badges76 silver badges87 bronze badges

answered Jul 23, 2013 at 7:21

CJAY's user avatar

CJAYCJAY

6,71717 gold badges61 silver badges103 bronze badges

4

The following worked for me:

  1. run VBoxManage internalcommands sethduuid «VDI/VMDK file» twice (the first time is just to conveniently generate an UUID, you could use any other UUID generation method instead)

  2. open the .vbox file in a text editor

  3. replace the UUID found in Machine uuid=»{…}» with the UUID you got when you ran sethduuid the first time

  4. replace the UUID found in HardDisk uuid=»{…}» and in Image uuid=»{}» (towards the end) with the UUID you got when you ran sethduuid the second time

answered Mar 31, 2016 at 8:24

borchvm's user avatar

borchvmborchvm

3,3547 gold badges43 silver badges42 bronze badges

7

If you’ve copied a disk (vmdk file) from one machine to another and need to change a disk’s UUID in the copy, you don’t need to change the Machine UUID as has been suggested by another answer.

All you need to do is to assign a new UUID to the disk image:

VBoxManage internalcommands sethduuid your-box-disk2.vmdk
UUID changed to: 5d34479f-5597-4b78-a1fa-94e200d16bbb

and then replace the old UUID with the newly generated one in two places in your *.vbox file

<MediaRegistry>
  <HardDisks>
    <HardDisk uuid="{5d34479f-5597-4b78-a1fa-94e200d16bbb}" location="box-disk2.vmdk" format="VMDK" type="Normal"/>
  </HardDisks>

and in

    <AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
      <Image uuid="{5d34479f-5597-4b78-a1fa-94e200d16bbb}"/>
    </AttachedDevice>

It worked for me for VirtualBox ver. 5.1.8 running on Mac OS X El Capitan.

answered Dec 15, 2016 at 23:09

Oleg Gryb's user avatar

Oleg GrybOleg Gryb

5,0741 gold badge27 silver badges40 bronze badges

4

I have searched the web for an answer regarding MAC OS, so .. the solution is

cd /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/

VBoxManage internalcommands sethduuid "full/path/to/vdi"

answered Apr 14, 2017 at 17:40

al3x2ndru's user avatar

al3x2ndrual3x2ndru

5885 silver badges8 bronze badges

0

Though you have solved the problem, I just post the reason here for some others with the similar problem.

The reason is there’s an space in your path(directory name VirtualBox VMs) which will separate the command. So the error appears.

answered Aug 27, 2013 at 1:36

JavaNoScript's user avatar

JavaNoScriptJavaNoScript

2,32521 silver badges27 bronze badges

The command fails because it has space in one of the folder name,
i.e. ‘VirtualBox VMs.

VBoxManage internalcommands sethduuid /home/user/VirtualBox VMs/drupal/drupal.vhd

If there is no space at folder name or file name, then the command will work even without quoting it,
e.g. after changing ‘VirtualBox VMs’ into ‘VBoxVMs’

VBoxManage internalcommands sethduuid /home/user/VBoxVMs/drupal/drupal.vhd

answered Feb 20, 2014 at 11:56

januarvs's user avatar

januarvsjanuarvs

3983 silver badges7 bronze badges

Same solution as @Al3x for Windows x64, in cmd.exe:

cd %programfiles%OracleVirtualBox

VBoxManage internalcommands sethduuid "full/path/to/.vdi"

This randomizes the UUID of the disk. Pro tip: Right click the .vdi file while holding shift and select «Copy as path» to obtain "full/path/to/.vdi" and enable quick edit in cmd.exe, then right click to paste.

answered Nov 14, 2018 at 9:03

masterxilo's user avatar

masterxilomasterxilo

2,3741 gold badge29 silver badges34 bronze badges

Even though this question asked is old, note that changing a UUID on a virtual HDD in a windows system will make windows treat it as a not activated machine (as it notices the disk change) and will ask for reactivation !

answered Jul 2, 2015 at 10:28

aniston's user avatar

anistonaniston

2,9872 gold badges10 silver badges3 bronze badges

Another alternative to your original solution would be to use the escape character before the space:

VBoxManage internalcommands sethduuid /home/user/VirtualBox VMs/drupal/drupal.vhd

answered Sep 9, 2015 at 0:21

Whitaker's user avatar

Did you try to copy, move or back up and restore your VirtualBox virtual machines and now one or more of them cannot boot because of “some UUID problem?” Here we will show you how you can change the UUID in VirtualBox HHDs.

When we set up a Virtual Machine in VirtualBox, it’s given a Universal Unique IDentifier, or UUID for short. This is a 128-bit number, specific to the virtual hardware. Here’s the thing: the Hard Disk Drives attached to the VMs we make also have their own UUIDs. Those are also presumed to be unique. When they are not, problems emerge.

Change Virtualbox Uuid Virtualbox Hdd Uuid Error

The most usual case may appear after you try to copy or back up a virtual machine. When trying to run “a second version” of the VM, VirtualBox might announce that its HDD’s UUID isn’t the one it was waiting on.

That’s when you should reset the HDD’s UUID and reattach it to the VM as a new device. It is easy to do but demands the use of a command-line tool, coupled with some clicks in a rarely visited part of VirtualBox’s GUI.

Meet VboxManage

VirtualBox comes with a command-line tool, VboxManage, that, as its name states, helps you manage your virtual machines.

VboxManage is the Swiss Army knife of VirtualBox. It is the command-line interface to the program, offering a lot of functionality not encountered in the “main” GUI-based app.

With it, you can create new virtual machines, modify their parameters, clone them, or reset a virtual HDD’s UUID. And that last one is precisely what we require here.

Change Virtualbox Uuid Vboxmanage

If you have VirtualBox, VboxManage is already installed. To check it out, enter in a terminal:

Two commands worth remembering

Although we won’t need them for this article, two VboxManage commands worth remembering when troubleshooting VMs are:

vboxmanage showhdinfo FILE
Change Virtualbox Uuid Vboxmanage List Vms

The first one displays a list of all your virtual machines that are “attached” to VirtualBox.

The second one can show information about the virtual hard disk files you feed it.

Although the process we will employ is uncomplicated and bulletproof, you can use the second one on your virtual hard disk file before and after the procedure. This way, you’ll be sure its UUID has changed.

Release the HDD

From VirtualBox’s main window, with your VM stopped, select “File -> Virtual Media Manager.”

Change Virtualbox Uuid Virtualbox Virtual Media Manager

From the window that appears on your screen, identify your problematic hard disk drive. Click on it to select it. Then, click on the “Release” button to detach the selected HDD from VirtualBox. Confirm that you want to release it when VirtualBox asks you if you are sure. Then click on “Remove.”

Change Virtualbox Uuid Virtualbox Virtual Media Manager Window

VirtualBox will notify you that “As this hard disk is inaccessible, its image file can not be deleted.” Click on “Remove.” If the error message is different, skip this step to avoid really deleting your virtual hard disk.

Go back to your terminal and enter:

vboxmanage internalcommands sethduuid FILENAME

Replace “FILENAME” with your actual virtual hard disk file.

Change Virtualbox Uuid Vboxmanage Sethduuid

The program should notify you of the new UUID assigned to the virtual hard disk file.

Re-attach your virtual HDD

Return to the Virtual Media Manager window and click on “Add.” Find and select the updated virtual hard disk file to connect it again to VirtualBox.

Change Virtualbox Uuid Virtualbox Select Updated Hdd File

Close the Virtual Media Manager window and revisit the settings of the virtual machine that was affected by the problem.

Move to the “Storage” settings of your virtual machine and pick the appropriate controller. Click on the icon with the HDD and the plus sign. Select “Choose existing disk” and then, from the window that pops up, your updated virtual hard disk file.

Change Virtualbox Uuid Virtualbox Reattach Updated Hdd File

Click OK to save the changes and exit the window. Start your virtual machine and, if everything went according to plan, it should boot with no problems.

Related:

  • How to Install Guest Additions in VirtualBox
  • How to Import and Export OVA Files in Virtualbox
  • How to Shrink a Virtualbox VM in Windows 10

Odysseas Kourafalos

Odysseas Kourafalos

OK’s real life started at around 10, when he got his first computer — a Commodore 128. Since then, he’s been melting keycaps by typing 24/7, trying to spread The Word Of Tech to anyone interested enough to listen. Or, rather, read.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

На английском языке ошибка звучит так:

Cannot register the hard disk because a hard disk with UUID ... already exists.

vbox-move-hdd-0005

Данная ошибка возникает при попытке добавить файл виртуального жёсткого диска к виртуальной машине после перемещения этого файла.

Зачем перемещать файл виртуального жёсткого диска

Это бывает необходимо, если на текущем жёстком диске компьютера недостаточно свободного места. Либо в случае, если вы хотите переместить файл на более быстрый накопитель компьютера (например SSD) для улучшения быстродействия виртуальной машины.

Перемещение файла виртуального жёсткого диска

1.Поиск файла и собственно перемещение

Откройте менеджер виртуальных машин. Выберите нужную виртуальную машину и вызовите её свойства (Настроить):

vbox-move-hdd-0011

На вкладке Носители выясните путь к файлу виртуального жёсткого диска и скопируйте его:

vbox-move-hdd-0012

Вставьте в адресную строку путь, сотрите имя файла в конце и нажмите Enter. Вы попадёте в папку, где расположен файл.

Переместите файл, куда желаете. Мы в нашем примере перемещаем с диска E на диск C SSD.

vbox-move-hdd-0015

2. Изменение UUID виртуального жёсткого диска в Virtualbox

Выполните следующие действия:

1. Запустите командную строку:

vbox-move-hdd-0021

2. Откройте папку, где установлена Virtualbox.

3. В командной строке наберите cd и поставьте один пробел.

4. Перетащите иконку папки в командную строку. Должна получиться строка:

cd "C:Program FilesOracleVirtualbox"

5. Нажмите Enter:

vbox-move-hdd-0025

6. Наберите команду vboxmanage internalcommands sethduuid и поставьте один пробел.

7. Перетащите файл жёсткого диска в командную строку. Должна получиться строка вида:

vboxmanage internalcommands sethduuid C:folderwin7.vdi

8. Нажмите Enter: 

vbox-move-hdd-0026

Вот так выглядит окно консоли после выполнения всех команд:

vbox-move-hdd-0027

Если вы видите сообщение

UUID changed to:...

значит, всё получилось.

Если при попытке изменить  UUID вы получили ошибку Syntax error: Invalid UUID parameter, возьмите путь в кавычки следующим образом:

vboxmanage internalcommands sethduuid "E:VirtualBox VMswin8win8.vdi"

Чаще всего эта ошибка возникает из-за того, что в имени какой-то папки в пути есть пробелы.

3. Подключение перемещённого файла к виртуальной машине

Откройте свойства виртуальной машины и перейдите на вкладку Носители.

Удалите жёсткий диск:

vbox-move-hdd-0028

Добавьте жёсткий диск, указав новое расположение перемещённого файла виртуального жёсткого диска:

vbox-move-hdd-0029

Выбрать существующий образ

Нажмите ОК для сохранения изменений виртуальной машины:

Сохранение свойств виртуальной машины

Как видите, теперь ошибки не наблюдается.

I’d like to change the hard disk’s serial number in VirtualBox.

Does anyone know how to do that?

slhck's user avatar

slhck

219k68 gold badges592 silver badges580 bronze badges

asked Nov 8, 2012 at 8:35

asker's user avatar

2

I’m guessing you want to change the UUID of the hard disk
uuid is like this UUID {55b773b8-cbcb-42ea-9a44-1368b30ed823}

To set the UUID of a hard drive run this in command prompt :

VBoxManage internalcommands setvdiuuid disk2.vdi

eg: VBoxManage internalcommands sethduuid disk2.vdi 55b773b8-cbcb-42ea-9a44-1368b30ed823 will work.

Journeyman Geek's user avatar

answered Nov 9, 2012 at 12:02

swapyonubuntu's user avatar

1

Looks like the command has changed:

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

So in my case it was:

C:Program FilesOracleVirtualBox>VBoxManage internalcommands sethduuid <vmdk location>

uuid is changed if you don’t fill in a new one either way.

slhck's user avatar

slhck

219k68 gold badges592 silver badges580 bronze badges

answered Jul 19, 2013 at 8:49

user239204's user avatar

I guess you mean the Volume Serial Number that you see when you do a dir in de command console.

VolumeID solved it for me, run it as administrator:

volumeid C: C8BA-7B18

After the reboot it’d be changed:

C:>dir
 Volume in drive C has no label.
 Volume Serial Number is C8BA-7B18

 Directory of C:
 ...

Xandy's user avatar

Xandy

3,47022 silver badges28 bronze badges

answered Nov 9, 2012 at 9:58

Nikske's user avatar

I’d like to change the hard disk’s serial number in VirtualBox.

Does anyone know how to do that?

slhck's user avatar

slhck

219k68 gold badges592 silver badges580 bronze badges

asked Nov 8, 2012 at 8:35

asker's user avatar

2

I’m guessing you want to change the UUID of the hard disk
uuid is like this UUID {55b773b8-cbcb-42ea-9a44-1368b30ed823}

To set the UUID of a hard drive run this in command prompt :

VBoxManage internalcommands setvdiuuid disk2.vdi

eg: VBoxManage internalcommands sethduuid disk2.vdi 55b773b8-cbcb-42ea-9a44-1368b30ed823 will work.

Journeyman Geek's user avatar

answered Nov 9, 2012 at 12:02

swapyonubuntu's user avatar

1

Looks like the command has changed:

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

So in my case it was:

C:Program FilesOracleVirtualBox>VBoxManage internalcommands sethduuid <vmdk location>

uuid is changed if you don’t fill in a new one either way.

slhck's user avatar

slhck

219k68 gold badges592 silver badges580 bronze badges

answered Jul 19, 2013 at 8:49

user239204's user avatar

I guess you mean the Volume Serial Number that you see when you do a dir in de command console.

VolumeID solved it for me, run it as administrator:

volumeid C: C8BA-7B18

After the reboot it’d be changed:

C:>dir
 Volume in drive C has no label.
 Volume Serial Number is C8BA-7B18

 Directory of C:
 ...

Xandy's user avatar

Xandy

3,47022 silver badges28 bronze badges

answered Nov 9, 2012 at 9:58

Nikske's user avatar

06 Dec 2018

  • virtualbox

После создания снапшота или после перемещения .vhd или .vdi файла, при запуске виртуальной машины появляется ошибка 0x80004005 UUID doesn`t match


Текст ошибки примерно такой

Fehlercode: E_FAIL (0x80004005)
Component: ProgressProxy
Interface: IProgress {c20238e4-3221-4d3f-8891-81ce92d9f913}

В этом случае менеджер виртуальных машин показывает ошибку, что родительский UUID снапшота не соответствует UUID диска-родителя, хранящемуся в реестре носителей c: Users Username .virtualbox VirtualBox.xml.

или

Parent UUID {00000000-0000-0000-0000-000000000000} of the medium ‘C:UsersUsernameVirtualBox VMsXP-nikSnapshots{5ad80a47-8509-4b7d-9955-44bf137a77c7}.vhd’ does not match UUID {94b27e89-d561-4449-a1a7-83c2f1dd8d12} of its parent medium stored in the media registry (‘C:UsersUsername.VirtualBoxVirtualBox.xml’).

error code:
E_FAIL (0x80004005)

Как и в первом случае родительский UIID снапшота не соответствует UUID диска-родителя, хранящемуся в реестре носителей c: Users Username .virtualbox VirtualBox.xml.

Мы можем это поправить.

Для начала нужно запустить cmd.exe от имени администратора, перейти в каталог, где установлена VirtualBox

В первом случае

Нам нужно получить UUID родительского диска

D:> vboxmanage internalcommands dumphdinfo harddisk0.vdi

--- Dumping VD Disk, Images=1
Dumping VD image "harddisk0.vdi" (Backend=VHD)
Header: Geometry PCHS=20573/16/255 LCHS=0/0/0 cbSector=512
Header: uuidCreation={b76d8026-e222-470a-9c83-bc91351bb307}
Header: uuidParent={00000000-0000-0000-0000-000000000000}

и свойства снапшота:

D:>vboxmanage internalcommands dumphdinfo "c:UsersUserNameVirtualBox VMsVMNameSnapshots{fdb2b61d-2212-45cc-8d29-b9f598d06f39}.vhd"

--- Dumping VD Disk, Images=1
Dumping VD image "c:UsersUserNameVirtualBox VMsVMNameSnapshots{fdb2b61d-2212-45cc-8d29-b9f598d06f39}.vhd" (Backend=VHD)
Header: Geometry PCHS=20573/16/255 LCHS=0/0/0 cbSector=512
Header: uuidCreation={fdb2b61d-2212-45cc-8d29-b9f598d06f39}
Header: uuidParent={00000000-0000-0000-0000-000000000000}

Родительский UUID снапшота (00000000-0000-0000-0000-000000000000) установлен неверно. Установим правильный родительский UIID снапшоту:

D:>VBoxManage.exe internalcommands sethdparentuuid "c:UsersUserNameVirtualBox VMsVMNameSnapshots{fdb2b61d-2212-45cc-8d29-b9f598d06f39}.vhd" {b76d8026-e222-470a-9c83-bc91351bb307}

UUID changed to: b76d8026-e222-470a-9c83-bc91351bb307

Теперь виртуальная машина должна раотать верно, загружаться и последний снапшот должен быть доступен.

Во втором случае

Parent UUID {00000000-0000-0000-0000-000000000000} of the medium ‘C:UsersUsernameVirtualBox VMsXP-nikSnapshots{5ad80a47-8509-4b7d-9955-44bf137a77c7}.vhd’ does not match UUID {94b27e89-d561-4449-a1a7-83c2f1dd8d12} of its parent medium stored in the media registry (‘C:UsersUsername.VirtualBoxVirtualBox.xml’).

error code:
E_FAIL (0x80004005)

В сообщении об ошибке, у нас уже есть UUID снапшота и правильный UUID родительского диска, нам остается только присвоить снапшоту правильный родительский UUID:

C:Program FilesOracleVirtualBox>VBoxManage.exe internalcommands sethdparentuuid C:Usersnik.NUTEPVirtualBox VMsXP-nikSnapshots{5ad80a47-8509-4b7d-9955-44bf137a77c7}.vhd {94b27e89-d561-4449-a1a7-83c2f1dd8d12}

После этого виртуальная машина должна работать правильно.

Также это решение работает, если vhd файлы вашей вируальной машины лежат не в стандартной папке виртуальной машины и снапшоты иногда теряют своих родителей.

Понравилась статья? Поделить с друзьями:
  • Как изменить userprofile windows 10
  • Как изменить username twitter
  • Как изменить username spotify
  • Как изменить username github
  • Как изменить username git