Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start colima when host is not connected to any network #1210

Closed
1 of 5 tasks
mduran80 opened this issue Dec 12, 2024 · 3 comments
Closed
1 of 5 tasks

Unable to start colima when host is not connected to any network #1210

mduran80 opened this issue Dec 12, 2024 · 3 comments

Comments

@mduran80
Copy link

Description

Colima (or lima) is unable to start the VM when the host is offline, disconnected from wired or wireless networks. It fails the first time it is launched under these conditions and then hangs the rest of the times it is attempted to be restarted.

These are the logs of those attempts plus logs of ha.stderr.log

➜  .docker colima stop --force
INFO[0000] stopping colima
INFO[0000] stopping ...                                  context=vm
INFO[0000] done

➜  .docker colima start --very-verbose
TRAC[0000] cmd ["limactl" "info"]
TRAC[0000] cmd ["system_profiler" "-json" "SPHardwareDataType"]
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
INFO[0000] starting colima
INFO[0000] runtime: docker
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "start" "default" "--inotify" "--inotify-runtime" "docker" "--inotify-dir" "/Users/user/" "--inotify-dir" "/tmp/colima/" "--very-verbose"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0001] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0001] cmd ["system_profiler" "-json" "SPHardwareDataType"]
INFO[0001] starting ...                                  context=vm
TRAC[0001] cmd ["limactl" "start" "colima"]
> Using the existing instance "colima"
> Starting the instance "colima" with VM driver "vz"
> vmType vz: ignoring networks[0]: [Metric]
> [hostagent] hostagent socket created at /Users/user/.colima/_lima/colima/ha.sock
> [hostagent] Starting VZ (hint: to watch the boot progress, see "/Users/user/.colima/_lima/colima/serial*.log")
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/user/.colima/_lima/colima/ha.stderr.log")
FATA[0002] error starting vm: error at 'starting': exit status 1

➜  .docker colima start --very-verbose
TRAC[0000] cmd ["limactl" "info"]
TRAC[0000] cmd ["system_profiler" "-json" "SPHardwareDataType"]
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
INFO[0000] starting colima
INFO[0000] runtime: docker
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "stop" "default"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "start" "default" "--inotify" "--inotify-runtime" "docker" "--inotify-dir" "/Users/user/" "--inotify-dir" "/tmp/colima/" "--very-verbose"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0001] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0001] cmd ["system_profiler" "-json" "SPHardwareDataType"]
INFO[0001] starting ...                                  context=vm
TRAC[0001] cmd ["limactl" "start" "colima"]
> Using the existing instance "colima"

ha.stderr.log:

➜  ~ tail .colima/_lima/colima/ha.stderr.log
{"level":"debug","msg":"Creating iso file /Users/user/.colima/_lima/colima/cidata.iso","time":"2024-12-12T20:29:02+01:00"}
{"level":"debug","msg":"Using /var/folders/1v/3tlt5gzs0q7gjwdhv3lflzh80000gn/T/diskfs_iso3250094531 as workspace","time":"2024-12-12T20:29:02+01:00"}
{"level":"debug","msg":"Failed to detect CPU features. Assuming that AES acceleration is available on this Apple silicon.","time":"2024-12-12T20:29:02+01:00"}
{"level":"debug","msg":"OpenSSH version 9.8.1 detected","time":"2024-12-12T20:29:02+01:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing aes128-gcm@openssh.com and aes256-gcm@openssh.com","time":"2024-12-12T20:29:02+01:00"}
{"level":"info","msg":"hostagent socket created at /Users/user/.colima/_lima/colima/ha.sock","time":"2024-12-12T20:29:02+01:00"}
{"level":"info","msg":"Starting VZ (hint: to watch the boot progress, see \"/Users/user/.colima/_lima/colima/serial*.log\")","time":"2024-12-12T20:29:02+01:00"}
{"level":"debug","msg":"Kernel file \"/Users/user/.colima/_lima/colima/kernel\" not found","time":"2024-12-12T20:29:02+01:00"}
{"level":"debug","msg":"Using EFI Boot Loader","time":"2024-12-12T20:29:02+01:00"}
{"level":"fatal","msg":"dial unix /Users/user/.colima/_lima/_networks/user-v2/user-v2_fd.sock: connect: no such file or directory","time":"2024-12-12T20:29:02+01:00"}

