title: Vagrant box not getting set up running under WSL2
body: <p>Vagrant version</p>
  <pre><code>Vagrant 2.2.10
  </code></pre>
  <p>Host OS</p>
  <p>Windows 10 (20045, May 2020)</p>
  <p>Guest OS</p>
  <p>Ubuntu 18.04 (tried with 16.04, 20.04)</p>
  <p>Vagrantfile</p>
  <pre><code>Vagrant.configure(&quot;2&quot;) do |config|
   config.vm.box = &quot;ubuntu/trusty64&quot;
  
   config.vm.synced_folder &quot;.&quot;, &quot;/vagrant&quot;, disabled: true
  
   config.vm.provider &quot;virtualbox&quot; do |vb|
          vb.memory = &quot;4024&quot;
          vb.cpus = &quot;1&quot;
  end
  
  config.vm.provision &quot;ansible&quot; do |ansible|
         ansible.become = true
         ansible.verbose = &quot;v&quot;
         ansible.playbook = &quot;roles/firewall.yml&quot;
         ansible.galaxy_roles_path = &quot;./roles&quot;
  end end
  </code></pre>
  <p>Error:</p>
  <pre><code>U9HRRBMV:/mnt/c/Users/KeithJames/firewall-role-ak$ vagrant up --provision
  Bringing machine 'default' up with 'virtualbox' provider...
  ==&gt; default: Checking if box 'ubuntu/trusty64' version '20190514.0.0' is up to date...
  ==&gt; default: Running provisioner: ansible...
      default: Running ansible-playbook...
  PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_ROLES_PATH='/mnt/c/Users/KeithJames/firewall-role-ak/roles' ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=&quot;default&quot; --inventory-file=/mnt/c/Users/KeithJames/firewall-role-ak/.vagrant/provisioners/ansible/inventory --become -v roles/firewall.yml
  Using /etc/ansible/ansible.cfg as config file
  
  PLAY [all] *********************************************************************
  
  TASK [Gathering Facts] *********************************************************
  fatal: [default]: UNREACHABLE! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;Failed to connect to the host via ssh: ssh: connect to host 127.0.0.1 port 2222: Connection refused&quot;, &quot;unreachable&quot;: true}
  
  PLAY RECAP *********************************************************************
  default                    : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0
  
  Ansible failed to complete successfully. Any error output should be
  visible above. Please fix these errors and try again.
  </code></pre>
  <p>Expected behavior</p>
  <p>The VirtualBox VM should be started, Vagrant should be able to connect to it (instead I get</p>
  <pre><code>default: Warning: Connection refused. Retrying...
  </code></pre>
  <p>over and over, and I can't connect via SSH).</p>
  <p>Actual behavior</p>
  <p>Vagrant inside WSL2 can't connect to the VM it just started.</p>
  <p>U9HRRBMV:/mnt/c/Users/KeithJames/firewall-role-ak$ service ssh status
  * sshd is running</p>
  <p>Steps to reproduce</p>
  <ol>
  <li><p>Install WSL2 on Windows 10 (2004), with Ubuntu bash</p>
  </li>
  <li><p>Create a directory with the above Vagrantfile in it</p>
  </li>
  <li><p>Download and install Vagrant for Linux in the WSL2 environment (regardless of it being installed in Windows)</p>
  </li>
  <li><p>Run vagrant up</p>
  </li>
  </ol>
  <p>I also tried:</p>
  <p>Run vagrant ssh in WSL2.</p>
  <pre><code>U9HRRBMV:/mnt/c/Users/KeithJames/firewall-role-ak$ vagrant ssh
  U9HRRBMV:/mnt/c/Users/KeithJames/firewall-role-ak$
  </code></pre>
  <p>Then I tried using raw SSH:</p>
  <pre><code>U9HRRBMV:/mnt/c/Users/KeithJames/firewall-role-ak$ ssh -p 2222 vagrant@127.0.0.1
  ssh: connect to host 127.0.0.1 port 2222: Connection refused
  
  
  U9HRRBMV:/mnt/c/Users/KeithJames/firewall-role-ak$ vagrant up
  Bringing machine 'default' up with 'virtualbox' provider...
  ==&gt; default: Importing base box 'ubuntu/trusty64'...
  ==&gt; default: Matching MAC address for NAT networking...
  ==&gt; default: Checking if box 'ubuntu/trusty64' version '20190514.0.0' is up to date...
  ==&gt; default: Setting the name of the VM: firewall-role-ak_default_1602247434343_82880
  ==&gt; default: Clearing any previously set forwarded ports...
  ==&gt; default: Clearing any previously set network interfaces...
  ==&gt; default: Preparing network interfaces based on configuration...
      default: Adapter 1: nat
  ==&gt; default: Forwarding ports...
      default: 22 (guest) =&gt; 2222 (host) (adapter 1)
  ==&gt; default: Running 'pre-boot' VM customizations...
  ==&gt; default: Booting VM...
  ==&gt; default: Waiting for machine to boot. This may take a few minutes...
      default: SSH address: 127.0.0.1:2222
      default: SSH username: vagrant
      default: SSH auth method: private key
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
      default: Warning: Connection refused. Retrying...
  </code></pre>
  <p>Timed out while waiting for the machine to boot. This means that
  Vagrant was unable to communicate with the guest machine within
  the configured (&quot;config.vm.boot_timeout&quot; value) time period.</p>
  <p>If you look above, you should be able to see the error(s) that
  Vagrant had when attempting to connect to the machine. These errors
  are usually good hints as to what may be wrong.</p>
  <p>If you're using a custom box, make sure that networking is properly
  working and you're able to connect to the machine. It is a common
  problem that networking isn't setup properly in these boxes.
  Verify that authentication configurations are also setup properly,
  as well.</p>
  <p>If the box appears to be booting properly, you may want to increase
  the timeout (&quot;config.vm.boot_timeout&quot;) value.</p>
  <pre><code>U9HRRBMV:/mnt/c/Users/KeithJames/firewall-role-ak$ vagrant up --provision
  Bringing machine 'default' up with 'virtualbox' provider...
  ==&gt; default: Checking if box 'ubuntu/trusty64' version '20190514.0.0' is up to date...
  ==&gt; default: Running provisioner: ansible...
      default: Running ansible-playbook...
  PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_ROLES_PATH='/mnt/c/Users/KeithJames/firewall-role-ak/roles' ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=&quot;default&quot; --inventory-file=/mnt/c/Users/KeithJames/firewall-role-ak/.vagrant/provisioners/ansible/inventory --become -v roles/firewall.yml
  Using /etc/ansible/ansible.cfg as config file
  
  PLAY [all] *********************************************************************
  
  TASK [Gathering Facts] *********************************************************
  fatal: [default]: UNREACHABLE! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;Failed to connect to the host via ssh: ssh: connect to host 127.0.0.1 port 2222: Connection refused&quot;, &quot;unreachable&quot;: true}
  
  PLAY RECAP *********************************************************************
  default                    : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0
  </code></pre>
  <p>Ansible failed to complete successfully. Any error output should be
  visible above. Please fix these errors and try again.</p>
  <p><a href="https://i.stack.imgur.com/KprU3.png" rel="nofollow noreferrer">VirtualBox</a></p>
  <p><a href="https://i.stack.imgur.com/FJyS7.png" rel="nofollow noreferrer">VirtualBox Vagrant Machine</a></p>