0

I am using a MacBook Pro M2 running macOS Sonoma.

My vagrant project to find that the NFS mount is failing. I have two vagrant VMs; a development one where I develop my VM setup, and a production one that provides my LAMP stack for web work. After a few weeks away from vagrant and web stuff, I came back to find this problem on both VMs. Both had been working when I last worked with them.

I went thermonuclear on my development VM, running vagrant destroy then sudo rm -rf ./.vagrant (I'm leaving the production VM alone for now). Then I created a brand new bare VM. The vagrantfile for that is...

# -*- mode: ruby -*-
# vi: set ft=ruby

# 01 Create Bare VM

# Machine Variables
VM_HOSTNAME         = "p2vagrant"
VM_IP               = "192.168.22.42"
TIMEZONE            = "Australia/Brisbane"
MEMORY              = 4096
CPUS                = 1

# Synced Folders
HOST_FOLDER         = "."
VM_FOLDER           = "/var/www"

Vagrant.configure("2") do |config|

    config.vm.box = "bento/ubuntu-20.04-arm64"

    config.vm.provider "vmware_desktop" do |v|
        v.memory    = MEMORY
        v.cpus      = CPUS
        v.gui       = true
    end

    # Configure hostname...
    config.vm.hostname = VM_HOSTNAME

    # Configure network...
    config.vm.network :private_network, ip: VM_IP

    # Set a synced folder...
    config.vm.synced_folder HOST_FOLDER, VM_FOLDER, create: true, nfs: true, mount_options: ["actimeo=2"]
end

And the Terminal output is...

==> default: Machine booted and ready!
==> default: Setting hostname...
==> default: Configuring network adapters within the VM...
==> default: Installing NFS client...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
Could not kickstart service "com.apple.nfsd": 1: Operation not permitted
/bin/launchctl exited with status 1
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp,actimeo=2 172.16.68.1:/Users/pedro/Developer/Vagrant/p2vagrant /var/www

Stdout from the command:

Stderr from the command:

mount.nfs: access denied by server while mounting 172.16.68.1:/Users/pedro/Developer/Vagrant/p2vagrant

Searches tell me that this issue has come up many times before. However all the answers I've found are at least a couple of years old, and I haven't found one that solves it for me.

0

0

You must log in to answer this question.

Browse other questions tagged .