I am experiencing problems using wifi-connect as multi container image.
I built the image myself (not using balenacloud nor docker-compose build), the error is:
Starting WiFi Connect
Cannot get the NetworkManager service state
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: D-Bus error: Failed to connect to socket /host/run/dbus/system_bus_socket: No such file or directory (org.freedesktop.DBus.Error.FileNotFound)', /checkout/src/libcore/result.rs:906:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
the container is started with the following command, issued directly in the raspberry pi:
Can you please confirm which device you are using and the balenaOS and supervisor version running on your device?
also, from the snippets you shared, it seems you are running the container manually from the host os? is that correct? any particular reason for this workflow rather than our recommended deploy options?
Hello, yes I am running the container directly from the host OS, because I started with a disconnected balenaOS image (from the “getting started” section).
I am using the latest version of the balenaOS, running on a raspberry pi model 3 B.
I also tried the pre built balenablocks/wifi-connect image from docker hub with slightly different settings ( GitHub - balenablocks/wifi-connect: Easy WiFi setup for Linux devices from your mobile phone or laptop ), same problem: unable to access dbus socket.
Can you please try running the container as privileged and see if that works?
we can then look into additional capabilities required if any. also can you please try a more recent version? you are using 4.4.0 which is 2 years old and recent versions have security fixes
Hello, done both: privileged and version 4.4.6 as well as pre built image from balenablocks, which should be the most recent wifi-connect release.
Exactly same issue: dbus socket.
I am running the container directly from the host OS, because I started with a disconnected balenaOS image (from the “getting started” section)
can you please elaborate on this? what do you mean disconnected image? do you mean it is no showing up on your balenaCloud dashboard? do you have an account?
Yes the device is not showing up, I think this is correct since the image is not linked to any account ( I followed this guide: balenaOS - Docs ).
Yes I do have an account (personal use), so I will try with an image linked to my account and follow the standard “push” procedure and see if the problem persists.
Ok, I think I found out the problem, thanks to your advice.
joined the device to balenaCloud (balena-cli join -f org/fleet)
deployed the wifi-connect service via balenaCloud (balena-cli push fleet)
With wifi-connet service working ok, I inspected the running container and found that I should not rely on labels to mount the dbus socket, instead I had to explicitly mount it via --mount option.
So the working command is:
Again, many thanks for the support.
I want to say that using the balenaCloud service is pretty awesome, I probably don’t really need for my use case but it does solve a lot of device management tasks in a clever way.