Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: Add support for nfs4j #126

Open
Toilal opened this issue Dec 11, 2018 · 6 comments
Open

Discussion: Add support for nfs4j #126

Toilal opened this issue Dec 11, 2018 · 6 comments

Comments

@Toilal
Copy link

Toilal commented Dec 11, 2018

I'm in process of writing a daemon based on nfs4j as a replacement for winnfsd.

Reasons to look for an alternative to winnfsd are the following :

nfs4j provides a mount server, NFSv3 server and NFSv4.1 server implementation, but it doesn't support any real FileSystem sharing implementation. So I created a project called nsf4j-daemon to implement proper file sharing for a Windows host (Linux is also supported, and MacOS could come later).

It's still unreleased, but I have tested this by running npm install on a web project lying in a shared directory, and it now works smothly, with same or better performance for now. It does support NFSv4.1 and unicode filenames properly !

Then, would you consider vagrant-winnfsd to support this alternative daemon when it'll be stable and released ? Or would it be better to fork this repository and provide another plugin ?

@marcharding
Copy link
Member

Hey, this sounds really great.

I moved away from vagrant/docker based environments for the moment due to performance problems, but a nfs 4.1 windows server would be great!

I do not know if supporting two daemons is possible, i never worked much on the plugin itself.

Maybe a fork with a different name would be the better approach?

@Toilal
Copy link
Author

Toilal commented Dec 11, 2018

Ok, i'll fork the plugin then. It will take some time to have something ready to use, but i'll let you know when it's available.

@Toilal
Copy link
Author

Toilal commented Dec 16, 2018

First release is available, check the README ! https://github.com/Toilal/nfs4j-daemon

I still have to add an option to customize default uid/gid (currently hardcoded to 1000/1000), but I now use this instead of winnfsd and it runs smoothly ! Next step is the vagrant plugin :)

@Toilal
Copy link
Author

Toilal commented Dec 19, 2018

It's out 🎉 😄

gfi-centre-ouest/vagrant-nfs4j

vagrant plugin install vagrant-nfs4j (vagrant-winnfsd must be uninstalled for this plugin to work)

I still have to write some docs, but it should work out of box, you only have to set uid=xxxx and gid=xxxx in mount_options to setup owner of the shared directory. Also, Java should be installed and JAVA_HOME environment variable set properly.

Example

config.vm.synced_folder 'C:\Users\Toilal', '/C/Users/Toilal', id: '1', type: 'nfs', nfs_version: 4, nfs_udp: false, mount_options: ['uid=1000', 'gid=1000']
config.vm.synced_folder 'D:\devel', '/D/devel', id: '2', type: 'nfs', nfs_version: 4, nfs_udp: false, mount_options: ['uid=1000', 'gid=1000']

nfs4j-daemon now embeds a small REST API to add/remove shares dynamically. vagrant-nfs4j controls the shares through this API.

Inside nfs4j-daemon, share is registered under the configured synced_folder#target property, but share path is internally prefixed with the machine id to avoid collisions when using the plugin with many machines at the same time.

So it should now be possible to share the same directory with various settings (uid/gid) on many machines at the same time.

@func0der
Copy link

Awesome :)
Keep the good work going. It would be great to just merge your project with winnfsd if possible, so not everyone has to migrate.

@Toilal
Copy link
Author

Toilal commented Apr 26, 2019

@func0der It won't happen, sorry. Configuration is different, so even if it's been merged in vagrant-winnfsd, user would have to perform some kind of migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants