Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Virtualization»How to Create Shared Folder on Virtualbox

How to Create Shared Folder on Virtualbox

Abhishek SilwalBy Abhishek SilwalNovember 29, 2022
virtualbox shared folder

Creating a shared folder is one of the easiest ways to transfer files between your Virtual Machines (VMs) and the host PC. There are other simple methods as well, such as the network sharing process and Drag-and-Drop. However, network sharing is slightly more tedious, and Drag-and-Drop carries certain restrictions due to how elevation works.

Shared folders also allow symbolic links, provided that you enable such setting using the VBoxManage setextradata "VM name" VBoxInternal2/SharedFoldersEnableSymlinksCreate/sharename 1 command.

However, if you don’t properly create a shared folder or perform the prerequisite actions, you won’t be able to access them from your guest operating system. So, we have mentioned everything you need to do for this purpose in this article.

Table of Contents

  • How to Create Shared Folders on VirtualBox?
  • How to Access Shared Folders From VM?
    • Step 1: Install Guest Additions
      • On Windows VM
      • On Linux VM
      • On Oracle Solaris VM
      • On Mac OS VM
    • Step 2: Access Shared Folders
      • On Windows VM
      • On Linux, Mac, and Oracle Solaris VM

How to Create Shared Folders on VirtualBox?

VirtualBox allows creating shared folders without having to manually change the permissions of the folders. You even get an option to auto-mount these folders for easier access. Here’s what you need to do to create them:

  1. Create a folder you want to share on your Operating System.
  2. Then, open VirtualBox.
  3. Select the Virtual Machine (VM) for which you wish to share the folder and click Settings.
  4. Go to the Shared Folders tab.
  5. Click on the Add icon.
    add-virtualbox-shared-folder
  6. Navigate to and select the folder you need to share. Then, click Open.
  7. Check Auto-mount. If you don’t do so, you need to manually mount the shared folder from your VM.
  8. Don’t check Read-only if you want to edit the folder contents from within the VM. You can also set another name for the folder before clicking OK.
    folder-path-and-auto-mount
  9. Hit OK to create the shared folder.

How to Access Shared Folders From VM?

Accessing the shared folders is easy. However, you need to have installed VirtualBox Guest Additions to access the folders.

Step 1: Install Guest Additions

First, follow the instructions below to install VirtualBox Guest Additions on your guest OS:

On Windows VM

  1. Open the Windows Virtual Machine inside VirtualBox.
  2. On the menu, go to Devices and select Insert Guest Additions CD Image.
    Insert-Guest-Additions-CD
  3. Follow the on-screen instructions if the installer launches automatically.
  4. Otherwise, open File Explorer and go to the mounted CD drive.
  5. Run VBoxWindowsAdditions.exe and follow the on-screen instructions.
    virtualbox-guest-additions-windows-setup

On Linux VM

  1. Open the Linux Terminal.
  2. First, you need to install build-essentials on the system. To do so, run the following commands:
    • sudo apt-get update
    • sudo apt-install build-essentials
    • sudo reboot
      sudo-apt-install-build-essentials
  3. After restarting, go to Devices > Optical Disks > Choose a disk file from the menu.
  4. On Windows, go to C:\Program Files\Oracle\VirtualBox and select VBoxGuestAdditions.iso. Then, click on Open. On Mac, the file is inside the Contents/macOS and on Linux, it’s usually in the /opt/VirtualBox/ directory.
    mount-iso-file
  5. Open the Terminal again and enter the following commands:
    • sudo mkdir /mnt/cdrom
    • sudo mount /dev/cdrom /mnt/cdrom
    • cd /mnt/cdrom
    • sudo sh ./VBoxLinuxAdditions.run – nox11
    • sudo restart
      mount-and-install-vbox-linux

On Oracle Solaris VM

  1. Go to Devices > Optical Disks > Choose a disk file from the menu.
  2. Go to C:\Program Files\Oracle\VirtualBox and select VBoxGuestAdditions.iso. Then, click on Open. (See the Linux steps above to know the location on other host systems)
  3. If the ISO file is not mounted,
    • Open a root terminal.
    • Type svcadm restart volfs and press Enter to mount the ISO file.
    • Change to the mounted directory using the cd and ls commands.
    • Then, enter the pkgadd -G -d ./VBoxSolarisAdditions.pkg command.
      pkgadd-solaris-guest-additions
    • Choose 1 and continue with the installation of the package.

On Mac OS VM

