Skip to content

windows MK_WRONG_BINARY_WSL even when not in powershell #10689

@trixnz

Description

@trixnz

The offending function below is incorrectly assuming that if WSLENV has a non-empty value, that the shell is an WSL shell. According to this post, this environment variable is used for sharing variables into new WSL sessions, and is set within Windows too.

func IsMicrosoftWSL() bool {
return os.Getenv("WSL_DISTRO_NAME") != "" || os.Getenv("WSLPATH") != "" || os.Getenv("WSLENV") != ""
}

Steps to reproduce the issue:

  1. Ensure the WSLENV environment variable has a non-empty value. Mine is WT_SESSION::WT_PROFILE_ID
  2. Run minikube from a regular Windows cmd.exe shell
  3. Observe the incorrect output
> minikube docker-env

❌  Exiting due to MK_WRONG_BINARY_WSL: You are trying to run windows .exe binary inside WSL, for better integration please use Linux binary instead (Download at https://minikube.sigs.k8s.io/docs/start/.). Otherwise if you still want to do this, you can do it using --force

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.kind/regressionCategorizes issue or PR as related to a regression from a prior release.os/wsl-windowsmicrosoft wsl related issuespriority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.top-10-issuesTop 10 support issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions