How to Enable File Sharing between Host and Virtualbox Guest

In a previous tutorial, I showed you how to install Virtualbox guest additions on Debian. This tutorial will explain how to enable file sharing between host and virtualbox guest OS. In order to do this, you have to install guest additions in the guest OS first, so if you haven’t done yet, check out that post and go back here when you are done.

Also read:

Enable File Sharing between Host and Virtualbox Guest

In the Virtualbox Manager window, right-click on your guest machine and select Settings.

Enable File Sharing between Host and Virtualbox Guest

In the left pane, select Shared Folders. Then click on the add button to add a shared folder.

Enable File Sharing between Host and Virtualbox Guest

Then in the Folder Path field, select a folder on your host machine.

Enable File Sharing between Host and Virtualbox Guest

You can check Read-only to let your guest have read access but no write permission to the shared folder on the host machine. Check Auto-mount to auto-mount the shared folder when the guest OS boots up. After that, click OK button.

Enable File Sharing between Host and Virtualbox Guest

Now start the Linux guest machine. In /media/ directory of the Linux guest,  you will find a new directory called sf_shared_folder if the shared folder name on the host is shared_folder. By default, only root and members of the vboxsf group have read and write access to this directory. So what we need to now is add your user to vboxsf group. Open up a terminal in the guest machine and enter the following command. Replace <username> with your real username.

sudo gpasswd -a <username> vboxsf

Log out of the current session and log back in. Now you can access the /media/sf_shared_folder directory.

You can create a soft link that points to /media/sf_shared_folder.

ln -s /media/sf_shared_folder /home/<username>/shared_folder

The above command will create a shared_folder directory under the user’s home. File created in shared_folder actually resides in /media/sf_shared_folder.

How to enable copy and paste clipboard between host and guest

Another thing you may want to do is enable copy and paste clipboard between host and guest. To accomplish that, open the settings window of your virtual machine. Go to General > Advanced. Change the value of Shared Clipboard and Drap’n’Drop to Bidirectional. Then click the OK button.

Virtualbox Shared Clipboard

Next Step

You might also want to read:

Rate this tutorial
[Total: 11 Average: 4.3]

3 Responses to “How to Enable File Sharing between Host and Virtualbox Guest

  • wpeckham
    7 years ago

    NOTE: This only works on operating systems with certain levels of drive mount support. Generally all modern Linux, Windows, etc. fall into this category. Some alternate operating systems do not, such as KolibriOS and ReactOS in their current state. Support for drive mounts at the required level is planned for ReactOS is in development but with no planned delivery date. I have not discussed or researched the question with the Kolibri team, but would expect it to be something they would be open to discussing.

    Afterthought, I have not tested things like FREEDOS with long file name support enabled. I suspect it would not work, but it may be fun to try.

  • thank u . u had help me to save time

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here