Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I recently needed to set this up, and discovered that the trick is: <em>order matters</em> for the <code>&lt;listen&gt;</code> elements in <code>session.conf</code>. You should make sure the TCP element occurs first. Bizarre, I know, but true, at least for my case. (I see <em>exactly</em> the same black screen behavior if I reverse the order and put the UNIX socket <code>&lt;listen&gt;</code> element first.)</p> <p>Also, prepending the TCP <code>&lt;listen&gt;</code> tag is necessary, but not sufficient. To make remote D-Bus connections via TCP work, you need to do three things:</p> <ol> <li><p>Add a <code>&lt;listen&gt;</code> tag above the UNIX one, similar to this: </p> <pre><code>&lt;listen&gt;tcp:host=localhost,bind=*,port=55556,family=ipv4&lt;/listen&gt; &lt;listen&gt;unix:tmpdir=/tmp&lt;/listen&gt; </code></pre></li> <li><p>Add a line (right below the <code>&lt;listen&gt;</code> tags is fine) that says:</p> <pre><code>&lt;auth&gt;ANONYMOUS&lt;/auth&gt; </code></pre></li> <li><p>Add another line below these that says:</p> <pre><code>&lt;allow_anonymous/&gt; </code></pre></li> </ol> <p>The <code>&lt;auth&gt;</code> tag should be added in addition to any other <code>&lt;auth&gt;</code> tags that may be contained in your <code>session.conf</code>. In summary, your <code>session.conf</code> should contain a snippet that looks like this:</p> <pre><code>&lt;listen&gt;tcp:host=localhost,bind=*,port=55556,family=ipv4&lt;/listen&gt; &lt;listen&gt;unix:tmpdir=/tmp&lt;/listen&gt; &lt;auth&gt;ANONYMOUS&lt;/auth&gt; &lt;allow_anonymous/&gt; </code></pre> <p>After doing these three things, you should be able to connect to the session bus remotely. Here's how it looks when specifying a remote connection in <a href="http://live.gnome.org/DFeet/" rel="nofollow noreferrer">D-Feet</a>:</p> <p><img src="https://i.stack.imgur.com/wItSA.png" alt="D-Feet screen capture"></p> <p>Note that, if you want to connect to the system bus, too, you need to make similar changes to <code>/etc/dbus-1/system.conf</code>, but specify a <em>different</em> TCP port, for example 55557. (Oddly enough, the element order appears not to matter in this case.)</p> <p>The only weird behavior I've noticed in this configuration is that running Desktop apps with <code>sudo</code> (e.g., <code>sudo gvim</code>) tends to generate errors or fail outright saying "No D-BUS daemon running". But this is something I need to do so rarely that it hardly matters.</p> <p>If you want to send to a remote machine using <code>dbus-send</code>, you need to set <code>DBUS_SESSION_BUS_ADDRESS</code> accordingly, e.g., to something like:</p> <pre><code>export DBUS_SESSION_BUS_ADDRESS=tcp:host=localhost,bind=*,port=55556,family=ipv4 </code></pre> <p>This works even if the bus you want to send to is actually the <em>system</em> bus of the remote machine, as long as the setting matches the TCP <code>&lt;listen&gt;</code> tag in <code>/etc/dbus-1/system.conf</code> on the target. (Thanks to <a href="https://stackoverflow.com/users/684133/martin-vidner">Martin Vidner</a> for this tip. Until I stumbled across his answer to <a href="https://stackoverflow.com/questions/3944458/dbus-send-to-remote-machine">this question</a>, I didn't believe <code>dbus-send</code> supported remote operation.)</p> <p><strong>UPDATE</strong>: If you're using systemd (and want to access the system bus), you might also need to add a line saying <code>ListenStream=55557</code> to <code>/lib/systemd/system/dbus.socket</code>, like so:</p> <pre><code>[Socket] ListenStream=/var/run/dbus/system_bus_socket ListenStream=55557 # &lt;-- Add this line </code></pre> <p><strong>UPDATE2</strong>: Thanks to @altagir for pointing out that <a href="https://launchpad.net/ubuntu/+source/dbus/1.6.12-0ubuntu5" rel="nofollow noreferrer">recent versions of D-Bus</a> will enable <a href="http://wiki.apparmor.net/index.php/Main_Page" rel="nofollow noreferrer">AppArmor</a> mediation on systems where it's available, so you may also need to add <code>&lt;apparmor mode="disabled"/&gt;</code> to <code>session.conf</code>/<code>system.conf</code> for these instructions to work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload