How to Create a Shared Folder in VirtualBox
This guide shows you how to set up a shared folder between your Windows, macOS, or Linux host and a guest virtual machine running in VirtualBox. After following these steps, you’ll be able to drag-and-drop or access files directly from both systems without needing USB drives or network transfers.
What You’ll Need
- Oracle VM VirtualBox installed (version 6.x or newer recommended)
- A virtual machine with a guest OS installed (Windows, Linux, or macOS)
- Administrator or sudo access on both host and guest
- Guest Additions installed in the guest OS (required for most shared folder features)
Step-by-Step
- Shut down the guest VM (or at least ensure it’s powered off) before adding a shared folder. In VirtualBox Manager, select your VM and click Settings.
- Go to the Shared Folders section (under “General” or in the left sidebar).
- Click the Add Folder icon (a folder with a plus sign).
- In the “Folder Path” field, click the drop-down arrow and choose Other to browse for a folder on your host system. Select the folder you want to share (e.g.,
C:\Shareor/home/you/share). - Give the shared folder a Name. This is the name you’ll use inside the guest OS. Use only letters, numbers, and underscores (no spaces or special characters).
- Choose the mount options:
- Read-only: check if you want the guest to only read files, not modify them.
- Auto-mount: check to have the folder automatically mounted when the guest starts.
- Make Permanent: leave checked so the folder persists after reboots.
- Click OK to save the shared folder configuration.
- Start the guest VM and log in.
- If you haven’t installed Guest Additions, do that now: in the VM menu, click Devices → Insert Guest Additions CD image…, then run the installer inside the guest. Reboot the guest if prompted.
- Access the shared folder:
- Windows guest: Open File Explorer and look under “This PC” → “Network locations” or type
\\VBOXSVR\sharenamein the address bar. If that doesn’t work, try\\10.0.2.4\sharename(for NAT networking). - Linux guest: Open your file manager and look under “Other Locations” → “Computer” → “media” → “sf_sharename”, or open a terminal and type
ls /media/sf_sharename. If permission denied, add your user to thevboxsfgroup:sudo usermod -aG vboxsf $USERand log out/in. - macOS guest: Shared folders appear under “Volumes” in Finder, usually as
sf_sharename.
- Windows guest: Open File Explorer and look under “This PC” → “Network locations” or type
- Test by copying a file from the host into the shared folder and see if it appears in the guest (and vice versa).
Common Mistakes
- Forgetting to install Guest Additions – Shared folders won’t work without them.
- Using spaces or special characters in the folder name – This causes mounting errors.
- Not adding the user to the vboxsf group on Linux – You’ll get “Permission denied” even though the folder is mounted.
- Sharing a folder while the VM is running – Some versions require the VM to be off; changes may not appear until reboot.
- Choosing a host folder that doesn’t exist – Double-check the path.
- Using a network drive as the shared folder – VirtualBox may not handle mapped network drives reliably; use a local folder instead.
Tips
- Use a dedicated folder on your host (like
C:\Users\YourName\Shared) to avoid accidentally sharing sensitive data. - Keep the folder name short and lowercase to avoid case-sensitivity issues in Linux guests.
- If you need to share multiple folders, repeat the steps for each one.
- For better performance, place the shared folder on an SSD.
- If you’re using a Linux host and want to share a folder that contains symlinks, enable the “Symlinks” option in the shared folder settings (requires the VM to be off).
Troubleshooting
Shared folder not showing up in Windows guest
Try mapping a network drive: open Command Prompt and run net use Z: \\VBOXSVR\sharename. If that fails, check that Guest Additions are installed and the VM is running with the correct network adapter (NAT or Host-Only).
Permission denied on Linux guest
Most likely your user isn’t in the vboxsf group. Run sudo usermod -aG vboxsf $USER, then log out and back in. If the group doesn’t exist, reinstall Guest Additions.
Shared folder disappears after reboot
Make sure “Make Permanent” was checked when you added the folder. If not, edit the VM settings and re-add it with that option.
Auto-mount doesn’t work
Try mounting manually: on Linux, sudo mount -t vboxsf sharename /mnt/point. If that works, the issue is with auto-mount; check that the folder name matches exactly (case-sensitive).
Files are read-only even though I didn’t check read-only
On Linux, the shared folder is mounted with permissions that may not allow writing for non-root users. Add your user to the vboxsf group and ensure the folder’s host permissions allow write access.
Guest Additions installation fails
On Linux, you may need to install kernel headers and build tools first: sudo apt install build-essential linux-headers-$(uname -r) (Debian/Ubuntu) or equivalent for your distro. On Windows, run the installer as administrator.
Frequently Asked Questions
Do I need Guest Additions for shared folders?
Yes, Guest Additions provides the necessary drivers and services for shared folders to work. Without them, the feature is unavailable.
Can I share a folder with a macOS guest?
Yes, but macOS guests are only supported on Apple hardware (or with certain workarounds). Shared folders appear under /Volumes in Finder.
Why is my shared folder empty?
Check that the host folder path is correct and contains files. Also, ensure you’re looking in the right location inside the guest (e.g., /media/sf_sharename on Linux).
Can I share a folder between two VMs?
No, VirtualBox shared folders are only between host and guest. To share between VMs, use network shares or a common host folder mounted in both.
Is it safe to share my entire C: drive?
Technically possible, but not recommended. Malware in the guest could access or modify host files. Share only specific folders you need.
Does the shared folder work with snapshots?
Yes, but if you revert to a snapshot, the shared folder configuration from that snapshot is restored. Changes made after the snapshot may be lost.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.