Editing th location of a .vdi file

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
microfox
Posts: 25
Joined: 13. Jul 2010, 14:52
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Ubuntu

Editing th location of a .vdi file

Post by microfox »

Hi

I use the latest version of VirtualBox and I have installed Ubuntu on my iMac. The .vdi file was installed on an external LaCie(identified as such) HD and everything was fine.

Now, I decided to use that HD for another use and have partitioned my internal HD and transferred everything I have stored on my LaCie drive to that new partitioned drive (obviously identified differently than my previous LaCie drive).

How can I modify the settings of that guest in the virtualBox so it now reflects my new reality ?

thanks
microfox
Posts: 25
Joined: 13. Jul 2010, 14:52
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Editing th location of a .vdi file

Post by microfox »

Just bumping this hoping someone can help me.

thanks
theDaniel
Posts: 39
Joined: 12. Oct 2011, 16:44
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Wind-does-blow XP (Xtra Porous), ReactOS
Location: Eastern Most County in USA

Re: Editing th location of a .vdi file

Post by theDaniel »

Can't you just set up the VM again? and choose your current Virtual_Machine_Name.vdi as the hard disk?

If you don't want to do that, I find in the .vbox file this entry

Code: Select all

<HardDisk uuid="{6a653d6f-7da2-472c-9b4f-13fa46e635e9}" location="/Volumes/path/to/vm/hard/disk.vdi" format="VDI" type="Normal"/>
Originally it reflected the location of my winxp.vdi Not sure where the .VBox file is installed by default, but look in ~/Library/VirtualBox/.
microfox
Posts: 25
Joined: 13. Jul 2010, 14:52
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Editing th location of a .vdi file

Post by microfox »

theDaniel wrote:Can't you just set up the VM again? and choose your current Virtual_Machine_Name.vdi as the hard disk

If you don't want to do that, I find in the .vbox file this entry

Code: Select all

<HardDisk uuid="{6a653d6f-7da2-472c-9b4f-13fa46e635e9}" location="/Volumes/path/to/vm/hard/disk.vdi" format="VDI" type="Normal"/>
Originally it reflected the location of my winxp.vdi Not sure where the .VBox file is installed by default, but look in ~/Library/VirtualBox/.
Thanks fo taking the time to answer but I,m not THAT much into Ubuntu that I want to reinstall and take a few hours to reconfigure all my settings.

As for the rest of your answer, I guess I'm too green to figure out what it really means... :(
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Editing th location of a .vdi file

Post by BillG »

Then your best solution is option one. Create a new vm and when you get to the virtual hard disk section, select use an existing hard disk and browse to find your existing .vdi (wherever it is now stored).
Bill
theDaniel
Posts: 39
Joined: 12. Oct 2011, 16:44
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Wind-does-blow XP (Xtra Porous), ReactOS
Location: Eastern Most County in USA

Re: Editing th location of a .vdi file

Post by theDaniel »

microfox wrote:As for the rest of your answer, I guess I'm too green to figure out what it really means... :(
File: somename.vdi is the virtual machine's hard drive
File: somename.VBox is a text file where the virtual machine's hardware information is stored
File: VirtualBox.xml is a text file where information about VirtualBox.app GUI and it's uses are stored

So,
1.) Using a text editor, like TextEdit or TextWrangler, open your "Ubuntu.VBox" (the .VBox file might be in your "home_folder/Library/VirtualBox/" or it may be elsewhere if you chose a different place other than the default).
2.) Using the editor's "Find" feature, search for "HardDisk". Find the place that says

Code: Select all

<HardDisk uuid="{6a653d6f-7da2-472c-9b4f-13fa46e635e9}" location="/Volumes/path/to/vm/hard/disk.vdi" format="VDI" type="Normal"/>
3.) Replace the part that says, "/Volumes/path/to/vm/hard/disk.vdi" with the path to your Virtual Box virtual machine hard drive that used to live on your LaCie drive but now has it's new home wherever you put it on your local drive.

Example: if it were originally on your external drive it might say,

Code: Select all

... location="Volumes/LaCie/Ubuntu.vdi" ...
and if you moved it to the root of your local hard drive then it would be,

Code: Select all

..."location=/Ubuntu.vdi" ...
or perhaps,

Code: Select all

... "location=/Volumes/MacintoshHD/Ubuntu.vdi" ...
if the Mac HDD is partitioned.
Post Reply