vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Vagrant up hangs on vmware boxes if the GUI isn't running - M1 Mac ARM / VMWare tech preview

Open mattbryson opened this issue 3 years ago • 7 comments

Launching VMware in headless mode hangs on "==> default: Waiting for the VM to receive an address..."

However, With the GUI open, or with the vm.gui = true it works fine.

From the logs, it appears to be related to this (which just loops)

 INFO vmware_driver: Trying vmrun getGuestIPAddress...
 INFO subprocess: Starting process: ["/Applications/VMware Fusion.app/Contents/Library/vmrun", "getGuestIPAddress", "/Users/matt/test/.vagrant/machines/default/vmware_desktop/6900b117-ab8e-4f1a-aaf1-3a697ddd238a/Other Linux 5.x kernel 64-bit Arm.vmx"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO vmware_driver: vmrun getGuestIPAddress failed: VMRunError

Vagrant version

Vagrant 2.2.19 vagrant-vmware-desktop (3.0.1, global) vagrant-vmware-utility: 1.0.21

VMware Tech preview Professional Version e.x.p (18656771) (for M1 macs)

Alias has been added to map to the Tech preview, rather than the production version of VMWare. sudo ln -s /Applications/VMware\ Fusion\ Tech\ Preview.app /Applications/VMware\ Fusion.app

Host operating system

MacOS Monterey 12.2.1 M1 ARM chip

Guest operating system

spox/ubuntu-arm

as well as other ARM linux distros (doesn't appear to be distro related)

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "spox/ubuntu-arm"
  config.vm.box_version = "1.0.0"
  
  config.vm.provider :vmware_desktop do |vmware|
    #vmware.gui = true
    vmware.allowlist_verified = true
    vmware.vmx["ethernet0.pcislotnumber"] = "160"
  end
end

Debug output

gist

Expected behavior

Vagrant up should launch and connect to the guest server regardless of the vm.gui setting.

Actual behavior

If vm.gui is not true, vagrant up just hangs

Steps to reproduce

  1. M1 Mac ARM Chip
  2. Install VM Ware Tech Preview : https://customerconnect.vmware.com/downloads/get-download?downloadGroup=FUS-PUBTP-2021H1
  3. Install the VMware tools vagrant plugin install vagrant-vmware-desktop
  4. Install the VMware utility brew install vagrant-vmware-utility
  5. vagrant up using the attached vagrant file

References

Similar issues found here but with no solutions

https://github.com/hashicorp/packer/issues/6691 https://github.com/hashicorp/vagrant/issues/9902

mattbryson avatar Feb 24 '22 12:02 mattbryson

I can confirm, but it's not consistent. Sometimes I have vm.gui = false and it still works, but other times it'll hang too. I'm pretty flummoxed.

fredngo avatar Mar 08 '22 16:03 fredngo

I've had some success using the bytesguy/ubuntu-server-20.04-arm64 box and then not upgrading the kernel via sudo apt-get full-upgrade. I've found that upgrading the kernel will prevent the VM from booting again.

Instead, I just do a non-kernel sudo apt-get upgrade, which for now seems to allow the VM to boot up again via vagrant up

fredngo avatar Mar 09 '22 17:03 fredngo

OK, so it does seem like the latest kernel is problematic. Other reports here and here.

So, the workarounds are:

  1. Keep VMWare Fusion open in the background. vm.gui = true is actually not necessary, as long as the program is running in the background, the machines will boot up.
  2. Do not upgrade to the latest kernel. The bytesguy/ubuntu-server-20.04-arm64 image works just fine.

fredngo avatar May 02 '22 13:05 fredngo

Ah great 👍.

I'll try using the older image and see what happen.

On Mon, 2 May 2022, 14:42 Fred Ngo, @.***> wrote:

OK, so it does seem like the latest kernel is problematic. Other reports here https://github.com/utmapp/UTM/issues/2682 and here https://communities.vmware.com/t5/Fusion-for-Apple-Silicon-Tech/Unable-to-launch-a-VM-after-fresh-install-with-latest-technology/m-p/2899990 .

So, the workarounds are:

  1. Keep VMWare Fusion open in the background. vm.gui = true is actually not necessary, as long as the program is running in the background, the machines will boot up.
  2. Do not upgrade to the latest kernel. The bytesguy/ubuntu-server-20.04-arm64 image works just fine.

— Reply to this email directly, view it on GitHub https://github.com/hashicorp/vagrant/issues/12695#issuecomment-1114898461, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEGAVHWVR2YP63YZTTORWLVH7LTJANCNFSM5PHHDV5Q . You are receiving this because you authored the thread.Message ID: @.***>

mattbryson avatar May 02 '22 14:05 mattbryson

Hey All,

I have followed each steps as given but still getting the below error, can anyone please have a look at this.

amansrivastava@Amans-MacBook-Air ubuntu % vagrant up 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 [email protected] amansrivastava@Amans-MacBook-Air ubuntu %

Trying to find out what is happening and what's going wrong here .

Currently I m in ubuntu directory under which I have vagrant file with the content , still Its not getting started.

Thanks in advance !!

aman09-git avatar May 26 '22 09:05 aman09-git

With vmware.gui = true works for me but without it just hang up.

sourovroy avatar Jul 27 '22 17:07 sourovroy

I was running into the same issue on macOS 11.6.8. Solved by upgrading to the following:

  • Vagrant VMWare Utility 1.0.21
  • vagrant_vmware_desktop plugin 3.0.1
  • Vagrant VMWare Fusion/Player 12.2.4

bytehow avatar Sep 06 '22 06:09 bytehow

Hi everybody,

The cause of this issue has been documented here and is now resolved by upgrading your Vagrant installation.

Cheers!

chrisroberts avatar May 17 '23 00:05 chrisroberts

I am happy as a clam that this has been fixed. vm.gui = true is no longer necessary in my Vagrantfile, and it's no longer even necessary to have the VMWare Fusion app open at all. 🎉 Great job!

fredngo avatar May 30 '23 17:05 fredngo