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

[BUG] WSL2 validation check is currently case senstive #4279

Closed
alegacy opened this issue Jul 19, 2024 · 7 comments
Closed

[BUG] WSL2 validation check is currently case senstive #4279

alegacy opened this issue Jul 19, 2024 · 7 comments
Labels
kind/bug Something isn't working os/windows

Comments

@alegacy
Copy link
Contributor

alegacy commented Jul 19, 2024

General information

  • OS: Linux
  • Hypervisor: WSL2
  • Did you run crc setup before starting it (Yes/No)? Yes
  • Running CRC on: WSL2

CRC version

CRC version: 2.39.0+2fa795
OpenShift version: 4.16.0
MicroShift version: 4.16.0

CRC status

DEBU CRC version: 2.39.0+2fa795                   
DEBU OpenShift version: 4.16.0                    
DEBU MicroShift version: 4.16.0                   
DEBU Running 'crc status'                         
Machine does not exist. Use 'crc start' to create it

CRC config

- consent-telemetry                     : yes

Host Operating System

NAME="Fedora Remix for WSL"
VERSION="40"
ID=fedoraremixforwsl
ID_LIKE=fedora
VERSION_ID=40
PLATFORM_ID="platform:f40"
PRETTY_NAME="Fedora Remix for WSL"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:40"
HOME_URL="https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL"
SUPPORT_URL="https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL"
BUG_REPORT_URL="https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL/issues"
PRIVACY_POLICY_URL="https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL/blob/master/PRIVACY.md"
FEDORA_REMIX_VERSION=40.0.1

Steps to reproduce

  1. crc setup
  2. crc start

Expected

Should fail to start on WSL2 since not supported. See issue #2131 and fix #2323.

Actual

crc start attempts to start the VM and fails.

Logs

...
INFO Generating new SSH key pair...               
INFO Generating new password for the kubeadmin user 
INFO Starting CRC VM for openshift 4.16.0...      
Error starting machine: Error in driver during machine start: host is not running: getting ip during machine start

The output of /proc/version is this:

Linux version 5.15.153.1-microsoft-standard-WSL2 (root@941d701f84f1) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Fri Mar 29 23:14:13 UTC 2024
@alegacy alegacy added kind/bug Something isn't working status/need triage labels Jul 19, 2024
@alegacy
Copy link
Contributor Author

alegacy commented Jul 19, 2024

Looks like the issue is the case sensitivity of the validation check. I'm willing to submit a PR if that's agreed upon as the cause.

@praveenkumar
Copy link
Member

@alegacy Are you trying to run crc on a fedora wsl distro which is running on windows?

@alegacy
Copy link
Contributor Author

alegacy commented Jul 22, 2024

@praveenkumar yes, I didn’t realize that wasn’t supported so I spent a bit of time debugging why the libvirt instance wasn’t starting. Thru a bunch of google queries i eventually discovered that wasn’t supported and that there was a validation check that should have saved me earlier on.

@praveenkumar
Copy link
Member

@alegacy right, Better to run crc directly on the windows machine instead running it on a wsl environment which need wsl virtualization and nested virt support. I am closing this issue since it is a non supported setup. Please create a new issue if you face problem with running crc directly on windows machine.

@alegacy
Copy link
Contributor Author

alegacy commented Jul 22, 2024

@praveenkumar perhaps I wasn’t clear. The issue that I raised was against the validation check that should have flagged this as an unsupported configuration right from the beginning. That check is looking for the word Microsoft when the actual text is microsoft.

I was suggesting that the validation check could have been improved and I am willing to push a PR to do that.

@cfergeau
Copy link
Contributor

Ah ok, you are referring to this check

func checkRunningInsideWSL2() error {
version, err := os.ReadFile("/proc/version")
if err != nil {
return err
}
if strings.Contains(string(version), "Microsoft") {
logging.Debugf("Running inside WSL2 environment")
return fmt.Errorf("CRC is unsupported using WSL2")
}
return nil
}
which is not triggered as your system has:

Linux version 5.15.153.1-microsoft-standard-WSL2 (root@941d701f84f1) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Fri Mar 29 23:14:13 UTC 2024

A PR to improve it is definitely welcome!

@cfergeau cfergeau reopened this Jul 23, 2024
@praveenkumar
Copy link
Member

@alegacy Please open a PR to fix this.

alegacy added a commit to alegacy/crc that referenced this issue Jul 23, 2024
The WSL validation check assumes that the name "Microsoft" is
capitalized but this is not true in all cases.

Signed-off-by: Allain Legacy <[email protected]>
cfergeau pushed a commit that referenced this issue Jul 24, 2024
The WSL validation check assumes that the name "Microsoft" is
capitalized but this is not true in all cases.

Signed-off-by: Allain Legacy <[email protected]>
@alegacy alegacy closed this as completed Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working os/windows
Projects
None yet
Development

No branches or pull requests

4 participants