Page 1 of 1
Moved Virtual Hard Disk
Posted: 9. Apr 2009, 07:52
by bf109
I recently ran out of space on my Ubuntu installation partition so I moved a few of my virtual hard disks to another partition and one of them is showing in the Disk Manager in VBox with an orange exclamation icon now and it has an error when you hover the mouse cursor over it that shows the old path to the VHD and then it says that it cant read the file (obviously, since it is not there) then says VERR_FILE_NOT_FOUND.
I would just move the hard drive back to the original partition and then unregister it in the Disk Manager but I don't currently have enough space to move it back. When I try and register the disk I moved to the other partition is gives me an error basically saying that the disk cant be added since it has the same UUID as the file I moved!
Is there a way to use vboxmanage to unregister and then reregister the VHD? I could not find any specific commands in the User Manual for this.
Re: Moved Virtual Hard Disk
Posted: 9. Apr 2009, 11:50
by vbox4me2
Edit the xml files manually.
Re: Moved Virtual Hard Disk
Posted: 9. Apr 2009, 12:34
by Sasquatch
Or open the Media Manager, unregister the faulty HD and then add it again from the proper location.
Re: Moved Virtual Hard Disk
Posted: 9. Apr 2009, 19:55
by bf109
Sasquatch wrote:Or open the Media Manager, unregister the faulty HD and then add it again from the proper location.
Oops, forgot to mention that the disk manager would not let me unregister the "faulty HD". The buttons are grayed out for "remove" and "release" and the doesn't seem to be a way to unregister the HD from the GUI.
vbox4me2 wrote:Edit the xml files manually.
How would I do this?
Re: Moved Virtual Hard Disk
Posted: 9. Apr 2009, 20:20
by vbox4me2
Search the harddisk and have a look inside them (*.xml)?
Re: Moved Virtual Hard Disk
Posted: 9. Apr 2009, 22:42
by dmcgraw
bf109 wrote:vbox4me2 wrote:Edit the xml files manually.
How would I do this?
Here is an example of how to do this based on my Virtual Box installation on an Ubuntu host.
VirtualBox by default stores all its files in a directory tree called ".VirtualBox" under the users home directory. The file you want to edit to change the location of the .VDI file which was moved is called VirtualBox.xml. This is the main VirtualBox settings file, so you might want to make a backup copy of it before you modify it. On my system, the full path to this file is:
/home/dave/.VirtualBox/VirtualBox.xml
Open this file in your favorite editor and search down until you find a line something like this:
<HardDisk uuid="{cea3ff0b-920b-491c-d294-4ec25a518750}" location="/home/dave/.VirtualBox/VDI/WindowsXP2.vdi" format="VDI" type="Normal">
This is the definition for the location for one .VDI file in VirtualBox. In the example I have given, you can see the full path to the .VDI file is:
"/home/dave/.VirtualBox/VDI/WindowsXP2.vdi"
It should only be necessary to edit this location to point to the new location of the file you moved.
Dave
Re: Moved Virtual Hard Disk
Posted: 9. Apr 2009, 23:08
by bf109
Thanks for the detailed instructions Dave. I'm very new to Virtualbox so this is a big help. I will try it and post my results.
Re: Moved Virtual Hard Disk
Posted: 10. Apr 2009, 03:29
by bf109
Ok, I opened the file and edited the path to the new path and saved the file then restarted VBox and it did not work. I am wondering if there is an issue with VBox "seeing" the snapshot for this HD in the correct path?? I have one snapshot for this VM which is a W2K3 Server VM.
Re: Moved Virtual Hard Disk
Posted: 10. Apr 2009, 11:42
by Sasquatch
When editing files, VB must not run. Else the changes will be reversed.
Re: Moved Virtual Hard Disk
Posted: 10. Apr 2009, 19:15
by bf109
Well, I ran out of time to be fiddling around with this so I just freed up enough space to move the HD back to the original location. I would like to try this again just to see if I can have some success editing the file manually but for now thanks all for your help.