VMware Communities
kunalkapoor
Contributor
Contributor

Shared folders on a Linux guest for a Windows host doesn't work properly

When I share a folder on a Windows host with a Linux guest VM, the guest portrays some weird behavior with respect to operations performed on the shared folder. All files and directories in the shared folder have 777 permissions which cannot be changed by chmod. This makes sense as the shared folder has been configured with read/write permissions and these are essentially managed by Windows implying that Linux permissions cannot be applied on them. When I try to perform certain git operations, though, they just don't seem to work for some reason.

For example, a git clone doesn't work and gives the following error:

Cloning into 'git-clone-test'...

fatal: 'origin' does not appear to be a git repository

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

When I tried to reproduce the steps that git clone follows, I realized that git is unable to add remote repositories to the config file within the .git directory which is done using the following command. 

git remote add origin https://github.com/poelzi/git-clone-test.git

On a normal directory (not shared), the .git/config file now contains the following.

[core]

        repositoryformatversion = 0

        filemode = true

        bare = false

        logallrefupdates = true

[remote "origin"]

        url = https://github.com/poelzi/git-clone-test.git

        fetch = +refs/heads/*:refs/remotes/origin/*

On the shared directory, the same file contains the following.

[core]

        repositoryformatversion = 0

        bare = false

        ignorecase = true

[remote "origin"]

        fetch = +refs/heads/*:refs/remotes/origin/*

We can see that the lines "filemode = true" and "url = https://github.com/poelzi/git-clone-test.git" are missing in the latter. This causes git to not work and makes it difficult to synchronize work on the Linux guest with the Windows host.

I saw a few links related to the same issue on StackOverflow and on the VMware communities but did not find any info that helps solve this problem. Although there are workarounds like working on the VM and then copying the files over to Windows, they are more cumbersome than working directly on the shared folder.

0 Kudos
1 Reply
Fetch
Contributor
Contributor

I'm experiencing a similar problem, except with a Windows host and both a linux and Windows guest. My shared folder happens to be a mapped network drive in the host (drive letter mapped to a network share) which has been working perfectly fine up until about 2 weeks ago. When I use my Windows guest to run AV scans, I choose to save my document to the shared drive in a sub-folder, and it will create the file, but then have no permissions to write to the file. I get permission denied errors every time. In my linux guest, I will cat a file and redirect output to any folder/sub-folder on the shared drive and I get an error saying I don't have permissions to modify I file.

The only changes I made recently would have been running/fixing the Linux VM tools, since they seemed to give me the d_alias error (struct error in inode.c) when I ran the tools inherently. Prior to that I updated the kernel version. The catch is though, that I have the same VM's on 4 different physical hosts, two of the hosts are Windows 7 running VMWare 10, and two of the hosts are Mac OS X 10.9.5 running VMWare Fusion 6, and I don't have these problems with the Mac's.

I don't know if anything I've said will help you specifically, but I thought I'd add it here in case someone else might have something to add.

@kunalkapoor, can you post the links you referenced from StackOverflowand other VMWare community posts? I'd like to follow them as well and see if something sparks.

Cheers

0 Kudos