crc: [BUG]macOS FATA /etc/hosts is not readable/writable by the current user
General information
- OS: macOS
- Hypervisor: hyperkit
- Did you run
crc setupbefore starting it: Yes
CRC version
version: 1.0.0-beta.5+f2aa58c
CRC status
CRC VM: Stopped
OpenShift: Stopped
Disk Usage: 0B of 0B (Inside the CRC VM)
Cache Usage: 10.48GB
Cache Directory: /Users/jr00n/.crc/cache
CRC config
output is empty
Host Operating System
~ » sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G95
Steps to reproduce
- rm -rf ~/.crc
- crc setup
- crc start
Expected
starting cluster
Actual
FATA /etc/hosts is not readable/writable by the current user stops
Logs
https://gist.github.com/jr00n/9c3bc02e1fe9fdbde042dc7d5b317cfa
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 20 (9 by maintainers)
Hi @cfergeau
crcis doing it. Repro steps:Ownership and permissions of /etc/hosts (this is MacOS default):
Run
crc setup… Note the:INFO Setting file permissions for /etc/hoststhat is logged.Ownership and permissions of
/etc/hostsaftercrc setup:The ownership & permissions of system files should not be mucked with (IMHO), and the installer should prompt for creds if/when it needs them to modify system files.
@jr00n looks like we found out the bug so if you are new user of crc you are hitting it because of recent changes in the file permission. As a work around can you do following and then use the crc ?
Ah yes, of course it’s doing this. I misread your initial comment because the bug you answered to was a bug where crc failed to change these permissions. I agree with you that it’s suboptimal, but we don’t want to ask for sudo permissions at
crc starttime, we want to limit this atcrc setuptime. This is being reworked in https://github.com/code-ready/crc/pull/1136 through the use of a suid binary. And changing /etc/hosts would not be needed ifocwas built to use native macos DNS resolution APIs 😦@boomkap - I had the same issues and then got your error. I deleted the folder ~/.crc folder and went through setup again and was able to get the cluster to start