Open Toilal opened 5 years ago
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?
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.
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 :)
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.
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.
@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.
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 ?