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

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

Closed
mattbryson opened this issue Feb 24, 2022 · 9 comments

Comments

@mattbryson
Copy link

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

hashicorp/packer#6691
#9902

@fredngo
Copy link

fredngo commented Mar 8, 2022

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
Copy link

fredngo commented Mar 9, 2022

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
Copy link

fredngo commented May 2, 2022

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.

@mattbryson
Copy link
Author

mattbryson commented May 2, 2022 via email

@aman09-git
Copy link

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 support@hashicorp.com
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 !!

@sourovroy
Copy link

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

@bytehow
Copy link

bytehow commented Sep 6, 2022

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

@chrisroberts
Copy link
Member

Hi everybody,

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

Cheers!

@fredngo
Copy link

fredngo commented May 30, 2023

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!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants