4.4 Folder sharing
Shared Folders allow you to access files of your host system from within the guest
system, much like ordinary shares on Windows networks would – except that shared
folders do not need a networking setup. Sharing is accomplished using a special ser-
vice on the host and a file system driver for the guest, both of which are provided by
In order to use this feature, the VirtualBox Guest Additions have to be installed.
Currently, Shared Folders are limited to Windows XP, Windows 2000 and Linux 2.4
and 2.6 guests.
To share a folder with a virtual machine in VirtualBox, you must specify the path of
the folder to be shared on the host and chose a “share name” that the guest can use
to access it. Hence, first create the shared folder on the host; then, within the guest,
connect to it.
There are several ways in which shared folders can be set up for a particular virtual
• In the graphical user interface of a running virtual machine, you can select
“Shared folders” from the “Devices” menu, or click on the folder icon on the
status bar in the bottom right corner of the virtual machine window.
• If a virtual machine is not currently running, you can configure shared folders in
each virtual machine’s “Settings” dialog.
• From the command line, you can create shared folders using the the VBoxMan-
age command line interface; see chapter 8, VBoxManage reference, page 82. The
command is as follows:
VBoxManage sharedfolder add "VM name" -name "sharename" -hostpath "C:\test"
There are two types of shares:
1. VM shares which are only available to the VM for which they have been defined;
2. transient VM shares, which can be added and removed at runtime and do not
persist after a VM has stopped; for these, add the -transient option to the
above command line.
Then, you can mount the shared folder from inside a VM the same way as you would
mount an ordinary network share:
• In a Windows guest, starting with VirtualBox 1.5.0, shared folders are
browseable and are therefore visible in Windows Explorer. So, to attach the
host’s shared folder to your Windows guest, open Windows Explorer and look
for it under “My Networking Places” -> “Entire Network” -> “VirtualBox Shared
Folders”. By right-clicking on a shared folder and selecting “Map network drive”
from the menu that pops up, you can assign a drive letter to that shared folder.
Alternatively, on the Windows command line, use the following:
net use x: \\vboxsvr\sharename
While vboxsvr is a fixed name (note that vboxsrv would also work), replace
“x:“ with the drive letter that you want to use for the share, and sharename
with the share name specified with VBoxManage.