title: Vagrant disable guest capability in Vagrantfile
body: <p>I would like to disable one specific guest capability: &quot;persist_mount_shared_folder&quot;<br />
  Is this possible somehow in the Vagrantfile?</p>
  <p><strong>Reason:</strong><br />
  The setting &quot;config.vm.allow_fstab_modification = false&quot; does not work as expected by me and still tries to clean up the fstab file.<br />
  See: <a href="https://github.com/hashicorp/vagrant/blob/main/lib/vagrant/action/builtin/synced_folders.rb#L140" rel="nofollow noreferrer">https://github.com/hashicorp/vagrant/blob/main/lib/vagrant/action/builtin/synced_folders.rb#L140</a><br />
  So, setting that setting to &quot;false&quot; only sets the synced_folder list to &quot;nil&quot;, which leads in the capability &quot;<a href="https://github.com/hashicorp/vagrant/blob/main/plugins/guests/linux/cap/persist_mount_shared_folder.rb#L20" rel="nofollow noreferrer">persist_mount_shared_folder.rb</a>&quot; to try to remove all entries from fstab. (Which I did not expect to happen, because I set the setting do not allow for any modifications of the fstab file ...?)</p>
  <p>I am building an OPNSense box (v21). Starting that box results in an error after connecting with SSH. The error is about the &quot;sed&quot; command which tries to cleanup the /etc/fstab file. Unfortunately that sed command does not work on this OPNSense version:</p>
  <pre><code>==&gt; opnsense21: Machine booted and ready!
  The following SSH command responded with a non-zero exit status.
  Vagrant assumes that this means the command failed!
  
  sed -i '/#VAGRANT-BEGIN/,/#VAGRANT-END/d' /etc/fstab
  
  Stdout from the command:
  
  Stderr from the command:
  sed: 1: &quot;/etc/fstab&quot;: invalid command code f
  </code></pre>
  <p>The sed command is defined in &quot;<a href="https://github.com/hashicorp/vagrant/blob/aae8f4f4a5860d21bae9adbc409740279d172ee3/plugins/guests/linux/cap/persist_mount_shared_folder.rb#L66" rel="nofollow noreferrer">persist_mount_shared_folder.rb line 66</a>&quot; but I do not know how to alter this command. So that's why I am trying to disable the capability.<br />
  <em>The VM does not need any synced folders</em></p>