BrunoAugusto
Contributor
Contributor

Problem with VMWare Shared Folders Permissions on Linux Mint guest

I'm in a recent incursion to PHP development under Linux environment so I'll ask to take it easy with commands or general guidelines.

Because of some reason I can't explain I can't install any distro in my computer, be it dual boot or after a full format so I'm using VMWare Player for that. I created the VM, installed the OS (Linux Mint 17 64bits) and after setting up the basic environment for PHP development I ran into an issue with permissions of the Shared Folder I configured, a secondary partition in  my physical hard drive where I keep separate all my stuff (pictures, movies and development files) while in Windows environment.

I do understand at least the basics of Linux permissions but I couldn't understand why I couldn't edit any file of this partition, located in /mnt/hgfs/<PartitionName>/<somefolder>. I know there is a command I could run to change the permissions, owner and group but unless I'm wrong I think this is stupidity, I mean, repeat such procedure over and over again for every file I wish to create.

Anyway... After a lot of researching I've found this old blog post and, although a little confusing to me (and not very polite with VMWare products I dare to say), I managed to "fix" this permissions issue by editing the /etc/vmware-tools/services.sh file and changing one line accordingly to Rob Kreisel's comment in the same page.

After reboot, if I check the file properties, I can see that the files in the Shared Folder belong to root and have full access, read and write. However, seems I can't reflect such permissions in the editor I want to use, in this case, Sublime Text 3. Every time I change the contents of any file and try to save I receive two errors referring to permission denied. I can't post the exact error messages right now because the following reason.

If I open ANY PHP file with ANY other text editor, like GEdit, even without elevate the permissions, the whole issue is fixed and all files subsequently opened in Sublime produce no error.

I know this might sound a Sublime issue, but this do not happen to regular files in other Linux folders. It's only with files within the Shared Folder.

0 Kudos
3 Replies
homm86
Contributor
Contributor

You can just mount <PartitionName> to another folder with required permissions. To do that add following to your /etc/rc.local:

    modprobe vmhgfs

    mount -t vmhgfs .host:/<PartitionName> /home/<User>/<PartitionName> -o defaults,uid=<user_uid>,gid=<user_gid>

0 Kudos
WoodyZ
Immortal
Immortal

BrunoAugusto wrote: ... so I'm using VMWare Player for that. I created the VM, installed the OS (Linux Mint 17 64bits) and after setting up the basic environment for PHP development I ran into an issue with permissions of the Shared Folder I configured, a secondary partition in  my physical hard drive where I keep separate all my stuff (pictures, movies

Then why are you posting in VMware Fusion® (for Mac) instead of VMware Player?

After reboot, if I check the file properties, I can see that the files in the Shared Folder belong to root and have full access, read and write. However, seems I can't reflect such permissions in the editor I want to use, in this case, Sublime Text 3. Every time I change the contents of any file and try to save I receive two errors referring to permission denied. I can't post the exact error messages right now because the following reason.

If I open ANY PHP file with ANY other text editor, like GEdit, even without elevate the permissions, the whole issue is fixed and all files subsequently opened in Sublime produce no error.

I know this might sound a Sublime issue, but this do not happen to regular files in other Linux folders. It's only with files within the Shared Folder.

From what you've said it sure sounds like a Sublime issue and that fact that Sublime Text 3 is still beta software and I'm wondering if that might not be a factor.  BTW and off topic, I use Sublime Text 2 and I love it! Smiley Happy  Will move to 3 after its beta.

That said... If you use an Industry Standard SMB/CIFS Share, instead of the VMware Shared Folders feature, are the results the same?

0 Kudos
BrunoAugusto
Contributor
Contributor

I don't know how to multiquote messages in this board but...

homm86 I'll try that tomorrow but, beforehand, what should I add as replacements for user_uid and user_gid? From the blog post I know 0 (zero) for both of them means root, but would this be correct? Also, what would be the best standard permissions for the target folder? I know some specific operations like upload usually require 0777, but I also know that such wide permission is not the right thing to do for all folders within.

WoodyZ First thing, yeah, I just notice I'm in a completely wrong section. If there are moderators here, please, could this topic be moved? Well... The fact is I was switching between Host and Guest with several tabs opened in two different browsers (some in the same page >.<) and when I found this board I clicked the "Start a Discussion" without read the section properly.

Second, about the standard SMB, when I was a kid I remember vaguely something about it but I don't remember how to proceed. In fact, before this "failed learning" on how to use the Shared Folders feature, I was trying to accomplish this, if I recall, by mapping a network drive in Windows 7 and then I could access the partition through regular network.

But I don't remember how to do it and because it's my first real usage of Linux environment, I'm not even sure how to formulate a query to Google around.

0 Kudos