Page 1 of 1
Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 12:12
by emil78
Is it possible to change the location of .VirtualBox folder that is in the users directory? I tried the option from the Preferences>General>Default Machine Folder but this changes only the location of the virtual machines hard disks.
Re: Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 12:20
by mpack
emil78 wrote:I tried the option from the Preferences>General>Default Machine Folder but this changes only the location of the virtual machines hard disks.
It doesn't even do that. It determines where any future VMs will be created - it has no bearing on the location of existing VMs, nor is it only for hard disk images.
Yes, you can control the location of the ".VirtualBox" folder by setting the VBOX_USER_HOME environment variable... but I struggle to see why anyone would need to. That folder contains almost nothing - a small xml and a couple of log files, so your reason surely can't be because of disk space. Perhaps you should tell us your problem instead of your solution?
Re: Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 13:15
by emil78
Can you tell me how to change the .VirtualBox location from command prompt using the VBOX_USER_HOME variable?
I want the folder to be outside C: drive, because when i reinstall Windows it will delete it.
Re: Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 13:18
by loukingjr
You could just copy the folder somewhere safe and put it back afterwards.
Re: Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 13:46
by emil78
Yes, but if i forget to do that it will be deleted. I prefer to be outside C drive since this can be done, but i don't know how to do that from the command prompt.
Re: Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 15:36
by mpack
If you forget to preserve the contents of the .VirtualBox folder then it's no biggie: like I said, it contains almost nothing. All you would lose is the list of registered VMs, so all you would have to do is reregister them, which you might well have to do anyway (e.g. if reinstalling Windows caused drive letters to change).
Telling you how to configure an environment variable on your host is really beyond the scope of these forums. But, I'm sure that Googling for VBOX_USER_HOME will help.
Re: Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 16:12
by emil78
I tried this from the command prompt but it didn't work:
Code: Select all
set VBOX_USER_HOME=E:\VM\.VirtualBox
Also, where can i see all available variables for Virtualbox?
Re: Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 18:23
by mpack
Did you check Google as I suggested? Setting an environment variable inside a command console only applies for that command console, and only until it closes. This isn't DOS, where one OS environment applies to all apps.
On my PC I would set global environment variables in My Computer | Advanced | Environment variables.
Re: Can i change the location of .VirtualBox folder?
Posted: 30. Jan 2015, 18:52
by emil78
I created the variable in the standard way and backup the corresponding registry settings, so when i have to restore the settings i will run the .reg file.