crc: [BUG] Windows CRC pre-create error primary domain failed
General information
- OS: Windows
- Hypervisor: Hyper-V
- Did you run
crc setupbefore 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
- Download and unzip
- run crc setup
- 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)
https://github.com/code-ready/machine/pull/30 and https://github.com/machine-drivers/machine/pull/24 are merged, and we have the fix in crc 1.3.0
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.
I hope below is the correct command to fetch the requested info: