-
Notifications
You must be signed in to change notification settings - Fork 822
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
Extra chars in /etc/hosts
#9642
Comments
Thanks @elsaco, as a sanity check |
None of us have been able to repro this. If you have any clues that'd be appreciated. |
|
I'm seeing the same issue. You might be able to reproduce this issue by displaying non-printable characters, i.e. look for Windows' host file starts with the offending character and it seems like it's being appended (albeit stripped from comments) to Get lines 6-9 from /etc/hosts and display non-printable characters$ sed '6,9!d' /etc/hosts | cat -A
M-oM-;M-?$ # <FEFF>
192.168.88.254^Ihost.docker.internal$
192.168.88.254^Igateway.docker.internal$
127.0.0.1^Ikubernetes.docker.internal$ Reformat Windows' host file$ sed -f w32hosts.sed /mnt/c/Windows/System32/drivers/etc/hosts | cat -A
M-oM-;M-?$ # <FEFF>
192.168.88.254^Ihost.docker.internal$
192.168.88.254^Igateway.docker.internal$
127.0.0.1^Ikubernetes.docker.internal$ w32hosts.sed# Strip comments from
s/#.*//g
# Remove carriage returns
s/\r//g
# Remove empty lines
/^$/d
# Ensures spaces are tabulars
s/[[:space:]]/\t/g |
Is Docker Desktop to blame for this? I do not think the file normally has a BOM at all. None of the other text files in the Windows etc directory have it. |
This issue is still prevalent, any fix? |
Version
Microsoft Windows [Version 10.0.19045.2604]
WSL Version
Kernel Version
5.15.90.1
Distro Version
AlmaLinux 9.1
Other Software
No response
Repro Steps
Check system logs for
bad address at /etc/hosts
kind of message (i.e. journalctl --grep "bad address")Expected Behavior
No extra characters added to /etc/hosts
Actual Behavior
<feff>
added to /etc/hosts. Top pane show Windows' hosts file content. The bottom is WSL, Useview
to display ascat
orbat
won't show it. Notice line 6:Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: