# Nfs-server - No Support in current kernel

**URL:** <https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343>\
**Category:** RancherOS\
**Created:** [October 18, 2016, 7:22am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343 "2016-10-18T07:22:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 18, 2016, 7:22am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/1 "2016-10-18T07:22:33Z")

</div>

i wanted to run cpuguy83/nfs-server but the daemon can’t start:

[rancher@RancherOS2\_SRV ~]$ docker logs -f dc5fc55c0ec5cf076eeddf33512daf125a9782b7ea7721516ba0c60bb34b220e

- Not starting NFS kernel daemon: no support in current kernel.  
Setting up watches.  
Watches established.

How can I modify rancheros so it would work?

Regards  
Guido

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [October 18, 2016, 10:51am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/2 "2016-10-18T10:51:27Z")

</div>

I’ve run this image without issue in the past. IIRC the issue has been caused by a recent update. Unfortunately ‘latest’ is the only version available on Docker hub.

Luckily for me I had an old version stored somewhere that I could use but I didn’t like the idea of relying on some old image so I created my own. I’ve not documented it yet but perhaps try this: [https://hub.docker.com/r/itsthenetwork/nfs-server-ubuntu/](https://hub.docker.com/r/itsthenetwork/nfs-server-ubuntu/).

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [October 25, 2016, 9:28am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/3 "2016-10-25T09:28:19Z")

</div>

**Update:** I just remembered I actually had this issue on Boot2Docker, not RancherOS. Coincidentally, I need to get this working thanks to a new request so I’ll post an update on what I find.

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [October 25, 2016, 11:54am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/4 "2016-10-25T11:54:12Z")

</div>

OK, I got an Alpine image working, see here: [https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/](https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/) but I also ran the first two commands listed here: [http://docs.rancher.com/os/configuration/kernel-modules-kernel-headers/](http://docs.rancher.com/os/configuration/kernel-modules-kernel-headers/) so I don’t know if one will work independently of the other.

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 26, 2016, 9:49am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/5 "2016-10-26T09:49:49Z")

</div>

I tried your container…but there seam to be a small problem.

> Starting Confd population of files…  
> confd 0.12.0-dev  
> 2016-10-26T09:31:04Z RancherOS\_STG /usr/bin/confd[11]: INFO Backend set to env  
> 2016-10-26T09:31:04Z RancherOS\_STG /usr/bin/confd[11]: INFO Starting confd  
> 2016-10-26T09:31:04Z RancherOS\_STG /usr/bin/confd[11]: INFO Backend nodes set to  
> 2016-10-26T09:31:04Z RancherOS\_STG /usr/bin/confd[11]: INFO /etc/exports has md5sum 4f1bb7b2412ce5952ecb5ec22d8ed99d should be 43c6557e46ab874a474a7bfc191f7d62  
> 2016-10-26T09:31:04Z RancherOS\_STG /usr/bin/confd[11]: INFO Target config /etc/exports out of sync  
> 2016-10-26T09:31:04Z RancherOS\_STG /usr/bin/confd[11]: INFO Target config /etc/exports has been updated  
> Displaying /etc/exports contents…  
> /nfsshare \*(rw,fsid=0,async,no\_subtree\_check,no\_auth\_nlm,insecure)  
> Starting rpcbind… -w  
> Displaying rpcbind status…  
> program version netid address service owner  
> 100000 4 tcp6 ::.0.111 - superuser  
> 100000 3 tcp6 ::.0.111 - superuser  
> 100000 4 udp6 ::.0.111 - superuser  
> 100000 3 udp6 ::.0.111 - superuser  
> 100000 4 tcp 0.0.0.0.0.111 - superuser  
> 100000 3 tcp 0.0.0.0.0.111 - superuser  
> 100000 2 tcp 0.0.0.0.0.111 - superuser  
> 100000 4 udp 0.0.0.0.0.111 - superuser  
> 100000 3 udp 0.0.0.0.0.111 - superuser  
> 100000 2 udp 0.0.0.0.0.111 - superuser  
> 100000 4 local /var/run/rpcbind.sock - superuser  
> 100000 3 local /var/run/rpcbind.sock - superuser  
> Starting NFS in the background…  
> rpc.nfsd: knfsd is currently up  
> exporting \*:/nfsshare

but when i try to mount i get permission errors

sudo mount 192.168.60.220:/nfsshare test/  
mount.nfs: access denied by server while mounting 192.168.60.220:/nfsshare

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [October 26, 2016, 12:26pm UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/6 "2016-10-26T12:26:18Z")

</div>

Yes, I just found that too.

I’ve fixed it such that NFS v4 works now and have tested extensively (note there’s no portmapper required with v4). I’ve been unable to get v3 to work reliably; sometimes I can mount, sometimes I can’t and there’s no discernible logic that I can identify - hence, I’ve disabled it.

About to test a fresh build without kernel-headers installed shortly, will report back.

---

<div class="post-metadata">

**Author:** ![bruno.galindro](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bruno.galindro](https://forums.suse.com/u/bruno.galindro)\
**Post date:** [October 26, 2016, 10:56pm UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/7 "2016-10-26T22:56:37Z")

</div>

@sjiveson, could you share Dockerfile of [https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/](https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/)?

I want to build an image with s3fs and nfs-server in alpine because [this image](https://github.com/eduardocardoso/s3fs-container) not works. The error is the same as posted by @Guido_Steiner with cpuguy83/nfs-server image and I can’t make it running even executing the commands that you have mentioned from rancher docs.

```
$ sudo ros service enable kernel-headers
$ sudo ros service up -d kernel-headers
```

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 9:07am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/8 "2016-10-27T09:07:03Z")

</div>

doesn’t work for me. Still no permissions.

here the log from the container:

27.10.2016 10:03:41Displaying /etc/exports contents…  
27.10.2016 10:03:41/nfsshare \*(rw,fsid=0,async,no\_subtree\_check,no\_auth\_nlm,insecure)  
27.10.2016 10:03:41rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).  
27.10.2016 10:03:41Please try, as root, ‘mount -t nfsd nfsd /proc/fs/nfsd’ and then restart rpc.nfsd to correct the problem  
27.10.2016 10:03:41exporting \*:/nfsshare  
27.10.2016 10:03:41Starting NFS in the background…

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [October 27, 2016, 9:08am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/9 "2016-10-27T09:08:32Z")

</div>

Are you running it with `privileged`? Driving me insane, this was working flawlessly for me yesterday. Isn’t this morning.

My container starts just fine, I just can’t connect.

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 9:12am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/10 "2016-10-27T09:12:48Z")

</div>

UPS 😨

Now it works

nfs:  
environment:  
SHARED\_DIRECTORY: /nfsshare  
labels:  
io.rancher.container.pull\_image: always  
tty: true  
image: itsthenetwork/nfs-server-alpine  
privileged: true  
volumes:

- /home/rancher/nfsshare:/nfsshare  
stdin\_open: true  
net: host

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [October 27, 2016, 9:14am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/11 "2016-10-27T09:14:19Z")

</div>

Can you mount from a client?

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 9:19am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/12 "2016-10-27T09:19:35Z")

