+3 votes
93 views
in Apps / software by (242k points)
reopened
VirtualBox: Create a shared folder

1 Answer

+4 votes
by (1.6m points)
 
Best answer

Requirement: Install guest additions for VirtualBox
1st step:
2nd step:
3rd step:
4th step:
How to create a shared folder in VirtualBox
1st step:
2nd step:
3rd step:
4th step:
5th step:
6th step:
7th step:
8th step:
Quick Start Guide: Install Guest Additions
Quick start guide: Shared folder

You can use a shared folder to automatically share files between the virtual machine and the host..

image image

Files can be exchanged from the host to a virtual machine or vice versa via a shared folder. A shared storage location is particularly useful if you want to exchange data between the systems on a regular basis. We will show you what is required as a prerequisite in VirtualBox and how you can then integrate the shared folder.

Requirement: Install guest additions for VirtualBox

Before you can use a shared folder in VirtualBox, the guest additions for the operating system used must be installed. We use Windows 10 as the host machine and Linux Ubuntu 20.04 as the virtual machine. Follow our step-by-step instructions or take a look at the brief instructions .

1st step:

image
First start your virtual system and switch to " Devices " in the menu bar . There click on the entry " Insert guest additions ". A virtual optical drive is then inserted in the guest system and started automatically.

2nd step:

image
You will get a warning that VBox_GAs contains software that should be run automatically. Confirm the installation by clicking on " Execute ".

3rd step:

image
Identify yourself by entering your password and clicking on " Login ".

4th step:

image
The installation runs automatically in the terminal. Wait until "Press Return to close this window" appears and press [Enter] . Then you have to restart the guest system .

How to create a shared folder in VirtualBox

After the guest additions have been installed, a shared folder can be created for exchanging data between Windows and our virtual machine. To do this, follow our step-by-step instructions or take a look at the brief instructions ..

1st step:

image
In the VirtualBox menu bar, navigate to Devices > Shared Folders > Shared Folders to create the folder.

2nd step:

image
In the settings, click on the folder symbol with the plus sign to create a new folder.

3rd step:

image
In the " Add Folder " window, the folder path must now be set to Windows. To do this, click on the downward pointing arrow and select the desired folder on your host system .

4th step:

image
As an example, our folder is located on Windows under C: / Linux . Check the box next to " Include automatically " and confirm the creation with " OK ".

5th step:

image
Check that the correct folder to mount is displayed and click " OK " again.

6th step:

image
If you then navigate to the folder created in the file browser, you will receive an error message that you do not have the necessary access rights for the path. To fix that, follow the next step.

7th step:

image
Open a terminal, for example using the key combination [Alt] + [Ctrl] + [T] . Enter the command sudo usermod -aG vboxsf username here . Replace username with your actual username on the guest system. If you are not sure what the name of your current user is, you can find them in the terminal in front of the @ sign. Then restart the virtual machine.

8th step:

image
Files can finally be exchanged or shared between the host system and the guest system.

Quick Start Guide: Install Guest Additions

  1. Navigate to " Devices "> " Add Guest Additions " in the VirtualBox menu bar .
  2. Now confirm the warning with " Execute ".
  3. The installation will then start automatically in the terminal. When finished, exit with [Enter] .
  4. Restart the guest system .

Quick start guide: Shared folder

  1. First, navigate to " Devices "> " Shared Folders "> " Shared Folders " in the VirtualBox menu bar .
  2. Add a new folder using the folder symbol with the plus sign.
  3. Select a folder on your host system .
  4. Next, confirm the folder selection twice by clicking " OK ".
  5. Initially, you do not have the rights to access the folder. This is fixed with the terminal command sudo usermod -aG vboxsf Benutzername . Replace username with your actual username.
  6. Restart the guest system.
  7. Finally, you have full access rights to the folder and can exchange files between the two systems.

...