Enable non-root user access to shared folders on Oracle VM VirtualBox

Environment: Windows 7 64-bit (host), Oracle Linux 6.2 64-bit (guest), Oracle VM VirtualBox 4.1.10 with Guest Additions.

I recently installed Oracle Linux 6.2 on VM VirtualBox under Windows 7, and I decided to add a shared folder to C:Temp, so I could exchange files between my Windows 7 host and the Oracle Linux guest.

This worked fine for user “root”: I could easily access the Windows files from my Linux installation through the folder /media/sf_Temp. However, whenever I tried to access the files with a non-root user (in my example: user “oracle”), all I got was a “Permission denied” message:

[oracle@ol6ora11g02 ~]$ cd /media/sf_Temp/
-bash: cd: /media/sf_Temp/: Permission denied

The solution for this problem is to add the user that needs access to the shared folder to the user group “vboxsf”:

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

Note: don’t forget the “-a” (append) option, otherwise you might remove all other groups from the user!

After this, I switched back to the user “oracle”, and I could easily access my shared folder:

[root@ol6ora11g02 ~]# su – oracle
[oracle@ol6ora11g02 ~]$ cd /media/sf_Temp/
[oracle@ol6ora11g02 sf_Temp]$ ls -la
total 340315
drwxrwx— 1 root vboxsf 8192 Mar 13 16:43 .
drwxr-xr-x. 3 root root 4096 Apr 4 14:36 ..
drwxrwx— 1 root vboxsf 0 Feb 27 11:19 apex_4.1
-rwxrwx— 1 root vboxsf 121601974 Sep 8 2011 apex_4.1.zip

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: