Saturday, April 18, 2020

Creating an NFS share on Proxmox host to share in VMs

The goal is to create a folder on the Proxmox host that we can share on a guest. An NFS share seems to be the recommended way, because a kernel level share folder breaks the high availability paradigm. An advanced user can navigate the command line and force a kernel share, but this causes other problems.

The current setup uses
Proxmox VE 6.1
Ubuntu 18.04

# Install NFS Service on Proxmox
apt install nfs-kernel-server
# Create share folder
mkdir /tank/vmshare
# Share the folder
echo "/tank/vmshare 192.168.1.0/255.255.255.0 (rw,no_root_squash,subtree_check)" >> /etc/exports
exportfs -a
systemctl reload nfs-kernel-server

Now we can mount the NFS share from the guest VM.

# Install the NFS client
sudo apt install nfs-common
# Mount the share
sudo mkdir /mnt/vmshare
sudo chmod 777 /mnt/vmshare
sudo mount 192.168.1.100:/tank/vmshare /mnt/vmshare

TODO: Instructions for autofs to mount the NFS

No comments:

Post a Comment