Vagrant: Vagrant unable to communicate with the VMware Utility

Created on 19 Sep 2019  路  2Comments  路  Source: hashicorp/vagrant

This is a replica of issue #10493 which got closed. Please don't close this one, have some mercy. The struggle is real. I have the exact same issue with an almost exact same output, saved as this gist.

And I have tried EVERYTHING IN MY POWER including uninstalling/reinstalling you-name-it (yes, even the license files for the VMware Utility) and manually deleting folders that belong to both Vagrant and VMware. And yes, I have tried new boxes and new Vagrant machines - everything.

I think the problem is that the utility Windows service is not running and/or can not start.

I tried starting the service using Windows Service interface/dialog. This failed with a message:

The vagrant-vmware-utility service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

I tried running it manually from where the exe is installed (In my case, C:\HashiCorp\VagrantVMwareUtility\bin):

vagrant-vmware-utility service run

I get this message back:

Run command is not intended for interactive execution.

Tried this:

vagrant-vmware-utility service install

I get:

Failed to install service: failed to start the service

So this time around the utility himself tried to start the service but failed.

I tried deleting the service manually:

sc delete "VagrantVMware"

..and deleting all kinds of "VagrantVMware" entries from Regedit - nothing helps. Service still refuse to start. SOMETIMES when I try to install the service using the exe I get this weird message:

Failed to install service: failed to configure service

I am completely out of ideas. Does this thing produce log files anywhere?? Passing --debug or --verbose to the utility exe has no effect.

As far as I know there is nothing left I can try at this point, but please, surprise me lol.

My stack:

  • Windows 10 x64
  • Vagrant 2.2.5 (also tried 2.2.4)
  • VMware Utility 1.0.7 (also tried 1.0.6 and 1.0.5)
  • vagrant-vmware-desktop plugin 2.0.3 (also tried all previous versions down to and including 1.0.4)
  • VMware Workstation 15.1.0.

Everything was working this morning. Then, my laptop lost power right in the middle of booting one of the VMware machines. After plugging in power I tried a new boot. Got a weird JSON parse error. After lots of goggling and manual delete of Vagrant folders left and right the error morphed into the VMware communication error described above, of which I have been completely unable to recover.

This error is a complete show stopper. No Vagrant command that deals with the machine work (status, up). I doubt there is nothing I haven't tried to uninstall and reinstall at this point. Please advise!

bug hoswindows providevmware

All 2 comments

Okay I think I have figured it out.

Delete the file C:\ProgramData\HashiCorp\vagrant-vmware-desktop\settings\nat.json and the service starts again.

Before the delete, this file had weird contents which my notepad++ couldn't read as text. After deleting the file and starting the service again, the file got created anew with this content:

{
"fwds": []
}

I don't know what "future" consequences this has for my virtual machines and what not, but at least the service starts.

Funny how deleting a file that is related to a Vagrant plugin (which in theory might have not even been installed on my machine) got a separate service to start. Furthermore, had you properly deleted and removed all crap spread around my file system upon uninstall then the uninstall would have been the only fix I needed in the first place. But hey, this is what modern software do. Zero respect for user's hardware and their disk drives. Just pollute it with all kinds of disk-consuming files all over. Great. In my humble opinion a program should only create temporary files outside of the installation folder. Anything else is a violation of my private hardware.

Anyways, here is how I found the hack. First I went into the Windows event log viewer (Windows+R and then type "eventvwr" into the run box). On the left side, click "Windows Logs -> Application". On the right side, click "Filter Current Log...". In the "Event Sources", click on the drop-down button to see a list of things and select "VagrantVMware". Just typing "VagrantVMware" into the text field doesn't do shit. It has to be selected from the drop-down list.

So this gave me tons of events related to the utility service. Among the events I noticed an "error" event with this text:

vagrant-vmware-utility service setup failed: failed to setup Vagrant VMware driver - invalid character '\x00' looking for beginning of value

After extensive googling I understood that this error message is related to a corrupt file, somewhere. Which file? Who knows. But I was determined to find it, so I simply googled the shit out of my file system, temporarily renaming files to see what worked and what didn't work until I discovered the hack specified above.

I consider this issue unresolved. The only proper solution is for Vagrant to either not corrupt files through using atomic file operations, or have the uninstall procedure properly remove previously installed files.

Your determination saved me a lot of time debugging - had a power outage which caused a bunch of weird vagrant corruption, and was able to find this issue with the quoted text... thank you!

Was this page helpful?
0 / 5 - 0 ratings