VMWare Fusion Plugin with bundler-executed Vagrant

87 views
Skip to first unread message

James Nugent

unread,
May 24, 2017, 2:04:21 PM5/24/17
to Vagrant
Hi all,

I'm trying to enhance the guest support for various operating systems, but am hitting issues with using the VMWare Fusion plugin with the source builds of Vagrant. The steps with output I'm trying are:

```
$ ruby --version
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin16]

$ bundle install
[output trimmed]

$ # Make various changes to guest support

$ which vagrant
vagrant not found

$ /opt/vagrant/bin/vagrant --version
Vagrant 1.9.5

$ opt/vagrant/embedded/bin/ruby --version
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin13]

$ export VAGRANT_INSTALLER_EMBEDDED_DIR=/opt/vagrant/embedded

$ bundle exec vagrant plugin install vagrant-vmware-fusion
[output trimmed, installation succeeds]

$ bundle exec vagrant plugin license vagrant-vmware-fusion /Users/James/Desktop/license-vmware-8.lic
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

Installing license for 'vagrant-vmware-fusion'...
The license for 'vagrant-vmware-fusion' was successfully installed!

$ bundle exec vagrant box add --name test /path/to/box

$ bundle exec vagrant up
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.

Your license to use 'vagrant-vmware-fusion' hasn't been verified in
months. We'll attempt to verify it now. This requires an internet
connection. If the verification fails, you'll need to connect to the
internet. If verification continues to fail, please contact support
Verification successful. Please use Vagrant while connected to the
internet from time to time so Vagrant can keep your license verified.
Bringing machine 'default' up with 'vmware_fusion' provider...
/Users/James/.rbenv/versions/2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- vagrant/version (LoadError)
from /Users/James/.rbenv/versions/2.2.5/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/James/.vagrant.d/gems/2.2.5/gems/vagrant-vmware-fusion-4.0.19/bin/vagrant_vmware_desktop_sudo_helper:16:in `<encoded>'
from /Users/James/.vagrant.d/gems/2.2.5/gems/vagrant-vmware-fusion-4.0.19/bin/vagrant_vmware_desktop_sudo_helper:44:in `RGLoader_load'
from /Users/James/.vagrant.d/gems/2.2.5/gems/vagrant-vmware-fusion-4.0.19/bin/vagrant_vmware_desktop_sudo_helper:44:in `<main>'
```

Is there a way to use the release of the VMWare provider with a development build of Vagrant?

Thanks,


James

Chris Roberts

unread,
Jun 1, 2017, 4:53:33 PM6/1/17
to vagra...@googlegroups.com
Hi James!

After getting a local setup to match your own I was able to chase down the root cause, bundler. The plugin isn't playing nice when bundler is involved and it re-executes via the sudo helper to interact with vmware. Since the bundle isn't set back up during the re-execution it is unable to locate vagrant and fails when requiring. I will add some detection into the next release so that this works as expected when using the plugin from the vagrant source and not the installer.

In the meantime a little brute force and provide a workaround to get things working:

* Install Vagrant from the official installer (so `$ vagrant` is found on the path and is using the installer provided version)
* Locate the vagrant gem source in the embedded directory (for example: /opt/vagrant/embedded/gems/gems/vagrant-1.9.5)
* Delete the gem source directory (rm -rf /opt/vagrant/embedded/gems/gems/vagrant-1.9.5)
* Link the local source version to the removed gem source directory (ln -s /Users/James/PathTo/vagrant /opt/vagrant/embedded/gems/gems/vagrant-1.9.5)

Now when you run `vagrant version` (without bundler), you should see it produce a development version indicating it's loading your local source.

I'll give you a ping here when the plugin is updated and released. If you have an problems getting the above workaround setup, let me know.

Cheers!
Chris

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/e77cc84d-6341-4abc-8a1f-488472448fd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Nugent

unread,
Jun 8, 2017, 1:22:29 PM6/8/17
to Vagrant
Hi Chris!

I can confirm it works, and is easier than my previous workflow of exporting patches and applying them to the bundled install!

Thanks for the time spent investigating this.

Cheers,


James
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages