Page 1 of 1
How to set "Default Machine Folder" Preference setting via command line?
Posted: 29. Sep 2022, 17:04
by ZillaG
I'm installing VirtualBox on a Windows node via Ansible, and the task essentially just executes the following command
Code: Select all
VirtualBox-<version>-Win.exe --silent --ignore-reboot
After it's installed, how can I then change the equivalent GUI setting "File->Preferences->Default Machine Folder" via command line?
TIA
Re: How to set "Default Machine Folder" Preference setting via command line?
Posted: 29. Sep 2022, 17:19
by mpack
Why do you want to do that? The "default machine folder" only controls where new VMs will be created, but all the command line methods for creating a VM allow you to set the target folder directly.
AFAIK the default machine folder setting can't be set from the command line, it's a private setting for the manager app which determines which parameter it will pass to the background process when creating VMs.
But, you could copy a template VirtualBox.xml file into the users\<user>\.VirtualBox folder, as that is where this setting is stored.
Re: How to set "Default Machine Folder" Preference setting via command line?
Posted: 29. Sep 2022, 17:45
by ZillaG
mpack wrote:Why do you want to do that? The "default machine folder" only controls where new VMs will be created, but all the command line methods for creating a VM allow you to set the target folder directly.
AFAIK the default machine folder setting can't be set from the command line, it's a private setting for the manager app which determines which parameter it will pass to the background process when creating VMs.
But, you could copy a template VirtualBox.xml file into the users\<user>\.VirtualBox folder, as that is where this setting is stored.
I'm trying to automate manual installation instructions from the development team, and one of them was to change the "Default Machine Folder" setting, So then how do I set the target folder when creating a new VM via the command line? I was given a script that takes an *.ova file as a parameter, and it's not clear to me, by looking at it, where the VM is created. I only see the following line in the script.
Code: Select all
%PATH_TO%\VboxManager.exe import %1
Re: How to set "Default Machine Folder" Preference setting via command line?
Posted: 29. Sep 2022, 17:51
by ZillaG
Ah I see
https://docs.oracle.com/en/virtualizati ... mport.html
Code: Select all
%PATH_TO%\VirtualBoxManager.exe import %1 --basefolder F:\some_folder