You can mount a directory (or drive) of VM on your Mac or vice-versa with NFS, for example:
On Linux:
First install (and start) NFS on your linux VM, if your distro is debian based:
sudo apt install nfs-kernel-server
sudo systemctl nfs-kernel-server start
1) Create user account, in this example, let's set the user and group ID to 5000
useradd -u 5000 macusers
2) Set password for NFS user account:
# passwd macusers
3) Edit the exports file, here we use vim:
# vim /etc/exports
4) Add the following line (fix to your context):
/home/user/share 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)
5) Save and exit.
6) Set permission to exports:
chown -R macuser:macuser /home/user/share
Enable NFS on OS X
1) On a terminal window, start the NFS service (enter your password, if necessary):
# sudo nfs start
2) Close the terminal window.
Launch Connect to server:
1) Press Command+K to launch Connect to Server.
2) In the server address field enter nfs:// define the network protocol for CIFS and then enter the IP address of the server with the export path
nfs://192.168.5.3/home/user/share
3) Click connect to connect to share.
See this link for more detail.