</div>

from rancheros yes…but convoy-nfs still makes trouble…I got convoy-nfs running with a debian nfs server.

> [rancher@RancherOS2\_SRV ~]$ sudo mount -o nfsvers=4 192.168.60.201:/ share/  
> [rancher@RancherOS2\_SRV ~]$ cd share  
> [rancher@RancherOS2\_SRV share]$ ls  
> [rancher@RancherOS2\_SRV share]$

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 9:24am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/13 "2016-10-27T09:24:39Z")

</div>

> 27.10.2016 11:23:09time=“2016-10-27T09:23:09Z” level=error msg=“mkdir /var/lib/rancher/convoy/convoy-nfs-3b2124eb-8593-482d-8829-dd965b52bb79/mnt/config: permission denied”  
> 27.10.2016 11:23:09{  
> 27.10.2016 11:23:09 “Error”: “mkdir /var/lib/rancher/convoy/convoy-nfs-3b2124eb-8593-482d-8829-dd965b52bb79/mnt/config: permission denied”  
> 27.10.2016 11:23:09}  
> 27.10.2016 11:23:09time=“2016-10-27T09:23:09Z” level=info msg=“convoy exited with error: exit status 1”  
> 27.10.2016 11:23:09time=“2016-10-27T09:23:09Z” level=info msg=Exiting.

Looks like permissions are wrong

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 9:29am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/14 "2016-10-27T09:29:11Z")

</div>

I changed the nfsshare permission inside of the container now it seams to work with convoy-nfs

[rancher@RancherOS2\_SRV ~]$ sudo mount -o nfsvers=4 192.168.60.201:/ share/  
[rancher@RancherOS2\_SRV ~]$ cd share/  
[rancher@RancherOS2\_SRV share]$ ls  
config gaga  
[rancher@RancherOS2\_SRV share]$

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [October 27, 2016, 9:42am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/15 "2016-10-27T09:42:41Z")

</div>

Unfortunately I know nothing about Convoy.

Any chance you could post a copy of the /usr/bin/nfsd.sh from your working image please? I’d like to compare it to what I have.

---

<div class="post-metadata">

