How to change the location of an image file

Discussions related to using VirtualBox on Windows hosts.
Post Reply
EgonF
Posts: 53
Joined: 3. Oct 2010, 12:24
Primary OS: MS Windows other
VBox Version: OSE other
Guest OSses: MX Linux

How to change the location of an image file

Post 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
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: How to change the location of an image file

Post 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.
EgonF
Posts: 53
Joined: 3. Oct 2010, 12:24
Primary OS: MS Windows other
VBox Version: OSE other
Guest OSses: MX Linux

Re: How to change the location of an image file

Post 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
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: How to change the location of an image file

Post 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.
EgonF
Posts: 53
Joined: 3. Oct 2010, 12:24
Primary OS: MS Windows other
VBox Version: OSE other
Guest OSses: MX Linux

Re: How to change the location of an image file

Post by EgonF »

free / freigeben

is not available

Egon
EgonF
Posts: 53
Joined: 3. Oct 2010, 12:24
Primary OS: MS Windows other
VBox Version: OSE other
Guest OSses: MX Linux

Re: How to change the location of an image file

Post 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
EgonF
Posts: 53
Joined: 3. Oct 2010, 12:24
Primary OS: MS Windows other
VBox Version: OSE other
Guest OSses: MX Linux

Re: How to change the location of an image file

Post by EgonF »

Line in vbox file with drive letter found and changed.

Problem solved.

Egon
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How to change the location of an image file

Post 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.
Post Reply