Page 1 of 1

How to change the location of an image file

Posted: 24. Sep 2012, 18:07
by EgonF
I had to reinstall Windows 7. After reinstallation the old drive G: becomes drive D:

The image files are therefore now in D:. The list of the hdd-files shows files which location is in G:

Code: Select all

C:\Programme\oracle\VirtualBox>VBoxManage list hdds
[snip]
UUID:        4592ad4a-7b56-413c-924c-13289910ae41
Parent UUID: base
Format:      VDI
Location:    G:\Egon\Server-Ubuntu_5.vdi
State:       inaccessible
Type:        normal
Usage:       Server-Ubuntu_5 (UUID: 6d3f742b-f815-4da1-9102-1504796eb447) [Sich
rung20120916 (UUID: a68a79aa-efe3-4cde-b81c-6a9f0278aaf3)]
[snip
How can I change the location from G: to D:?

In which file can I find the location configuration?


Egon

Re: How to change the location of an image file

Posted: 24. Sep 2012, 18:38
by stefan.becker
Remove the virtual hd from the guest configuration. Attentention: No file delete! Its the same as unplugging a hd from real pc.

Then copy the file to the other partitition. Thena add a new hd, in the file dialog choose the file at the new location.

Re: How to change the location of an image file

Posted: 24. Sep 2012, 18:54
by EgonF
I tried this. But if I add the vdi-file VirtualBox tells me:
Die Die Festplatte D:\Egon\Server-Ubuntu_5.vdi konnte nicht geöffnet werden.

Cannot register the hard disk 'D:\Egon\Server-Ubuntu_5.vdi' {4592ad4a-7b56-413c-924c-13289910ae41} because a hard disk 'G:\Egon\Server-Ubuntu_5.vdi' with UUID {4592ad4a-7b56-413c-924c-13289910ae41} already exists.

Fehlercode:E_INVALIDARG (0x80070057)
Komponente:VirtualBox
Interface:IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}
Egon

Re: How to change the location of an image file

Posted: 24. Sep 2012, 19:29
by stefan.becker
Datei / Manager für virtuelle Medien / Festplatten / Image markieren / Freigeben

Dann erneut versuchen.

----------------------------------------------------------------------------------------------------

File / manager for virtual media / harddisks / select image / free

Then try again.

Re: How to change the location of an image file

Posted: 24. Sep 2012, 20:05
by EgonF
free / freigeben

is not available

Egon

Re: How to change the location of an image file

Posted: 24. Sep 2012, 21:42
by EgonF
I cannot free the image file because 'free' is grey.


So again:

How can I change the location from G: to D:?

In which file can I find the location configuration?


Egon

Re: How to change the location of an image file

Posted: 24. Sep 2012, 22:26
by EgonF
Line in vbox file with drive letter found and changed.

Problem solved.

Egon

Re: How to change the location of an image file

Posted: 25. Sep 2012, 11:04
by mpack
For future reference, Stefan's instruction was correct, however there is currently a bug in VirtualBox which means that the background VBoxSVC has a memory of mounted VMs and VDIs etc even after they are deleted from the GUI. After removing a VDI/VM you need to shut down all other VMs which may be running, shut down the GUI, and allow 20 seconds or so (or watch the task manager window) for the VBoxSVC process to unload. Then you can run the VirtualBox GUI and add back the drive from its new location.

ps. It is preferable to locate the entire VM folder on the 2nd drive, don't just relocate the VDI. It is best not to locate needed files outside the VM folder since these might be missed when moving or backing up.