# NFS settings (FreeBSD - Server <-> Windows XP - Client)



## strelok (May 8, 2014)

Hello,

I'm trying to learn NFS on FreeBSD 8.2.

NFS Server on FreeBSD
NFS Client on Windows XP, where installed SFU (Services for UNIX NFS Support) packet.

But I am  faced with some issue: I can mount the NFS share on Windows, see list of files in share and don't have any permissions for read/write. I can't copy files from share or write something.

Here are the settings of the NFS server and the NFS Client (SFU).

# Settings NFS server in rc.conf:


```
nfs_server_enable="YES"
rpcbind_enable="YES"
mountd_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
```

# In exports was added home directory of user sbr

```
/usr/home/sbr
```

Windows XP settings: 

# In SFU on Windows added files from FreeBSD (passwd/group)

# Made mapping of local user Windows XP to UNIX user


```
C:\Documents and Settings\Admin>mapadmin list -all
```

Advanced User Mappings:

```
Windows user                     UNIX user                          Uid PrGid
-------------------------------------------------------------------------------
* \\MICROSOF-8BD803\Admin          PCNFS\sbr                         1001     0
```


# Make mount of share:

```
mount \\192.168.88.249\usr/home/sbr z:
```

# Check parameters:


```
C:\Documents and Settings\Admin>mount
```


```
Local    Remote                                 Properties
-------------------------------------------------------------------------------
z:       \\192.168.88.249\usr\home\sbr          UID=1001, GID=0
                                                rsize=32768, wsize=32768
                                                mount=soft, timeout=0,8
                                                retry=1, locking=yes
                                                fileaccess=777, lang=ANSI
                                                casesensitive=no
```


But don't have read/write access... 

So, what's wrong?

Thank you in advance for your help.


----------



## SirDice (May 8, 2014)

The Windows NFS implementation is crap. I never, ever got it to work correctly. Use a Unix(-like) client to test NFS. You could simply create a small FreeBSD virtual machine on the Windows host to test with.


----------



## Rastko (Mar 21, 2018)

SirDice said:


> The Windows NFS implementation is crap. I never, ever got it to work correctly. Use a Unix(-like) client to test NFS. You could simply create a small FreeBSD virtual machine on the Windows host to test with.



I am struggling with this at the moment. But "crap" I wouldn't use. It actually worked for me out-of-the-box (Win Server 2008 R2 with File Server Role /i.e. a meta package with advanced file sharing utilities/ and Services for NFS).

I am guessing you are not referring to Services for NFS? It worked like a charm, that is, until I deployed my strict ipfilter ruleset template (modified for actual use). I'd rather say NFS is not well-understood /me included/ and the way it works with the firewall.

Before I enabled ipfilter rules, I could access the network shares. After that, they do mount (as in, on Windows), but don't open. Services for NFS can switch between TCP only, UDP only, or TCP+UDP. You also have a dedicated NFS share attributes file properties tab for configuring *NIX-like permissions and identities. But for the love of me, how do you set up that freakin' firewall? I barely managed to make FreeBSD speak to FreeBSD.

I have a few guesses/questions:

* basically, NFS can serve mountpoints, right? Three things here: permissions on a mountpoint, readonly status of a mountpoint, and readonly status of a share - do they interact?
* if a client can use both TCP and UDP, does the firewall need to have both protocols open?
* apparently, Services for NFS (the client part) requires some sort of user mapping, else anonymous access is used. Does the NFS server on FreeBSD support that, and is there any expliciti config needed?
* Services for NFS also has the option to not use reserved ports, but it's beyond me how different the semantics are between two systems.
* a static mountd port, or dynamic?
* why is NFSv4 disabled? How do you enable it? /not in handbook/

etc.


----------



## Rastko (Mar 21, 2018)

Here's an extensive how-to, which explains nothing:

Windows > NFS < UNIX set-up and testing


----------

