minikube: windows MK_WRONG_BINARY_WSL even when not in powershell
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.
Steps to reproduce the issue:
- Ensure the
WSLENVenvironment variable has a non-empty value. Mine isWT_SESSION::WT_PROFILE_ID - Run
minikubefrom a regular Windowscmd.exeshell - 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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 24 (14 by maintainers)
@NatsumiHB @fljamie @mrehanabbasi @kadel @trixnz @fljamie
we release v1.18.1 https://github.com/kubernetes/minikube/releases/tag/v1.18.1
and it includes the fix. please update the minikube version https://minikube.sigs.k8s.io/docs/start/
Just came here to say I’m getting the error too. Using the Windows executable inside PowerShell. Also it recommends trying to use
--forcebuuuuutTested the above PR in Windows Terminal before and after and fixed the issue on my machine.
After looking at the envs being preserved through
WSLENV, I realised this is exclusive to cmd.exe sessions spawned by Windows Terminal (WT_SESSIONandWT_PROFILE_IDare env vars provided by Windows Terminal). It actually behaves correctly when run from a regular cmd.exe (and powershell) session.I think it’s improper behaviour to check for
WSLENVbeing set, as this is not indicative of the shell being run under WSL, but rather which environment variables from Windows should be carried over into new WSL sessions.No, it errors that
--forceis an unknown flag.