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 CRC on windows #4639

Open
kansal-mukul opened this issue Feb 25, 2025 · 24 comments
Open

Unable to start CRC on windows #4639

kansal-mukul opened this issue Feb 25, 2025 · 24 comments
Assignees
Labels
kind/bug Something isn't working os/windows

Comments

@kansal-mukul
Copy link

General information

crc setup configure successfully .
when i run crc start , it showing me "INFO Creating CRC VM for OpenShift 4.17.14...
Error creating machine: error with pre-create check: Hyper-v commands have to be run as an Administrator"

Operating System

Windows

Hypervisor

Hyper-V

Did you run crc setup before crc start?

no

Running on

Laptop

Steps to reproduce

  1. crc setup
  2. crc start

CRC version

CRC version: 2.47.0+457b65
OpenShift version: 4.17.14
MicroShift version: 4.17.14

CRC status

C:\Program Files\Red Hat OpenShift Local>crc status --log-level debug
DEBU CRC version: 2.47.0+457b65
DEBU OpenShift version: 4.17.14
DEBU MicroShift version: 4.17.14
DEBU Running 'crc status'
DEBU Running '(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseId).ReleaseId'
DEBU Running '(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").EditionID'
Machine does not exist. Use 'crc start' to create it

CRC config

C:\Program Files\Red Hat OpenShift Local>crc config view
- consent-telemetry                     : yes

Host Operating System

C:\Program Files\Red Hat OpenShift Local>systeminfo

