vagrant-vmware-desktop: Vagrant vmware provider fails to work with Fusion Tech Preview

Hi, I am running an Apple Silicon Macbook (ARM) and found out that VirtualBox does not work on that platform. I then learned that VMWare released a Tech Preview of Fusion for ARM last month, and so I was hopeful in getting that to work with Vagrant, as you provide a VMWare provider.

I followed all the steps for installing the provider and you can see from the output that it seems to work. I then proceeded to follow the Getting Started guide (skipping the install of VirtualBox). You could also see my own notes when doing this. All seemed fine up until the last steps:

$ vagrant init hashicorp/bionic64

$ vagrant up --provider vmware_desktop
Vagrant encountered an unexpected communications error with the
Vagrant VMware Utility driver. Please try to run the command
again. If this error persists, please contact support@hashicorp.com

When running with the debug output, it seems as if it could not find any image matching the supplied image. I am not that familiar with Vagrant, but I assumed it might have to do with the image needing to specifically work with VMWare? So I searched vagrant images for anything support vmware and tried both "generic/ubuntu2104" and "roboxes/ubuntu2104" which both were tagged vmware. No luck there either; they all erred with something like this in the debug output

 WARN vagrantfile: Performing lookup with initial values roboxes/ubuntu2104 with version
 INFO box_collection: Box not found: roboxes/ubuntu2104 (vmware_desktop, vmware_fusion, vmware_workstation)

The following is info following the Bug template

$ vagrant -v
Vagrant 2.2.18

carlerik at carl-eriks-air in ~/dev/dotfiles (master)
$ vagrant plugin list
vagrant-vmware-desktop (3.0.1, global)
  - Version Constraint: > 0

carlerik at carl-eriks-air in ~/dev/dotfiles (master)
$ /opt/vagrant-vmware-desktop/bin/vagrant-vmware-utility -v
1.0.20

carlerik at carl-eriks-air in ~/dev/dotfiles (master)
$ uname -a
Darwin carl-eriks-air.lan 21.1.0 Darwin Kernel Version 21.1.0: Sat Sep 11 12:27:45 PDT 2021; root:xnu-8019.40.67.171.4~1/RELEASE_ARM64_T8101 arm64

Debug output

https://gist.github.com/fatso83/7da6c48debb4b48333feab90b44964d8

Expected behavior

That it fired up a vm as described in getting started

Actual behavior

It erred with

Vagrant encountered an unexpected communications error with the
Vagrant VMware Utility driver.

Steps to reproduce

  1. Use a M1 Mac (arm)
  2. Install the Fusion Tech Preview
  3. vagrant init hashicorp/bionic64
  4. vagrant up --provider vmware_desktop

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 28 (2 by maintainers)

Most upvoted comments

@fatso83 here are part of the notes I wrote down this weekend with all the steps: https://gist.github.com/sbailliez/f22db6434ac84eccb6d3c8833c85ad92 - Let me know if something is confusing, missing or incorrect.

@caius I managed to get the same error as you by making a symlink ln -s /Applications/VMWare\ Fusion\ Tech\ Preview.app /Applications/VMWare\ Fusion.app

As already mentioned above the network problems are really related to the predictable network interface names. As soon as I was falling back to the classic naming convention (eg. eth0) network worked perfectly.

I’ve uploaded two boxes for the VMware provider:

Ubuntu Server 20.04 Ubuntu Server 21.10

I tested several vagrant configurations and everything seems to work.

v.gui = true configures VMWare to show a window for the VM booting, so you can see what it’s doing. Useful for debugging issues with VMs in Vagrant. You’re right that there’s no GUI in the VM, so it comes up with a login prompt (serial console?) in the VMWare window.

@fatso83 Yes, that is what I was referencing, and the bento PR you have linked includes the required GRUB modifications.

I’m still investigating the linked clone part as I’m still experiencing that failure.

Hi there,

The network detection bits are working as expected. I pulled down the box and after inspect it the reason the networking is failing is due to the predictable network interface names being used. I built out a quick box to verify things (which is why it’s large, I didn’t take the time to prune anything out) but you can test it out and see how it’s working for you locally: https://app.vagrantup.com/spox/boxes/ubuntu-arm/versions/1.0.0

@neuraload I guess creating a StackOverflow question (and posting the link here) where you detail all the steps involved, including verifying what works at which stage, would give you the best chances of getting some help finding out. As you can see from this thread, there are many steps along the way where we get valuable diagnostic output. To me, it is unclear at which step you get problems and which of the steps were successful and not. I don’t think I can help, as I don’t use Vagrant (apart from this experiment, which was valuable in itself), but others (especially on SO) will have different incentives.