VirtualBox Guest Additions are not available for Mac OS X as of the date of this article. So, Shared Folder doesn’t work for a Mac VM. You need to use other methods to share files between the different host OS and the guest macOS, such as network share. However, it is possible to change the permissions on the /System/Library/Extensions/ folder of your Mac VM and force the installation of Guest Additions. Here’s how you can do so:

  1. First, you need to disable System Integrity Protection (SIP). To do so,
    • Open the Terminal and enter the following command to boot in recovery mode.
    • sudo nvram "recovery-boot-mode=unused"
    • sudo reboot
      Some Mac systems may need a different command. Check with official sources if the above doesn’t work.
    • On the Recovery mode, run the Terminal and enter the commands below:
      csrutil disable
      csrutil-disable
      spctl kext-consent add VB5E2TV963
      nvram -d recovery-boot-mode
      reboot
      spctl-kext-consent-add
  2. After that, open the Terminal again and enter the commands below:
    • sudo mount -uw /
    • sudo chown :admin /System/Library/Extensions/
    • sudo chmod 775 /System/Library/Extensions/
      chmod-permissions
  3. Go to Devices > Insert Guest Additions CD and follow the instructions.
  4. If it doesn’t work,
    • Go to Devices > Optical Disks > Choose a disk file.
    • Navigate to the VirtualBox installation folder (see Linux VM steps), select VBoxGuestAdditions.iso and click Open.
    • Open the mounted ISO drive and run the .pkg file.
  5. After that, open the Terminal and enter the following commands to revert the changes made earlier:
    • sudo chown :wheel /System/Library/Extensions/
    • sudo chmod 755 /System/Library/Extensions/
    • sudo nvram "recovery-boot-mode=unused"
    • sudo reboot
  6. On Recovery mode, enable SIP using the commands:
    • csrutil enable
    • nvram -d recovery-boot-mode
    • reboot

Reference : Github

Note: If you had previously installed Guest Additions but updated your VirtualBox app after that, you need to update the Guest Additions as well.

You can simply install the new Guest Additions for Windows and Linux guests to update them without having to uninstall them. However, on Oracle Solaris guest, you need to first uninstall the previous guest additions before installing the new one. 

To do so, open a root terminal and enter the command pkgrm SUNWvboxguest. Then, follow the above steps to re-install the Guest Additions.

Step 2: Access Shared Folders

Here’s how you can access the shared folders on different VM guests:

On Windows VM

  1. Open the Windows Virtual Machine inside VirtualBox.
  2. Open your File Explorer.
  3. Go to Network by clicking it from the navigation pane.
  4. Double-click on the Virtual Box Server (usually with the name VBOXSVR) to find the shared folder.
    shared-folder-vboxsvr

On Linux, Mac, and Oracle Solaris VM

  1. Open your Linux or Mac or Oracle Solaris Virtual Machine through VirtualBox.
  2. Go to Files or your File Explorer/Manager.
  3. You should see the shared folders as mounted folders, usually with the prefix “sf_”, if you enabled Auto-mount while creating them. You can just click on them to access the shared folders.
    sf-shared-folder-linux

If you can’t access a file inside the shared folder on Linux, your user account doesn’t have the necessary permissions. Here’s how you can resolve the issue:

  1. Open the Terminal inside the Linux VM.
  2. Enter the command sudo adduser “username” vboxsf while replacing “username” with your user account name.
how-to
Abhishek Silwal
  • LinkedIn

Abhishek Silwal is an Electronics Engineer and a technical writer at TechNewsToday. He specializes in troubleshooting a wide range of computer-related issues. His educational background in Electronics Engineering has given him a solid foundation in understanding of computers. He is also proficient in several programming languages and has worked on various robotics projects. Even in his early days, he used to tinker with various computer components, both hardware, and software, to satiate his curiosity. This experience has given him a breadth of experience that goes beyond his educational qualification. Abhishek has been writing articles on dealing with varieties of technical issues and performing specific tasks, especially on a Windows machine. He strives to create comprehensive guides on fixing many system and hardware issues and help others solve their problems. You can contact him at abhisheksilwal@technewtoday.com

Related Posts

virtual machine disks consolidation is needed

4 Ways to Fix “Virtual Machine Disks Consolidation is Needed”

December 27, 2022
failed to open a session for the virtual machine

How to Fix “Failed to Open a Session For The Virtual Machine” Error?

September 30, 2022
how to uninstall virtualbox

How to Uninstall VirtualBox on Windows

September 28, 2022
how to use vmware

How to Use VMware (Detailed Guide)

September 23, 2022
virtualize a physical machine vmware

How To Virtualize A Physical Machine With VMware

September 17, 2022
virtualbox-copy-paste-not-working

Virtualbox Copy Paste Not Working? Here’s How to Fix it

September 17, 2022
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how long does a cmos battery last

How Long Does a CMOS Battery Last

January 25, 2023
thunderbolt vs usb c

Thunderbolt Vs USB C: What’s the Difference

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
You may also like
Reset BIOS password

4 Ways to Reset BIOS Password

January 28, 2023
How to clean usb port 1

How to Clean USB Port on PC (Comprehensive Guide)

January 27, 2023
lenovo battery not charging

Lenovo Battery Not Charging? Try These Fixes

January 27, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday.

Type above and press Enter to search. Press Esc to cancel.