Introducing Lima to Trellis for Faster Local Development

Lando works gr8! But… :slight_smile: you cant provision lando with trellis as far i know.
What Lima provides is a way to get the “exact” same server you would on staging and production.

Sidenote:
Maybe you can add a provision command to landos build step or do it via trellis but im not sure.
But then going pure docker and docker-compose or even podman would be a better alternative.

1 Like

with this said roots new radicle adds Lando as an alternative for local development.

1 Like

Not sure if it helps in any way, but I discovered that the reason that I needed to restart before starting a new Lima server on silicon machines is that the process only works when no other Lima servers are running. So now in order to get it to work I can do so by just stopping all of the other servers instead of restarting the whole machine. Still not ideal but a little faster I guess.

1 Like

Yes I had the same issue but seems. Issue seems to be when the host machine goes to sleep port forwarding stops working. I was able to solve this buy doing a factory reset on the lima instance so that lima updates the network configs. So far I haven’t had an issue since.

1 Like

Did you figure this out? I had the same question.

It’s a bug that I need to fix :see_no_evil:

I did that factory reset but then when I run trellis vm start again I can’t seem to have the access to the backoffice anymore.
Did you do something else on the .trellis/lima/<site-host>.yml file?

When you say “back office” are you referring to wp-admin? Can you post the output from trellis vm start?

Correct, the wp-admin.

Running command => limactl start leafwell.dev
INFO[0000] Using the existing instance "leafwell.dev"
WARN[0000] Ignoring: vmType vz: [OS]
INFO[0000] Attempting to download the image              arch=aarch64 digest= location="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-arm64.img"
INFO[0000] Using cache "/Users/joaomamede/Library/Caches/lima/download/by-url-sha256/b0292969d1625be5cb3a28bcbd6660473d29afede9d0f7b2a791e4d9891335b8/data"
INFO[0000] Converting "/Users/joaomamede/.lima/leafwell.dev/basedisk" (qcow2) to a raw disk "/Users/joaomamede/.lima/leafwell.dev/diffdisk"
2.20 GiB / 2.20 GiB [-------------------------------------] 100.00% 150.43 MiB/s
INFO[0015] Expanding to 100GiB
INFO[0015] [hostagent] Starting VZ (hint: to watch the boot progress, see "/Users/joaomamede/.lima/leafwell.dev/serial*.log")
INFO[0015] [hostagent] new connection from  to
INFO[0015] SSH Local Port: 55129
INFO[0015] [hostagent] [VZ] - vm state change: running
INFO[0015] [hostagent] Waiting for the essential requirement 1 of 3: "ssh"
INFO[0025] [hostagent] Waiting for the essential requirement 1 of 3: "ssh"
INFO[0026] [hostagent] The essential requirement 1 of 3 is satisfied
INFO[0026] [hostagent] Waiting for the essential requirement 2 of 3: "user session is ready for ssh"
INFO[0037] [hostagent] Waiting for the essential requirement 2 of 3: "user session is ready for ssh"
INFO[0037] [hostagent] The essential requirement 2 of 3 is satisfied
INFO[0037] [hostagent] Waiting for the essential requirement 3 of 3: "the guest agent to be running"
INFO[0037] [hostagent] The essential requirement 3 of 3 is satisfied
INFO[0037] [hostagent] Waiting for the final requirement 1 of 1: "boot scripts must have finished"
INFO[0037] [hostagent] Forwarding "/run/lima-guestagent.sock" (guest) to "/Users/joaomamede/.lima/leafwell.dev/ga.sock" (host)
INFO[0037] [hostagent] The final requirement 1 of 1 is satisfied
INFO[0037] READY. Run `limactl shell leafwell.dev` to open the shell.

Updating /etc/hosts file (sudo may be required, see `trellis vm sudoers` for more details)

Your Trellis VM is ready to use!

* Composer and WP-CLI commands need to be run on the virtual machine for any post-provision modifications.
* You can SSH into the machine with 'trellis vm shell'
* Then navigate to your WordPress sites at '/srv/www'

Right after running limactl factory-reset cmd.

I didn’t do anything to the yml configs but what you can try is

try curl -vv -L leafwell.dev and post the output.

* Could not resolve host: leafwell.dev
* Closing connection 0
curl: (6) Could not resolve host: leafwell.dev

Try using the .test TLD — .dev is an actual TLD now and shouldn’t be used anymore

1 Like

Thanks everyone for the feedback and participation on here! I’m going to close this original topic out, but please create new topics for anything else related to Lima and Trellis so we can more easily stay on topic for each individual issue