Page 1 of 1

Setting "Mount Point" using VBoxManage and "sharedfolder" (#18873)

PostPosted: 28. Aug 2019, 08:07
by chrixm

ModEdit; related ticket: #18873: "VBoxManage sharedfolder add" is missing documentation about the "--auto-mount-point" option

I am trying to configure a Linux (CentOS 7) VM running on a Windows 7 host using VBoxManage (using VirtualBox 6.0.10) to script the configuration of my VM. While I have been able to add USB filters and perform other tasks via the CLI, I am struggling to map a folder on the host as a mount point in my VM. I am able to do it manually in the GUI where I am able to specify the "Mount Point" (e.g. "/mnt/host/x") which is associated with a "Folder Path" (e.g. "C:\Blah\Blah\x") and make it "Permanent" and "Auto-mount".

Where is the "Mount Point" option in the following syntax?
VBoxManage sharedfolder add "CentOS VM" --name "x" --hostpath "C:\Blah\Blah\x" --automount

It appears the VBoxManage command is missing this functionality and means I have to do it via the GUI - am I missing something here as I would really like to do this using VBoxManage?

Re: Setting "Mount Point" using VBoxManage and "sharedfolder"

PostPosted: 28. Aug 2019, 08:59
by socratis
It seems that the information/help/manual hasn't been updated to include that option. But, browsing through the source code, I see in src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp that this option is actually there:
chrixm wrote:
VBoxManage sharedfolder add "<VM>"
--name "<name>"
--hostpath "<hostpath>"
--automount
--auto-mount-point "<mountpoint>"

So, can you try the "--auto-mount-point" option and see if it works? It worked just fine on a test that I did here...


PS. IMHO, and in order to be consistent, this options should have been "--automount-point", to match the "--automount" option.

Re: Setting "Mount Point" using VBoxManage and "sharedfolder"

PostPosted: 28. Aug 2019, 10:36
by chrixm
Thank you - this works :)

Re: Setting "Mount Point" using VBoxManage and "sharedfolder" (#18873)

PostPosted: 28. Aug 2019, 11:35
by socratis
I went ahead and filed a ticket about this, ticket #18873.