Page 1 of 1
Change VM directory for external hard drive
Posted: 25. May 2010, 14:14
by slcman
Hi all,
my host hard drive is full! VirtualBox hard drive and machine took too much space in my hard disk and I would like to use a external hard to store machine and hard disk. I tried to change directory in VirtualBox.xml file but not working or I miss something. Any idea??
Re: Change VM directory for external hard drive
Posted: 25. May 2010, 15:10
by Perryg
You change the location where these are stored using the main VBox gui and selecting file -> preference and changing the location there.
Re: Change VM directory for external hard drive
Posted: 25. May 2010, 17:33
by slcman
Perryg -> I tried and it's not working. This is for set the folder of NEW machine. I want to move machine from c:\.....\.VirtualBox to G:\
Re: Change VM directory for external hard drive
Posted: 25. May 2010, 18:11
by Perryg
Then you will need to change the path of each in the VirtualBox.xml
Just be very careful and be sure to have a backup And the path must be the complete and full path.
If you can't figure out the path then create a new one selecting the new location on install, and then look at the VirtualBox.xml file and you should see how it is written.
Re: Change VM directory for external hard drive
Posted: 26. May 2010, 14:31
by slcman
Like I say in my original post, I already tried to change xml file and it's not working.
So I'm still looking for solution. Anyone tried to change directory?
Re: Change VM directory for external hard drive
Posted: 26. May 2010, 14:58
by Perryg
Anyone tried to change directory?
Yes I have and it does work. Tell you what. Post the virtualBox.xml file and write down the exact and full path to the location you are trying to use to store the Machine and VDI folders and I will see what is going on.
Hint: I made a folder called .VirtualBox on my D:\ drive and put the Machine and VDI folders in that folder. Then it was simply to change the path in the VirtualBox.xml file.
Re: Change VM directory for external hard drive
Posted: 26. May 2010, 15:06
by tb2571989
On my my E:\ drive I used in my example I made a VirtualBox folder, then two subfolders, one for Machine Settings, and one for VHD's...admittedly I did this before installing any VMs.
You will need to go trhough virtualbox.xml and check that each reference has been changed to the new location.
Re: Change VM directory for external hard drive
Posted: 26. May 2010, 15:41
by slcman
I got it! Now it's working.
I change all c:\document.......\ for my new hard drive g:\VM\ by using search tool in notepad. Still not working, only C:\.... for new directory doesn't complete change directry process. Then I look in machine registry:
<MachineRegistry>
<MachineEntry uuid="{845f18dd-94bf-4b7d-92ed-2e864774897a}" src="Machines\DOS\DOS.xml"/>
and I had my directory
<MachineRegistry>
<MachineEntry uuid="{845f18dd-94bf-4b7d-92ed-2e864774897a}" src="G:\VM\Machines\DOS\DOS.xml"/>
now is working.
Thanks all for your help
Re: Change VM directory for external hard drive
Posted: 27. May 2010, 20:25
by Sasquatch
That's what Perry was saying. Also make sure that the paths in your <VM>.xml files are changed too, else snapshots and saved states will still go to your C: drive.
Re: Change VM directory for external hard drive
Posted: 6. Jan 2014, 04:29
by Trần Tuấn Sơn
You must be change to Your directory in both .XML and .vbox files in the VirtualBox VMs document folder. And sure turned off Virtualbox (Check in Task manager - if use Windows)
E.g.
From:
<HardDisks>
<HardDisk uuid="{bbca7b5a-bb59-42b6-9ae9-199b25e2b297}" location="F:/OSS/Windows/Windows-XP-Pro-SP3-tricks.vmdk" format="VMDK" type="Normal"/>
</HardDisks>
To:
<HardDisks>
<HardDisk uuid="{bbca7b5a-bb59-42b6-9ae9-199b25e2b297}" location="H:/OSS/Windows/Windows-XP-Pro-SP3-tricks.vmdk" format="VMDK" type="Normal"/>
</HardDisks>
I have tried and successed. Hope to help you!
Re: Change VM directory for external hard drive
Posted: 6. Jan 2014, 11:20
by mpack
The information in this thread is mostly obsolete. Locking it.
If you want move an existing VM to a new drive on the same or a different host then see
Howto: Move a VM.
If you want new VMs to be created in a different drive then in the GUI see
File | Preferences | General | Default Machine Folder.