crc: [BUG] Windows CRC pre-create error primary domain failed

General information

  • OS: Windows
  • Hypervisor: Hyper-V
  • Did you run crc setup before starting it (Yes)?

CRC version

# Put `crc version` output here
version: 1.0.0-rc.0+34371d3
OpenShift version: 4.2.0-0.nightly-2019-09-26-192831 (embedded in binary)

CRC status

# Put `crc status` output here
ERRO Error occurred: Machine "crc" does not exist. Use "crc start" to add a new one.

CRC config

# Put `crc config view` output here
- skip-check-hyperv-installed           : true
- skip-check-user-in-hyperv-group       : true
- warn-check-user-in-hyperv-group       : false

Host Operating System

# Put the output of `systeminfo` in case of Windows
OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.16299 N/A Build 16299

Steps to reproduce

  1. Download and unzip
  2. run crc setup
  3. run crc start in the computer in the domain

Expected

Everything ok

Actual

Error about “primary domain failed” C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(“S-1-5-32-578”) (crc) DBG | [stderr =====>] : Exception calling “IsInRole” with “1” argument(s): “The trust relationship between this workstation and the primary domain failed.”

My user is in the correct group to access Hyper-V, My computer is in an AD domain, and the user in the HyperV group is my AD user. I can run hyperv commands.

I think it’s a problem with the powershell command as this works :

