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

Completely empty /etc/resolv.conf #77

Open
NoaHimesaka1873 opened this issue Oct 10, 2024 · 12 comments
Open

Completely empty /etc/resolv.conf #77

NoaHimesaka1873 opened this issue Oct 10, 2024 · 12 comments

Comments

@NoaHimesaka1873
Copy link

Installed the newly-released Steam wrapper, and it complains about no internet connection. So I dug deeper and tried to access muvm shell, Much to my surprise, /etc/resolv.conf is completely empty!
Happens with systemd-resolved + Tailsacle, and NetworkManager internal DNS management + no Tailscale too.

@teohhanhui
Copy link
Collaborator

Try this command to get some more logging:

RUST_LOG='muvm=debug,muvm_guest=debug,muvm_server=debug' RUST_BACKTRACE=1 muvm -e=RUST_BACKTRACE bash

@NoaHimesaka1873
Copy link
Author

[2024-10-10T15:34:17Z DEBUG muvm] sched_setaffinity cpuset=CpuSet { cpu4, cpu5, cpu6, cpu7 }
[2024-10-10T15:34:17Z DEBUG muvm] krun_set_vm_config num_vcpus=4 ram_mib=12508
[2024-10-10T15:34:17Z DEBUG muvm::net] passing fd to passt fd=6
[2024-10-10T15:34:17Z DEBUG muvm::env] env vars env={"XAUTHORITY": "/run/user/1000/xauth_HRAaVO", "HOST_DISPLAY": ":0", "RUST_LOG": "muvm=debug,muvm_guest=debug,muvm_server=debug", "PATH": "/home/noahimesaka/.pyenv/plugins/pyenv-virtualenv/shims:/home/noahimesaka/.pyenv/shims:/home/noahimesaka/.pyenv/bin:/home/noahimesaka/.local/bin:/home/noahimesaka/.sdkman/candidates/java/current/bin:/home/noahimesaka/.sdkman/candidates/gradle/current/bin:/home/noahimesaka/.cargo/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/noahimesaka/.local/share/JetBrains/Toolbox/scripts", "RUST_BACKTRACE": "1", "MESA_LOADER_DRIVER_OVERRIDE": "asahi"}
Using default interface naming scheme 'v255'.
Failed to open /usr/lib/udev/rules.d/60-nfs.rules, ignoring: Permission denied
[2024-10-10T15:34:24Z DEBUG muvm::guest::net] dhcpcd output output=Output { status: ExitStatus(unix_wait_status(0)), stdout: "", stderr: "dhcpcd-10.0.8 starting\nDropped protocol specifier '.link' from 'eth0.link'. Using 'eth0' (ifindex=2).\nsd_bus_open_system: No such file or directory\neth0: waiting for carrier\neth0: carrier acquired\nduid_get: cannot write duid: Permission denied\nDUID 00:03:00:01:5a:94:ef:e4:0c:ee\neth0: IAID ef:e4:0c:ee\neth0: soliciting a DHCP lease\neth0: offered 172.30.1.22 from 172.30.1.254\neth0: probing address 172.30.1.22/24\neth0: leased 172.30.1.22 for infinity\ndhcp_writefile: /var/lib/dhcpcd/eth0.lease: Permission denied\neth0: adding route to 172.30.1.0/24\neth0: adding default route via 172.30.1.254\nDropped protocol specifier '.dhcp' from 'eth0.dhcp'. Using 'eth0' (ifindex=2).\nsd_bus_open_system: No such file or directory\n" }
[2024-10-10T15:34:24Z DEBUG muvm::guest::sommelier] exec command="/usr/bin/muvm-server" command_args=["bash"]
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
noahimesaka@WATATEN-An-Angel-Flew-Down-to-Me:~$ thread 'main' panicked at src/client.rs:157:60:
called `Result::unwrap()` on an `Err` value: ETIMEDOUT
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

noahimesaka@WATATEN-An-Angel-Flew-Down-to-Me:~$ exit
exit
FATAL <sommelier.cc:2963> sl_handle_x_connection_event: got error or hangup (mask 5) on X connection, exiting

@teohhanhui
Copy link
Collaborator

teohhanhui commented Oct 10, 2024

