[vbox-dev] [PATCH] document --auto-mount-point

Timothy Tacker timothytacker+virtualbox at gmail.com
Wed Jul 22 02:28:43 GMT 2020


The VBoxManage sharedfolder command supports an optional --auto-mount-point
parameter, but it is not documented. The parameter was previously
implemented and functions as expected on CentOS 8. Per the documentation,
when the --automount parameter is used on Linux distributions, the default
mount point will be either /media/USER/sf_share-name or
/media/sf_share-name, where share-name is the share named. The
--auto-mount-point parameter can be used to override the default mount
point and use another one specified instead.

The below patch documents the --auto-mount-point parameter in both the
manual and in VirtualBox itself. In addition, VBoxManageMisc.cpp was
modified to handle -auto-mount-point in addition to --auto-mount-point,
consistent with the other parameters for the sharedfolder command in the
same file.

I'm licensing this patch under the MIT license. Please review. Feedback is
welcome. Thanks!

Timothy Tacker

---
 doc/manual/en_US/man_VBoxManage-sharedfolder.xml | 10 +++++++++-
 doc/manual/en_US/user_VBoxManage.xml             | 11 ++++++++++-
 src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp |  1 +
 src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp |  3 ++-
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/doc/manual/en_US/man_VBoxManage-sharedfolder.xml
b/doc/manual/en_US/man_VBoxManage-sharedfolder.xml
index bfa2c52b..7615eb6e 100644
--- a/doc/manual/en_US/man_VBoxManage-sharedfolder.xml
+++ b/doc/manual/en_US/man_VBoxManage-sharedfolder.xml
@@ -47,6 +47,7 @@
       <arg>--automount</arg>
       <arg>--readonly</arg>
       <arg>--transient</arg>
+      <arg>--auto-mount-point=<replaceable>mountpoint</replaceable></arg>
     </cmdsynopsis>

     <cmdsynopsis id="synopsis-vboxmanage-sharedfolder-remove">
@@ -111,7 +112,8 @@

 <filename>/var/run/media/<replaceable>username</replaceable>/sf_<replaceable>sharename</replaceable></filename>
               or

 <filename>/media/sf_<replaceable>sharename</replaceable></filename>,
-              depending on your guest OS.
+              depending on your guest OS, unless
+              <option>--auto-mount-point</option> is used.
             </para></listitem>
         </varlistentry>
         <varlistentry>
@@ -136,6 +138,12 @@
               after the VM stops.
             </para></listitem>
         </varlistentry>
+        <varlistentry>
+
 <term>--auto-mount-point=<replaceable>mountpoint</replaceable></term>
+          <listitem><para>
+              Specifies the mount point of the share.
+            </para></listitem>
+        </varlistentry>
       </variablelist>
     </refsect2>
     <refsect2 id="vboxmanage-sharedfolder-remove">
diff --git a/doc/manual/en_US/user_VBoxManage.xml
b/doc/manual/en_US/user_VBoxManage.xml
index 350709f4..60e4b987 100644
--- a/doc/manual/en_US/user_VBoxManage.xml
+++ b/doc/manual/en_US/user_VBoxManage.xml
@@ -6385,6 +6385,7 @@ Value: 2006.01.01</screen>
 VBoxManage sharedfolder     add <uuid|vmname>
                                 --name <name> --hostpath
<hostpath>
                                 [--transient] [--readonly] [--automount]
+                                [--auto-mount-point <mountpoint>]
 </screen>

     <para>
@@ -6454,7 +6455,8 @@ VBoxManage sharedfolder     add <uuid|vmname>
         <para>
           <computeroutput>-automount</computeroutput>: Specifies that
           the share will be automatically mounted. On Linux
-          distributions, this will be to either
+          distributions, unless
<computeroutput>--auto-mount-point</computeroutput>
+          is used, this will be to either

 <filename>/media/USER/sf_<replaceable>share-name</replaceable></filename>
           or

 <filename>/media/sf_<replaceable>share-name</replaceable></filename>,
@@ -6463,6 +6465,13 @@ VBoxManage sharedfolder     add <uuid|vmname>
         </para>
       </listitem>

+      <listitem>
+        <para>
+          <computeroutput>-auto-mount-point
<mountpoint></computeroutput>:
+          Specifies the mount point of the share.
+        </para>
+      </listitem>
+
     </itemizedlist>

 <screen>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
b/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
index d3c15586..7f90e322 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
@@ -1152,6 +1152,7 @@ void printUsage(USAGECATEGORY enmCommand, uint64_t
fSubcommandScope, PRTSTREAM p
                                "%s sharedfolder %s    add <uuid|vmname>\n"
                          "                            --name <name>
--hostpath <hostpath>\n"
                          "                            [--transient]
[--readonly] [--automount]\n"
+                         "                            [--auto-mount-point
<mountpoint>]\n"
                          "\n", SEP);

         if (fSubcommandScope & HELP_SCOPE_SHAREDFOLDER_REMOVE)
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
b/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
index 3655d077..4631a801 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
@@ -1128,7 +1128,8 @@ RTEXITCODE handleSharedFolder(HandlerArg *a)
             {
                 fAutoMount = true;
             }
-            else if (!strcmp(a->argv[i], "--auto-mount-point"))
+            else if (   !strcmp(a->argv[i], "--auto-mount-point")
+                     || !strcmp(a->argv[i], "-auto-mount-point"))
             {
                 if (a->argc <= i + 1 || !*a->argv[i+1])
                     return errorArgument("Missing argument to '%s'",
a->argv[i]);
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20200721/624a23a2/attachment.html>


More information about the vbox-dev mailing list