Page 1 of 1
Editing th location of a .vdi file
Posted: 17. Oct 2011, 14:51
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
Re: Editing th location of a .vdi file
Posted: 29. Oct 2011, 15:00
by microfox
Just bumping this hoping someone can help me.
thanks
Re: Editing th location of a .vdi file
Posted: 31. Oct 2011, 04:26
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/.
Re: Editing th location of a .vdi file
Posted: 31. Oct 2011, 18:44
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...

Re: Editing th location of a .vdi file
Posted: 1. Nov 2011, 08:16
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).
Re: Editing th location of a .vdi file
Posted: 2. Nov 2011, 17:25
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,
or perhaps,
Code: Select all
... "location=/Volumes/MacintoshHD/Ubuntu.vdi" ...
if the Mac HDD is partitioned.