Virtualbox shared folder access using global custom hooks

I have gitlab running on a virtual machine (Ubuntu 14.04) on an Ubuntu 16.04 host.

I have shared a folder on the host (permanent, automount & full access) I have set up a global custom hook which I have verified on a standard folder with permissions set to user ‘git’ and group ‘git’ and the custom hook works perfectly.

However when I switch the code to point to the virtual box mounted share it will not cd into the folder and fails on permissions. I’ve even added a whoami line to the script to see which user is running the commands and that verifies it is the user ‘git’

I have added ‘git’ to the vboxsf group and checked in a terminal as the git user (sudo su git) then checked to see if I can cd into the shared folder and this works fine.

Extra information…

I tried to push from a different project and found this worked fine, so I compared the project setup. The difference was that the project that has permissions issues running the post-receive is set to a http://myserver.com/group/project.git address, whereas the projects that work are using ssh git@myserver.com:group/project.git.

So this seems to affect the permissions of the hook, even though the hook runs on the server. My problem is that I am trying to use git integration with VS2012 and this will not work (afaik) with ssh. Anyone got any ideas how to make the hook work with the http: style remote address or am I flogging a dead horse???