$sid = New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-578')
([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole($sid)

Same problem as this issue with minishift : https://github.com/minishift/minishift/issues/2047

Logs

C:\D\crc-windows-amd64\crc-windows-1.0.0-rc.0-amd64>crc start --log-level debug
DEBU Error checking if a new version is available: Get https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/release-info.json: dial tcp: lookup mirror.openshift.com: no such host
INFO Checking if running as normal user
INFO Checking if oc binary is cached
DEBU oc binary already cached
INFO Check Windows 10 release
INFO Hyper-V installed and operational
WARN Skipping above check ...
INFO Is user a member of the Hyper-V Administrators group
WARN Skipping above check ...
INFO Does the Hyper-V virtual switch exist
Checking file: C:\Users\therbin\.crc\machines\crc\.crc-exist
? Image pull secret [? for help] ****************************

INFO Loading bundle: crc_hyperv_4.2.0-0.nightly-2019-09-26-192831.crcbundle ...
WARN Bundle certificates are going to expire in 3 days, better to use new release
INFO Creating CodeReady Containers VM for OpenShift 4.2.0-0.nightly-2019-09-26-192831...
Found binary path at crc.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:56859
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(crc) Calling .GetMachineName
(crc) Calling .DriverName
Running pre-create checks...
(crc) Calling .PreCreateCheck
(crc) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Get-Module -ListAvailable hyper-v).Name | Get-Unique
(crc) DBG | [stdout =====>] : Hyper-V
(crc) DBG |
(crc) DBG | [stderr =====>] :
(crc) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("S-1-5-32-578")
(crc) DBG | [stdout =====>] :
(crc) DBG | [stderr =====>] : Exception calling "IsInRole" with "1" argument(s): "The trust relationship between this workstation and the primary domain failed.
(crc) DBG | "
(crc) DBG | At line:1 char:1
(crc) DBG | + @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIde ...
(crc) DBG | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(crc) DBG |     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
(crc) DBG |     + FullyQualifiedErrorId : SystemException
(crc) DBG |
(crc) DBG |
(crc) DBG | exit status 1
(crc) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
(crc) DBG | [stdout =====>] : False
(crc) DBG |
(crc) DBG | [stderr =====>] :
ERRO Error occurred: Error creating host: Error creating the VM. Error with pre-create check: "Hyper-v commands have to be run as an Administrator"
Making call to close driver server
(crc) Calling .Close
Successfully made call to close driver server
Making call to close connection to plugin binary
(crc) DBG | Closing plugin on server side

You can start crc with crc start --log-level debug to collect logs. Please consider posting this on http://gist.github.com/ and post the link in the issue.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Hi @dharmit, you just need to open a simple cmd prompt (no need to start it as Administrator) and run the Powershell command exactly as listed.

I’m attaching a screenshot. Screenshot

can you provide the username and group membership information?

I hope below is the correct command to fetch the requested info:

PS C:\Users\dshah> whoami.exe \all
ERROR: Invalid argument/option - '\all'.
Type "WHOAMI /?" for usage.
PS C:\Users\dshah> whoami.exe /all

USER INFORMATION
----------------

User Name SID
========= ==============================================
win\dshah S-1-5-21-2496811084-580859778-1166941775-12836


GROUP INFORMATION
-----------------

Group Name                                 Type             SID          Attributes
========================================== ================ ============ ==================================================
Everyone                                   Well-known group S-1-1-0      Mandatory group, Enabled by default, Enabled group
BUILTIN\Administrators                     Alias            S-1-5-32-544 Group used for deny only
BUILTIN\Hyper-V Administrators             Alias            S-1-5-32-578 Mandatory group, Enabled by default, Enabled group
BUILTIN\Users                              Alias            S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\INTERACTIVE                   Well-known group S-1-5-4      Mandatory group, Enabled by default, Enabled group
CONSOLE LOGON                              Well-known group S-1-2-1      Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users           Well-known group S-1-5-11     Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization             Well-known group S-1-5-15     Mandatory group, Enabled by default, Enabled group
LOCAL                                      Well-known group S-1-2-0      Mandatory group, Enabled by default, Enabled group
Authentication authority asserted identity Well-known group S-1-18-1     Mandatory group, Enabled by default, Enabled group
Mandatory Label\Medium Mandatory Level     Label            S-1-16-8192


PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                          State
============================= ==================================== ========
SeShutdownPrivilege           Shut down the system                 Disabled
SeChangeNotifyPrivilege       Bypass traverse checking             Enabled
SeUndockPrivilege             Remove computer from docking station Disabled
SeIncreaseWorkingSetPrivilege Increase a process working set       Disabled
SeTimeZonePrivilege           Change the time zone                 Disabled

ERROR: Unable to get user claims information.

Please add crc start --log-level debug output also,

PS C:\Users\dshah> crc start --log-level debug
DEBU No new version available. The latest version is 1.1.0
INFO Checking if running as normal user
INFO Checking if oc binary is cached
DEBU oc binary already cached
INFO Check Windows 10 release
INFO Hyper-V installed and operational
INFO Is user a member of the Hyper-V Administrators group
INFO Does the Hyper-V virtual switch exist
Checking file: C:\Users\dshah\.crc\machines\crc\.crc-exist
? Image pull secret [? for help] ******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

INFO Loading bundle: crc_hyperv_4.2.2.crcbundle ...
INFO Creating CodeReady Containers VM for OpenShift 4.2.2...
Found binary path at C:\bin\crc.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:51883
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(crc) Calling .GetMachineName
(crc) Calling .DriverName
Running pre-create checks...
(crc) Calling .PreCreateCheck
(crc) DBG | [executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Get-Module -ListAvailable hyper-v).Name | Get-Unique
(crc) DBG | [stdout =====>] : Hyper-V
(crc) DBG |
(crc) DBG | [stderr =====>] :
(crc) DBG | [executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("S-1-5-32-578")
(crc) DBG | [stdout =====>] :
(crc) DBG | [stderr =====>] : Exception calling "IsInRole" with "1" argument(s): "The trust relationship between this workstation and the primary domain failed.
(crc) DBG | "
(crc) DBG | At line:1 char:1
(crc) DBG | + @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIde ...
(crc) DBG | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(crc) DBG |     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
(crc) DBG |     + FullyQualifiedErrorId : SystemException
(crc) DBG |
(crc) DBG |
(crc) DBG | exit status 1
(crc) DBG | [executing ==>] : C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
(crc) DBG | [stdout =====>] : False
(crc) DBG |
(crc) DBG | [stderr =====>] :
ERRO Error creating host: Error creating the VM: Error with pre-create check: "Hyper-v commands have to be run as an Administrator"
Making call to close driver server
(crc) Calling .Close
(crc) DBG | Closing plugin on server side
Successfully made call to close driver server
Making call to close connection to plugin binary