Trellis installation problems on WSL

trellis new just doesn’t complete for me on WSL2.

trellis new mysite.ie
Creating new Trellis project in /mnt/h/webdev/roots/mysite.ie

Site domain [mysite.ie]:
✔ mysite.ie
Initializing project...

[✓] Created virtualenv (/mnt/h/webdev/roots/mysite.ie/trellis/.trellis/virtualenv)
[✓] Ensure pip is up to date
⠏   Installing dependencies (this can take a minute...)

pip install taking longer than expected. Switching to verbose output:

I never get any further than this.

The process completes if I use a folder within WSL (e.g. \wsl.localhost\home\roots\mysite.ie) but then that causes all kinds of other errors. Should I be using the /mnt/ folder or a folder within WSL?

Any other ideas would be appreciated. Thanks.

@MWDelaney shared these steps that worked for him the other month:

  • Vagrant installed in WSL
  • VirtualBox installed in Windows
  • Working from a DrvFS directory (still required)
  • Two environment variables:
    • VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
      • export PATH="$PATH:/mnt/c/Program Files/Oracle/VirtualBox"

This is documented at Installing Trellis | Trellis Docs | Roots

Thanks. I already those lines added to my WSL ~/.bashrc file but it doesn’t seem to solve the problem.

After you modified your .bashrc file did you re-initialize your terminal? There’s several ways to do so

I did indeed. Usually I just do:

source ~/.bashrc

I’ve restarted my computer and tried various other things.

1 Like

This part I’m still not sure on:

Working from a DrvFS directory

Can I just use a regular windows folder (e.g. /mnt/c) or does the folder need to be within the linux subsystem?

I’ve had issues with this, too.

Keep in mind, when working from within the Windows filesystem, it is incredibly slow - almost unbearably so.

Even setting it up within WSL and transferring the files after the build is complete, takes ages.

I ended up working strictly within WSL2 using Lando and Docker for Desktop. Blazing fast compared to using Vagrant/Virtualbox.

1 Like

Yes, it does seem to be a problem of speed when communicating between WSL and the mounted folders. It’s much faster running these commands on a folder within WSL, but then that gets really complicated too (drfs folders and vagrantfile customisations).

With Trellis CLI and Bud I am finding Roots-Windows development even more difficult than it used to be. Docker and Lando sound intriguing but figuring out a whole other stack does not :frowning: Don’t suppose there’s an online guide for this?

I’ll continue for now with Laragon (like wamp), and WSL for compiling Acorn assets / deploying remote sites.

I used to use Laragon, and while it’s very point and shoot-easy, actually, so is Lando.

The guide for setting up Lando is a mix between what’s on here (in the docs) and Lando’s own Getting Started.

I found that it was really easy to get up and running. Moreso than Vagrant. And also, Virtualbox itself was super slow on my system. YMMV

Cool. Well I would love to get rid of Vagrant / Virtualbox. I will try out this Lando when I get a chance. Thanks for the advice!

Would you still use Trellis for remote deployments?

Yes, Trellis for deployments with Github. I’m using Radicle though, so it’s almost plug n play in that sense.

2 Likes

Did someone say Trellis for deployments with GitHub?

3 Likes

We use Radicle with Lando on our team. Several team members use WSL2 and several use OSX.

We weren’t able to set up a good Radicle+Trellis+WSL2 dev environment on the WSL2 machines, since we ran into the exact same problems as mentioned by you.

Lando works like a charm on both systems.

There’s only one annoying obstacle when running Lando on WSL2 and that’s trouble with the local SSL certificates.
I’d like to share the section from our developers’ guideline for Lando+WSL2:


HTTPS connection error on WSL2

On a WSL2 setup, you’ll very likely run into trouble with Lando’s local SSL certificate for the host lndo.site.

Open a PowerShell as an administrator and run the following command. Let’s say you run Ubuntu as your Linux distro and your username is pioneer. The command would look like this. Adjust accordingly for other distros and other users.

certutil -addstore -f "ROOT" \\wsl.localhost\Ubuntu\home\pioneer\.lando\certs\lndo.site.pem

After executing the command, you must restart your browser – otherwise you’ll still get the same error.

Read more about the local certificate authority (CA) in the Lando documentation.


I’d be happy if this makes your Lando/roots dev experience enjoyable :slight_smile:

4 Likes

Thanks guys. Radicle and lando seem to work great now, after some initial confusion. I’ve added a few more notes here: Radicle / Lando not syncing with browser