Native WSL2 VM backend for Trellis on Windows - looking for testers

Hi all - I’ve used and loved trellis for years, and recently started leading a team with several Windows devs. The official workaround (running trellis and lima nested inside WSL) was painfully slow and buggy for us. Before “accepting my fate” I decided to take another crack at it… and I did it!

I built a native WSL2 VM backend for trellis-cli that gives Windows developers a fast, native trellis vm experience - no Lima, no Vagrant, no nested VMs, etc.

I’ve tested this heavily on real production sites, and it works well! But for this to really be solid, I need to know if it works for y’all. I need testers, please! Let me know how it goes or drop bug reports on the GitHub fork.

How to test (Requires Windows 10/11 + WSL2)

  1. Download trellis.exe and trellis-linux from my latest release to a folder (something like C:\trellis-wsl\ or whatever you choose).
  2. Open PowerShell in an existing Trellis project or create a new one.
  3. Run the custom binary: C:\trellis-wsl\trellis.exe vm start

(Note: If you have a global trellis installed, invoke this one by its full path to avoid conflicts. It handles stopping other WSL Trellis projects automatically since WSL shares network namespaces).



For the details for how everything works, please see the following links:

3 Likes

Thanks for sharing! If this works for you, would you be interested in submitting a PR to Trellis itself to add WSL2 support?

I have a PC I can dust off to help test

1 Like

Awesome! And absolutely, sending up a PR now!

And that would be amazing if you could test! If you run into any issues getting it going, feel free to ping me here or open an issue on the fork.. happy to help troubleshoot.

1 Like

PR is up: https://github.com/roots/trellis-cli/pull/665

Happy to adjust anything based on your feedback.

1 Like

Quick update: released v1.18.0-wsl2.2 with a bug fix - vm start could incorrectly delete an existing distro in certain cases. If you’re testing, grab the latest binaries: https://github.com/qwatts-dev/trellis-cli/releases/tag/v1.18.0-wsl2.2

Quick update: the original PR was closed and replaced with a new one at https://github.com/roots/trellis-cli/pull/667 based on feedback from Ben.

Recent fixes since last post:

  • trellis init now gives a clear message on Windows instead of failing with a virtualenv error
  • Improved guard messages when running commands from the wrong terminal (Windows vs WSL)
  • CLI install inside the distro is now upstream-ready (uses the official install script for releases)

Ben has tested and confirmed provision + site loading works. The PR is now open for maintainer collaboration. If anyone else wants to test, you can build from source by cloning the fork and running go build.

1 Like