# Error starting a virtual machine with Lima

**URL:** https://discourse.roots.io/t/error-starting-a-virtual-machine-with-lima/25293
**Category:** trellis
**Created:** 2023-05-09T11:47:49Z
**Posts:** 8

## Post 1 by @aitor — 2023-05-09T11:47:49Z

It could be that the timeout occurs very quickly and does not give time to download the resources.

In another project I used the command several times with `--force` and finally I can get it running, but not in this one.

If I try to access the resources from the browser, they download with no problem.

```
➜ Trellis trellis new nomanisanisland.com        
Creating new Trellis project in /Users/aitor/Documents/Trellis/nomanisanisland.com

Site domain [nomanisanisland.com]: 

✔ nomanisanisland.com
Aborting: error while downloading Trellis
Error fetching release information from the GitHub API: Get "https://api.github.com/repos/roots/trellis/releases/latest": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

This could be a temporary network error. Please delete this project folder and try again.
```

---

## Post 2 by @swalkinshaw — 2023-05-09T15:27:39Z

This is probably related to GitHub outages earlier today? [GitHub Status - Incident with Actions, API Requests, Codespaces, Git Operations, Issues, Pages, Pull Requests and Webhooks](https://www.githubstatus.com/incidents/f0mhbz9xn497)

---

## Post 3 by @aitor — 2023-05-09T16:01:20Z

I’m experiencing the issue right now but I can reach the API with no problems from browser:

[https://api.github.com/repos/roots/trellis/releases/latest](https://api.github.com/repos/roots/trellis/releases/latest)

Also I can reach the final resource:

[https://codeload.github.com/roots/trellis/legacy.zip/refs/tags/v1.21.0](https://codeload.github.com/roots/trellis/legacy.zip/refs/tags/v1.21.0)

:upside_down_face:

---

## Post 4 by @aitor — 2023-05-09T16:27:42Z

It seems that suddenly it works. The problem may be that when deleting virtual machines with `trellis vm delete`, the process did not finish correctly and some kind of configuration is left somewhere. I have looked in etc/hosts and the entries are removed fine. Is there somewhere else I should look into?

---

## Post 5 by @aitor — 2023-05-09T17:59:45Z

This is the error I get when trying to stop VM:

```
trellis vm stop 
Running command => limactl stop nomanisanisland.com
INFO[0000] Sending SIGINT to hostagent process 10248    
INFO[0000] Waiting for the host agent and the driver processes to shut down 
INFO[0000] [hostagent] 2023/05/09 19:08:35 tcpproxy: for incoming conn 127.0.0.1:51156, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: no route to host 
INFO[0000] [hostagent] Received SIGINT, shutting down the host agent 
INFO[0000] [hostagent] Shutting down the host agent     
INFO[0000] [hostagent] Stopping forwarding "/run/lima-guestagent.sock" (guest) to "/Users/aitor/.lima/nomanisanisland.com/ga.sock" (host) 
INFO[0000] [hostagent] Shutting down VZ                 
ERRO[0001] [hostagent] dhcp: unhandled message type: RELEASE 
INFO[0001] [hostagent] panic: runtime/cgo: misuse of an invalid Handle 
INFO[0001] [hostagent] goroutine 17 [running, locked to thread]: 
INFO[0001] [hostagent] runtime/cgo.Handle.Value(...)    
INFO[0001] [hostagent] /usr/local/Cellar/go/1.20.3/libexec/src/runtime/cgo/handle.go:124 
INFO[0001] [hostagent] github.com/Code-Hex/vz/v3.changeStateOnObserver(0x0, 0xc000006601?) 
INFO[0001] [hostagent] /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/!code-!hex/vz/v3@v3.0.5/virtualization.go:160 +0xb4 
FATA[0180] did not receive an event with the "exiting" status 
Error stopping VM
exit status 1
➜ trellis
```

---

## Post 6 by @swalkinshaw — 2023-05-10T01:25:06Z

This was a known issue in lima: [`panic: runtime/cgo: misuse of an invalid Handle` (`Code-Hex/vz/v3.changeStateOnObserver`) · Issue #1381 · lima-vm/lima · GitHub](https://github.com/lima-vm/lima/issues/1381)

It should be fixed in the next release.

Regarding the original issue, are you saying that while a VM is running you get those timeouts downloading from GitHub but not when the VM is stopped?

---

## Post 7 by @aitor — 2023-05-10T04:41:44Z

In the last tests I’ve done starting virtual machines from scratch everything has worked fine (except the mentioned panic runtime when stopping the machine, which is a known problem in Lima). The original problem seems to have disappeared. If it comes back, I’ll open the thread again.

I don’t understand what was the cause because the problem persisted a while even after the Github incident was fixed.

Thank you very much for your help. :pray:

---

## Post 8 by @aitor — 2023-06-02T13:21:16Z

Three days ago version 0.16 of Lima was released. The error when stopping the virtual machine has been fixed.

`brew upgrade lima` just works
