lipponen
lipponen

Reputation: 753

Share D-BUS message bus on Linux when launching applications remotely

I'm trying to launch two applications in my server using SSH remote connection. These applications are using D-BUS message bus for communication. If I login to my server computer locally, the communication between these applications works perfectly. However when I try to launch these applications remotely, errors related to D-BUS occurs.

Is there any way to share D-BUS message bus when starting applications remotely on server computer?

My server is running on Ubuntu 12.04.

Upvotes: 2

Views: 1554

Answers (1)

lipponen
lipponen

Reputation: 753

Finally found a solution to my question.

First I needed to start ssh connection with trusted X11 forwarding enabled: ssh -2 -Y user@address

In this remote connection I started the application first application with new D-Bus: dbus-launch --autolaunch=machineID app1. Then I opened new SSH connection and also started second application together with D-Bus with the command dbus-launch --autolaunch=machineID app2. MachineID can be found from ~/.dbus/session-bus/ in Linux environment.

That is how I was able to make this two applications to use the same D-Bus message bus in remote connection.

Upvotes: 1

Related Questions