0

So, just got a Raspberry Pi, and I'm trying to connect to it via mDNS. However, when trying to start avahi-daemon on my WSL2 kali-linux distribution

sudo service avahi-daemon start

I get

Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon failed!

I already installed avahi-daemon avahi-discover avahi-utils libnss-mdns and mdns-scan.

Also, when I run avahi-discover

Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(avahi-discover:2476): Gtk-CRITICAL **: 09:08:43.802: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider) failed
(avahi-discover:2476): Gtk-CRITICAL **: 09:08:43.802: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider) failed
(avahi-discover:2476): Gtk-CRITICAL **: 09:08:43.802: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider) failed

Not sure why this is happening, but I can try connecting to my pi a different way, just was wondering why this wouldn't work so I can fix it for the future. Thank you

3
  • Have you looked at the system logs, then? If something goes wrong with a system service, the relevant messages usually go to syslog. That's either journalctl -n 100 or tail -n 100 /var/log/syslog or something similar. (Also, do you want to use mDNS simply for hostname lookup, or do you need it for service discovery? Windows already has the former.) – user1686 Apr 5 at 13:33
  • I need it for service discovery, I'm just trying to connect to my raspberry pi headless, so I just need the IP address. I'm trying other methods, I'm just wondering why avahi doesnt work. I checked the logs, but says "No journal entries were found" – user0000 Apr 5 at 13:43
  • Check the other log locations. Different Linux distributions place them in different spots. (Also, does a raspberry pi actually come with Avahi running by default nowadays? I think they used to have networking inactive by default in the past.) – user1686 Apr 5 at 13:54
0

So, I was looking for the log files (Thank you, user1686) and wondered what would happen if I ran ```sudo avahi-daemon'''. I did it, and found a "failed to contact D-bus error". I realized the dbus daemon wasn't running and started it up. Sure enough, avahi-daemon finally started. Thank you for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.