keepcalculator

06 Numbers and Powers

VirtualBox Shared Folder: Create & Access Guide

Card No. 06·62628 · Updated · Standard formula, shown below

This guide shows you how to create a shared folder in VirtualBox so you can easily exchange files between your host operating system and a guest virtual machine. You’ll set up the folder in VirtualBox’s settings, then access it from inside the guest OS. You’ll need VirtualBox installed, a virtual machine already created, and the guest operating system running.

What You’ll Need

  • VirtualBox installed on your host machine (Windows, macOS, or Linux).
  • A virtual machine with a guest operating system installed (Windows, Linux, etc.).
  • Administrator or sudo access to the guest OS to install Guest Additions if needed.
  • Basic familiarity with file explorer/terminal commands in both host and guest.

Step-by-Step

  1. Create a folder on your host that you want to share. For example, create C:\Shared on Windows or /home/username/Shared on Linux/macOS. Put any files you want to share into this folder.
  2. Open VirtualBox and select your virtual machine from the list. Do not start it yet; click the Settings button (gear icon) in the toolbar.
  3. In the Settings window, go to the Shared Folders section (usually under “General” or a separate tab depending on version).
  4. Click the Add Folder icon (folder with a plus sign) on the right side.
  5. In the “Add Share” dialog, use the Folder Path dropdown or the Browse button to select the host folder you created in step 1.
  6. Give the share a Folder Name that the guest will see. This can be anything, but keep it simple like shared. Avoid spaces and special characters.
  7. Check the Auto-mount option if you want the folder to be automatically available every time the VM starts. Check Make Permanent so it survives a reboot of the VM.
  8. If you want read-write access, leave Read-only unchecked. If you only want the guest to be able to read files, check it.
  9. Click OK to close the dialog, then OK again to save the VM settings.
  10. Start the virtual machine by clicking the Start button.
  11. Once the guest OS boots, you need to install Guest Additions if you haven’t already. In the VirtualBox menu bar (at the top of the VM window), go to Devices > Insert Guest Additions CD image…. Follow the installation prompts inside the guest, then reboot the guest if asked.
  12. After rebooting, the shared folder should appear automatically if you checked Auto-mount. On Windows guests, look for it under This PC or Network locations as a mapped drive (often VBOX_ followed by the folder name). On Linux/macOS guests, it usually appears under /media/ or /mnt/ with the folder name.
  13. If it didn’t auto-mount, you can manually mount it. On Windows, open File Explorer, right-click This PC, choose Map network drive, and use the path \\VBOXSVR\shared (replace shared with your folder name). On Linux, open a terminal and run: sudo mount -t vboxsf shared /mnt/shared (create the mount point first with mkdir /mnt/shared).
  14. You can now copy files in either direction between the host folder and the guest folder. Changes appear on both sides instantly.

Common Mistakes

  • Forgetting to install Guest Additions: Without Guest Additions, shared folders do not work at all. Always install them first.
  • Using spaces in the share name: This can cause issues on Linux guests. Stick to lowercase letters, numbers, and underscores.
  • Not checking Auto-mount: If you don’t enable it, you’ll have to manually mount the folder every boot, which is tedious.
  • Selecting the wrong folder path: Double-check that you’ve selected the host folder, not a subfolder or a drive root.
  • Read-only checkbox left checked: If you can’t write to the shared folder, check if Read-only is enabled in the settings.

Tips

  • For better performance, place the shared folder on a fast SSD and avoid sharing your entire hard drive.
  • Use a dedicated folder for sharing, not your Desktop or Documents, to avoid clutter and accidental file changes.
  • If you’re sharing sensitive data, consider using a separate VM snapshot before enabling the share.
  • On Linux guests, you may need to add your user to the vboxsf group to access the folder without sudo: sudo usermod -aG vboxsf $USER.
  • If you have multiple VMs, you can share the same host folder with each one, but give each share a unique name.

Troubleshooting

Folder not appearing in guest: First, verify that Guest Additions are installed correctly. Reinstall them and reboot. If still missing, check the VM settings to ensure the share is listed. Try removing the share and re-adding it. On Linux, run ls /media or ls /mnt to see if it’s mounted elsewhere.

Permission denied when accessing: On Linux, ensure the mount point has correct permissions. Run sudo chmod 755 /mnt/shared (or your mount point). Also, check that the host folder permissions allow read/write for your host user. On Windows, make sure the host folder isn’t marked as read-only.

Mount error on Linux: If you get mount: unknown filesystem type 'vboxsf', it means Guest Additions are not properly installed or the kernel module isn’t loaded. Reinstall Guest Additions and run sudo modprobe vboxsf.

Slow file transfer: Shared folders can be slower than direct network shares. If speed is critical, consider using a network share or a USB drive instead. Also, avoid transferring thousands of small files at once.

Shared folder works but changes don’t sync: This is normal—shared folders are not a real-time sync service. Files are written to the host disk immediately, but the guest may cache. Refresh the file explorer or run sync on Linux to force a flush.

Frequently Asked Questions

Q: Can I share a folder between two VMs?
A: Yes, but you need to create the same host folder as a shared folder for each VM. They’ll both access the same host directory, so changes are visible to both.

Q: Do I need to install Guest Additions on every VM?
A: Yes, each guest OS needs its own Guest Additions installation. It’s specific to the virtual hardware and OS version.

Q: Can I share a folder that is on an external drive?
A: Yes, as long as the drive is mounted on the host and the path is accessible. Just select it in the folder path.

Q: Why is my shared folder read-only on the guest?
A: Check if the Read-only checkbox was ticked when you added the share. Also, on Linux, the mount point might have restrictive permissions—use chmod to fix.

Q: Can I share a folder with a macOS guest?
A: Yes, but macOS guests require special configuration. Ensure you have the latest VirtualBox and Guest Additions, and note that macOS may restrict access to certain folders due to security policies.

Q: How do I remove a shared folder?
A: Go to VM Settings > Shared Folders, select the folder, and click the Remove button (trash icon). The folder will no longer be available to the guest.

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

The whole Numbers and Powers drawer →