Linux

 

 

 

 

Shared Folder Setting in VirtualBox

 

I am using Linux mostly on VirtualBox in Windows (I've rarely use Linux only PC). In this use model, there are many cases where I want to copy files between the host (Windows 10 in my case) and the VirtualBox. I googled many tips on setting the shared folder but most of those tips often missing with one or two critical steps and spend so much time and effort on figuring out the missing part. I just this again today (Jan 19, 2018) and I decided to write down what I did before I forget.

 

The operating systems and virtual box that I am using are as follows.

  • Windows 10 on x64-based PC(Intel64 Family)
  • Virtual Box Version 5.2.6
  • Operating System installed in Virtual Box : ubuntu-16.04.3-desktop-amd64.iso

 

Following is the procedure to setup and verify the shared folder.

 

 

Step 01 : Create a folder that you want to share on Windows

 

 

 

Step 02 : Select the operating system on Virtual Box and click [Settings] menu

 

 

 

Step 03 : Select [Shared Folders] options on the left panel and click on the operating system on Virtual Box and click [Settings] menu and [Add New Shared Folder] icon as shown below.

 

 

 

Step 04 : Specify the path for the shared folder that you created in step 01 as shown below.

 

 

 

 

 

Step 05 : Confirm on Folder path and Folder name, and Check [Auto-mount] option and hit [OK].

 

 

 

Now you see the shared folder shows up in the list as shown below.

 

 

 

Step 06 : In Ubuntu, Run following two commands. You don't need to do this everytime you Boot up Ubuntu in the Virtual box. You only need to do this once when you first setup the shared folder.

 

sudo apt-get update

sudo apt-get install virtualbox-guest-dkms

 

 

 

Step 07 : In Ubuntu, Mount the shared folder to a folder that you want as shown below. In this example, the VBoxShared folder will be mount to the folder /media. (NOTE : This will be unmounted when you power off the VirtualBox, so you would need to do this step everytime when you run Ubuntu on Virtual Box)

 

sudo mount -t vboxsf VboxShared /media

 

 

Step 08 : Just for a test, create (or copy) a file into /mount folder In Ubuntu,  as shown below.

 

 

 

Step 09 : Confirmat that you see the same file shows up in the share folder on your Windows 10 (Host Operating System)

 

 

 

 

Auto Mount Setting on Bootup

 

If you want to activate / mount the shared folder all the time when you run Ubuntu, it would be convinient to put the mount command in rc.local as shown below instead of repeating the Step 07 everytime you run Ubunto.