Can't access local site with Trellis and WSL 2

I’ve tried all of the installation instructions for WSL2 and was finally able to get vagrant and ansible to run without any issues, but now I’m unable to access the local domain. I just get rerouted by my ISP to a search page, but when curling the url I get wordpress code in response. Has anyone had this issue before?

A workaround I used before migrating to LInux is installing firefox inside wsl. Another one is running yarn start which allows me to access localhost:3000 from any window’s browser (I think this one was on wsl 1 not 2 tho).

If you’re gonna be using trellis a lot, I’d advice setting up Linux alongside windows or getting yourself a mac.

Yeah that’s what I was afraid of… I tried this about a year ago with WSL2 and seem to have gotten further along but it still just can’t seem to work. Was hoping WSL2 would be compatible enough but it seems no one really knows the exact configuration for it to work properly.

Does anyone know which ansible version is recommended? The docs seem to be outdated because other answers are using versions higher than ones mentioned there

I’m also still struggling to get Trellis working with WSL2.

I ran into a similar problem as you, and was able to fix this issue by allowing wsl2 in the Windows Defender firewall settings.

New trellis projects are working for me (after normal install followed by a provision), but I can’t get my existing Trellis projects up and I’m sad to say I have given up. The issues kept coming, it became too time consuming. Still have my old macbook that runs trellis just fine, so that’s my current backup for deployments.

Was already on docker based local dev, and am now migrating to a ci cd solution for deployments.

Edit: docker based local dev (with ddev) and migrating to a ci cd solution like github actions with deployer.php or with Buddy.works was already my plan here. I’m also not using trellis to provision servers, just to deploy to Kinsta. Me getting a new Windows pc, coincidentally during my migration away from Trellis, was the reason for me to get into wsl2. But also the reason I did not really had to push through all the way on getting it to work on wsl2. For my situation I’m therefore able to migrate away from Trellis (currently looking into this strategy: https://atymic.dev/blog/github-actions-laravel-ci-cd/ + https://github.com/FlorianMoser/bedrock deployer), but I hope you can find your solution.

Same problem here, after doing a lot of stuff to even finish the ‘vagrant up’ process, which was not working, my local domain doesn’t load (everything looks mapped up in W10 hosts file). I’m thinking for my scenario it is due to nginx not running on the virtualbox vm. I recently just realized ‘trellis check’ comes up with the following problem

https://i.imgur.com/SGqXeIL.png

Even though everything seems to be right an installed on both WSL2 and Windows

Yeah I just gave up on trying and dual booted Linux. Having other issues with setting up woocommerce but at least got it setup initially

Although I am really not using Vagrant (but rather Docker) on WSL 2,
this Vagrant plugin fixed the issues on WSL 2 for me:

This topic was automatically closed after 42 days. New replies are no longer allowed.