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] crc start fails for non-admin users on Windows #1691

Closed
gorkem opened this issue Nov 18, 2020 · 5 comments
Closed

[BUG] crc start fails for non-admin users on Windows #1691

gorkem opened this issue Nov 18, 2020 · 5 comments
Labels
kind/bug Something isn't working

Comments

@gorkem
Copy link
Contributor

gorkem commented Nov 18, 2020

General information

  • OS: Windows
  • Hypervisor: KVM / Hyper-V / hyperkit
  • Did you run crc setup before starting it (Yes/No)? Yes
  • Running CRC on: Laptop

CRC version

# Put `crc version` output here

CRC status

CodeReady Containers version: 1.18.0+bb304aa
OpenShift version: 4.6.1 (embedded in binary)

CRC config

Host Operating System

# Put the output of `systeminfo` in case of Windows

Steps to reproduce

crc start fails if the user does not have admin rights.
It prompts for an admin user to configure the DNS but fails if such credentials can not be provided.

...
INFO Will run as admin: add dns server address to interface vEthernet (Default Switch)
Error running post start: Nameserver 172.17.136.19 not successfully set on interface vEthernet (Default Switch)
@gorkem gorkem added the kind/bug Something isn't working label Nov 18, 2020
@gbraad
Copy link
Contributor

gbraad commented Nov 18, 2020

This is a requirement and part of the documentation (and by design; hence the error). There is at the moment no way around this, as adding the DNS entries to the virtual switch needs admin privileges.

We are however looking into an altternative using the hosts file for quitte some timme, though this also needs admin or installer/setup privileges. the workaround could be an admin helper tool, which runs with privileges to perform certain tasks specfic to crc with elevated privileges

Note: I am pretty sure this is a duplicate

@gbraad
Copy link
Contributor

gbraad commented Nov 18, 2020

Dup of: #1175 #1256, #1311
Solutions looked into in: #1132, #1537

Closing, as this is a known limitation, documented as 59fcb05 and has been part of the release notes for quite a while.

For CI purposes people disable UAC entirely. From the GUI this can be done as: https://articulate.com/support/article/how-to-turn-user-account-control-on-or-off-in-windows-10 or PowerShell:

PS> Set-ItemProperty -Path REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -Value 0

... but we do not promote this as it has implications:

@gbraad gbraad closed this as completed Nov 18, 2020
@gorkem
Copy link
Contributor Author

gorkem commented Nov 18, 2020

I actually looked into the docs but looked under Minimum System Requirements. Regardless this has been reported 4 times so far (perhaps more). I am a new wins user and tried crc on wins at version 1.17 for the first time and rage quit due to this error. This needs a better response on CRC, perhaps link to docs on the error and explanation on how to remediate?

When I read #1537 I do not read that it will improve the situation for windows. Will it @guillaumerose ?

@guillaumerose
Copy link
Contributor

guillaumerose commented Nov 18, 2020

#1537 will not help at first. We need to create an admin daemon #1652 and extract all the steps that the admin needs to perform in a powershell script eg:

// Activate Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

// Activate userland network stack communication
$service = New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices" -Name "00000400-FACB-11E6-BD58-64006A7986D3"
$service.SetValue("ElementName", "gvisor-tap-vsock")

// Run the admin daemon as service
something!

This script should be something we release.

After that, we need to make crc aware of this mode.

@gbraad
Copy link
Contributor

gbraad commented Nov 24, 2020

The problem for Hyper-V is that the Default Switch hands out addresses in a range using DHCP, we can't predict or pre-claim an eentry in the hosts-file. This is why we need to get the VM IP, and wwe use that to set using set-dnsclientserveraddress to force the VM to act as a nameserver.

Closing, as this is a known limitation, documented as 59fcb05 and has been part of the release notes for quite a while.

This needs a better response on CRC, perhaps link to docs on the error and explanation on how to remediate?

@robin-owen any idea how to make users more aware of this?

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
Projects
None yet
Development

No branches or pull requests

3 participants