-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Private network not getting set up running under WSL2 (same Vagrantfile fine under Windows Vagrant) #11716
Comments
I also tried:
But I get the error message:
So I also tried
So then I tried using raw SSH:
But if I started the VM via Powershell (which sets up the host-only private network correctly, unlike in WSL2), I can connect via raw SSH inside WSL2 through that private network:
So it looks like maybe a network boundary issue when vagrant is running inside WSL? It seems that |
Just as a note, I am able to get See full details of the workaround in this comment: geerlingguy/ansible-for-devops#291 (comment) |
I too am facing the same problem on
Otherwise experiencing same "missing network" on VM + WSL + Host as experienced in OP. Same Windows verison, same Vagrant verison, etc. |
it's looks like vagrant cannot access network file in wsl 2, when I move vagrant file to windows directory, its work properly. wsl directory from powershell
windows directory
|
Hey, I was wondering if anyone happened to get around this? It seems like a vagrant/wsl2 limitation but here's to hoping 🤞 |
I have the same problem in I get Warning Connection refused. Retrying. I can ssh log into the created machine with Putty. Bringing machine 'web01' up with 'virtualbox' provider... Vagrantfile Vagrant.configure("2") do |config| Distributor ID: Ubuntu |
Is there any update on this? I've spent two days trying to configure WSL2 with Vagrant and am constantly having the same issue for Ansible's connection to localhost being refused. I've tried multiple fixes suggested and none of made any progress. I can see the box is running and can connect it to it using username and password in the virtualbox interface, but this always hangs on this step and refuses the connection and throws the following: System info:
|
I've just encountered the same issue |
I've the exact same issue with virtualbox provider. any help is greatly appreciated. |
Same thing here. ssh from wsl2 times out on first vagrant up, even disabling key authentication and fallback to password. |
I have the same problem, to be honest I am suprised that his hasn't been picked up by the Hashicopr Vagrant team, since this will be something that a lot of people would like to be able to use, many of us are moving to mainly using the WLS2 instead of the windows itself and to be able to use Vagrant from inside it will certainly keep Vagrant very much alive. |
It seems to me this is nothing to do with Vagrant itself. This would be the exact steps: Extract the zip into a file that can be accessible from WSL2 (ie: /mnt/c/Users/your-user) Run the molecule test from WSL2 Check your logs until the port forwarding is done
Now run the following command to make localhost in Windows available from WSL2 Of course, this is far from ideal, but I hope it helps to understand better the limitations. |
I was actually able to get Roots Trellis to work with this vagrant plugin - virtualbox_WSL2. Hopefully this helps someone as well. I struggled for months trying to get VirtualBox and Vagrant to work in Windows 10. It's really a WSL issue however, not Vagrant. |
As @nusserstudios mentions, I was also able to get it to work using the virtualbox_WSL2 plugin. |
As @nusserstudios suggested, virtualbox_WSL2 worked for me. However, the Windows firewall still blocked access. I had to use the following PowerShell script to finally get everything to work the way I needed (you may also need to add other ports besides 53).
I also found that virtualbox_WSL2 is not compatible with another plugin I'm using (landrush). |
WSL2 has issue with Cisco AnnyConnect, which prevented to connect to internet. |
For me, Vagrant + Hyper-V + WSL 2 works beautifully in Windows, with one exception: vagrant up always asks me which switch to use.
If you prefer VirtualBox, VirtualBox 6.1.22 and later seem to finally work, at least most of the time.
Sent with [ProtonMail](https://protonmail.com/) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Tuesday, August 24th, 2021 at 10:29 PM, Andre Susantin ***@***.***> wrote:
WSL2 has issue with Cisco AnnyConnect, which prevented to connect to internet.
It's a show stopper bug for going forward.
However if I need running Docker Desktop, it's rely on WSL2.
The work around is to have WSL1 and and WSL2.
Running Ansible in Window is a real pain.
Does anyone have Vagrant with Window Hyper-V Hypervisor sucessfully?
VirtualBox 6.1 has it's own issue starting session. Sometime successful, other time not so.
At home, for the Ansible for DevOps practitioner here, I use Ubuntu or Centos with libvert, kvm, really great.
For work, stuck with Window laptop :)
—
You are receiving this because you commented.
Reply to this email directly, [view it on GitHub](#11716 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AABY5OXK2U7V5YZ2KNEXA3LT6R5SLANCNFSM4OGWE3EQ).
Triage notifications on the go with GitHub Mobile for [iOS](https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or [Android](https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email).
|
You should be able to use the Default Network Interface setting to remove the need of selecting the switch manually :) Example: |
I have that setting, but unfortunately, the Hyper-V provider ignores it. I believe it's listed as a known issue.
Sent with [ProtonMail](https://protonmail.com/) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Wednesday, August 25th, 2021 at 12:01 AM, Lauri Gates ***@***.***> wrote:
> For me, Vagrant + Hyper-V + WSL 2 works beautifully in Windows, with one exception: vagrant up always asks me which switch to use. If you prefer VirtualBox, VirtualBox 6.1.22 and later seem to finally work, at least most of the time.
You should be able to use the [Default Network Interface](https://www.vagrantup.com/docs/networking/public_network#default-network-interface) setting to remove the need of selecting the switch manually :)
Example:
config.vm.network "public_network", bridge: "Default Switch"
—
You are receiving this because you commented.
Reply to this email directly, [view it on GitHub](#11716 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AABY5OTQKQOEEAMW534LRF3T6SIMNANCNFSM4OGWE3EQ).
Triage notifications on the go with GitHub Mobile for [iOS](https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or [Android](https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email).
|
Thanks! Those firewall rules for the windows host solved my connection problem. And now vagrant + virtualbox + wsl2 works like a charm when using the virtualbox_WSL2 plugin for vagrant! |
Me too, do you have any solution for that ?
|
Vagrant version
Host operating system
Windows 10 (2004, May 2020)
Guest operating system
Ubuntu 16.04 (tried with others).
Vagrantfile
Debug output
https://gist.github.com/geerlingguy/2ccba46ce0c16d049d068cb2157d92dc
Expected behavior
The VirtualBox VM should be started, Vagrant should be able to connect to it (instead I get
default: Warning: Connection refused. Retrying...
over and over, and I can't connect via SSH), and the private network interface should be added (172.16.88.8
).Actual behavior
Note that when I run
vagrant up
under the Windows environment via PowerShell, the correct interfaces are brought up, and Vagrant is able to connect to the VM:Steps to reproduce
vagrant up
References
The text was updated successfully, but these errors were encountered: