1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!DOCTYPE topic
|
---|
3 | PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
|
---|
4 | <topic xml:lang="en-us" id="sharedfolders">
|
---|
5 | <title>Shared Folders</title>
|
---|
6 |
|
---|
7 | <body>
|
---|
8 | <p>
|
---|
9 | With the <i>shared folders</i> feature of
|
---|
10 | Oracle VM VirtualBox, you can access files of your host system from
|
---|
11 | within the guest system. This is similar to how you would use
|
---|
12 | network shares in Windows networks, except that shared folders do
|
---|
13 | not require networking, only the Guest Additions. Shared folders
|
---|
14 | are supported with Windows 2000 or later, Linux, and Oracle
|
---|
15 | Solaris guests. Oracle VM VirtualBox includes experimental support for
|
---|
16 | Mac OS X and OS/2 guests.
|
---|
17 | </p>
|
---|
18 | <p>
|
---|
19 | Shared folders physically reside on the <i>host</i>
|
---|
20 | and are then shared with the guest, which uses a special file
|
---|
21 | system driver in the Guest Additions to talk to the host. For
|
---|
22 | Windows guests, shared folders are implemented as a pseudo-network
|
---|
23 | redirector. For Linux and Oracle Solaris guests, the Guest
|
---|
24 | Additions provide a virtual file system.
|
---|
25 | </p>
|
---|
26 | <p>
|
---|
27 | To share a host folder with a virtual machine in Oracle VM VirtualBox,
|
---|
28 | you must specify the path of the folder and choose a
|
---|
29 | <i>share name</i> that the guest can use to access
|
---|
30 | the shared folder. This happens on the host. In the guest you can
|
---|
31 | then use the share name to connect to it and access files.
|
---|
32 | </p>
|
---|
33 | <p>
|
---|
34 | There are several ways in which shared folders can be set up for a
|
---|
35 | virtual machine:
|
---|
36 | </p>
|
---|
37 | <ul>
|
---|
38 | <li>
|
---|
39 | <p>
|
---|
40 | In the window of a running VM, you select
|
---|
41 | <b outputclass="bold">Shared Folders</b> from the
|
---|
42 | <b outputclass="bold">Devices</b> menu, or click on the
|
---|
43 | folder icon on the status bar in the bottom right corner.
|
---|
44 | </p>
|
---|
45 | </li>
|
---|
46 | <li>
|
---|
47 | <p>
|
---|
48 | If a VM is not currently running, you can configure shared
|
---|
49 | folders in the virtual machine's
|
---|
50 | <b outputclass="bold">Settings</b> window.
|
---|
51 | </p>
|
---|
52 | </li>
|
---|
53 | <li>
|
---|
54 | <p>
|
---|
55 | From the command line, you can create shared folders using
|
---|
56 | <userinput>VBoxManage</userinput>, as follows:
|
---|
57 | </p>
|
---|
58 | <pre xml:space="preserve">VBoxManage sharedfolder add "VM name" --name "sharename" --hostpath "C:\test"</pre>
|
---|
59 | <p>
|
---|
60 | See <xref href="man_VBoxManage-sharedfolder.dita#vboxmanage-sharedfolder"/>.
|
---|
61 | </p>
|
---|
62 | </li>
|
---|
63 | </ul>
|
---|
64 | <p>
|
---|
65 | There are two types of shares:
|
---|
66 | </p>
|
---|
67 | <ul>
|
---|
68 | <li>
|
---|
69 | <p>
|
---|
70 | Permanent shares, that are saved with the VM settings.
|
---|
71 | </p>
|
---|
72 | </li>
|
---|
73 | <li>
|
---|
74 | <p>
|
---|
75 | Transient shares, that are added at runtime and disappear when
|
---|
76 | the VM is powered off. These can be created using a check box
|
---|
77 | in VirtualBox Manager, or by using the <codeph>--transient</codeph>
|
---|
78 | option of the <userinput>VBoxManage sharedfolder add</userinput>
|
---|
79 | command.
|
---|
80 | </p>
|
---|
81 | </li>
|
---|
82 | </ul>
|
---|
83 | <p>
|
---|
84 | Shared folders can either be read-write or read-only. This means
|
---|
85 | that the guest is either allowed to both read and write, or just
|
---|
86 | read files on the host. By default, shared folders are read-write.
|
---|
87 | Read-only folders can be created using a check box in the
|
---|
88 | VirtualBox Manager, or with the <codeph>--readonly option</codeph> of the
|
---|
89 | <userinput>VBoxManage sharedfolder add</userinput> command.
|
---|
90 | </p>
|
---|
91 | <p>
|
---|
92 | Oracle VM VirtualBox shared folders also support symbolic links, also
|
---|
93 | called <i>symlinks</i>, under the following
|
---|
94 | conditions:
|
---|
95 | </p>
|
---|
96 | <ul>
|
---|
97 | <li>
|
---|
98 | <p>
|
---|
99 | The host operating system must support symlinks. For example,
|
---|
100 | a macOS, Linux, or Oracle Solaris host is required.
|
---|
101 | </p>
|
---|
102 | </li>
|
---|
103 | <li>
|
---|
104 | <p>
|
---|
105 | Currently only Linux and Oracle Solaris Guest Additions
|
---|
106 | support symlinks.
|
---|
107 | </p>
|
---|
108 | </li>
|
---|
109 | <li>
|
---|
110 | <p>
|
---|
111 | For security reasons the guest OS is not allowed to create
|
---|
112 | symlinks by default. If you trust the guest OS to not abuse
|
---|
113 | the functionality, you can enable creation of symlinks for a
|
---|
114 | shared folder as follows:
|
---|
115 | </p>
|
---|
116 | <pre xml:space="preserve">VBoxManage setextradata "VM name" VBoxInternal2/SharedFoldersEnableSymlinksCreate/<varname>sharename</varname> 1</pre>
|
---|
117 | </li>
|
---|
118 | </ul>
|
---|
119 | </body>
|
---|
120 |
|
---|
121 |
|
---|
122 | </topic>
|
---|