Host Name:                 GL0W7R3
OS Name:                   Microsoft Windows 11 Enterprise
OS Version:                10.0.22621 N/A Build 22621
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          Windows User
Registered Organization:
Product ID:                00330-80000-00000-AA570
Original Install Date:     26-07-2023, 00:58:58
System Boot Time:          25-02-2025, 17:39:32
System Manufacturer:       Dell Inc.
System Model:              Latitude 5420
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 140 Stepping 1 GenuineIntel ~1498 Mhz
BIOS Version:              Dell Inc. 1.30.0, 10-07-2023
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-us;English (United States)
Input Locale:              00004009
Time Zone:                 (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi
Total Physical Memory:     15,761 MB
Available Physical Memory: 5,286 MB
Virtual Memory: Max Size:  23,441 MB
Virtual Memory: Available: 12,453 MB
Virtual Memory: In Use:    10,988 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\GL0W7R3
Hotfix(s):                 3 Hotfix(s) Installed.
                           [01]: KB5049624
                           [02]: KB5051989
                           [03]: KB5053488
Network Card(s):           4 NIC(s) Installed.
                           [01]: Intel(R) Ethernet Connection (13) I219-LM
                                 Connection Name: Ethernet
                                 Status:          Media disconnected
                           [02]: Intel(R) Wi-Fi 6 AX201 160MHz
                                 Connection Name: Wi-Fi
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.29.1
                                 IP address(es)
                                 [01]: 192.168.29.207
                                 [02]: fe80::10c6:18b3:56a5:98f
                                 [03]: 2405:201:681d:e82a:910f:2a3e:578a:738f
                                 [04]: 2405:201:681d:e82a:ec6b:79ba:ffe2:6af
                           [03]: Cisco AnyConnect Virtual Miniport Adapter for Windows x64
                                 Connection Name: Ethernet 3
                                 Status:          Hardware not present
                           [04]: Bluetooth Device (Personal Area Network)
                                 Connection Name: Bluetooth Network Connection
                                 Status:          Media disconnected
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

Expected behavior

Its should start the CRC on local

Actual behavior

Image

CRC Logs

Additional context

No response

@kansal-mukul kansal-mukul added the kind/bug Something isn't working label Feb 25, 2025
@albfan
Copy link
Contributor

albfan commented Feb 25, 2025

  • Is it first time you try crc or it work before?
  • is your user Administrator or have administrator rights on that machine?
  • Can you confirm if restarting your machine fixes the problem?

@kansal-mukul
Copy link
Author

kansal-mukul commented Feb 26, 2025

@albfan Is it first time you try crc or it work before? Yes first time .
is your user Administrator or have administrator rights on that machine? I am normal user (using company laptop) and for installing CRC i took admin rights from IT team .
Can you confirm if restarting your machine fixes the problem? : NO .

Now i am getting this error :

Image

@kansal-mukul
Copy link
Author

kansal-mukul commented Feb 26, 2025

Now i ran this and getting below error even i run the crc setup already in a shell without admin rights as well

C:\Windows\System32>crc start
INFO Using bundle path C:\Users\LTIMMaster\.crc\cache\crc_hyperv_4.17.14_amd64.crcbundle
INFO Checking minimum RAM requirements
INFO Check if Podman binary exists in: C:\Users\LTIMMaster\.crc\bin\oc
INFO Checking if running in a shell with administrator rights
WARN Preflight checks failed during `crc start`, please try to run `crc setup` first in case you haven't done so yet
crc should be run in a shell without administrator rights

Image

@anjannath
Copy link
Member

the issue seems to be that crc setup thinks the current user is part of the Hyper-v Admins group, and crc start thinks its not, could you please share the output for the following powershell commands:

PS> ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(([System.Security.Principal.SecurityIdentifier]::new("S-1-5-32-578")))

PS> (Get-LocalGroupMember -SID 'S-1-5-32-578').Name

PS> [Security.Principal.WindowsIdentity]::GetCurrent()

@kansal-mukul
Copy link
Author

kansal-mukul commented Feb 26, 2025

@anjannath

PS C:\Users\10726982> ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(([System.Security.Principal.SecurityIdentifier]::new("S-1-5-32-578")))
False

PS C:\Users\10726982> (Get-LocalGroupMember -SID 'S-1-5-32-578').Name
GL0W7R3\10726982

PS C:\Users\10726982> [Security.Principal.WindowsIdentity]::GetCurrent()

AuthenticationType : CloudAP
ImpersonationLevel : None
IsAuthenticated    : True
IsGuest            : False
IsSystem           : False
IsAnonymous        : False
Name               : XXXXXXX\107XXX82
Owner              : S-1-12-1-3272853008-1205808052-1053276804-1942375835
User               : S-1-12-1-3272853008-1205808052-1053276804-1942375835
Groups             : {S-1-1-0, S-1-5-21-207431810-3214598592-1103151311-1017, S-1-5-32-545, S-1-5-4...}
Token              : 2736
AccessToken        : Microsoft.Win32.SafeHandles.SafeAccessTokenHandle
UserClaims         : {http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name: LTIMINDTREE\10726982,
                     http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid:
                     S-1-12-1-3272853008-1205808052-1053276804-1942375835,
                     http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid: S-1-1-0,
                     http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid:
                     S-1-5-21-207431810-3214598592-1103151311-1017...}
DeviceClaims       : {}
Claims             : {http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name: LTIMINDTREE\10726982,
                     http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid:
                     S-1-12-1-3272853008-1205808052-1053276804-1942375835,
                     http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid: S-1-1-0,
                     http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid:
                     S-1-5-21-207431810-3214598592-1103151311-1017...}
Actor              :
BootstrapContext   :
Label              :
NameClaimType      : http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
RoleClaimType      : http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid

@albfan albfan self-assigned this Feb 26, 2025
@albfan albfan moved this to Work In Progress in Project planning: crc Feb 26, 2025
@albfan
Copy link
Contributor

albfan commented Feb 26, 2025

"S-1-5-32-578" is the Hyper-V Administrator group

See "Hyper-V Administrators":

https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers

So from your output your user is not in on that group Hyper-V Administrators

Your user cannot get elevated permissions needed, and running as Administrator is not allowed

You need to be included in that group.

Is supposed crc installation does that for you:

https://github.com/crc-org/crc/blob/main/packaging/windows/product.wxs.template#L91

You might try to reinstall and check those PS commands again. That's why we ask for restart before running crc

Let us know if that works and close the issue

@kansal-mukul
Copy link
Author

@albfan Which PS command you are talking about . Please share the exact steps to install/uninsatll CRC ..

@albfan
Copy link
Contributor

albfan commented Feb 26, 2025

"[POWERSHELLEXE]" -NonInteractive -ExecutionPolicy Bypass -NoProfile -Command "Add-LocalGroupMember -Member '[LogonUser]' -SID S-1-5-32-578"

But is something crc installer will do for you. You need to restart after that so your user reload its groups so you can run crc allowing it to do some stuff related to hyper-v

Did you install crc using this installer:

https://console.redhat.com/openshift/create/local

@kansal-mukul
Copy link
Author

kansal-mukul commented Feb 26, 2025

Yes . i am using same link and then downalod from there (https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/crc-windows-installer.zip) .

Install it -->restart the laptop--> then run crc setup command

PS C:\Users\10726982> crc setup
INFO Using bundle path C:\Users\10726982\.crc\cache\crc_hyperv_4.17.14_amd64.crcbundle
INFO Checking minimum RAM requirements
INFO Check if Podman binary exists in: C:\Users\10726982\.crc\bin\oc
INFO Checking if running in a shell with administrator rights
INFO Checking Windows release
INFO Checking Windows edition
INFO Checking if Hyper-V is installed and operational
INFO Checking if Hyper-V service is enabled
INFO Checking if crc-users group exists
INFO Checking if current user is in crc-users and Hyper-V admins group
INFO Checking if vsock is correctly configured
INFO Checking if CRC bundle is extracted in '$HOME/.crc'
INFO Checking if C:\Users\10726982\.crc\cache\crc_hyperv_4.17.14_amd64.crcbundle exists
INFO Getting bundle for the CRC executable
INFO Downloading bundle: C:\Users\10726982\.crc\cache\crc_hyperv_4.17.14_amd64.crcbundle...
5.24 GiB / 5.24 GiB [-----------------------------------------------------------------------------------------------------------------] 100.00% 24.42 MiB/s
INFO Uncompressing C:\Users\10726982\.crc\cache\crc_hyperv_4.17.14_amd64.crcbundle
crc.vhdx:  21.51 GiB / 21.51 GiB [----------------------------------------------------------------------------------------------------------------] 100.00%
oc.exe:  128.74 MiB / 128.74 MiB [----------------------------------------------------------------------------------------------------------------] 100.00%
INFO Checking if the win32 background launcher is installed
INFO Checking if the daemon task is installed
INFO Installing the daemon task
INFO Checking if the daemon task is running
INFO Running the daemon task
INFO Checking admin helper service is running
INFO Checking SSH port availability
Your system is correctly setup for using CRC. Use 'crc start' to start the instance
PS C:\Users\10726982> crc start
INFO Using bundle path C:\Users\10726982\.crc\cache\crc_hyperv_4.17.14_amd64.crcbundle
INFO Checking minimum RAM requirements
INFO Check if Podman binary exists in: C:\Users\10726982\.crc\bin\oc
INFO Checking if running in a shell with administrator rights
INFO Checking Windows release
INFO Checking Windows edition
INFO Checking if Hyper-V is installed and operational
INFO Checking if Hyper-V service is enabled
INFO Checking if crc-users group exists
INFO Checking if current user is in crc-users and Hyper-V admins group
INFO Checking if vsock is correctly configured
INFO Checking if the win32 background launcher is installed
INFO Checking if the daemon task is installed
INFO Checking if the daemon task is running
INFO Checking admin helper service is running
INFO Checking SSH port availability
INFO Loading bundle: crc_hyperv_4.17.14_amd64...
INFO Creating CRC VM for OpenShift 4.17.14...
Error creating machine: error with pre-create check: Hyper-v commands have to be run as an Administrator

I checked in computer management-> Groups-> Hyper-V admin --> my user is listed there ..so you are right crc installation automatically added my user in Hyper-V admin group ..but why crc start command is not running properly @albfan

@kansal-mukul
Copy link
Author

One more query .if we successfully able to install this openshit local on my ocal laptop .can i instal oadp operator on this local ocp cluster and do data backup and recovery ? Is openshift local has that much of functionality to do these pocs?

@albfan
Copy link
Contributor

albfan commented Feb 27, 2025

This are the 2 checks done:

User being Hyper-V Administrator:

@([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(([System.Security.Principal.SecurityIdentifier]::new("S-1-5-32-578")))

User being Administrator:

@([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")

So probably you need to be in Administrator group, but not Administrator

About OADP, yes it is available and you can install it

@kansal-mukul
Copy link
Author

My id is added in both group . please check

Image

Image

Image

This entry is added by CRC installer internally .

Image

Confused what is left ..Please suggest and let me know if you need more info for more debugging from my end @albfan Thanks for your quick reply and support ...

@anjannath
Copy link
Member

@kansal-mukul my guess is that you are being assigned a different username (in the form domain\username) based on whether you are connected to a Domain Controller or not, so the user which actually has the required group memberships is not the same user that is being used to run crc probably because when installing crc you were connected to the domain controller and afterwards when crc start was failing you are in a different network and not connected to the DC

we can verify if this is the case by checking if the following commands all return the same domain\username:

PS> (Get-LocalGroupMember -SID 'S-1-5-32-578').Name
GL0W7R3\10726982

PS> whoami

PS> ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).Name

if possible could you please run these commands in both the domain connected and disconnected scenarios

@kansal-mukul
Copy link
Author

@anjannath Connected network :

Image

What do you mean disconnected ? is this without internet ?

@anjannath
Copy link
Member

from the output of those commands it seems the user that is added to the hyper-v admins group is GL0W7R3\10726982, but the current user account that is used is ltimindtree\10726982

can you add this ltimindtree\10726982 user to the Hyper-v Administrators group and reboot then try to run crc start again and see if that helps

What do you mean disconnected ? is this without internet ?

by this i mean when you are not able to reach the corporate domain controller to authenticate, and using your machine with the local user account

@kansal-mukul
Copy link
Author

I disconnected from the internet and run below commands

Image

@anjannath
Copy link
Member

anjannath commented Feb 27, 2025

@kansal-mukul thanks for sharing those outputs, could you please try to add the ltimindtree\10726982 user to the Hyper-v Administrators group and reboot then try to run crc start again and see if that helps

@kansal-mukul
Copy link
Author

@anjannath @albfan Please let me know once this will be fixed ..IN the mean time i am trying from my end whatever suggestion u gave me above

@gbraad
Copy link
Contributor

gbraad commented Feb 27, 2025

Can we suppress the message Hyper-v commands have to be run as an Administrator as this is misleading. The actual error from PowerShell (Hyper-V cmdlets) should be have to be run as a Hyper-V Administrator.

@kansal-mukul
Copy link
Author

This is the actual error currently coming from powershell when i ran crc start command : Error creating machine: error with pre-create check: Hyper-v commands have to be run as an Administrator

@albfan
Copy link
Contributor

albfan commented Mar 1, 2025

@kansal-mukul crc installation try to do its best, but if finally:

@([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent())

is not in hyper-v administrators:

@([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(([System.Security.Principal.SecurityIdentifier]::new("S-1-5-32-578")))

You need to fix that manually as the error message suggest

PS: Please copy command output in text so we can search on your replies

@kansal-mukul
Copy link
Author

kansal-mukul commented Mar 5, 2025

@albfan Now i am getting this error while running crc start command:

INFO Starting CRC VM for openshift 4.17.14...
DEBU Updating CRC VM configuration
DEBU Machine: libhvee -> get machine
DEBU Machine: libhvee -> start
DEBU Running '(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseId).ReleaseId'
DEBU Running '(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").EditionID'
Error starting machine: Error in driver during machine start: failed to start vm: Job failed with error code: 32788 ()

@albfan
Copy link
Contributor

albfan commented Mar 6, 2025

Yes, this is a windows config known error:

https://www.revove.com/blog/fix-hyper-v-failed-to-change-state-with-error-code-32788/

You need to fix on your own

@gbraad
Copy link
Contributor

gbraad commented Mar 10, 2025

an Administrator

this means also: "a user from the Hyper-V Administrators". Seems like this is not the case.

The create could fail when the resources for running the VM is not sufficient. This might explain the 32788 (COM error, that we did not used to have with powershell).

Can you create another VM from the Manager tool and see if this works?

What might lead to the failure could be:

  • missing virtual hardware components, though this is unlikely as we only add a bare minimum
  • not enough actual 'usable' memory
  • not enough disk space for the backing file (to start the VM process)
  • maybe the disk is located on a removal disk
  • ... and others

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
Status: Work In Progress
Development

No branches or pull requests

4 participants