# jailed NFS over zfs



## bbzz (Oct 15, 2012)

I am unable to export NSF share that is sitting on zfs. NFS is jailed, and jail is sitting on its own zfs filesystem.

NFS service fires up in jail, but */var/log/messages* shows

```
Oct 15 22:35:19 pxeboot mountd[25008]: Can't delete exports for V4:
Oct 15 22:35:19 pxeboot mountd[25008]: can't delete exports for /: Operation not permitted 
Oct 15 22:35:19 pxeboot mountd[25008]: can't change attributes for /b
Oct 15 22:35:19 pxeboot mountd[25008]: bad exports list line /b -ro -alldirs
```

This is jail's */etc/exports*

```
/b -ro -alldirs
```

That's all.
But like I said */b* is sitting on *tank/ezjail/pxeboot* which is separate filesystem.

I tried applying different solutions but couldn't figure it out.

I have nonjailed setup that's using both NFSv3 and NFSv4 and it's working fine.


----------



## SirDice (Oct 16, 2012)

bbzz said:
			
		

> I have nonjailed setup that's using both NFSv3 and NFSv4 and it's working fine.


Make sure they're all bound to the host's IP address. By default they'll listen on _all_ addresses, including the ones belonging to the jails.


----------



## Nukama (Oct 16, 2012)

You don't want to use net/unfs3?


----------



## bbzz (Oct 16, 2012)

SirDice said:
			
		

> Make sure they're all bound to the host's IP address. By default they'll listen on _all_ addresses, including the ones belonging to the jails.



I made it so that server accepts connections only from 127.0.0.1, since I tunnel ssh to it first.


----------



## bbzz (Oct 16, 2012)

Nukama said:
			
		

> You don't want to use net/unfs3?



I haven't tried this. How does it differ from regular NFS?


----------



## SirDice (Oct 16, 2012)

I'm wondering where that V4: comes from. Is that from previous attempts or is that really in your jail's /etc/exports?

Also check if you haven't set any sharenfs flags for that filesystem. That may interfere as it's likely to get added on the host's /etc/zfs/exports instead of the jail's.


----------



## bbzz (Oct 16, 2012)

No, not in */etc/zfs/exports*.

Not sure where that V4 comes form either. I'm only running NFSv3 in jail together with tftp/dhcp for pxebooting.

edit:

I do have V4: / line in "global" */etc/exports*. Maybe that's what confusing it. But then how to keep this line for host NFSv4 and have a working configuration in jail.

EDIT2: Disabled NFS on host, but I still get same error in jail.


----------



## bbzz (Oct 16, 2012)

Similar problem here.

Seems like exporting NFS from jail is not possible. Will have to try with net/unfs3 or just exporting from global set. If anyone managed to get NFS running from jail please let me know.


----------

