adlogix / docker-machine-nfs

Activates NFS on docker-machine
MIT License
794 stars 104 forks source link

macOS Catalina #100

Closed mtibben closed 4 years ago

mtibben commented 4 years ago

It appears docker-machine-nfs is having problems running on macOS Catalina

+ docker-machine-nfs 99dev-v15 --mount-opts=noatime,nodiratime,vers=3,nolock,noacl,timeo=10 --force
[INFO] Configuration:

    - Machine Name: 99dev-v15
    - Shared Folder: /Users
    - Mount Options: noatime,nodiratime,vers=3,nolock,noacl,timeo=10
    - Force: true

[INFO] machine presence ...             OK
[INFO] machine running ...          OK
[INFO] Lookup mandatory properties ... OK

    - Machine IP: 192.168.99.102
    - Network ID: vboxnet0
    - NFSHost IP: 192.168.99.1

[INFO] Configure NFS ...

 !!! Sudo will be necessary for editing /etc/exports !!!
Password:
exports:3: exported dir/fs mismatch: /Users /System/Volumes/Data

It appears the error is occurring at

$ sudo nfsd checkexports
exports:3: exported dir/fs mismatch: /Users /System/Volumes/Data
$ echo $?
1

and likely caused by the APFS Volume Groups in Catalina making separate partitions appear as one logical filesystem

tonivdv commented 4 years ago

Hi @mtibben ,

I didn't upgrade yet so I cannot help figure this out at the moment. Maybe you can try and propose a PR?

alessiopiazza commented 4 years ago

@mtibben have you tried to set --shared-folder=/System/Volumes/Data/Users ?

rivetmichael commented 4 years ago

@alessiopiazza it does work when running docker-machine-nfs command, but then we you share a folder or file with a container it is empty

PaulBrandt commented 4 years ago

Im facing the same problem and setting the hosts path with /System/Volumes/Data/[...] seems to fix the problems at first (I even see all the files) but the guest is not able to write files as it was earlier. So there seems to be some follow-up problems.

mtibben commented 4 years ago

Here's the approach taken by Vagrant to the same problem https://github.com/hashicorp/vagrant/pull/11108

tonivdv commented 4 years ago

Thanks @mtibben for providing a fix.

Can everybody try it out and share feedback on the PR. As said, I didn't migrate yet so can't test it out (yet)

PaulBrandt commented 4 years ago

What I had to do:

(Inspired by the Vagrant Issue - They edited their Vagrant-File)

I think this is the reason why @rivetmichael has empty folders in his guest. Do you maybe need to add the prefix in your docker-compose.yml as well?

Edit: (Done before the fix was provided - WIll test the fix with original configs)

PaulBrandt commented 4 years ago

102 created my /etc/export including the /System/Volumes/Data prefix.

After removing all the manually set prefixes in my docker-compose.yml everything worked. 👍 for the fix

rivetmichael commented 4 years ago

@PaulBrandt thanks, I am trying this right now 👍

rivetmichael commented 4 years ago

thanks @mtibben and @PaulBrandt works fine with your PR

nathpaiva commented 4 years ago

Hello guys, I updated my macOs and I'm trying to execute the command docker-machine-nfs default --shared-folder=/System/Volumes/Data/Users --force, but I have some errors.

± docker-machine-nfs default --shared-folder=/System/Volumes/Data/Users
[INFO] Configuration:

    - Machine Name: default
    - Shared Folder: /System/Volumes/Data/Users
    - Mount Options: noacl,async,nfsvers=3
    - Force: false

[INFO] machine presence ...             OK
[INFO] machine running ...          OK
[INFO] Lookup mandatory properties ... OK

    - Machine IP: 192.168.99.106
    - Network ID: vboxnet0
    - NFSHost IP: 192.168.99.1

[INFO] Configure NFS ...

 !!! Sudo will be necessary for editing /etc/exports !!!
Password:
Unknown user:
map credential error
exports:3: error processing options: -mapall=:501:20
exports:9: /System/Volumes/Data/Users conflicts with existing export /System/Volumes/Data/Users/nathpaiva/www

Someone knows, how can I fix this?

nathpaiva commented 4 years ago

Even if I pass the folder I want to share, like: docker-machine-nfs default --shared-folder=/System/Volumes/Data/Users/nathpaiva/www --force

I receive this error.

Unknown user:
map credential error
exports:3: error processing options: -mapall=:501:20
tonivdv commented 4 years ago

Hey @nathpaiva ,

As the error tells you, you have a conflicting configuration in your /etc/exports file.

Remove the line with /System/Volumes/Data/Users/nathpaiva/www and try again.

Cheers

nathpaiva commented 4 years ago

Yeah, of course! I didn't think to check this. 🤦‍♀️

I remove from there and everything works fine. Thanks @tonivdv

frankgraave commented 4 years ago

I have the same kind of error: exports:3: /System/Volumes/Data/Users conflicts with existing export /System/Volumes/Data

I'm running "docker-machine-nfs default"

But how to 'remove the line' as @tonivdv says?

Thanks in advance!

nathpaiva commented 4 years ago

@frankgraave go to /etc/exports and delete all data about the path you are passing.

And do the upgrade version with brew upgrade docker-machine-nfs and try again docker-machine-nfs default.

This is worked to me.

frankgraave commented 4 years ago

Ah, I see now 🤦‍♂ Sorry, long day and I wasn't reading quite well 😅 Thanks for pointing it out @nathpaiva!