Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usability check for NFS broken... #8624

Closed
sean- opened this issue May 27, 2017 · 5 comments
Closed

Usability check for NFS broken... #8624

sean- opened this issue May 27, 2017 · 5 comments

Comments

@sean-
Copy link
Contributor

sean- commented May 27, 2017

Summary

Vagrant's NFS usability check is broken for at least FreeBSD, possibly other BSDs. Below is a patch to workaround the issue. I wasn't sure how to fix this. I believe this was broken last summer during the NFS refactor and has been broken since. I've been sitting on this bug for a while but want to stop carrying around this workaround patch. This worked last summer (2016) but appears to have been broken around or after #7480 (I presented this code as working at a June 11th talk on Packer and Vagrant.

Vagrant version

$ vagrant -v
Vagrant 1.9.5

Host operating system

% uname -a
Darwin ethics.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

Guest operating system

FreeBSD

Vagrantfile

https://github.com/sean-/packer-freebsd/blob/70df39848f71498d2c59c78402e4d890bf3fde56/11.0/Vagrantfile

Debug output

Debug output: https://pastebin.com/eLCPwVav

Expected behavior

$ vagrant up
Bringing machine 'default' up with 'vmware_fusion' provider...
==> default: Cloning VMware VM: 'FreeBSD-11.0-STABLE-zfs-20170510-r318134-vmware'. This can take some time...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
WARNING: The VMX file for this box contains a setting that is automatically overwritten by Vagrant
WARNING: when started. Vagrant will stop overwriting this setting in an upcoming release which may
WARNING: prevent proper networking setup. Below is the detected VMX setting:
WARNING:
WARNING:   ethernet0.pcislotnumber = "160"
WARNING:
WARNING: If networking fails to properly configure, it may require this VMX setting. It can be manually
WARNING: applied via the Vagrantfile:
WARNING:
WARNING:   Vagrant.configure(2) do |config|
WARNING:     config.vm.provider :vmare_fusion do |vmware|
WARNING:       vmware.vmx["ethernet0.pcislotnumber"] = "160"
WARNING:     end
WARNING:   end
WARNING:
WARNING: For more information: https://www.vagrantup.com/docs/vmware/boxes.html#vmx-whitelisting
==> default: Fixed port collision for 22 => 2222. Now on port 2206.
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 192.168.192.166:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Forwarding ports...
    default: -- 22 => 2206
==> default: Configuring network adapters within the VM...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: pkg already bootstrapped at /usr/local/sbin/pkg
==> default: Update the pkg database...
==> default: Updating FreeBSD repository catalogue...
==> default: FreeBSD repository is up to date.
==> default: All repositories are up to date.
==> default: Upgrade pkg database...
==> default: Updating FreeBSD repository catalogue...
==> default: FreeBSD repository is up to date.
==> default: All repositories are up to date.
==> default: Checking for upgrades (1 candidates): .
==> default:  done
==> default: Processing candidates (1 candidates): . done
==> default: Checking integrity... done (0 conflicting)
==> default: Your packages are up to date.
==> default: Initializing the pkg audit database...
==> default: vulnxml file up-to-date
==> default: 0 problem(s) in the installed packages found.
==> default: Upgrading out of date packages...
==> default: Updating FreeBSD repository catalogue...
==> default: FreeBSD repository is up to date.
==> default: All repositories are up to date.
==> default: Checking for upgrades (1 candidates): . done
==> default: Processing candidates (1 candidates): . done
==> default: Checking integrity... done (0 conflicting)
==> default: Your packages are up to date.

==> default: Machine 'default' has a post `vagrant up` message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default:
==> default: Application directory: /local
==> default: Num cores: 4
==> default: MB RAM: 1536

Time spent in user mode   (CPU seconds) : 13.439s
Time spent in kernel mode (CPU seconds) : 2.839s
Total time                              : 2:03.36s
CPU utilization (percentage)            : 13.1%
Times the process was swapped           : 0
Times of major page faults              : 2685
Times of minor page faults              : 831437
$ vagrant destroy
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Discarding suspended state...
==> default: Deleting the VM...
==> default: Pruning invalid NFS exports. Administrator privileges will be required...

Actual behavior

$ vagrant up --provider=vmware_fusion
Bringing machine 'default' up with 'vmware_fusion' provider...
==> default: Verifying vmnet devices are healthy...
The synced folder type 'nfs' is reporting as unusable for
your current setup. Please verify you have all the proper
prerequisites for using this shared folder type and try again.
Exit 1
$ vagrant destroy
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Discarding suspended state...
==> default: Deleting the VM...
==> default: Pruning invalid NFS exports. Administrator privileges will be required...
The synced folder type 'nfs' is reporting as unusable for
your current setup. Please verify you have all the proper
prerequisites for using this shared folder type and try again.
Exit 1

Steps to reproduce

  1. git clone https://github.com/sean-/packer-freebsd.git
  2. cd packer-freebsd/11.0
  3. make cfgt
  4. make 20170510-r318134-zfs TARGET=vmware-iso
  5. vagrant box add --name FreeBSD-11.0-STABLE-zfs-20170510-r318134-vmware --provider=vmware_desktop FreeBSD-11.0-STABLE-zfs-20170510-r318134-vmware.box
  6. mkdir t
  7. vagrant init FreeBSD-11.0-STABLE-zfs-20170510-r318134-vmware
  8. vagrant up --provider=vmware_fusion

To work around the issue, apply the following patch:

https://raw.githubusercontent.com/sean-/packer-freebsd/70df39848f71498d2c59c78402e4d890bf3fde56/11.0/.vagrant-nfs.patch

--- /opt/vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/action/builtin/mixin_synced_folders.rb.orig	2017-05-27 17:48:42.000000000 -0400
+++ /opt/vagrant/embedded/gems/gems/vagrant-1.9.5/lib/vagrant/action/builtin/mixin_synced_folders.rb	2017-05-27 16:51:03.000000000 -0400
@@ -141,7 +141,7 @@
                 if !impl_class[0].new.usable?(machine, true)
                   # Verify that explicitly defined shared folder types are
                   # actually usable.
-                  raise Errors::SyncedFolderUnusable, type: data[:type].to_s
+                  #raise Errors::SyncedFolderUnusable, type: data[:type].to_s
                 end
               end
             end
@jen20
Copy link
Contributor

jen20 commented May 28, 2017

This is not the case for Illumos, guessing it's missing a capability registration in plugin.rb in FreeBSD guest plugin.

@sean-
Copy link
Contributor Author

sean- commented May 30, 2017

Cool, I misunderstood the NFS interaction you were having then. So yeah, BSD NFS detect

@jen20
Copy link
Contributor

jen20 commented Aug 21, 2017

This seems to have been fixed in v1.9.7 (at least for FreeBSD, I haven't tried any others). cc @sean-.

@chrisroberts
Copy link
Member

Hi there,

It looks like this has been resolved within a previously shipped version of Vagrant so I am now closing this issue. If the original issue was not fully resolved, please reopen this issue or create a new one.

Cheers!

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants