winnfsd / vagrant-winnfsd

Manage and adds support for NFS for Vagrant on Windows.
Other
567 stars 62 forks source link

Can't see the file list in guest #78

Closed mfilipe closed 8 years ago

mfilipe commented 8 years ago

I'm trying to communicate a Windows 10 (host) and a FreeBSD 10.2 (guest).

When I boot the guest, it mounts the host dir, but I can't see the file list ($ ls /vagrant) into the dir. If I try to open a file using some editor, it opens the file content even the file is not listed.

amontalban commented 8 years ago

I'm experiencing the same with a FreeBSD 10.1 guest, this is what I see in the client:

root@devserver:/usr/local/www/perceptyx # ls -lah
total 0

And this is what I see in the winnfsd side:

[17:42:47] NFS ACCESS \\?\c:\code\Perceptyx  OK
[17:42:47] NFS FSSTAT \\?\c:\code\Perceptyx  OK
[17:42:47] NFS READDIR \\?\c:\code\Perceptyx  OK
[17:42:47] NFS FSSTAT \\?\c:\code\Perceptyx  OK
[17:42:47] NFS READDIR \\?\c:\code\Perceptyx  OK

However a lot of files exists in C:\code\Perceptyx. I even tried @marcharding latest build:

WinNFSd develop [e872967]
Network File System server for Windows
Copyright (C) 2005 Ming-Yang Kao
Edited in 2011 by ZeWaren
Edited in 2013 by Alexander Schneider (Jankowfsky AG)
Edited in 2014 2015 by Yann Schepens
Edited in 2016 by Peter Philipp (Cando Image GmbH), Marc Harding

I'm trying to get this working but not sure how to get more debug in order to fix this.

Thanks!

amontalban commented 8 years ago

Adding more info, this is only affects FreeBSD guests. Below is a screenshot of the FreeBSD guest creating a file and all files are visible in Ubuntu guest but not in FreeBSD guest.

screen shot 2016-06-16 at 11 41 40 am

I will try to compare mount options and if possible a network packet capture to see if I can catch the difference.

Thanks!

amontalban commented 8 years ago

Ok I found the issue, FreeBSD does not mount NFS with the following option:

 rdirplus
     Used with NFSV3 to specify that the ReaddirPlus RPC
     should be used.  For NFSV4, setting this option has a
     similar effect, in that it will make the Readdir Opera-
     tion get more attributes.  This option reduces RPC traf-
     fic for cases such as ``ls -l'', but tends to flood the
     attribute and name caches with prefetched entries.  Try
     this option and see whether performance improves or
     degrades.  Probably most useful for client to server net-
     work interconnects with a large bandwidth times delay
     product.

Using this option this options the files are shown when you run ls -l, for example:

mount -t nfs -o nfsv3 -o udp -o nolockd -o rdirplus IP:/share /mnt

Unfortunately Vagrant has a bug (mitchellh/vagrant#7466) and this options can't be used in Vagrantfile like below until is fixed.

config.vm.synced_folder "C:\code\Perceptyx", "/usr/local/www/perceptyx",
:nfs => true,
:nfs_udp => true,
:nfs_version => 3,
:mount_options => ['nfsv3,udp,nolockd,rdirplus,actimeo=2,async']

Hope this helps someone and I think it worth adding this note to Readme / @marcharding @GM-Alex

Thanks!

marcharding commented 8 years ago

Hey @amontalban,

thanks for the thorough issue.

I think i fixed the issue (READDIR was not implemented correctly).

Please try the attached exe and report your results ;)

WinNFSd.zip

amontalban commented 8 years ago

Hey @marcharding,

Worked like a charm!

Just one thing, I had to execute the following command:

winnfsd.exe -log on C:\code\Perceptyx /C/code/Perceptyx

Because if I didn't specify the /C/code/Perceptyx argument the share was created as C:\code\Perceptyx and don't know how to mount that.

Before I didn't have to do this, so maybe it worth checking if it works good in vagrant-winnfsd.

PS: When you think this version will be released so I can install the plugin with this exe?

Thank you for the quick fix!

marcharding commented 8 years ago

This behaviour (wrong mount alias) is also fixed now, i'll release a new version sometime this week.

marcharding commented 8 years ago

Fixed with v1.2.0