# FreeBSD 9.0 NFSv4 in Jail



## MCFBSD (Jun 2, 2012)

Hi all,

*A*s I searched through the Internet, I've found some posts about the combination of NFS and Jail, but I've not found any working solution. Maybe something has changed and someone figured out how to make this work.

What I want to achieve is to have each service working in separate environment. Not working NFS stopped me with continuing with jails so I switched to VirtualBox. In VB I observed decreased performance, specially network delays within multiple virtual machines. Nothing huge, but it bothers me. I tried several combination of sysctl options but it's not working yet.

So before I decide what to do next I would like to ask if someone has made NFS work in Jail. Specially NFSv4, because I want to use Kerberos with it.

When I try to start NFS with [cmd=]/etc/rc.d/nfsd start[/cmd] I got:

```
sysctl: vfs.nfsd.nfs_privport: Operation not permitted
sysctl: vfs.nfsd.server_max_nfsvers: Operation not permitted
Starting rpcbind.
Starting mountd.
Starting nfsd.
```

After this, RPC and mountd are running except nfsd.

```
Mountd error log:[/B]
Jun  2 23:59:32 MCBSD_J mountd[4474]: Can't delete exports for V4:
Jun  2 23:59:32 MCBSD_J mountd[4474]: can't delete exports for /: Operation not permitted
```
nfsd error log:

```
Jun  2 23:59:32 MCBSD_J nfsd[4477]: Can't read stable storage file
```

(I tried to run NFSv4 on the host machine first and it's working without problems.)

Do any of you have any hint/modifications or any direction I can follow? There must be some workaround, but unfortunately my knowledge here is not sufficient. Is even NFSv3 working for any of you who tried?

Thanks very much.


----------



## MCFBSD (Jun 5, 2012)

Until now, I've tried several tunings gathered from other relevant posts, but still the same error messages. I think, there is no other solution so far, pity.

But another interesting behavior: I was just playing around with NFS (NFSv4) and what I did:

start sharing exports on local machine
mount shared NFS folder to local /mnt
I moved 400MB file across and write to /mnt was about 25MB/S. I have FBSD FreeBSD on an external drive via eSATA and the maximum write on this device is around 50MB/s. I tested it by moving this file local*l*y and got circa 50MB/s.

Why is the NFS half of speed?  I checked the load. CPU unused, write reserve is 25MB/s, almost no IRQ, nothing special.

Have you any ideas? 

Thank you.


----------

