Saturday, April 29, 2017

Share Windows files and Folders in Oracle VirtualBox 5.1 VM


This post is about sharing Windows files and folders with Linux Guest Operating System in Oracle VirtualBox VM.

Prerequisites:

1.      Installed Oracle VirtualBox VM 5.1
2.      Guest Operating System Oracle Enterprise Linux 7.X installed in virtual machine.

1.      Insert Guest Additions CD Image


In VirtualBox VM windows select “Devices -> Insert Guest Additions CD image” menu option.



Image:01-Insert Guest Additions CD

2. Run Guest Additions

Click on Run button to install Guest Additions module.


Image:02-Run Virtual Box Guest Additions

3. Press Return

Press “Enter” key in the keyboard to exit from the installation terminal.


Image:03-Press Return

    4. Create Shared Folder

In Oracle VM VirtualBox Manager window click on “Shared folders” to open wizard to create Shared Folders.


Image:04-Create Shared Folder

5. Add Folder
In “Add Share” window click on “Folder Path:” drop down button and then "Other" option to browse folder to share. Then browse folder you want to share.



Image:05-Add Folder Path

In this case, I am sharing folder “F:\VM\SharedFolder\” . Select “Auto-mount” and “Make Permanent” check box. Restart Linux guest operating system, the shared folder will be automatically mounted in “/media/sf_SharedFolder/”. Permanent option will make the mount option persistent across VM operating system reboots.

6. Provide Folder Name

Enter a name for shared folder. This folder appears as sf_{folder name} in Linux guest operating system. Click on “Ok” button to continue.


Image:06-Add Folder To Share

7. Shared folder created
Click on “Ok” button to continue.


Image:07-Shared Folder

8. Check the shared folder

Login to guest operating system and check if the folder is mounted.


Image:08-Check Shared Folder

9. Add user to vboxsf group

The ownership of files and folders accessed this way is root:vboxsf, so the user through which these files are accessed should belong to vboxsf group. The command below is used to assign grid and oracle user to vboxsf group.

[root@db12c-01 ~]#usermod -a -G vboxsf grid

[root@db12c-01 ~]#usermod -a -G vboxsf oracle

Hope this helps.


1 comment: