Search code examples
debianchrootavahischroot

Use avahi in schroot (chroot) environment


I'm working on debian wheezy and use avahi to communicate with test hardware. For a renewal of the test suite I had to change to a chroot environment (jessie). Is there any possibility to find an 'avahi on chroot' solution, so that I can communicate with the test hardware as before?


Solution

  • Found a way to solve this issue:

    1. In your host machine (wheezy in my case) do:

      sudo vi /etc/schroot/default/fstab

      and add the line

      /var/run/avahi-daemon /var/run/avahi-daemon none rw,bind 0 0

    2. In the chroot environment (jessie in my case) do:

      sudo apt-get install libnss-mdns

      and

      sudo vi /etc/nsswitch.conf

      there make sure the line for the hosts looks like this:

      hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4