Skip to content
Charlie Sharpsteen edited this page May 10, 2014 · 4 revisions

VMware Fusion Support

As of 1.0.0, auto_network supports the Vagrant VMware fusion provider. The 1.0.0 release is currently in beta and can be installed thusly:

vagrant plugin install oscar --plugin-version 0.3.1
vagrant plugin install vagrant-auto_network --plugin-version 1.0.0.beta2

Troubleshooting

There are a couple of things that can go wrong when using the VMware fusion provider.

Error When Bringing Up a Machine

Often, you will see an error the very first time a machine is started on a network managed by auto_network:

✗ vagrant up --provider=vmware_fusion pe-323-master --no-provision
Bringing machine 'pe-323-master' up with 'vmware_fusion' provider...
==> pe-323-master: Assigning "10.20.2.4" to 'pe-323-master'
==> pe-323-master: VMware requires root privileges to make many of the changes
==> pe-323-master: necessary for Vagrant to control it. In a moment, Vagrant will ask for
==> pe-323-master: your administrator password in order to install a helper that will have
==> pe-323-master: permissions to make these changes. Note that Vagrant itself continues
==> pe-323-master: to run without administrative privileges.
Password:
==> pe-323-master: Cloning VMware VM: 'puppetlabs/centos-6.5-64-nocm'. This can take some time...
==> pe-323-master: Checking if box 'puppetlabs/centos-6.5-64-nocm' is up to date...
==> pe-323-master: Verifying vmnet devices are healthy...
dyld: DYLD_ environment variables being ignored because main executable (/usr/local/var/vagrant/vagrant_data/gems/gems/vagrant-vmware-fusion-2.4.1/bin/vagrant_vmware_desktop_sudo_helper_wrapper_darwin_amd64) is setuid or setgid
The VMware "vmnet" devices are failing to start. The most common
reason for this is collisions with existing network services. For
example, if a hostonly network space collides with another hostonly
network (such as with VirtualBox), it will fail to start. Likewise,
if forwarded ports collide with other listening ports, it will
fail to start.

Vagrant does its best to fix these issues, but in some cases it
cannot determine the root cause of these failures.

Please verify you have no other colliding network services running.
As a last resort, restarting your computer often fixes this issue.

This should be a one-time error that only occurs for the very first box that is brought up. Re-running vagrant up usually succeeds.

Vagrant Hangs During Machine Startup

Sometimes, a machine managed by the VMware Fusion provider will just hang at "Waiting for the VM":

✗ vagrant up --provider=vmware_fusion pe-323-master --no-provision
Bringing machine 'pe-323-master' up with 'vmware_fusion' provider...
==> pe-323-master: Checking if box 'puppetlabs/centos-6.5-64-nocm' is up to date...
==> pe-323-master: Verifying vmnet devices are healthy...
==> pe-323-master: Preparing network adapters...
==> pe-323-master: Starting the VMware VM...
==> pe-323-master: Waiting for the VM to finish booting...

Re-starting the VMware Fusion networking service seems to solve this issue:

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

Acceptance Tests

The AutoNetwork plugin contains acceptance tests based on helpers provided by vagrant-spec. This acceptance suite allows basic plugin functionality to be tested against multiple vagrant providers. The AutoNetwork acceptance tests are currently designed to be run under Bundler rather than against a packaged Vagrant installation.

Running the Tests

To run the acceptance tests, activate the example vagrant-spec configuration:

cp vagrant-spec.config.example.rb vagrant-spec.config.rb

Then, run the acceptance Rake task:

bundle exec rake acceptance:run
mkdir -p acceptance/artifacts
Downloading: https://vagrantcloud.com/puppetlabs/centos-6.5-64-nocm/version/2/provider/virtualbox.box
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   157  100   157    0     0    221      0 --:--:-- --:--:-- --:--:--   432
100  521M  100  521M    0     0  1382k      0  0:06:26  0:06:26 --:--:-- 2023k
vagrant-spec test


provider/virtualbox/auto_network
  it should behave like provider/auto_network
    manages IP address allocation for the lifecycle of a VM
      Execute: vagrant box add box /Users/sharpie/code/oscar/vagrant-auto_network/acceptance/artifacts/virtualbox.box
      Execute: vagrant up --provider=virtualbox
      Execute: vagrant status
      Execute: vagrant reload default
      Execute: vagrant destroy --force
      manages IP address allocation for the lifecycle of a VM

Finished in 2 minutes 10.7 seconds
1 example, 0 failures

This downloads a CentOS test box from vagrantcloud.com and runs a series of actions using the VirtualBox provider.

VMware Fusion

This requires a valid license for the vagrant-vmware-fusion plugin and a bit of extra setup:

  • Copy license-vagrant-vmware-fusion.lic and the rgloader directory into the root directory of the AutoNetwork project. The rgloader directory can be obtained from two places:

  • Add a Gemfile.local to the project root that installs vagrant-vmware-fusion and adds it to the list of plugins auto-loaded by Vagrant:

# Gemfile.local
source 'http://gems.hashicorp.com'
group :plugins do
  gem 'vagrant-vmware-fusion'     
end

Run bundle update to install the plugin.

  • After copying vagrant-spec.config.example.rb, uncomment the lines related to VMware fusion.

  • Modify the TEST_BOXES array in tasks/acceptance.rake to download a VMware Fusion box. An easy way to do this is by copying the URL for VirtualBox and replace virtualbox.box with vmware_fusion.box.

After completing these steps, bundle exec rake acceptance:run should run tests against VMware Fusion in addition to VirtualBox.