I will close this issue, as the provider does work with VMWare Fusion Tech Preview on ARM, but it does not work all that great from a user perspective. I think some issues/feature requests that should exist would be:

  • The provider should detect that VMWare is not installed and explicitly tell the user in cleartext. This would have helped me to realize I need to either move or symlink the ...Preview.ap installation to the normal location.
  • The provider should detect that VMWare fails to boot the image (this will happen on all non-ARM images, i.e. 99%)

Seems like the bento templates take this into account: https://github.com/chef/bento/pull/1014/files

I will try and fix the current image. If time permits (not likely), it would be nice to supply a new PR for the bento project so that they have an ARM template as well.


@sbailliez and @chrisroberts Any chance of you writing up the steps required to get to a working system? The thread is getting a tad bit long. It does not seems like we need to customize the spox box by setting gui.enable or linked_clone. Is this correct? And do we need to symlink/move the tech preview directory into the default location?

With the following installed versions of vagrant utility, vagrant plugin and vmware fusion itself:

$ /opt/vagrant-vmware-desktop/bin/vagrant-vmware-utility -v
1.0.21

$ vagrant plugin list
vagrant-vbguest (0.30.0, global)
vagrant-vmware-desktop (3.0.1, global)
  - Version Constraint: > 0

$ /Applications/VMWare\ Fusion.app/Contents/Library/vmware-vmx -v

VMware Fusion Information:
VMware Fusion e.x.p build-18656771 Release

and a Vagrantfile set to use @fatso83’s box (thanks!)

Vagrant.configure("2") do |config|
  config.vm.box = "fatso83/impish64-arm"

  config.vm.provider "vmware_desktop" do |v|
    v.gui = true
    v.memory = "1024"
  end
end

Running vagrant up I get the following output (box has already been imported at this point):

$ vagrant up           
Bringing machine 'default' up with 'vmware_desktop' provider...
==> default: Cloning VMware VM: 'fatso83/impish64-arm'. This can take some time...
An error occurred while executing `vmrun`, a utility for controlling
VMware machines. The command and output are below:

Command: ["clone", "/Users/caius/.vagrant.d/boxes/fatso83-VAGRANTSLASH-impish64-arm/1.0.1/vmware_desktop/Ubuntu 64-bit Arm Server 21.10.vmx", "/Users/caius/tmp/m1ubuntu/.vagrant/machines/default/vmware_desktop/67aff3a8-a1cf-407e-a2ea-6fba427b6c30/Ubuntu 64-bit Arm Server 21.10.vmx", "linked", {:notify=>[:stdout, :stderr]}]

Stdout: Error: The file is already in use

Stderr: 

I can reproduce it running the vmrun clone command directly with the arguments in the error message.

$ rm -f "/Users/caius/tmp/m1ubuntu/.vagrant/machines/default/vmware_desktop/b36f35be-c967-4582-aba6-5c2626453b48/Ubuntu 64-bit Arm Server 21.10.vmx"
$ vmrun clone "/Users/caius/.vagrant.d/boxes/fatso83-VAGRANTSLASH-impish64-arm/1.0.1/vmware_desktop/Ubuntu 64-bit Arm Server 21.10.vmx" "/Users/caius/tmp/m1ubuntu/.vagrant/machines/default/vmware_desktop/b36f35be-c967-4582-aba6-5c2626453b48/Ubuntu 64-bit Arm Server 21.10.vmx" linked
Error: The file is already in use

Looking at the docs, I can see https://www.vagrantup.com/docs/providers/vmware/configuration#linked-clones states you can do a full clone instead of a linked clone. Updating the Vagrantfile with this then leads my VM to booting at least. Vagrant gets stuck at “Waiting for the VM to receive an address” stage, although I can see the VM has booted with the GUI enabled.

Vagrant.configure("2") do |config|
  config.vm.box = "fatso83/impish64-arm"

  config.vm.provider "vmware_desktop" do |v|
    v.gui = true
    v.memory = "1024"
    v.linked_clone = false
  end
end
↳ caius$ v up
Bringing machine 'default' up with 'vmware_desktop' provider...
==> default: Cloning VMware VM: 'fatso83/impish64-arm'. 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 :vmware_desktop 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-allowlisting
==> default: Starting the VMware VM...
==> default: Waiting for the VM to receive an address...