lima-vm / lima-vm/lima

WSL machine fails to boot when `LIMA_CIDATA_UID=1000`

Open
#5,089 2 comments 0 reactions 0 assignees View on GitHub
bug host/Windows
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

There is code which reads UID using `id` tool on Windows https://github.com/lima-vm/lima/blob/3569ecbe1b163d602037a618147915fcd90c8fe4/pkg/osutil/user.go#L116, which normally maps to cygwin/msys2 version of the utility, which in turn outputs some number outside of regular Linux user range. If `id` utility is missing in path, then fallback takes place and sets uid to 1000 https://github.com/lima-vm/lima/blob/3569ecbe1b163d602037a618147915fcd90c8fe4/pkg/osutil/user.go#L94 and WSL machine fails to boot.

~This is a regression in 2.1.2 and was working for 2.1.1 (I haven't rechecked 2.1.1 now, but it was working around time the release was cut) - machine was able to boot when uid/gid were 1000/1000.~

I believe I found that it failed at least once with 2.1.1 and additional detail would be that it started with WSL 2.7.3. So it might be a regression caused by WSL version bump.

Contributor guide

Open the contributing guide

Research direction

Start with pkg/osutil/user.go, especially the UID lookup and fallback paths linked in the issue. Reproduce the WSL boot failure with LIMA_CIDATA_UID=1000 and check the UID/GID values passed to the machine. Done means the affected WSL configuration boots reliably without breaking the existing Windows lookup behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
57/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.