Version

0.8.0

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

Output of colima status

➜  .docker colima status -e
FATA[0000] colima is not running

Reproduction Steps

  1. Run colima stop --force
  2. Disconnect all networks
  3. Run colima start --very-verbose

Expected behaviour

Start colima normally in offline environments

Additional context

No response

@abiosoft
Copy link
Owner

This should be resolved with the latest release https://github.com/abiosoft/colima/releases/tag/v0.8.1.

tmeijn pushed a commit to tmeijn/dotfiles that referenced this issue Dec 21, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [abiosoft/colima](https://github.com/abiosoft/colima) | patch | `v0.8.0` -> `v0.8.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>abiosoft/colima (abiosoft/colima)</summary>

### [`v0.8.1`](https://github.com/abiosoft/colima/releases/tag/v0.8.1)

[Compare Source](abiosoft/colima@v0.8.0...v0.8.1)

#### Highlights

This is an incremental release with bug fixes.

#### Fixes

-   Cleanup of network assets directory on startup. Fixes [#&#8203;1210](abiosoft/colima#1210), [#&#8203;1029](abiosoft/colima#1029), [#&#8203;1212](abiosoft/colima#1212), [#&#8203;1116](abiosoft/colima#1116).
-   Use of primary network adapter as default route when external network address is enabled. Fixes [#&#8203;1214](abiosoft/colima#1214).

#### Other Updates

-   `VZ` is now the default virtual machine type on macOS 13 or newer. Qemu can still be used if specified.
-   Disk image can now be downloaded locally and specified with the `--disk-image` flag for `colima start`.

##### Runtime version bumps

Runtime version can be updated running the `colima update` command.

-   Docker version updated to `27.4.0`
-   Nerdctl version updated to `2.0.2`
-   Incus version updated to `6.8`

#### Commits

-   ci: fix integration tests by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1190
-   build(deps): bump golang.org/x/term from 0.25.0 to 0.26.0 by [@&#8203;dependabot](https://github.com/dependabot) in abiosoft/colima#1189
-   core: update disk images by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1191
-   cli: add --json flag to status command by [@&#8203;ecrousseau](https://github.com/ecrousseau) in abiosoft/colima#1196
-   config: ability to specifying memory in decimal GiB by [@&#8203;qiao-summer](https://github.com/qiao-summer) in abiosoft/colima#1206
-   build(deps): bump golang.org/x/term from 0.26.0 to 0.27.0 by [@&#8203;dependabot](https://github.com/dependabot) in abiosoft/colima#1207
-   net: clear assets directory on startup by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1213
-   net: set route for external address by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1214
-   core: update disk images by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1215
-   vm: add support for custom disk images by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1216
-   config: use vz as default vm type on macOS 13 or newer by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1217
-   ci: clean up by [@&#8203;abiosoft](https://github.com/abiosoft) in abiosoft/colima#1220

#### New Contributors

-   [@&#8203;ecrousseau](https://github.com/ecrousseau) made their first contribution in abiosoft/colima#1196
-   [@&#8203;qiao-summer](https://github.com/qiao-summer) made their first contribution in abiosoft/colima#1206

**Full Changelog**: abiosoft/colima@v0.8.0...v0.8.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS43Ny4wIiwidXBkYXRlZEluVmVyIjoiMzkuNzcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
@lfdebrux
Copy link

lfdebrux commented Jan 14, 2025

I'm seeing a similar issue to this on colima v0.8.1, where if I'm not connected to a network colima start hangs indefinitely.

Additionally I've noticed that there are no logs in the ha.stderr.log file, but there is something in the log file for the network in ~/.colima/_lima/_networks/user-v2/usernet.user-v2.stderr.log:

time="2025-01-14T08:41:15Z" level=fatal msg="cannot add network services: no DNS servers configured in /etc/resolv.conf"

I was able to workaround by adding nameserver 8.8.8.8 to /etc/resolv.conf.

@AnthoBalitrand
Copy link

Hello,
This is probably linked to this issue : lima-vm/lima#3050

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants