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

VMware utility driver communications issue when running vagrant up --provider=vmware_desktop in WSL2 #100

Open
willdafoe opened this issue Aug 30, 2023 · 6 comments

Comments

@willdafoe
Copy link

Vagrant version

Vagrant 2.3.7

Run vagrant -v to show the version. If you are not running the latest version
of Vagrant, please upgrade before submitting an issue.

Vagrant VMware plugin version

Run vagrant plugin list to show the version. If you are not running the latest
version of the Vagrant VMware plugin, please upgrade before submitting an issue.

Vagrant VMware utility version

vagrant-vmware-desktop (3.0.3, global)

To show the version, run C:\HashiCorp\vagrant-vmware-desktop\bin\vagrant-vmware-utility -v on
Windows systems or /opt/vagrant-vmware-desktop/bin/vagrant-vmware-utility -v on non-Windows
systems. If you are not running the latest version of the Vagrant VMware utility, please
upgrade before submitting an issue.

Host operating system

Windows Host:

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.19045 N/A Build 19045

WSL2 Distribution:

Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

This is the operating system that you run locally.

Guest operating system

This is the operating system you run in the virtual machine.

Windows 10 (gusztavvargadr/windows-10)

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "gusztavvargadr/windows-10"
end

Please ensure the Vagrantfile provided is a minimal Vagrantfile which contains
only the required configuration to reproduce the behavior. Please note that if
your Vagrantfile contains an excess of configuration unrelated the the reported
issue, or is in a different format, we may be unable to assist with your issue.
Always start with a minimal Vagrantfile and include only the relevant configuration
to reproduce the reported behavior.

Debug output

https://gist.github.com/willdafoe/290fb9f61915f9be5e6023c064dc1797

Provide a link to a GitHub Gist containing the complete debug output:
https://www.vagrantup.com/docs/other/debugging.html. The debug output should
be very long. Do NOT paste the debug output in the issue, just paste the
link to the Gist.

Expected behavior

Windows 10 VM running in VMWare workstation on the Windows host.

Actual behavior

The following error message:

Vagrant encountered an unexpected communications error with the
Vagrant VMware Utility driver. Please try to run the command again.

Steps to reproduce

  1. Install Vagrant on the Windows host
  2. Install Vagrant VMWare Utility on the Windows Host
  3. Install Vagrant on the WSL2 host
  4. Install vagrant-vmware-utility on the WSL2 host
  5. Set the following env. vars on the WSL2 host:
export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
export VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH="/mnt/c/Users/<redacted>/"
export PATH="$PATH:/mnt/c/Program Files (x86)/VMware/VMware Workstation"
  1. Vagrant init on the WSL2 host
  2. vagrant up --provider=vmware_desktop on the WSL2 host
@c42-adam
Copy link

AFAICT I am having the same issue, just with Ubuntu 22.04 under WSL.

@ratfink417
Copy link

likewise...

@ralphbrynard
Copy link

Can we get a bump on this?

@nathansmyth
Copy link

i'm having this same issue on MacOS 14.2.1 (23C71)

@MohandOudelha
Copy link

i'm having the same issue
sudo systemctl status vagrant-vmware-utility
× vagrant-vmware-utility.service - Vagrant VMware Utility
Loaded: loaded (/etc/systemd/system/vagrant-vmware-utility.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2024-03-06 11:55:04 CET; 2s ago
Process: 14729 ExecStart=/opt/vagrant-vmware-desktop/bin/vagrant-vmware-utility api -config-file=/opt/vagrant-vmware-desktop/config/service.hcl (code=exited, status=1/FAILURE)
Main PID: 14729 (code=exited, status=1/FAILURE)

Mar 06 11:55:04 PC-0008 systemd[1]: Started Vagrant VMware Utility.
Mar 06 11:55:04 PC-0008 vagrant-vmware-utility[14729]: 2024-03-06T11:55:04.668+0100 [INFO] vagrant-vmware-utility.api: created: vmx=
Mar 06 11:55:04 PC-0008 vagrant-vmware-utility[14729]: 2024-03-06T11:55:04.668+0100 [ERROR] vagrant-vmware-utility.api: path loading failure: error="Failed to locate VMware installation director>
Mar 06 11:55:04 PC-0008 vagrant-vmware-utility[14729]: 2024-03-06T11:55:04.668+0100 [ERROR] vagrant-vmware-utility.api: base driver setup failure: error="Failed to locate VMware installation dir>
Mar 06 11:55:04 PC-0008 vagrant-vmware-utility[14729]: Failed to setup Vagrant VMWare API service - Failed to locate VMware installation directory!
Mar 06 11:55:04 PC-0008 systemd[1]: vagrant-vmware-utility.service: Main process exited, code=exited, status=1/FAILURE
Mar 06 11:55:04 PC-0008 systemd[1]: vagrant-vmware-utility.service: Failed with result 'exit-code'.

@mattgagliardi
Copy link

mattgagliardi commented Mar 7, 2024

Same issue here. Seems like perhaps this is a networking problem? vagrant-vmware-utility is bound to localhost (127.0.0.1) port 9922 on the WSL2 host. You can see in the linked Gist (line 336) Vagrant is trying to reach out to 127.0.0.1:9922...unless that's being started up on the WSL2 guest that communication path isn't gonna work IME. FWIW there does seem to be an undocumented VMware provider option for "utility_host" ("utility_port" is documented) but even modifying that to point at the host's IP doesn't work...because the utility isn't bound to a port that can actually listen to anything but localhost traffic.

So...do I/we need to also install and run the Vagrant VMware Utility on our WSL2 guests (I'm not sure we'd be able to run that as a "service"...systemd is sketch-ish IME on WSL2 guests)?

EDIT: feels like this might end up tied to WSL2's NAT vs. "mirrored" networking, mirrored networking only being avail. in fairly recent versions, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants