NFS Share ( between two VMs )

friendodevil

Member
Apr 5, 2022
39
3
8
I'm trying to create an NFS share drive between two Ubuntu 20.04 VMs -- so far unsuccessful -- help will be highly appreciated

VM1 (Server)
  1. Install NFS srvr package: sudo apt-get install nfs-kernel-server
  2. Create share list
    • add to /etc/exports:
    • /mnt/nfs-share 192.168.1.0/24(rw,sync,root_squash,subtree_check)
    • start NFS: sudo service nfs-kernel-server start
  3. Did not see Ubuntu complain thus far :)

Add NFS share drive to Proxmox in Datacenter, exports autofilled nfs-share so I assume VM1 share drive was setup successfully.

VM2 (Client)
  1. Install NFS client package: sudo apt-get install nfs-common
  2. Create share directory & and mount nfs drive
    • sudo mkdir /mnt/nfs-share-mount
    • edit /etc/fstab:
    • 192.168.1.100:/mnt/nfs-share /mnt/nfs-share-mount nfs rw,soft,intr,noatime,timeo=100,rsize=32768,wsize=32768 0 2

when a running 'mount -a' I get: NFS mount.nfs: access denied by server while mounting.... am I missing some permissions settings anywhere or is it something else?
 
I've never needed to use "exportfs -a" .. it's just a high-level way of making the changes in /etc/exports active which can also be done with
systemctl restart nfs-kernel-server
... just saying ..

Friendodevil - did you get this working?
 
I was finally able to get this going with the following steps:

Installing nfs server
  1. sudo apt update
  2. sudo apt install nfs-kernel-system -y
  3. Make directory : sudo mkdir /mnt/<dir> <<< This should be where the virtual HDD is mounted to via disk mount
  4. sudo chmod 755 /mnt/<dir>
  5. sudo nano /etc/exports

    1. /mnt/<dir>

      192.168.1.0/255.255.255.0(rw,sync,no_subtree_check)
  6. sudo exportfs -arvf
  7. sudo systemctl start nfs-kernel-server
  8. sudo systemctl enable nfs-kernel-server
  9. sudo systemctl status nfs-kernel-server


Installing on Client

  1. sudo apt install nfs-common
  2. showmount –e <server IP>
  3. Sudo mkdir /mnt/nfs-drv
  4. sudo nano /etc/fstab

    1. 192.168.1.10:/mnt/<dir>

      /mnt/nfs-drv

      Nfs

      Defaults,_netdev

      0

      0
  5. sudo mount -a
  6. Mount
 
  • Like
Reactions: NCCM

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!