How to move VirtualBox files?
By default VirtualBox stores all data in a directory below the home directory. I know how to change it but how can I change the location of existing images (without editing VirtualBox.xml manually)? I’m working on Windows and don’t want to try using any NTFS links .
I don’t trust links on Windows at all. While NTFS is capable of it, Windows XP knows nothing about it and there are enough problems with it already. I may be needlessly coward.
Ah, yeah, I wouldn’t touch them on XP. But support on 7 is pretty solid — you still have to build them from the cmd line, but that’s not really much of a chore. I’m not sure about Vista.
It’s even worse, XP version of NTFS does support hardlinks, but these cannot span volumes. Obviously, I wanted to move the data to a different partition.
Hardlinks can’t ever span volumes, only symlinks can (and can be used for this sort of thing, my user folders are all symlinked to my second HDD, for example). But, personally I’d still avoid hardlinks in XP (even if they were an option).
16 Answers 16
(Edit: As of 6.0.4 there is now a built-in function to move a VM. See https://superuser.com/a/1401548/120738)
If you mean to MOVE all your VM to an entirely new location, you should just follow these 2 replies:
- Shut down VirtualBox, back up your .VirtualBox\VirtualBox.xml file.
- Find your existing «Virtualbox VMs» folder, and copy (not move) the whole folder with contents to your new drive E:
- Run VirtualBox, then for each VM in turn:
This worked for me, though I also needed to update the paths to each HardDisk and snapshot image by editing the .VirtualBox\VirtualBox.xml file, and doing a find/replace. Also, I only moved the Machines and HardDisk folders, not all the files contained under .VirtualBox , since that’s all the global configuration and logging and such.
For Mac OS X users, VirtualBox.xml is located at ~/Library/VirtualBox/VirtualBox.xml . The VMs are located in ~/VirtualBox VMs .
Virtual Box 4.3.0+ has solved the «Last Important Thing», I didn’t even need to close it — instructions.
Virtualbox now has an official «Move» option for VM’s. Just shutdown your VM and right click it in the UI and select «Move»
(Edit: As of 6.0.4 there is now a built-in function to move a VM. See https://superuser.com/a/1401548/120738)
I only had a couple of VMs, and I found that I could just change the default storage location for VirtualBox and then clone my VM’s. The clones where created in the new location on the new HD where I wanted them. Everything intact, snapshots and no need to remap the location of the virtual HDs.
Warning: Clone doesn’t produce a perfect copy and may trigger a need to update licenses for installed software as machine/disk ids change. Encountered this when moving an old copy of Quicken on a VM to a new disk.
@thomthom, There is already an answer that talks about the Move option but it only has 3 votes which means it is hidden under all of the older more complex answers.
The easiest method doesn’t require removing your virtual machines and mucking up their settings.
- Copy your Virtualbox VMs folder to a new drive.
- Run the Virtual Box Machine Manager. Run the media Manager File -> Virtual Media Manager 2a. Choose the VM to move storage for. Click the Release button and then the Remove button. On the next dialog, you can either remove or keep the virtual drive. Close the manager leaving you in your Virtualbox Machine Manager.
- Select the VM you just removed media for, click the Settings button, Click the Storage section. Add a controller for the media (SATA usually) and then add a hard drive and choose existing disk and select the VD at your new location.
- Repeat for each machine you’re moving
Fire off your virtual machine at the new location to check. Next time you visit the Virtual Media Manager, hovering over the VM entry will show you where the VD is stored.
Make sure you change your snapshots folders to point to the new drive if you’re using them. Each machine has a snapshot folder setting and the VM Manager has a Default Machine folder setting in File -> Settings that needs to be changed as well.
In addition I had to also modify path in xml file. After that it worked flawlessly.
NOTE: Things have changed a bit since this was written, see Rob’s answer. It’s extremely simple now.
Where is VirtualBox’s virtual hard disks repository?
A colleague shared a VirtualBox VM with me. When double clicking the VDI file, VirtualBox opens but I get a few errors (the errors were related to incorrect paths and UUIDs in the VBOX file). So I had to RTFM. I found Importing a VDI in VirtualBox from Oracle’s blog. The blog states:
First copy your VDI file into VirtualBox’s virtual hard disks repository. On Mac OS X it’s $HOME/Library/VirtualBox/HardDisks/.
I seem to have VDI’s scattered all about, but all under a common root folder of «VirtualBox VMs» . And I don’t have a folder «HardDisks» . So its not clear to me where the repository is, or where I’m supposed to put the VDI. Where is VirtualBox’s virtual hard disks repository in Windows 8.1?
3 Answers 3
For Microsoft Windows OS, default Storage is in %HOMEDRIVE%%HOMEPATH%\VirtualBox VMs
Which typically expands out to
The subfolders will be named with the Name: field contents entered in the Create Virtual Machine dialog where you’re asked to enter Name and OS information.
If you’ve decided to do a little more orgainization, the Machine Name subfolders will be under the Machine Group subfolder. Full implementation may look like the following:
C:\Users\[username]\VirtualBox VMs\[vm group]\[vm name]
The VDI may exist elsewhere if you used the option to Use an existing virtual hard drive
It’s easy to find where the VDI disks reside by using File=>Virtual Media Manager
Где хранятся файлы Oracle VM Virtual Box?
Подскажите пожалуйста я создавал несколько виртуальных систем по 20 гб на каждую, после удаления Virtual Box, занимаемое место не освободилось, как найти и очистить файлы виртуальных систем? Версия 4.3.
Оценить 2 комментария
Это виртуальные диски такого размера, а не настройки виртуальных машин. Диски могут быть разных типов, соответственно и расширение у них будет разное. Обычно находятся в папке виртуальной машины, но могут быть где угодно (вы же их создавали — вспоминайте где). Обычно при удалении виртуальной машины VirtualBox запрашивает и удаление соответствующего виртуального диска (по-умолчанию «Да» — вы же говорили «Нет»).
Если я не ошибаюсь то это 20гб гибкого жесткого диска, т.е. это максимальный размер который машине разрешается занять
папка по умолчанию для размещения виртуальных машин в virtualBox может быть различной.
поищите на Вашем компьютере файлы с расширением «.vbox»
это файлы с описаниями виртуальных машин.
все файлы внутри папки содержащей файл .vbox» и будут составлять одну виртуальную машину.
Т.е. для удаления машины надо удалить папку в которой содержится файл с расширением «.vbox»
Если не знаете как искать файлы вот статья
pc-users.ru/windows/poisk-fajlov-v-windows-7.html
в поле поиска ввести «*.vbox»