**Author:** ![sjiveson](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sjiveson/32/966_2.png) [@sjiveson](https://forums.suse.com/u/sjiveson)\
**Post date:** [October 27, 2016, 9:48am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/16 "2016-10-27T09:48:07Z")

</div>

@bruno.galindro

It currently looks like this. See the following post for what the entrypoint script looks like. My latest version doesn’t bother with rpcbind and works fine.

```auto
FROM alpine:latest

RUN apk add -U -v nfs-utils bash iproute2 && \
    rm -rf /var/cache/apk/* /tmp/* && \
    rm -f /sbin/halt /sbin/poweroff /sbin/reboot && \
    mkdir -p /var/lib/nfs/rpc_pipefs && \
    mkdir -p /var/lib/nfs/v4recovery && \
    mkdir -p /nfs && chmod -R 777 /nfs && \
    echo "rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs defaults 0 0" >> /etc/fstab && \
    echo "nfsd /proc/fs/nfsd nfsd defaults 0 0" >> /etc/fstab

COPY confd-binary /usr/bin/confd
COPY confd/confd.toml /etc/confd/confd.toml
COPY confd/toml/* /etc/confd/conf.d/
COPY confd/tmpl/* /etc/confd/templates/

COPY nfsd.sh /usr/bin/nfsd.sh
COPY .bashrc /root/.bashrc

RUN chmod +x /usr/bin/nfsd.sh /usr/bin/confd

ENTRYPOINT ["/usr/bin/nfsd.sh"]

```

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 9:50am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/17 "2016-10-27T09:50:08Z")

</div>

cat /usr/bin/nfsd.sh

```auto
#!/bin/bash

# Make sure we react to these signals by running stop() when we see them - for clean shutdown
# And then exiting
trap "stop; exit 0;" SIGTERM SIGINT

stop()
{
  # We're here because we've seen SIGTERM, likely via a Docker stop command or similar
  # Let's shutdown cleanly
  echo "SIGTERM caught, terminating NFS process(es)..."
  /usr/sbin/exportfs -ua
  pid1=$(pidof rpc.nfsd)
  pid2=$(pidof rpc.mountd)
  kill -TERM $pid1 $pid2 > /dev/null 2>&1
  echo "Terminated."
  exit
}

if [-z "$SHARED_DIRECTORY"]; then
  echo "The SHARED_DIRECTORY environment variable is null, exiting..."
  exit 1
fi

# This loop runs till until we've started up successfully
while true; do

  # Check if NFS is running by recording it's PID (if it's not running $pid will be null):
  pid=$(pidof rpc.mountd)

  # If $pid is null, do this to start or restart NFS:
  while [-z "$pid"]; do
    echo "Starting Confd population of files..."
    /usr/bin/confd -version
    /usr/bin/confd -onetime
    echo "Displaying /etc/exports contents..."
    cat /etc/exports

    # Only required if v3 will be used
    echo "Starting rpcbind..."
    /sbin/rpcbind -w
    echo "Displaying rpcbind status..."
    /sbin/rpcinfo

    # Only required if v3 will be used
    # /usr/sbin/rpc.idmapd
    # /usr/sbin/rpc.gssd -v
    # /usr/sbin/rpc.statd

    /usr/sbin/rpc.nfsd --debug 8
    /usr/sbin/exportfs -rv
    echo "Starting NFS in the background..."
    /usr/sbin/rpc.mountd --debug all --no-udp --exports-file /etc/exports

    # Check if NFS is now running by recording it's PID (if it's not running $pid will be null):
    pid=$(pidof rpc.mountd)

    # If $pid is null, startup failed; log the fact and sleep for 2s
    # We'll then automatically loop through and try again
    if [-z "$pid"]; then
      echo "Startup of NFS failed, sleeping for 2s, then retrying..."
      sleep 2
    fi

  done

  # Break this outer loop once we've started up successfully
  # Otherwise, we'll silently restart and Docker won't know
  break

done

while true; do

  # Check if NFS is STILL running by recording it's PID (if it's not running $pid will be null):
  pid=$(pidof rpc.mountd)
  # If it is not, lets kill our PID1 process (this script) by breaking out of this while loop:
  # This ensures Docker observes the failure and handles it as necessary
  if [-z "$pid"]; then
    echo "NFS has failed, exiting, so Docker can restart the container..."
    break
  fi

  # If it is, give the CPU a rest
  sleep 1

done

sleep 1
exit 1

```

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 9:52am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/18 "2016-10-27T09:52:41Z")

</div>

Got it pretty much working with Convoy-nfs the only issue i still have is that the mariadb container wants to chown inside the nfs mount. I added no\_root\_squash to the /etc/exports but looks like your script is replacing the file at a restart.

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 9:55am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/19 "2016-10-27T09:55:19Z")

</div>

This pretty cool and my solution for Multihost.

 ![](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/1/142d9e990236c084b3c4dd7169b803e370286378.png)

---

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [October 27, 2016, 10:07am UTC](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343/20 "2016-10-27T10:07:36Z")

</div>

Yes 🙂 I changed your exports.tmpl to this

{{getenv “SHARED\_DIRECTORY”}} \*(rw,fsid=0,async,no\_subtree\_check,no\_auth\_nlm,insecure,no\_root\_squash)

and now I can start this:

wordpress:  
image: wordpress  
links:  
- db:mysql  
ports:  
- ${public\_port}:80  
db:  
image: mariadb  
environment:  
MYSQL\_ROOT\_PASSWORD: example  
volumes:  
- wordpress:/var/lib/mysql  
stdin\_open: true  
volume\_driver: convoy-nfs

and it is working with 🙂

[Next page](https://forums.suse.com/t/nfs-server-no-support-in-current-kernel/4343.md?page=2)
