# NFS problem on macOS Sonoma

**URL:** https://discourse.roots.io/t/nfs-problem-on-macos-sonoma/26894
**Category:** trellis
**Tags:** trellis
**Created:** 2024-03-27T08:01:15Z
**Posts:** 11

## Post 1 by @Twansparant — 2024-03-27T08:01:16Z

Hi there,

I’m bumping into this issue with a fresh **Trellis** clone on a M1/2/3 MacBook running macOS **Sonoma 14.4** \* when running `trellis up`:

```
==> 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 10.211.55.2:/Users/user/Work/test.com/site /vagrant-nfs-test.com

Stdout from the command:

Stderr from the command:

mount.nfs: an incorrect mount option was specified
```

By the looks of things, I’m not alone:

> <https://github.com/hashicorp/vagrant/issues/13364>
>
> ### Debug output
> 
> https://gist.github.com/dfreudenberger/7e894870dc739cba7876f…ef4983c8508
> 
> ### Expected behavior
> 
> synced_folder should mount the specified path using NFS.
> 
> ### Actual behavior
> 
> [Apple decided](https://developer.apple.com/documentation/macos-release-notes/macos-14_4-release-notes#Known-Issues) to limit the access to kickstart which is currently used to restart the NFS daemon. Therefore the mount operation fails. 
> 
> Edit:
> It seems like Vagrant doesn't actually use kickstart by itself; instead, it runs "sudo nfsd restart" which causes the error mentioned. Perhaps modifying [this line](https://github.com/hashicorp/vagrant/blob/d8fdc500b76c840cdeaa69869d0c000530b036b3/plugins/hosts/bsd/cap/nfs.rb#L163) to use `update` instead of `restart` could solve the problem.
> 
> ```bash
> sudo nfsd restart
> Could not kickstart service "com.apple.nfsd": 1: Operation not permitted
> /bin/launchctl exited with status 1
> ```
> 
> ### Reproduction information 
> 
> #### Vagrant version
> 
> Vagrant 2.4.1
> 
> #### Host operating system
> 
> MacOS Sonoma 14.4
> 
> #### Guest operating system
> 
> Fedora 
> 
> #### Steps to reproduce
> 
> 1. vagrant up
> 
> #### Vagrantfile
> 
> ```ruby
> # -*- mode: ruby -*-
> # vi: set ft=ruby :
> 
> Vagrant.configure("2") do |config|
> config.vm.box = "bento/fedora-latest"
> 
> config.vm.provider "parallels" do |prl|
> prl.update_guest_tools = false
> end
> 
> config.vm.synced_folder '~/dev', "/data", :type => 'nfs', :nfs_version => 3
> end
> ```

Is there nothing we can do then wait for a fix? I don’t quit understand where/when to run this command: `sudo nfsd update` like suggested [here](https://github.com/hashicorp/vagrant/issues/13364#issuecomment-2020631019) and how that’s is suppose to fix it, when the playbook stops running?

Any suggestions are welcome!  
Thanks

---

## Post 2 by @psymeon — 2024-03-28T17:13:56Z

I was also having the same issue. I actually just managed to solve it by running the `sudo nfsd update` command in the same directory where I had run the `vagrant up` / `trellis up` command, directly after the command exited with the error. Not sure what the command really does TBH and whether it’s the definitive solution to this issue though.

---

## Post 3 by @Twansparant — 2024-03-29T09:26:51Z

Ah check, just tried that. I presume you have to run `trellis up` again after that?

Because the initial provisioning of my vagrant box exits with an error and therefore the **nfsd mounts** are not recognized and the second time provisioning it fails at the composer task:

```
TASK [wordpress-install : Install Dependencies with Composer] ******************
failed: [default] (item=example.com) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "example.com", "value": {"admin_email": "user@example.com", "admin_user": "example", "cache": {"enabled": false}, "cron_interval": "*/1", "env": {"db_name": "example_development", "db_prefix": "wp_", "db_user": "example", "log_channel": "stack"}, "local_path": "../site", "multisite": {"enabled": false}, "site_hosts": [{"canonical": "example.test", "redirects": ["www.example.test"]}], "ssl": {"enabled": true, "provider": "self-signed"}, "xmlrpc": {"enabled": false}}}, "msg": "Composer could not find a composer.json file in /srv/www/example.com/current To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage", "stdout": "Composer could not find a composer.json file in /srv/www/example.com/current\nTo initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage\n", "stdout_lines": ["Composer could not find a composer.json file in /srv/www/example.com/current", "To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage"]}
```

When I ssh into the box, the `srv/www/example.com/current` folder doesn’t have any composer files, only the `web` folder?

---

## Post 4 by @btraill — 2024-04-02T17:31:04Z

> [@psymeon](#):
>
> sudo nfsd update

Thanks – this fixed it for me as well.

---

## Post 5 by @btraill — 2024-04-02T18:26:42Z

Nevermind… 20mins later when reprovisioning its not working (even after subsequently running it) Hmm… it’s odd. I had no issues initially with my first environment. It’s only since creating a second Vagrant box now and deploying another environment.

---

## Post 6 by @Twansparant — 2024-04-02T18:47:26Z

I’ve got the feeling it only happens with new projects that are not added yet in the `/etc/exports` file.  
Then the first time running `trellis up` will fail while mounting the nfs volumes.  
When I run `sudo nfsd update`, shutdown the box and run `trellis up` again, that error seems to be gone.  
After that, you need to finish provisioning the box with `trellis provision development`.  
It shouldn’t affect deploying remote servers though I think?

---

## Post 7 by @btraill — 2024-04-02T18:59:36Z

I believe you’re correct about the remote deployments. I wasn’t seeing any issues yet. I’m going to try this order of operations to get my new environment going.

---

## Post 8 by @btraill — 2024-04-02T19:23:34Z

Confirmed – working now after this sequence.

---

## Post 9 by @gutobenn — 2024-04-26T00:57:12Z

I’m having this issue but can’t fix it by running `sudo nfsd update`. Does anyone has any idea why? I already tried running it in different moments, but couldn’t make it work.

My project is not new (it has 2 years), and I am using vagrant 2.4.1 on macOS Sonoma 14.4.1.

Thanks!

---

## Post 10 by @rkalajian — 2024-05-15T12:03:37Z

in your vagrant.default.yml change:

```
vagrant_mount_type: 'nfs'
```

to

```
vagrant_mount_type: 'parallels'
```

---

## Post 11 by @Twansparant — 2024-07-15T19:27:09Z

This fixed it for me (sorry for the late response). I did have to destroy the box though
