Story so far
We recently migrated from Linux laptops to Macbook Pro laptops (company IT no longer supports native Linux laptops with VPN, so it's all Macbook/OSX devices for us). However, all of our development requires the use of Ubuntu and Debian, so we're running everything in virtual machines. Our plan is to use QEMU (with the appropriate hardware acceleration via hvf) to easily spin up VMs on-demand. We are able to successfully launch our VMs via something like this:
qemu-system-x86_64 \ -m 4096 \ -smp 4\ -accel hvf \ -show-cursor \ -drive file=/public/my_os_disk.qcow2,if=virtio \ -net user,hostfwd=tcp::8022-:22 \ -net nic This starts up our VM (Ubuntu) instance with 4GB of RAM, 4 cores, hardware acceleration, and allows us to ssh into the VM (port 22 from the VM's perspective) via ssh -p8022 username@localhost.
Question
How can we setup an NFS server on the Linux guest so that our Mac/OSX host can share files? If the host were also Linux, we could use virtfs like we used to, but it seems our solution must involve networking. We've setup NFS server on the Ubuntu VM (using common articles, 1, 2). We then setup the QEMU launcher script to enable the NFS ports (i.e. 111, 2049), like so:
qemu-system-x86_64 \ -m 4096 \ -smp 4\ -accel hvf \ -show-cursor \ -drive file=/public/my_os_disk.qcow2,if=virtio \ -net user,hostfwd=tcp::8022-:22,hostfwd=tcp::2049-:2049,hostfwd=tcp::111-:111 \ -net nic On the Mac host (or OSX host), we attempt to mount the NFS share (assuming the Linux guest is exporting the /export_from_linux path on the the 10.0.100.0/24 subnet) via:
mount -t nfs localhost:/export_from_linux /my_mac_mount_path However, this just hangs indefinitely.
What is the best way to (preferably using NFS) establish a means of sharing files between a Mac/OSX host, and a Linux/Ubuntu guest running in QEMU?