1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!--
|
---|
3 | manpage, user manual, usage: VBoxManage sharedfolder
|
---|
4 | -->
|
---|
5 | <!--
|
---|
6 | Copyright (C) 2006-2024 Oracle and/or its affiliates.
|
---|
7 |
|
---|
8 | This file is part of VirtualBox base platform packages, as
|
---|
9 | available from https://www.alldomusa.eu.org.
|
---|
10 |
|
---|
11 | This program is free software; you can redistribute it and/or
|
---|
12 | modify it under the terms of the GNU General Public License
|
---|
13 | as published by the Free Software Foundation, in version 3 of the
|
---|
14 | License.
|
---|
15 |
|
---|
16 | This program is distributed in the hope that it will be useful, but
|
---|
17 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
19 | General Public License for more details.
|
---|
20 |
|
---|
21 | You should have received a copy of the GNU General Public License
|
---|
22 | along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
23 |
|
---|
24 | SPDX-License-Identifier: GPL-3.0-only
|
---|
25 | -->
|
---|
26 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
27 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"[
|
---|
28 | <!ENTITY % all.entities SYSTEM "all-entities.ent">
|
---|
29 | %all.entities;
|
---|
30 | ]>
|
---|
31 | <refentry id="vboxmanage-sharedfolder" lang="en">
|
---|
32 | <refentryinfo>
|
---|
33 | <pubdate>$Date: 2025-02-04 05:24:54 +0000 (Tue, 04 Feb 2025) $</pubdate>
|
---|
34 | <title>VBoxManage sharedfolder</title>
|
---|
35 | </refentryinfo>
|
---|
36 |
|
---|
37 | <refmeta>
|
---|
38 | <refentrytitle>VBoxManage-sharedfolder</refentrytitle>
|
---|
39 | <manvolnum>1</manvolnum>
|
---|
40 | </refmeta>
|
---|
41 |
|
---|
42 | <refnamediv>
|
---|
43 | <refname>VBoxManage-sharedfolder</refname>
|
---|
44 | <refpurpose>add and remove shared folders, configure security policy for shared folders</refpurpose>
|
---|
45 | <refclass>&product-name;</refclass>
|
---|
46 | </refnamediv>
|
---|
47 |
|
---|
48 | <refsynopsisdiv>
|
---|
49 | <cmdsynopsis id="synopsis-vboxmanage-sharedfolder-add">
|
---|
50 | <!-- The 'id' is mandatory and must start with 'synopsis-'. -->
|
---|
51 | <command>VBoxManage sharedfolder add</command>
|
---|
52 | <group choice="req">
|
---|
53 | <arg choice="plain">global</arg>
|
---|
54 | <arg choice="plain"><replaceable>uuid</replaceable></arg>
|
---|
55 | <arg choice="plain"><replaceable>vmname</replaceable></arg>
|
---|
56 | </group>
|
---|
57 | <arg choice="req">--name=<replaceable>share-name</replaceable></arg>
|
---|
58 | <arg choice="req">--hostpath=<replaceable>hostpath</replaceable></arg>
|
---|
59 | <arg>--readonly</arg>
|
---|
60 | <arg>--transient</arg>
|
---|
61 | <arg>--automount</arg>
|
---|
62 | <arg>--auto-mount-point=<replaceable>path</replaceable></arg>
|
---|
63 | </cmdsynopsis>
|
---|
64 |
|
---|
65 | <cmdsynopsis id="synopsis-vboxmanage-sharedfolder-remove">
|
---|
66 | <command>VBoxManage sharedfolder remove</command>
|
---|
67 | <group choice="req">
|
---|
68 | <arg choice="plain">global</arg>
|
---|
69 | <arg choice="plain"><replaceable>uuid</replaceable></arg>
|
---|
70 | <arg choice="plain"><replaceable>vmname</replaceable></arg>
|
---|
71 | </group>
|
---|
72 | <arg choice="req">--name=<replaceable>share-name</replaceable></arg>
|
---|
73 | <arg>--transient</arg>
|
---|
74 | </cmdsynopsis>
|
---|
75 |
|
---|
76 | <cmdsynopsis id="synopsis-vboxmanage-sharedfolder-modify">
|
---|
77 | <command>VBoxManage sharedfolder modify</command>
|
---|
78 | <group choice="req">
|
---|
79 | <arg choice="plain"><replaceable>uuid</replaceable></arg>
|
---|
80 | <arg choice="plain"><replaceable>vmname</replaceable></arg>
|
---|
81 | </group>
|
---|
82 | <arg choice="req">--name=<replaceable>share-name</replaceable></arg>
|
---|
83 | <arg choice="req">--readonly=
|
---|
84 | <group choice="plain">
|
---|
85 | <arg choice="plain">true</arg>
|
---|
86 | <arg choice="plain">false</arg>
|
---|
87 | </group>
|
---|
88 | </arg>
|
---|
89 | <arg choice="req">--automount=
|
---|
90 | <group choice="plain">
|
---|
91 | <arg choice="plain">true</arg>
|
---|
92 | <arg choice="plain">false</arg>
|
---|
93 | </group>
|
---|
94 | </arg>
|
---|
95 | <arg choice="req">--auto-mount-point=<replaceable>path</replaceable></arg>
|
---|
96 | <arg choice="req">--symlink-policy=
|
---|
97 | <group choice="plain">
|
---|
98 | <arg choice="plain">forbidden</arg>
|
---|
99 | <arg choice="plain">subtree</arg>
|
---|
100 | <arg choice="plain">relative</arg>
|
---|
101 | <arg choice="plain">any</arg>
|
---|
102 | </group>
|
---|
103 | </arg>
|
---|
104 | </cmdsynopsis>
|
---|
105 | </refsynopsisdiv>
|
---|
106 |
|
---|
107 | <refsect1 id="vboxmanage-sharedfolder-description">
|
---|
108 | <title>Description</title>
|
---|
109 | <para>
|
---|
110 | Shared folders enable you to share data between the host system
|
---|
111 | and guest VMs. To use shared folders you must first install the
|
---|
112 | &product-name; Guest Additions software in the guest VM.
|
---|
113 | </para>
|
---|
114 | <para>
|
---|
115 | The shared folder is associated with a share name and the full
|
---|
116 | path name of the folder or directory on the host system. The share
|
---|
117 | name is a unique name within the namespace of the host OS.
|
---|
118 | </para>
|
---|
119 | <refsect2 id="vboxmanage-sharedfolder-add">
|
---|
120 | <title>Add a Shared Folder</title>
|
---|
121 | <remark role="help-copy-synopsis"/>
|
---|
122 | <para>
|
---|
123 | The <command>VBoxManage sharedfolder add</command> command
|
---|
124 | creates a shared folder. The folder you specify is on the host
|
---|
125 | computer. Once created the contents of the folder on the
|
---|
126 | host system can be accessed from within the guest OS.
|
---|
127 | </para>
|
---|
128 | <variablelist>
|
---|
129 | <varlistentry>
|
---|
130 | <term><literal>global</literal></term>
|
---|
131 | <listitem><para>
|
---|
132 | Specifies that the share is global which means that it is
|
---|
133 | available to all virtual machines.
|
---|
134 | </para></listitem>
|
---|
135 | </varlistentry>
|
---|
136 | <varlistentry>
|
---|
137 | <term><option><replaceable>uuid</replaceable> | <replaceable>vmname</replaceable></option></term>
|
---|
138 | <listitem><para>
|
---|
139 | Specifies the name or UUID of the guest VM that shares a
|
---|
140 | folder with the host system.
|
---|
141 | </para></listitem>
|
---|
142 | </varlistentry>
|
---|
143 | <varlistentry>
|
---|
144 | <term>--name=<replaceable>share-name</replaceable></term>
|
---|
145 | <listitem><para>
|
---|
146 | Specifies the name of the share, which is a unique name
|
---|
147 | within the namespace of the host OS.
|
---|
148 | </para></listitem>
|
---|
149 | </varlistentry>
|
---|
150 | <varlistentry>
|
---|
151 | <term>--hostpath=<replaceable>hostpath</replaceable></term>
|
---|
152 | <listitem><para>
|
---|
153 | Specifies the absolute path of the folder or directory on
|
---|
154 | the host OS to share with the guest OS.
|
---|
155 | </para></listitem>
|
---|
156 | </varlistentry>
|
---|
157 | <varlistentry>
|
---|
158 | <term>--readonly</term>
|
---|
159 | <listitem><para>
|
---|
160 | Specifies that the share has only read-only access to
|
---|
161 | files at the host path.
|
---|
162 | </para><para>
|
---|
163 | By default, shared folders have read-write access to the
|
---|
164 | files mounted from the host. However on Solaris and Linux
|
---|
165 | distributions shared folders are mounted with 770 file
|
---|
166 | permissions with the files owned by the <literal>root</literal>
|
---|
167 | user and the <literal>vboxsf</literal> group which means the
|
---|
168 | files are restricted to members of the <literal>vboxsf</literal>
|
---|
169 | group and the <literal>root</literal> user. If the --readonly
|
---|
170 | option is specified the file permissions become 700 and the
|
---|
171 | files are accessible only to the <literal>root</literal> user.
|
---|
172 | </para></listitem>
|
---|
173 | </varlistentry>
|
---|
174 | <varlistentry>
|
---|
175 | <term>--transient</term>
|
---|
176 | <listitem><para>
|
---|
177 | Specifies that the share is transient which means that it
|
---|
178 | is added and removed to a running VM and does not persist
|
---|
179 | after the VM stops.
|
---|
180 | </para></listitem>
|
---|
181 | </varlistentry>
|
---|
182 | <varlistentry>
|
---|
183 | <term>--automount</term>
|
---|
184 | <listitem><para>
|
---|
185 | Specifies that the share is automatically mounted.
|
---|
186 | </para></listitem>
|
---|
187 | </varlistentry>
|
---|
188 | <varlistentry>
|
---|
189 | <term>--auto-mount-point=<replaceable>path</replaceable></term>
|
---|
190 | <listitem><para>
|
---|
191 | Specifies the mount point of the share. This is guest OS specific.
|
---|
192 | </para><para>
|
---|
193 | For Windows and OS/2 guests this must be an unused drive letter.
|
---|
194 | If left blank (or if the drive letter is already in use), the
|
---|
195 | last unused drive letter is used instead (i.e. searching from
|
---|
196 | <literal>Z:</literal> through <literal>A:</literal>).
|
---|
197 | </para><para>
|
---|
198 | For Linux, Solaris and other Unix guests, it must be an absolute
|
---|
199 | path such as <filename>/mnt/mysharedfolder</filename>. If left
|
---|
200 | empty the default location is
|
---|
201 | <filename>/media/sf_<replaceable>sharename</replaceable></filename>.
|
---|
202 | </para></listitem>
|
---|
203 | </varlistentry>
|
---|
204 | </variablelist>
|
---|
205 | </refsect2>
|
---|
206 | <refsect2 id="vboxmanage-sharedfolder-remove">
|
---|
207 | <title>Remove a Shared Folder</title>
|
---|
208 | <remark role="help-copy-synopsis"/>
|
---|
209 | <para>
|
---|
210 | The <command>VBoxManage sharedfolder remove</command> command
|
---|
211 | removes a shared folder.
|
---|
212 | </para>
|
---|
213 | <variablelist>
|
---|
214 | <varlistentry>
|
---|
215 | <term><literal>global</literal></term>
|
---|
216 | <listitem><para>
|
---|
217 | Specifies that the share is global which means that it is
|
---|
218 | accessible from all applicable guest VMs.
|
---|
219 | </para></listitem>
|
---|
220 | </varlistentry>
|
---|
221 | <varlistentry>
|
---|
222 | <term><option><replaceable>uuid</replaceable> | <replaceable>vmname</replaceable></option></term>
|
---|
223 | <listitem><para>
|
---|
224 | Specifies the name or UUID of the guest VM that shares a
|
---|
225 | folder with the host system.
|
---|
226 | </para></listitem>
|
---|
227 | </varlistentry>
|
---|
228 | <varlistentry>
|
---|
229 | <term>--name=<replaceable>share-name</replaceable></term>
|
---|
230 | <listitem><para>
|
---|
231 | Specifies the name of the share to remove.
|
---|
232 | </para></listitem>
|
---|
233 | </varlistentry>
|
---|
234 | <varlistentry>
|
---|
235 | <term>--transient</term>
|
---|
236 | <listitem><para>
|
---|
237 | Specifies that the share is transient which means that it
|
---|
238 | is added and removed to a running VM and does not persist
|
---|
239 | after the VM stops.
|
---|
240 | </para></listitem>
|
---|
241 | </varlistentry>
|
---|
242 | </variablelist>
|
---|
243 | </refsect2>
|
---|
244 | <refsect2 id="vboxmanage-sharedfolder-modify">
|
---|
245 | <title>Modify a Shared Folder's Configuration</title>
|
---|
246 | <remark role="help-copy-synopsis"/>
|
---|
247 | <para>
|
---|
248 | The <command>VBoxManage sharedfolder modify</command> command
|
---|
249 | modifies the configuration of a Shared Folder.
|
---|
250 | </para>
|
---|
251 | <variablelist>
|
---|
252 | <varlistentry>
|
---|
253 | <term><option><replaceable>uuid</replaceable> | <replaceable>vmname</replaceable></option></term>
|
---|
254 | <listitem><para>
|
---|
255 | Specifies the name or UUID of the guest VM that shares a
|
---|
256 | folder with the host system.
|
---|
257 | </para></listitem>
|
---|
258 | </varlistentry>
|
---|
259 | <varlistentry>
|
---|
260 | <term>--name=<replaceable>share-name</replaceable></term>
|
---|
261 | <listitem><para>
|
---|
262 | Specifies the name of the shared folder to modify.
|
---|
263 | </para></listitem>
|
---|
264 | </varlistentry>
|
---|
265 | <varlistentry>
|
---|
266 | <term>--readonly=<replaceable>true | false</replaceable></term>
|
---|
267 | <listitem><para>
|
---|
268 | Specifies whether the shared folder is to be mounted as read-only.
|
---|
269 | </para></listitem>
|
---|
270 | </varlistentry>
|
---|
271 | <varlistentry>
|
---|
272 | <term>--automount=<replaceable>true | false</replaceable></term>
|
---|
273 | <listitem><para>
|
---|
274 | Specifies whether the shared folder is to be mounted automatically
|
---|
275 | when the VM boots.
|
---|
276 | </para></listitem>
|
---|
277 | </varlistentry>
|
---|
278 | <varlistentry>
|
---|
279 | <term>--auto-mount-point=<replaceable>path</replaceable></term>
|
---|
280 | <listitem><para>
|
---|
281 | Specifies where to mount the shared folder if it is configured to be
|
---|
282 | be mounted automatically when the VM boots.
|
---|
283 | </para></listitem>
|
---|
284 | </varlistentry>
|
---|
285 | <varlistentry>
|
---|
286 | <term>--symlink-policy=<replaceable>policy-name</replaceable></term>
|
---|
287 | <listitem><para>
|
---|
288 | Specifies the symbolic link security policy of the shared folder.
|
---|
289 | Valid symlink security policies are:
|
---|
290 | <literal>forbidden</literal>, <literal>subtree</literal>,
|
---|
291 | <literal>relative</literal>, and <literal>any</literal>.
|
---|
292 | </para></listitem>
|
---|
293 | </varlistentry>
|
---|
294 | </variablelist>
|
---|
295 | </refsect2>
|
---|
296 | </refsect1>
|
---|
297 |
|
---|
298 | <refsect1 id="vboxmanage-sharedfolder-examples">
|
---|
299 | <title>Examples</title>
|
---|
300 | <remark role="help-scope" condition="GLOBAL" />
|
---|
301 | <para>
|
---|
302 | The following command creates a shared folder named
|
---|
303 | <filename>o7share</filename> for the <filename>ol7</filename> VM
|
---|
304 | and configures the share to be mounted automatically when the VM
|
---|
305 | is started.
|
---|
306 | </para>
|
---|
307 | <screen>$ VBoxManage sharedfolder add ol7 --name ol7share --hostpath "/home/user/ol7share" --automount</screen>
|
---|
308 | <para>
|
---|
309 | The following command removes the shared folder named
|
---|
310 | <filename>o7share</filename> from the <filename>ol7</filename> VM.
|
---|
311 | </para>
|
---|
312 | <screen>$ VBoxManage sharedfolder remove ol7 --name ol7share</screen>
|
---|
313 | </refsect1>
|
---|
314 | </refentry>
|
---|