codekitchen/dinghy

Unaccessible file mounts with VirtualBox

elmar-hinz opened this issue · 2 comments

Another case related to access rights (Dinghy 4.5.0)

bildschirmfoto 2017-04-21 um 10 10 15

eval $(dinghy env)
export DINGHY_HOST_MOUNT_DIR=/Volumes/
export DINGHY_GUEST_MOUNT_DIR=/Volumes/

When I log in with dinghy ssh I find /Users/ElmarHinz mapped to root:root and those directories are mountable. /Volumes is mapped to the user 501:80 and is not mountable.

bildschirmfoto 2017-04-21 um 10 27 08

On my local machine both directories have the same user and group settings.

UPDATE: In another try /Users/ElmarHinz changed to 501:80, too, while I was browsing the directory.

My startup script:

https://github.com/elmar-hinz/TYPO3.docker-development/blob/master/run.sh

There is no error, but the directories are not mounted. (The script works with docker-for-mac).

Possible solution

My other Vagrant based VirtualBox sets /Volumes/ to root:root basically proving the issue is solvable.

    6             #################
    5             # NFS
    4             #################
    3             config.vm.synced_folder "#{mount['src']}",
    2                 "#{mount['target']}",
    1                 :nfs => { :mount_options => [ "dmode=775", "fmode=774" ] }

I don't know what it does different. Maybe it the trick to write to /etc/exports. Maybe the alldirs mapall parameters are OS X special. I don't find them documented for unfsd.

 # VAGRANT-BEGIN: 501 0e101423-03fe-4b72-98ad-b0745111e9d8
 "/Users/ElmarHinz" 192.168.56.2 -alldirs -mapall=501:20
 "/Volumes/Work" 192.168.56.2 -alldirs -mapall=501:20
 # VAGRANT-END: 501 0e101423-03fe-4b72-98ad-b0745111e9d8

(I did remove those lines and recreated dinghy to check troubles are not caused by them.)

When I log in with dinghy ssh I find /Users/ElmarHinz mapped to root:root and those directories are mountable. /Volumes is mapped to the user 501:80 and is not mountable

Right now Dinghy only supports NFS mounting one directory at a time, if you use DINGHY_HOST_MOUNT_DIR to change the mount dir to /Volumes that means /Users/ElmarHinz will no longer be NFS shared. Am I understanding correctly that is what is going on?

Also I suspect a problem here:

eval $(dinghy env)
export DINGHY_HOST_MOUNT_DIR=/Volumes/
export DINGHY_GUEST_MOUNT_DIR=/Volumes/

It looks like you're exporting those env vars after dinghy is already running, which means they aren't taking effect. dinghy up needs to see those env vars.

Hi, I'm closing this due to inactivity, please re-open if you'd like to continue digging into it.