Unable to create virtual machine using Vagrant in WSL2-Ubuntu22.04 on Windows Machine

I enabled WSL2 on my Windows 10 and installed the Distribution - Ubuntu 22.04.2 LTS. And installed the latest versions of Vagrant, and Vagrant plugins - vagrant-hostmanger, vagrant-vmware-desktop in the WSL.

And in Windows- I installed the VMware player and vagrant-vmware-utility.

and opened the WSL terminal, executed below command to create the VM.

vagrant init bento/ubuntu-22.10

vagrant up --provider vmware_desktop

And got the below error.

ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<HashiCorp::VagrantVMwareDesktop::Errors::DriverAPIRequestUnexpectedError: 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>
ERROR vagrant: 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

HashiCorp::VagrantVMwareDesktop::Errors::DriverAPIRequestUnexpectedError", "Vagrant encountered an unexpected communications error with the\nVagrant VMware Utility driver.

I have couple questions.

  1. Do we need the Vagrant VMware Utility on WSL as its daemon service which won’t support by WSL have removed from WSL and installed on Windows.
    So I think , from WSL using vagrant VMware desktop plugin its not able to communicate though I enabled the windows access from WSL using- VAGRANT_WSL_ENABLE_WINDOWS_ACCESS=“1”. Any suggestions to get resolved this?

  2. please let us know whether we can use vagrant in the WSL to create VM using VMware provider.

Thanks in advance

Difficulty in creating a virtual machine using Vagrant within WSL2-Ubuntu22.04 on a Windows machine could be due to several reasons. Here’s a troubleshooting guide:

  1. Ensure WSL2 is Installed and Functional: Make sure you have WSL2 installed and properly configured on your Windows machine. You can follow Microsoft’s documentation to install and set up WSL2 infopulsepro: Install WSL on Windows 10.