I've run into a strange permissions issue;
A shared folder shows one set of permissions in Windows, and totally different ones when accessed in Linux via VirtualBox.
The shared folder is my XAMPP htdocs/ directory, as I want the ability to work on the same repositories/sites from 2 different environments - so I can't move the folder.
My current setup
- Windows 7 (Host), with Ubuntu running inside VirtualBox (Guest)
- I've set up the folder as a Shared location, and can access it via Ubuntu's terminal under
/media/sf_<myfolder>
. - The shared folder is set to automount and be permanent in VirtualBox's settings.
- My user is part of the
vboxsf
user group, and I've confirmed it via checking/etc/group
. - I've installed
vitrualbox-guest-additions-iso
. Shared clipboards are working fine. - I'm using
cygwin
for my Windows terminal
How the permissions appear
Windows (from cygwin terminal), using $ ls -alF
me@my-server /cygdrive/c/xampp/htdocs/my-website$ ls -alF
total 61313
drwxrwxr-x+ 1 me Domain Users 0 Sep 6 12:12 ./
drwxrwx---+ 1 me Domain Users 0 Sep 8 16:22 ../
drwxrwxr-x+ 1 me Domain Users 0 Sep 8 15:57 .git/
drwxrwxr-x+ 1 me Domain Users 0 Sep 6 12:06 bal/
-rw-rw-r--+ 1 me Domain Users 1065 Sep 6 12:06 .csslintrc
-rw-rw-r--+ 1 me Domain Users 367 Sep 6 12:06 .editorconfig
Ubuntu terminal (VirtualBox), using $ ls -alF
me@my-server:/media/sf_htdocs/my-website$ ls -alF
total 61256
drwxrwx--- 1 root vboxsf 12288 Sep 6 12:12 ./
drwxrwx--- 1 root vboxsf 4096 Sep 8 16:22 ../
drwxrwx--- 1 root vboxsf 4096 Sep 8 15:57 .git/
drwxrwx--- 1 root vboxsf 0 Sep 6 12:06 bal/
-rwxrwx--- 1 root vboxsf 1065 Sep 6 12:06 .csslintrc*
-rwxrwx--- 1 root vboxsf 367 Sep 6 12:06 .editorconfig*
Windows, using $ stat
me@my-server /cygdrive/c/xampp/htdocs/my-website$ stat .csslintrc
File: .csslintrc
Size: 1065 Blocks: 4 IO Block: 65536 regular file
Device: bcd2ece6h/3167939814d Inode: 4222124651673917 Links: 1
Access: (0664/-rw-rw-r--) Uid: (1051198/me) Gid: (1049089/Domain Users)
Access: 2017-09-06 12:06:15.578083600 +1000
Modify: 2017-09-06 12:06:15.578583700 +1000
Change: 2017-09-06 12:06:15.578583700 +1000
Birth: 2017-09-06 12:06:15.578083600 +1000
Ubuntu, using $ stat
me@my-server:/media/sf_htdocs/my-website$ stat .csslintrc
File: '.csslintrc'
Size: 1065 Blocks: 3 IO Block: 4096 regular file
Device: 29h/41d Inode: 14 Links: 1
Access: (0770/-rwxrwx---) Uid: ( 0/ root) Gid: ( 999/ vboxsf)
Access: 2017-09-06 12:06:15.578083600 +1000
Modify: 2017-09-06 12:06:15.578583700 +1000
Change: 2017-09-06 12:06:15.578583700 +1000
Birth: -
I also created a file from both systems, to inspect the default permissions. I did the same with test directories, and both files + folders show exactly the same permissions.
Windows
-rwxrwxr-x+ 1 Administrators Domain Users 0 Sep 11 08:52 .test-from-linux-vm*
-rw-rw-r--+ 1 me Domain Users 0 Sep 11 08:52 .test-from-windows
UbuntuVM
-rwxrwx--- 1 root vboxsf 0 Sep 11 08:52 .test-from-linux-vm*
-rwxrwx--- 1 root vboxsf 0 Sep 11 08:52 .test-from-windows*
What I've noticed
- I cannot change file/folder permissions in Ubuntu, even with
sudo chmod <permissions> <file>
- While I can change permissions in Windows, those changes are not reflected in Ubuntu:
Windows; updated web.config from 664
to 755
-rwxr-xr-x+ 1 me Domain Users 4555 Sep 6 12:06 web.config*
Ubuntu
-rwxrwx--- 1 root vboxsf 4555 Sep 6 12:06 web.config*
I've already tried...
- Restarting the VM (many times ;D)
- Confirming the shared directory is one and the same from both Windows and Linux, via creating test files in one and checking they appear in the other.
- The suggestions suggestions in this question
My questions:
- Why do the permission sets differ between systems?
- Are they being assigned at an OS level, not a file level?
Any help would be awesome!