VirtualBox – moving a VDI file and re-linking it to the Guest
So, I moved them and then started the Oracle VM VirtuaBox Manager to re-link the vdi files to the respective guest.First, I opened the settings of each Virtual Machine and deleted the "old" hard disk under "Storage".Then I clicked on "Add Attachment", selected "Add Hard Disk" and "Choose existing disk", and then selected the vdi file.
Next came a very strange error:
The Problem
This confused me pretty good, as I knew for a fact that I moved the vdi, so it did not exist at the old location anymore. I also had no clue what this media registry was supposed to be, and before opening that xml file and messing around with it, I decided to see if others had this issue before.
After a bit of google-ing, I found the solution in the VirtualBox forum:
Even though the thread was started on 2. Mar 2009, 16:43, some kind soul decided to register to the forum to make one single post to the forum in this thread on 21. Dec 2012, 22:00 (Christmas spirit?) with the simple solution to this problem.
I had the same UUID problem and a very easy fix worked for me. I went File>virtual media manager. I found the vdi file that was giving me issues. Selected it and removed (though it was showing up as inaccessible). Then started the VM again and selected the file from my local hard-disk. That was it!
Hope this works for you too.
Om
So, to summarize with a bit more clarity:
The Solution
1. Open the Oracle VM VirtuaBox Manager
Click on File -> Virtual Media Manager (or Ctrl+D)
2. Delete the hard disk entry in question (select and press "Del" on keyboard)
3. Open "Settings" of the Virtual Machine, go to "Storage", click "Add Attachment", select "Add Hard Disk" and "Choose existing disk", then selected the vdi file and you are done.
Enjoy
275362
Thanks!!!!
Man, thanks a lot for this! It was so easy, and there were so many weird solutions on the net that are nonsenses.
Thankfully I kept searching and found your post! Cheers and good luck!
Can only say thanks, I’d trawled that thread but missed what you picked up.
Thanks for finding it and for putting it up there
You are very welcome!
I am happy it has helped you and others ^^
Unfortunately the suggested procedure did not work for me as the “Remove” option in the Virtual Media Manager was grayed out. The same applies to the “Release” option.
Normally, “remove” is only grayed out when the drive is still attached to a guest, and “release” in grayed out when a disk is no longer attached to a guest, but I have never seen both of them grayed out at the same timeh…
Which Host OS do you use?
Looking at the terminal commands, you could just do:
~$ VBoxManage storagectl uuid-of-the-drive --remove
That’s 2 dashes infront of the ‘remove’, I need to fix the way that is displayed… actually I need a new theme, as this one isn’t even mobile friendly…
To get the uuid of the drive you want to remove: ~$ VBoxManage list hdds
You will see something like this:
UUID: e294fc8b-7414-48be-bef4-80e1dc76edcf
Parent UUID: base
State: created
Type: normal (base)
Location: /home/gyro/VirtualBox VMs/Android-x86/Android-x86.vdi
Storage format: VDI
Capacity: 59578 MBytes
Doing ” VBoxManage storagectl uuid-of-the-drive –remove” brings me “Syntax error: Too few parameters” message. Why?
Hi, did you actually provide the UUID? Also, did you use double dashes? (
--remove
)“Syntax error: Too few parameters”
Hi, did you actually provide the UUID? Also, did you use double dashes? (
--remove
)Same result here: storagectl requires an extra parameter “–name “. I think that’s probably the wrong command, since Help says storagectl removes a *storage controller*. Maybe ‘VBoxManage closemedium disk ‘, with an optional extra –delete if the file exists and you want the file deleted as well as its record in the Virtual Media Manager.
I was able to delete from File | Virtual Media Manager…, so couldn’t try this.
Many thanks!!
As you have already figured out, WP has taken two dashes and made a single long one from it. I will have to revise my posts and add a proper “code” tag that I can use, so it won’t get formatted by WP.
Both –name and –delete parameters should start with a double dash. Sorry, forum is auto-converting them to an en-dash, and I can’t see a link here to tell me the correct format. Maybe
--name
and--delete
? (That was. . .
without the extra spaces )Goodness, WordPress really does love to mess with my comments. To get the nice formatting, enclose things with double dashes etc. in HTML code tags.
I haven’t updates the site in a couple of years. Your comment makes me want to try out a new theme and a better editor for comments now…
Thanks!!!
Glad it helped
Thanks man it helped….
Thank you for your comment, it makes my day to know I was able to help someone
THANKS!!!!!!!
Thanks man. You helped me. All fixed.
Wow. So many strange workarounds and somewhat complicated methods on the internet, and this worked. Thanks!
Thanks.
Thanx a lot, you rocks!
Thanks for your comment. You site is down – Fatal error: Uncaught exception ‘PDOException’.
Worked like a charm. Thank you.
Thanks a lot, very nice and simple solution
I had this problem many many months ago and found a command line solution that fixed the problem (I recall changing/assigning a new UUID to my storage file). However I forgot what I did.
THANKFULLY, i found this simply solution. Thanks again.
Thanks ver much ,you really help me
Man, this is so simple and nobody knows that!! Thanks for sharing! The only post that helped me! Thanks!!
thanks…saved hours of trouble
Thank you !!!!!!!!!!! helped ! been trying to edit the .xml file and went all around the place.
Thanks again!!
I can surely say…
Many thanks to you my friend
your the best online :-)
I think the best would deserve a coffee. I didn’t get one, so…
Thanks for the kind words and making my day.
THANKS!!!!
Thanks It worked for me..!!
I love you.
Thanks a lot, I found weird solutions for same in other blogs. It was quite simple.
Great Job ..
It worked for me ..
Hi Gyro,
Thanks for posting it. Solution worked perfectly for me. Have a great weekend.
Too easy, can’t believe I didn’t try this myself. Thanks.
Add one more to the thanks!
Holy crap, that was simple.
As so many else have echo’d, all other solutions are inapt.
Thank you!
Superb!
Thanks !
Excellent advice, thanks very much.
That saved me a bunch of time, thank you.
Super helpful, thanks man!
Thank you so much for sharing!
I had a similar error. I had a VM in virtualbox, which was copied into a separate folder, when I powered it off. Now, I wanted to add it as a separate VM with a different name. However, I was seeing this UUID conflict. What I did :
1) Created a new empty VM with the desired NAME.
2) Located the new folder, where copy of the VM was there.
3) Ran the commands to change the UUID for each disk-file (.vmdk or others) I had there : “C:\Program Files\Oracle\VirtualBox\vboxmanage.exe” internalcommands sethduuid disk1.vmdk
(you have to be in the same directory as the disk files, to run this command. Easy, wherever you need the command window, SHIFT+Right-click > open command window here)
4) I ran the above command 4 times for 4 disks I had in the folder. Each disk file got new UUID now.
(make sure to remember / note the sequence of disk file numbering if there are many)
5) Now, go into the settings of the empty VM, storage, add the disks in same sequence under SATA disks.
6) That’s it ! Now could start my new VM without issues, as all the disks had new UUID without conflicts.
Thanks for helping me out! Keep it going
thanks you!
Thanks you are awesome
best regards
YOU ROCK !
Thanks!!!
Thank you – It was such a simple solution, thankfully I came here