I have Vagrant set up on one of my computers. I would like to change the location of its virtual hard drive, which is currently in the default location. How can I do this without breaking Vagrant?
I have Vagrant set up with VirtualBox 4.2.
EDIT: I mean that I want to move the location of the VirtualBox machine folder, which is currently at C:\Users\Kevin\VirtualBox VMs\my_vm\box-disk1.vmdk
.
You can now use the VirtualBox Manager to move a VM. Right-click on the VM in the VirtualBox Manager's machine list and select Move.
On Windows: C:/Users/USERNAME/. vagrant. d/boxes.
Not sure if you want to change the ~/.vagrant.d
or VirtualBox default machine folder.
If you want to move ~/.vagrant.d
to somewhere else. You can set environment variable VAGRANT_HOME
, see this https://stackoverflow.com/a/14804694/1801697
Update:
To change VirtualBox's Default Machine Folder, either do it in GUI => Prefs - General - Default Machine Folder or manually edit the ~/.VirtualBox/VirtualBox.xml
<SystemProperties defaultMachineFolder="/path/to/VirtualBox/VMs" defaultHardDiskFormat="VDI" VRDEAuthLibrary="VBoxAuth" webServiceAuthLibrary="VBoxAuth" LogHistoryCount="3"/>
you can use the command :
VBoxManage setproperty machinefolder
here the doc for more information : https://www.virtualbox.org/manual/ch08.html#vboxmanage-setproperty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With