Sunday, May 7, 2017

Virtual Box: Mount Host Shared Folders in Guest

I installed Oracle VM Virtual Box v 5.1.14 on Windows 7 Professional (64 bit) PC and installed Oracle Linux (OEL) 7.2 as a guest OS.

However, I was not able to share folders between host & guest. I received following error in Guest OS, when I clicked on shared folder mount.

Error: "The folder contents could not be displayed. You do not have the permissions necessary to view the contents of sf_temp."

I followed below steps to resolve the issue and mount shared folder in Guest OS.
  • Download and Install Oracle VM Virtual Box Extension Pack
  • Restart Virtual Machine
  • Install Guest Additions. Go to Devices > Insert Guest Additions CD image...
  • Restart Virtual Machine
  • Add the shared folder to the virtual machine using Virtual Box graphical interface. Make sure to select 'Auto-mount' and 'Make Permanent'
  • Restart Virtual Machine
Try to access /media/sf_your_shared_folder_name. If you still don't have access, that means you don't belong to the vboxsf group.
  • Login to the virtual machine using a root account
  • Check vboxsf group exists
          ~$ grep vboxsf /etc/group
          vboxsf:x:983:
  • Check user is not already in vboxsf group
          ~$ id lkakarla
          uid=1000(lkakarla) gid=1000(lkakarla) groups=1000(lkakarla)
  • Add user lkakarla to vboxsf group
          ~$ sudo usermod -a -G vboxsf lkakarla
  • Check again user groups
          ~$ id lkakarla
          uid=1000(lkakarla) gid=1000(lkakarla) groups=1000(lkakarla),983(vboxsf)
  • Restart Virtual Machine and login as lkakarla
  • Shared folder is now accessible in desktop and /media/sf_temp (temp is the name I gave to the share)

Click Here for more info.

No comments:

Post a Comment

Provide your thoughts !