1 On most systems you will need to setup a security policy for avahi to allow it to own the Avahi service on the system d-bus.
3 You can find an example in avahi.conf.example, this usually goes in /etc/dbus-1/system.d
4 You will need to change the username 'lathiat' to whatever username you use for testing this code (later it will be a dedicated 'avahi' user)
6 In future this stuff should be handled automatically but for now some manual setup is required.