I can reproduce the problem while using dhcpcd. Looks like something broke at some point. Using dhcp-client (dhclient) seems to work (but it's deprecated...)

@NoaHimesaka1873
Copy link
Author

@teohhanhui Then is there any way to force the use of dhclient for the time being?

@teohhanhui
Copy link
Collaborator

sudo dnf swap dhcpcd dhcp-client

@stellaloveslinux
Copy link

sudo dnf swap dhcpcd dhcp-client

I did this, it installed but now when launching steam it just does invisible window and does nothing else
image

@ddxtanx
Copy link

ddxtanx commented Oct 11, 2024

I'm experiencing basically the same issue - though from the perspective of running steam and encountering a http 0 error when trying to download from cdn.steamstatic.com. When running the debug muvm command, even if I perform the right configuration with either dhcp clients the /etc/resolv.conf file inside the vm is always empty. For reference I'll include the outputs of trying to dig from the vm with either dhcp-client or dhcpcd as the dhcp backend:
dhcp-client:

[2024-10-11T02:49:56Z DEBUG muvm] sched_setaffinity cpuset=CpuSet { cpu2, cpu3, cpu4, cpu5, cpu6, cpu7, c
[2024-10-11T02:49:56Z DEBUG muvm] krun_set_vm_config num_vcpus=8 ram_mib=12451
[2024-10-11T02:49:56Z DEBUG muvm::net] passing fd to passt fd=6
[2024-10-11T02:49:56Z DEBUG muvm::env] env vars env={"MESA_LOADER_DRIVER_OVERRIDE": "asahi", "RUST_BACKTRACE": "1", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/us:/home/ddxtanx/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git:/home/ddxtanx/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/command-not-found:/home/ddxtanx/.antigen/bundles/zsh-users/zsh-completions:/home/ddxtanx/.antigen/bundles/zsh-users/zsh-syntax-highlighting:/home/ddxtanx/.antigen/bundles/MichaelAquilina/zsh-auto-notify:/home/ddxtanx/.antigen/bundles/MichaelAquilina/zsh-you-should-use:/home/ddxtanx/.antigen/bundles/aubreypwd/zsh-plugin-fd-1.0.0:/home/ddxtanx/.antigen/bundles/romkatv/powerlevel10k:/home/ddxtanx/.local/opt:/home/ddxtanx/.cargo/bin:/usr/sbin:/home/ddxtanx/.local/bin:/home/ddxtanx/go/bin", "RUST_LOG": "muvm=debug,muvm_guest=debug,muvm_server=debug", "HOST_DISPLAY": ":0"}
Couldn't get any nameserver address
No IPv4 nameserver available for DHCP
Using default interface naming scheme 'v255'.
Failed to open /usr/lib/udev/rules.d/60-nfs.rules, ignoring: Permission denied
[2024-10-11T02:49:58Z DEBUG muvm::guest::net] dhclient output output=Output { status: ExitStatus(unix_wait_status(0)), stdout: "", stderr: "" }
[2024-10-11T02:49:58Z DEBUG muvm::guest::sommelier] exec command="/usr/bin/muvm-server" command_args=["bash"]
[ddxtanx@ddxmacx ~]$ The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
dig google.com
;; communications error to 127.0.0.1#53: connection refused
;; communications error to 127.0.0.1#53: connection refused
;; communications error to 127.0.0.1#53: connection refused

; <<>> DiG 9.18.28 <<>> google.com
;; global options: +cmd
;; no servers could be reached

[ddxtanx@ddxmacx ~]$ echo "nameserver 192.168.2.2" > /etc/resolv.conf
[ddxtanx@ddxmacx ~]$ dig google.com

; <<>> DiG 9.18.28 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39675
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.   IN A

;; ANSWER SECTION:
google.com.  219 IN A 172.217.4.78

;; Query time: 10 msec
;; SERVER: 192.168.2.2#53(192.168.2.2) (UDP)
;; WHEN: Thu Oct 10 21:50:16 CDT 2024
;; MSG SIZE  rcvd: 5

dhcpcd:

[2024-10-11T02:42:11Z DEBUG muvm] sched_setaffinity cpuset=CpuSet { cpu2, cpu3, cpu4, cpu5, cpu6, cpu7, cpu8, cpu9 }
[2024-10-11T02:42:11Z DEBUG muvm] krun_set_vm_config num_vcpus=8 ram_mib=12451
[2024-10-11T02:42:11Z DEBUG muvm::net] passing fd to passt fd=6
[2024-10-11T02:42:11Z DEBUG muvm::env] env vars env={"RUST_LOG": "muvm=debug,muvm_guest=debug,muvm_server=debug", "RUST_BACKTRACE": "1", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/ddxtanx/.antigen/bundles/robbyrussell/oh-my-zsh/lib:/home/ddxtanx/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/dirhistory:/home/ddxtanx/.antigen/bundles/zsh-users/zsh-autosuggestions:/home/ddxtanx/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git:/home/ddxtanx/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/command-not-found:/home/ddxtanx/.antigen/bundles/zsh-users/zsh-completions:/home/ddxtanx/.antigen/bundles/zsh-users/zsh-syntax-highlighting:/home/ddxtanx/.antigen/bundles/MichaelAquilina/zsh-auto-notify:/home/ddxtanx/.antigen/bundles/MichaelAquilina/zsh-you-should-use:/home/ddxtanx/.antigen/bundles/aubreypwd/zsh-plugin-fd-1.0.0:/home/ddxtanx/.antigen/bundles/romkatv/powerlevel10k:/home/ddxtanx/.local/opt:/home/ddxtanx/.cargo/bin:/usr/sbin:/home/ddxtanx/.local/bin:/home/ddxtanx/go/bin", "HOST_DISPLAY": ":0", "MESA_LOADER_DRIVER_OVERRIDE": "asahi"}
Couldn't get any nameserver address
No IPv4 nameserver available for DHCP
Using default interface naming scheme 'v255'.
Failed to open /usr/lib/udev/rules.d/60-nfs.rules, ignoring: Permission denied
[2024-10-11T02:42:18Z DEBUG muvm::guest::net] dhcpcd output output=Output { status: ExitStatus(unix_wait_status(0)), stdout: "", stderr: "dhcpcd-10.0.8 starting\nDUID 00:01:00:01:2e:9b:40:81:fa:7c:50:dd:00:65\neth0: waiting for carrier\neth0: carrier acquired\neth0: IAID ef:e4:0c:ee\neth0: rebinding lease of 192.168.2.75\neth0: probing address 192.168.2.51/24\neth0: leased 192.168.2.51 for infinity\neth0: adding route to 192.168.2.0/24\neth0: adding default route via 192.168.2.1\n" }
[2024-10-11T02:42:18Z DEBUG muvm::guest::sommelier] exec command="/usr/bin/muvm-server" command_args=["bash"]
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
[ddxtanx@ddxmacx ~]$ echo "nameserver 192.168.2.2" > /etc/resolv.conf
[ddxtanx@ddxmacx ~]$ dig google.com

; <<>> DiG 9.18.28 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51992
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.   IN A

;; ANSWER SECTION:
google.com.  291 IN A 172.217.4.78

;; Query time: 40 msec
;; SERVER: 192.168.2.2#53(192.168.2.2) (UDP)
;; WHEN: Thu Oct 10 21:44:01 CDT 2024
;; MSG SIZE  rcvd: 55

(to get dhcpcd functionality, all that was necessary was to make /var/lib/dhcpcd world readable and writable, though I'm sure more fine-grained permissions could be given depending on what user the muvm process runs as.)

Unlike the above, though, no matter which dhcp client I use, no window opens up at all.

@ddxtanx
Copy link

ddxtanx commented Oct 13, 2024

As a hotfix, I've edited ~/.local/share/fex-steam/steam-launcher/bin_steam.sh to include echo "nameserver [YOUR DNS SERVER]" >> /etc/resolv.conf at the top of the file. Then steam/muvm seems to be able to connect to all links with no issue! :)

@theoparis
Copy link

theoparis commented Oct 31, 2024

Permission denied

I am encountering the same issue with dhcpcd installed.

 cannot write duid: Permission denied

The mentioned fix of adding to /etc/resolv.conf doesn't fix dhcpcd unfortunately.

@kaazoo
Copy link

kaazoo commented Nov 21, 2024

Hi, I have the same problem on Ubuntu Asahi when running a Ubuntu 24.10 based root FS:

$ RUST_LOG='muvm=trace,muvm_guest=trace,muvm_server=trace' RUST_BACKTRACE=1 LD_LIBRARY_PATH=/usr/local/lib64 muvm --passt-socket=/tmp/passt_1.socket FEXBash
[2024-11-21T23:40:02Z DEBUG muvm] sched_setaffinity cpuset=CpuSet { cpu4, cpu5, cpu6, cpu7, cpu8, cpu9, cpu10, cpu11 }
[2024-11-21T23:40:02Z DEBUG muvm] krun_set_vm_config num_vcpus=8 ram_mib=25342
[2024-11-21T23:40:02Z DEBUG muvm::env] env vars env={"XAUTHORITY": "/run/user/XXX/.mutter-Xwaylandauth.LOCWW2", "PATH": "/home/XXX/.local/bin:/home/XXX/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/XXX/.cargo/bin", "HOST_DISPLAY": ":0", "LD_LIBRARY_PATH": "/usr/local/lib64", "MESA_LOADER_DRIVER_OVERRIDE": "asahi", "RUST_LOG": "muvm=trace,muvm_guest=trace,muvm_server=trace"}
Using default interface naming scheme 'v255'.
[2024-11-21T23:40:08Z DEBUG muvm::guest::net] dhcpcd output output=Output { status: ExitStatus(unix_wait_status(0)), stdout: "", stderr: "dhcpcd-10.0.6 starting\nmkdir: cannot create directory '/var/lib/ntp': Permission denied\nDropped protocol specifier '.link' from 'eth0.link'. Using 'eth0' (ifindex=2).\nsd_bus_open_system: No such file or directory\nmkdir: cannot create directory '/var/lib/ntp': Permission denied\neth0: waiting for carrier\neth0: carrier acquired\nmkdir: cannot create directory '/var/lib/ntp': Permission denied\nduid_get: cannot write duid: Permission denied\nDUID XXX\neth0: IAID XXX\nipv6_readsecret: cannot write secret: Permission denied\neth0: ipv6_start: Permission denied\neth0: soliciting a DHCP lease\neth0: offered 192.168.1.XXX from 192.168.1.XXX\neth0: probing address 192.168.1.XXX/24\neth0: leased 192.168.1.XXX for infinity\ndhcp_writefile: /var/lib/dhcpcd/eth0.lease: Permission denied\neth0: adding route to 192.168.1.0/24\neth0: adding default route via 192.168.1.XXX\nDropped protocol specifier '.dhcp' from 'eth0.dhcp'. Using 'eth0' (ifindex=2).\nsd_bus_open_system: No such file or directory\nmkdir: cannot create directory '/var/lib/ntp': Permission denied\n" }
[2024-11-21T23:40:08Z DEBUG muvm::guest::sommelier] exec command="/usr/local/bin/muvm-server" command_args=["FEXBash"]

dhcpcd wants to create /var/lib/ntp and connect to systemd via sd_bus_open_system(), which both fails.
I'm not sure if that's actually the reason why /etc/resolv.conf is not updated.

However, muvm is installing an empty /etc/resolv.conf during VM startup in https://github.com/AsahiLinux/muvm/blob/main/crates/muvm/src/guest/mount.rs#L142 . I guess it's expected that the DHCP client overwrites this file afterwards.

As a workaround, we can also populate the file during creation already:

diff --git a/crates/muvm/src/guest/mount.rs b/crates/muvm/src/guest/mount.rs
index a816b3c..78e8f68 100644
--- a/crates/muvm/src/guest/mount.rs
+++ b/crates/muvm/src/guest/mount.rs
@@ -138,7 +138,7 @@ pub fn mount_filesystems() -> Result<()> {
         println!("Failed to mount FEX rootfs, carrying on without.")
     }
 
-    place_etc("resolv.conf", None)?;
+    place_etc("resolv.conf", Some("nameserver 9.9.9.9\n"))?;
 
     mount2(
         Some("binfmt_misc"),

This provides working DNS resolution without any other configuration in the root FS.

@teohhanhui
Copy link
Collaborator

teohhanhui commented Nov 22, 2024

I think it's fine to add that workaround (but with 1.1.1.1), provided dhclient / dhcpcd correctly overwrites it.

PR welcome.

@kaazoo
Copy link

kaazoo commented Nov 24, 2024

Please see PR here: #110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants