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

NFS Client for Windows (non-Enterprise) #135

Closed
BlueBeN82 opened this issue Jan 21, 2016 · 17 comments
Closed

NFS Client for Windows (non-Enterprise) #135

BlueBeN82 opened this issue Jan 21, 2016 · 17 comments

Comments

@BlueBeN82
Copy link

Hi! This might be a stupid question:

Might this library be used to mount an NFS Share to an drive letter in Windows 10 e.g.?
As only Enterprise Version of Windows 8+ deliver an NFS Client i'm looking for an open source alternative. This might be intresting to Windows 10 Enterprise as well because the integrated NFS Client is limited to only one set of GID/UID.

I would expect this to compile to an mount.exe or such to be used like the linux mount binary.
If this would be possible a Wiki entry with build instructions (HowTo) would be really great!

May be a prebuild client (hosted at your repository) would integrate greatly with scoop.sh:
https://github.com/lukesampson/scoop

@sahlberg
Copy link
Owner

No, libnfs can not be used for that today.

While it does compile natively on windows, it is not an IFS driver, not is
it kernel code.
It is a userspace library to allow applications to talk directly to an NFS
server, bypassing the host os.

I.e. it is what allows for example Kodi on Windows(and other platforms) to
use NFS even for cases where the host OS does not have NFS support.

In theory, it should be possible to build a Windows IFS driver that
encapsulates libnfs.dll and provides an NFS client to windows that way.
But my understanding is that building IFS drivers is very poorly documented
and almost no examples of how to do so exist.
I know one IFS driver that comes with souce codes :
http://www.fs-driver.org/ that could possibly be used as a basis for that
work.

I don't know much details about IFS development myself but if you find
someone that has experience with Windows driver development and IFS then I
think they should be able to build a client based on libnfs.

For example, there is a FUSE module for linux and other platforms that have
adopted the FUSE API that uses libnfs. Something similar should be possible
to build with IFS.

On Wed, Jan 20, 2016 at 9:23 PM, Bernd Niehues [email protected]
wrote:

Hi! This might be a stupid question:

Might this library be used to mount an NFS Share to an drive letter in
Windows 10 eg?
As only Enterprise Version of Windows 8+ deliver an NFS Client i'm looking
for an open source alternative This might be intresting to Windows 10
Enterprise as well because the integrated NFS Client is limited to only one
set of GID/UID

I would expect this to compile to an mountexe or such to be used like the
linux mount binary
If this would be possible a Wiki entry with build instructions (HowTo)
would be really great!

May be a prebuild client (hosted at your repository) would integrate
greatly with scoopsh:
https://githubcom/lukesampson/scoop


Reply to this email directly or view it on GitHub
#135.

@sahlberg sahlberg closed this as completed Feb 2, 2016
@Daniel-Abrecht
Copy link
Contributor

Daniel-Abrecht commented Sep 18, 2016

I have the same Problem.

I know that there is an active fork of dokan which has a fuse wrapper:
https://github.com/dokan-dev/dokany
I also know that sahlberg made a fuse module which uses libnfs:
https://github.com/sahlberg/fuse-nfs

I thought i could try to build fuse-nfs with the dokan fuse wrapper, but I need to build libnfs first, and I failed to build it on windows so far. What is the last commit of libnfs I can build on windows? Do I need a specific version of Visual Studio or a specific SDK version?

@Daniel-Abrecht
Copy link
Contributor

Daniel-Abrecht commented Sep 18, 2016

I just tried it, and it kinda works. I used the master branch of dokany and visual studio 2015 to compile fuse_nfs. I used visual studio 2010 to compile libnfs branch 1.3. I had to make a few changes to fuse_nfs to use it together with that libnfs branch. Also, I had to make some changes to libnfs to get it compiling, and I think I broke something in the process. I am now able to mount the nfs as a drive letter using these tools. The drive capacity is shown correctly. All directories & files are shown, but appear as empty files, and I can't create files, but I think that is because of one of my changes.

I conclude that it is possible to get libnfs, fuse-nfs and dokany working together under windows 10, but its a lot of work.

sc

@sahlberg
Copy link
Owner

Awesome.

But libnfs 1.3 is very old. I think it was about that time there were
issues that hit Kodi about whether size_t was 32 or 64 bits which caused
all sort of issues. Which may be why the stat data you see is invalid (file
size == 0)

