You can mount a directory (or drive) of VM on your Mac or vice-versa with NFS, for example:
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):
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
3) Click connect to connect to share.
See this link for more detail.