# Possible to run Avahi for Samba Shares in multi-container environment?

**URL:** <https://forums.balena.io/t/possible-to-run-avahi-for-samba-shares-in-multi-container-environment/5629>\
**Category:** balenaEngine\
**Created:** [March 14, 2019, 7:49pm UTC](https://forums.balena.io/t/possible-to-run-avahi-for-samba-shares-in-multi-container-environment/5629 "2019-03-14T19:49:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drewcovi](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/drewcovi/32/1115_2.png) [@drewcovi](https://forums.balena.io/u/drewcovi)\
**Post date:** [March 14, 2019, 7:49pm UTC](https://forums.balena.io/t/possible-to-run-avahi-for-samba-shares-in-multi-container-environment/5629/1 "2019-03-14T19:49:11Z")

</div>

Seems that Avahi is used on the host for advertising SSH. Is it possible to install Avahi in a container and advertise some Samba shares as well?

Currently struggling with this setup. Seems it is blocked by dbus:

```
Found user 'avahi' (UID 102) and group 'avahi' (GID 106).
Successfully dropped root privileges.
avahi-daemon 0.6.32 starting up.
dbus_bus_get_private(): Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
WARNING: Failed to contact D-Bus daemon.
avahi-daemon 0.6.32 exiting.
```

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [March 18, 2019, 7:39pm UTC](https://forums.balena.io/t/possible-to-run-avahi-for-samba-shares-in-multi-container-environment/5629/4 "2019-03-18T19:39:11Z")

</div>

Hi, likely the best path is using the system Avahi daemon to advertise things

- you have to talk to the system Avahi daemon over the system D-Bus connection
- no need to install Avahi in the container

We have a (currently pretty old) example that might give some hints (using Python’s D-Bus libraries to talk to it, but should be workable over any other way to talk to D-Bus)

> **[balena-io-playground/balena-avahi-dbus](https://github.com/balena-io-playground/balena-avahi-dbus)**
>
> Example project announcing mDNS/Avahi services over dbus on resin.io - balena-io-playground/balena-avahi-dbus

Let us know if you have a chance to try anything like this, and we’ll be looking into bringing that project up-to-date, but should be still okay.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [March 18, 2019, 7:39pm UTC](https://forums.balena.io/t/possible-to-run-avahi-for-samba-shares-in-multi-container-environment/5629/5 "2019-03-18T19:39:19Z")

</div>

Hi, likely the best path is using the system Avahi daemon to advertise things

you have to talk to the system Avahi daemon over the system D-Bus connection

no need to install Avahi in the container

We have a (currently pretty old) example that might give some hints (using Python’s D-Bus libraries to talk to it, but should be workable over any other way to talk to D-Bus)

> **[balena-io-playground/balena-avahi-dbus](https://github.com/balena-io-playground/balena-avahi-dbus)**
>
> Example project announcing mDNS/Avahi services over dbus on resin.io - balena-io-playground/balena-avahi-dbus

  
Let us know if you have a chance to try anything like this, and we’ll be looking into bringing that project up-to-date, but should be still okay.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [March 18, 2019, 7:48pm UTC](https://forums.balena.io/t/possible-to-run-avahi-for-samba-shares-in-multi-container-environment/5629/6 "2019-03-18T19:48:03Z")

</div>

Hey @drewcovi, my colleague also brought my attention to this project, that should be another example example of publishing a service with the system Avahi, in case it’s useful:

> **[balena-io-playground/avahi-zoo-publisher](https://github.com/balena-io-playground/avahi-zoo-publisher)**
>
> Quick example of how to use an in-container Avahi instance to publish a service - balena-io-playground/avahi-zoo-publisher

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [March 18, 2019, 7:48pm UTC](https://forums.balena.io/t/possible-to-run-avahi-for-samba-shares-in-multi-container-environment/5629/7 "2019-03-18T19:48:10Z")

</div>

Hey @drewcovi, my colleague also brought my attention to this project, that should be another example example of publishing a service with the system Avahi, in case it’s useful:

> **[balena-io-playground/avahi-zoo-publisher](https://github.com/balena-io-playground/avahi-zoo-publisher)**
>
> Quick example of how to use an in-container Avahi instance to publish a service - balena-io-playground/avahi-zoo-publisher
