sjiveson / nfs-server-alpine

A handy Alpine Linux based NFS Server image running NFS v4 only, over TCP on port 2049
https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/
GNU General Public License v3.0
295 stars 187 forks source link

NFS Client Connection Error #39

Open capriciousduck opened 4 years ago

capriciousduck commented 4 years ago

I deployed this image on my linux laptop and trying to mount the shares in my raspberry pi(running debian). I get the following error.

sudo mount -v 10.0.0.58:/ /mnt/nfs-p4
mount.nfs: timeout set for Thu Dec 12 10:20:10 2019
mount.nfs: trying text-based options 'vers=4.2,addr=10.0.0.58,clientaddr=10.0.0.33'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.1,addr=10.0.0.58,clientaddr=10.0.0.33'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.0,addr=10.0.0.58,clientaddr=10.0.0.33'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=10.0.0.58'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query retrying: RPC: Unable to receive
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Unable to receive - Connection refused
mount.nfs: trying text-based options 'vers=4.0,addr=10.0.0.58,clientaddr=10.0.0.33'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=10.0.0.58'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query retrying: RPC: Unable to receive
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Unable to receive - Connection refused
mount.nfs: trying text-based options 'vers=4.0,addr=10.0.0.58,clientaddr=10.0.0.33'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=10.0.0.58'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query retrying: RPC: Unable to receive
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Unable to receive - Connection refused
mount.nfs: trying text-based options 'vers=4.0,addr=10.0.0.58,clientaddr=10.0.0.33'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=10.0.0.58'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query retrying: RPC: Unable to receive
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Unable to receive - Connection refused

Though, my container logs show no errors. The log from container is below.


docker logs 09665f043dfd
Writing SHARED_DIRECTORY to /etc/exports file
The PERMITTED environment variable is unset or null, defaulting to '*'.
This means any client can mount.
The READ_ONLY environment variable is unset or null, defaulting to 'rw'.
Clients have read/write access.
The SYNC environment variable is set, using 'sync' mode.
Writes will be immediately written to disk.
Displaying /etc/exports contents:
/nfsshare *(rw,fsid=0,sync,no_subtree_check,no_auth_nlm,insecure,no_root_squash)

Starting rpcbind...
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 down
rpc.nfsd: Writing version string to kernel: -2 -3
rpc.nfsd: Created AF_INET TCP socket.
rpc.nfsd: Created AF_INET6 TCP socket.
Exporting File System...
exporting *:/nfsshare
/nfsshare       <world>
Starting Mountd in the background...These
Startup successful.
nickma82 commented 3 years ago

Which command did you use to start it up?

sureshjoshi commented 3 years ago

@capriciousduck Any luck with this? I have the same issue

sureshjoshi commented 3 years ago

Nevermind, turns out I had mis-typed my ports.

docker run --name nfs --privileged -v /tmp/nfs:/nfsshare -e SHARED_DIRECTORY=/nfsshare -p "2049:2049" itsthenetwork/nfs-server-alpine:latest

fvfvsda commented 2 years ago

I have the same problem. Have you found a way to solve it? @capriciousduck

TheNexter commented 2 years ago

@fvfvsda @capriciousduck Hello, same problem, do you find a way to solve the problem ? 3 Months stuck with simple thing like this :(

fvfvsda commented 2 years ago

You can try to refer to docker-compose.yml in this website. I hope this can help you. https://blog.siaimes.me/2021/01/01/p54.html#more @TheNexter

TheNexter commented 2 years ago

You can try to refer to docker-compose.yml in this website. I hope this can help you. https://blog.siaimes.me/2021/01/01/p54.html#more @TheNexter

It's work for you ? :(

fvfvsda commented 2 years ago

You can try to refer to docker-compose.yml in this website. I hope this can help you. https://blog.siaimes.me/2021/01/01/p54.html#more @TheNexter

It's work for you ? :(

The file in the container named nfsd.sh also need to be modified. You can refer to this. https://github.com/siaimes/nfs-server-alpine/commit/15ff1e0399430ea46a639819be2143fc785f6b12

jaykishan007 commented 9 months ago

Do we have a solution yet? Stuck with this for a while now. @sureshjoshi @capriciousduck @sjiveson

I am running this as a stand alone container, facing the same problem and yes the privileged: true

version: '3'
services:
  nfs-server:
    image: itsthenetwork/nfs-server-alpine:latest-arm
    container_name: nfs-server
    ports:
      - "2049:2049"
    volumes:
      - ./shared:/nfsshare
    environment:
      - SHARED_DIRECTORY=/nfsshare
    privileged: true
    restart: always

Yet when I try to mount from host

sudo mount -v 192.168.29.203:/nfsshare ./somelocalplace

gives connection refused.

Screenshot 2024-02-07 at 4 52 51 PM
AiAutomationAgency commented 2 months ago

Hi, Try this: sudo mount.nfs4 -v 192.168.29.203:/ ./somelocalplace Without "nfsshare" just "/"