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

Discussions related to using VirtualBox on Windows hosts.

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

Postby chrixm » 28. Aug 2019, 08:07


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?
Last edited by socratis on 28. Aug 2019, 11:34, edited 2 times in total.
Reason: Added ticket related information.
chrixm
 
Posts: 2
Joined: 28. Aug 2019, 07:32

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

Postby socratis » 28. Aug 2019, 08:59

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.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
socratis
Site Moderator
 
Posts: 26891
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

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

Postby chrixm » 28. Aug 2019, 10:36

Thank you - this works :)
chrixm
 
Posts: 2
Joined: 28. Aug 2019, 07:32

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

Postby socratis » 28. Aug 2019, 11:35

I went ahead and filed a ticket about this, ticket #18873.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
socratis
Site Moderator
 
Posts: 26891
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: Google [Bot] and 22 guests