Page 1 of 1

Moving Guest to another drive

Posted: 28. Mar 2009, 17:44
by timothybythesea
I need to move my Guest installation from the physical slave drive on my desktop system (Using Ubuntu 8.10) to the physical master drive. This change needs to be made to be made for space reasons. I know it can be done by moving the .vdi to the other hard drive. I moved the vdi . . . and used Virtual Media Manager to add a new drive. When I try I get an error message stating:

Cannot register the hard disk '/home/gtm/.VirtualBox/HardDisks/XP.vdi' with UUID {207d0779-9f25-439a-bc48-6551b6921973} because a hard disk '/home/gtm/.VirtualBox/HardDisks/XP.vdi' with UUID {207d0779-9f25-439a-bc48-6551b6921973} already exists in the media registry ('/home/gtm/.VirtualBox/VirtualBox.xml').


Result Code:
NS_ERROR_INVALID_ARG (0x80070057)
Component:
VirtualBox
Interface:
IVirtualBox {339abca2-f47a-4302-87f5-7bc324e6bbde}

I guess I don't know where to go from here. It would be easier I guess to reinstall XP to that drive but then I would have to try to get it validated again. I have read elsewhere that it is possible to change drives and could someone tell me how to do it? I am very new to VirtualBox.

Re: Moving Guest to another drive

Posted: 28. Mar 2009, 17:48
by Sasquatch
Unregister the currently registered VDI from the old location and then register it again from the new location. Or you open the XML files (both generic VirtualBox.xml as the VM specific file) and change the location of the VDI from there. Be sure to have VB closed when editting the files.

Re: Moving Guest to another drive

Posted: 28. Mar 2009, 22:50
by timothybythesea
Sasquatch wrote:Unregister the currently registered VDI from the old location and then register it again from the new location. Or you open the XML files (both generic VirtualBox.xml as the VM specific file) and change the location of the VDI from there. Be sure to have VB closed when editting the files.
Thanks for the help. I figured out how to unregister the vdi using the the gui program but stopped by the instructions that seem to say that a straight copy of the vdi file to another drive would not work. It suggested using VBoxManage clonehd command. But I can't figure how to use the command. Using:
VBoxManage clonehd /.VirtualBox/HardDisks/XP.vdi /media/disk/VirtualBox/HardDisks/XP2.vdi
Simply returns an error message.
So it looks like before I can unregister or edit the location of the .xml I need to figure out how to clone the vdi.

Re: Moving Guest to another drive

Posted: 28. Mar 2009, 23:32
by Sasquatch
You don't need to clone the VDI. What your read is when you want to use the same image on two different locations for two VMs. You are just moving the file to a new location to preserver space on the original location.

Re: Moving Guest to another drive

Posted: 29. Mar 2009, 04:27
by timothybythesea
Sasquatch wrote:You don't need to clone the VDI. What your read is when you want to use the same image on two different locations for two VMs. You are just moving the file to a new location to preserver space on the original location.
GOT IT! Thanks for putting up with my questions. Tim

Re: Moving Guest to another drive

Posted: 29. Mar 2009, 13:59
by foxclo
I use Ubuntu 8.04 and did what you are trying to do by simply copying (using ssh) the slave .Virtualbox directory and files to the master drive /home partition and everything worked.
Hope this helps.