Please try to build a more recent version, such as 1.9.8 or current HEAD.
Kodi builds and ships with libnfs on win32/64 so the project files for
visual studio should build without trouble.

I don't think anyone has tried building fuse-nfs for windows, so you are
the first.
Once you get it building, I am happy to pull any of the changes you do to
fuse-nfs and documentation how to set it up under windows.
I think it would be awesome with a free NFS client for windows.

Awesome stuff,

Best regards
ronnie sahlberg

On Sun, Sep 18, 2016 at 12:55 PM, Daniel Abrecht [email protected]
wrote:

I just tried it, and it kinda works. I used the master branch of dokany
and visual studio 2015 to compile fuse_nfs. I used visual studio 2010 to
compile libnfs branch 1.3. I had to make a few changes to fuse_nfs to use
it together with that libnfs branch. Also, I had to make some changes to
libnfs to get it compiling, and I think I broke something in the process. I
am now able to mount the nfs as a drive letter using these tools. The drive
capacity is shown correctly. All directories & files are shown, but appear
as empty files, and I can't create files, but I think that is because of
one of my changes.

I conclude that it is possible to get libnfs, fuse-nfs and dokany working
together under windows 10, but its a lot of work.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#135 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeNkBnBsTdNdweqHgvsgEUdFu3n0ymgks5qrZdHgaJpZM4HJOL_
.

@sahlberg
Copy link
Owner

I have pushed some changes that fixes the build of libnfs.dll

The example programs do not yet build under visual studio but libnfs.dll
does.
Can you please try current master of libnfs and build a fuse module ?

On Mon, Sep 19, 2016 at 8:28 AM, ronnie sahlberg [email protected]
wrote:

Awesome.

But libnfs 1.3 is very old. I think it was about that time there were
issues that hit Kodi about whether size_t was 32 or 64 bits which caused
all sort of issues. Which may be why the stat data you see is invalid (file
size == 0)

Please try to build a more recent version, such as 1.9.8 or current HEAD.
Kodi builds and ships with libnfs on win32/64 so the project files for
visual studio should build without trouble.

I don't think anyone has tried building fuse-nfs for windows, so you are
the first.
Once you get it building, I am happy to pull any of the changes you do to
fuse-nfs and documentation how to set it up under windows.
I think it would be awesome with a free NFS client for windows.

Awesome stuff,

Best regards
ronnie sahlberg

On Sun, Sep 18, 2016 at 12:55 PM, Daniel Abrecht <[email protected]

wrote:

I just tried it, and it kinda works. I used the master branch of dokany
and visual studio 2015 to compile fuse_nfs. I used visual studio 2010 to
compile libnfs branch 1.3. I had to make a few changes to fuse_nfs to use
it together with that libnfs branch. Also, I had to make some changes to
libnfs to get it compiling, and I think I broke something in the process. I
am now able to mount the nfs as a drive letter using these tools. The drive
capacity is shown correctly. All directories & files are shown, but appear
as empty files, and I can't create files, but I think that is because of
one of my changes.

I conclude that it is possible to get libnfs, fuse-nfs and dokany working
together under windows 10, but its a lot of work.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#135 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeNkBnBsTdNdweqHgvsgEUdFu3n0ymgks5qrZdHgaJpZM4HJOL_
.

@sahlberg
Copy link
Owner

The library builds a dll from current master using visual studio online,
but the examples fail for various reasons to build.

One failure that is common to all of them are that they can not find
libnfs.lib

Link:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe
/ERRORREPORT:QUEUE /OUT:"C:\a\1\s\win32\libnfs\Debug\nfsclient-async.exe"
/INCREMENTAL /NOLOGO libnfs.lib WS2_32.lib kernel32.lib user32.lib
gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST
/ManifestFile:"Debug\nfsclient-async.exe.intermediate.manifest"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG
/PDB:"C:\a\1\s\win32\libnfs\Debug\nfsclient-async.pdb" /SUBSYSTEM:CONSOLE
/TLBID:1 /DYNAMICBASE /NXCOMPAT
/IMPLIB:"C:\a\1\s\win32\libnfs\Debug\nfsclient-async.lib" /MACHINE:X86
"Debug\nfsclient-async.exe.embed.manifest.res"
"Debug\nfsclient-async.obj"
LINK(0,0): Error LNK1104: cannot open file 'libnfs.lib'

I am totally ignorant on how to build on win32, but if someone can find out
what the problem is with the project files to build these utilities I would
be totally grateful.

