A VirtualBox shared folder is a directory on your host computer that you make accessible inside a guest virtual machine, letting you move files between the two without a network or USB drive. You set it up through the VirtualBox Manager or with the VBoxManage command, and then mount it inside the guest OS. This article explains how to create one, why it sometimes fails, and how to fix the most common issues.
What a Shared Folder Actually Does
When you run a virtual machine, the guest OS thinks it has its own hard drive, but that drive is just a file on your host. A shared folder is a separate, deliberate bridge: you point VirtualBox at a real folder on your host (for example, C:\Users\you\Documents\Shared on Windows or /home/you/shared on Linux), and the guest sees it as a mounted directory like D:\Shared or /mnt/shared. Files written in the guest appear instantly on the host and vice versa.
This is different from drag-and-drop or the clipboard. Those are separate VirtualBox features that copy files or text through the Guest Additions. A shared folder is a live, bidirectional mount—both sides see the same files in real time. It works with any file type, and you can use it for source code, documents, or even installing software inside the guest from an ISO you keep on the host.
Prerequisites: Guest Additions
Before a shared folder will work, the guest must have VirtualBox Guest Additions installed. Guest Additions is a package of drivers and system utilities that VirtualBox injects into the guest to improve performance and enable features like shared folders, seamless mode, and better video. Without it, the shared folder option exists in the settings, but the guest will not see the mount point.
- Windows guest: In the VirtualBox menu, go to Devices → Insert Guest Additions CD image…, then run
VBoxWindowsAdditions.exeinside the guest and reboot. - Linux guest: Mount the same CD image, then run
sudo ./VBoxLinuxAdditions.runfrom the mounted media. You may need the kernel headers and build tools installed first (build-essentialon Debian/Ubuntu,kernel-develon Fedora). - macOS guest: macOS guests are not officially supported by VirtualBox, and shared folders generally do not work reliably there. This is a known limitation of the product.
After installation, reboot the guest. You can verify the installation by checking the VirtualBox menu: if Devices → Shared Folders is greyed out, Guest Additions are not running.
How to Create a Shared Folder
There are two ways to define a shared folder: through the graphical interface or the command line. The graphical method is simpler for one-off use.
- With the VM powered off (or while it is running, but changes require a remount), open the VM’s Settings.
- Go to Shared Folders.
- Click the folder-with-a-plus icon to add a new definition.
- In the Folder Path field, browse to the host directory you want to share.
- Give it a Folder Name—this is the name the guest will use to identify it. Keep it simple, like
shared. - Choose Read-only if the guest should not modify files, and Auto-mount if you want the guest to mount it automatically at boot.
- Click OK twice.
If you prefer the command line, the equivalent is:
VBoxManage sharedfolder add "MyVM" --name shared --hostpath "C:\Users\you\Shared" --automount
This adds the definition to the VM’s configuration. The actual mounting still happens inside the guest, as described next.
Mounting the Folder Inside the Guest
Defining the shared folder in VirtualBox only tells the hypervisor that the folder exists. The guest OS must then mount it. The exact command depends on the guest OS.
Windows guest: If you chose Auto-mount, the folder appears as a network drive (usually V:\ or the next available letter) in This PC. If not, open a command prompt and run:
net use Z: \\vboxsvr\shared
Replace Z: with a free drive letter and shared with the folder name you gave. The host name vboxsvr is fixed.
Linux guest: With auto-mount, the folder appears under /media/sf_shared (or /mnt/shared on older versions). If you need to mount it manually, run:
sudo mount -t vboxsf shared /mnt/shared
You must create the mount point first (sudo mkdir /mnt/shared). To make it permanent, add a line to /etc/fstab:
shared /mnt/shared vboxsf defaults,uid=1000,gid=1000 0 0
The uid and gid options set the owner of the mount so you can write to it without sudo every time.
Common Problems and Fixes
The most frequent issue is “mount: unknown filesystem type ‘vboxsf’.” This means the Guest Additions kernel module is not loaded. On Linux, run sudo modprobe vboxsf to load it immediately, then try mounting again. If that fails, reinstall Guest Additions, making sure the kernel headers match your running kernel.
Another common problem: the folder is visible but read-only. This usually happens on Linux because the mount is owned by root. Add uid=1000,gid=1000 (or your user’s IDs) to the mount options in /etc/fstab or the manual mount command.
On Windows guests, you might see “The system cannot find the drive specified” when using net use. Check that the folder name is exactly as defined (case matters) and that Guest Additions are running. You can verify by opening the VirtualBox menu and looking at Devices → Shared Folders—if it is greyed out, the service is not active.
If files appear on the host but not in the guest (or vice versa), the most likely cause is that the guest is caching directory listings. Refresh the folder view, or on Linux run sync and then ls -la again. This is rare but happens with some network filesystems.
Performance and Limitations
Shared folders are not as fast as a native disk. They go through the VirtualBox filesystem driver, which adds overhead. For large files (multiple GB) or many small files, you will see slower speeds than a directly attached virtual disk. If performance is critical, consider using a virtual disk image that both systems can access, or use a network share over the virtual network adapter.
There are also some known limitations:
- Symbolic links may not work unless you enable the
symlinksoption in the mount command, and even then, the host filesystem must support them. - File permissions are simplified. The guest sees the host’s permissions, but mapping is not perfect, especially between Windows (NTFS) and Linux (ext4).
- Special files like Unix sockets or device files cannot be shared.
- Case sensitivity differs: Windows is case-insensitive, Linux is case-sensitive. A file named
Readme.txtandreadme.txtcannot coexist on a Windows host but can on Linux.
Alternatives to Shared Folders
Shared folders are the easiest way to exchange files, but they are not the only option. Depending on your needs, one of these may be better:
- Drag and drop: Built into VirtualBox (with Guest Additions), good for occasional file transfers. It copies, not syncs, so changes are not reflected back.
- Clipboard sharing: For text and small images, not for files.
- Network share (SMB/NFS): Set up a file server on the host and connect to it from the guest over the virtual network. This is more realistic for testing network configurations and often faster than vboxsf.
- Virtual disk image: Create a second small virtual disk, attach it to the VM, and format it with a filesystem both OSes can read (like FAT32 or exFAT). You can then mount that disk image on the host using tools like
qemu-nbdor 7-Zip, but it is clunky. - Cloud storage: Use Dropbox, Google Drive, or similar in both OSes. Simple, but requires internet and has latency.
For most users, shared folders are the right choice because they are built-in and require no extra software.
Frequently Asked Questions
Why is my shared folder empty in the guest?
If the folder mounts but shows no files, check that you are looking at the correct mount point. On Linux, auto-mount puts it under /media/sf_name, and you may need to add your user to the vboxsf group (sudo usermod -aG vboxsf $USER) to see the contents. On Windows, the drive letter may be different from what you expect; check This PC for a drive labeled with the folder name.
Can I share a folder between two guests?
No, not directly. A shared folder is always between the host and one guest. To share between two guests, you would need to put the folder on the host and share it with both guests separately, or set up a network share and have both guests connect to it.
Does a shared folder work when the VM is paused or saved?
No. The shared folder is only active while the VM is running. If you pause or save the VM, the guest cannot access the folder until you resume it. Files written to the host while the VM is paused will appear in the guest once it resumes and refreshes the directory.
How do I remove a shared folder?
Open the VM’s Settings → Shared Folders, select the folder, and click the minus icon. Then unmount it inside the guest: on Linux run sudo umount /mnt/shared; on Windows use net use Z: /delete. The folder definition is removed from the VM configuration immediately.
Is it safe to share my entire C: drive?
Technically yes, but it is a bad idea. The guest will have read/write access to everything on that drive, including system files. If the guest is compromised, an attacker could modify or delete host files. Always share a specific, dedicated folder with only the data you need.
Why is the shared folder slow when copying many small files?
Each file operation goes through the VirtualBox filesystem driver, which adds overhead per file. Copying 10,000 small files will be much slower than copying one large file of the same total size. If you need to move many small files, zip them first, or use a different transfer method like a network share.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Campus Tech Innovation Hubs: What They Are
- Poco C51 Airtel Prepaid Locked Variant India?
- Jenkins vs GitHub Actions: Which CI/CD Fits Your Team?
- Turn Off Backup Encryption in iTunes?
- Shared VPS Hosting: Is It Better?
- Disk Defrag Pro: What It Does and Whether You Need It