On Tue, Sep 20, 2016 at 5:47 PM, ronnie sahlberg [email protected]
wrote:

I have pushed some changes that fixes the build of libnfs.dll

The example programs do not yet build under visual studio but libnfs.dll
does.
Can you please try current master of libnfs and build a fuse module ?

On Mon, Sep 19, 2016 at 8:28 AM, ronnie sahlberg <[email protected]

wrote:

Awesome.

But libnfs 1.3 is very old. I think it was about that time there were
issues that hit Kodi about whether size_t was 32 or 64 bits which caused
all sort of issues. Which may be why the stat data you see is invalid (file
size == 0)

Please try to build a more recent version, such as 1.9.8 or current HEAD.
Kodi builds and ships with libnfs on win32/64 so the project files for
visual studio should build without trouble.

I don't think anyone has tried building fuse-nfs for windows, so you are
the first.
Once you get it building, I am happy to pull any of the changes you do to
fuse-nfs and documentation how to set it up under windows.
I think it would be awesome with a free NFS client for windows.

Awesome stuff,

Best regards
ronnie sahlberg

On Sun, Sep 18, 2016 at 12:55 PM, Daniel Abrecht <
[email protected]> wrote:

I just tried it, and it kinda works. I used the master branch of dokany
and visual studio 2015 to compile fuse_nfs. I used visual studio 2010 to
compile libnfs branch 1.3. I had to make a few changes to fuse_nfs to use
it together with that libnfs branch. Also, I had to make some changes to
libnfs to get it compiling, and I think I broke something in the process. I
am now able to mount the nfs as a drive letter using these tools. The drive
capacity is shown correctly. All directories & files are shown, but appear
as empty files, and I can't create files, but I think that is because of
one of my changes.

I conclude that it is possible to get libnfs, fuse-nfs and dokany
working together under windows 10, but its a lot of work.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#135 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAeNkBnBsTdNdweqHgvsgEUdFu3n0ymgks5qrZdHgaJpZM4HJOL_
.

@Daniel-Abrecht
Copy link
Contributor

I'll take a look on it next weekend, I have too much else to do right now.

@BlueBeN82
Copy link
Author

Any news on this?

@Daniel-Abrecht
Copy link
Contributor

It isn't really a difficult task, but I have a lot more work to do lately than I expected and don't have the time to work on this at the moment. Sorry.

@Daniel-Abrecht
Copy link
Contributor

I had some spare time the last 2 days, and I tried to cross-compile fuse-nfs on my devuan server with x86_64-w64-mingw32-gcc and i686-w64-mingw32-gcc. I was able to compile it after a few changes, i'll make a pull request for those. The build scripts I used are available at: https://github.com/Daniel-Abrecht/fuse-nfs-crossbuild-scripts . However, it doesn't really work yet. I can mount the nfs share in Windows 7, but when I try to access it it crashes. I'll debug it as soon as I have time to do so.

@sahlberg
Copy link
Owner

sahlberg commented Feb 27, 2017 via email

@Daniel-Abrecht
Copy link
Contributor

I figured out why fuse-nfs crashed and fixed it. At the moment, it doesn't work yet with nfs exports on case-sensitive file systems, but it works flawlessly with case-insensitive file systems. This seams to be an issue in dokan_fuse, which sometimes converts all letters in paths to uppercase letters. When I get that fixed, everything should work.

https://dpa.li/fuse-nfs/video.mp4

@sahlberg
Copy link
Owner

sahlberg commented Feb 28, 2017 via email

@Daniel-Abrecht
Copy link
Contributor

Yes, I think I'll try the GitHub release API, maybe I can automate the whole build & release process.

I just noticed the problem with case-sensitive file systems only happens with directory mounts, but when mounting a drive letter case-sensitive file systems work fine too. It seams to be the same issue as in dokan-dev/dokany#293

@Daniel-Abrecht
Copy link
Contributor

I have now written a build script which builds fuse-nfs for Windows 32&64bit and uploads those builds as release to my github repo. The build scripts and more details are available here: https://github.com/Daniel-Abrecht/fuse-nfs-crossbuild-scripts
And the releases: https://github.com/Daniel-Abrecht/fuse-nfs-crossbuild-scripts/releases
The releases are updated every hour.

@sahlberg
Copy link
Owner

sahlberg commented Mar 9, 2017 via email

@Daniel-Abrecht
Copy link
Contributor

Sure, that would be great.

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