unsetting SESSION_MANAGER, DBUS_SESSION_BUS_ADDRESS in VNC xstartup script

2,217 views
Skip to first unread message

tim....@gmail.com

unread,
Jul 13, 2015, 11:27:40 AM7/13/15
to tigervn...@googlegroups.com
I've seen examples that say we should unset the following variables in the xstartup VNC script when starting GNOME:

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

Is this still required, in particular on Linux Mint 17 MATE (which is a GNOME 2 fork) or are these legacy requirements? What happens if these env vars are set or unset?

Thanks.

DRC

unread,
Jul 13, 2015, 2:15:49 PM7/13/15
to tigervn...@googlegroups.com
At one time, they were definitely necessary:

https://www.mail-archive.com/tigervn...@lists.sourceforge.net/msg00319.html

If you are distributing TigerVNC for a specific platform and know for a
fact that those environment variables aren't necessary anymore for that
platform, then you could of course modify the default xstartup for your
distribution, but the project as a whole still has to support a variety
of platforms, some of which definitely do require those environment
variables to be unset.

I did extensive testing across a variety of different platforms and
window managers in preparation for the TurboVNC 2.0 release (TurboVNC
also has those lines in its xstartup file), and I saw no issues. So I
think that minimally those lines are innocuous.

Ben Hildred

unread,
Jul 13, 2015, 2:33:38 PM7/13/15
to DRC, tigervn...@googlegroups.com
I would recommend in general to continue to unset them as if used they should probably have screen specific values. This is not a vnc issue per se but an issue of starting a session from a session.

--
You received this message because you are subscribed to the Google Groups "TigerVNC User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tigervnc-user...@googlegroups.com.
To post to this group, send email to tigervn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tigervnc-users/55A40053.6040409%40virtualgl.org.

For more options, visit https://groups.google.com/d/optout.



--
--
Ben Hildred
Automation Support Services

Yuri Kanivetsky

unread,
Apr 18, 2022, 5:13:57 AM4/18/22
to TigerVNC User Discussion/Support
Can you possibly explain what unsetting those variables do?

DRC

unread,
Apr 27, 2022, 6:30:20 PM4/27/22
to tigervn...@googlegroups.com

TigerVNC no longer uses xstartup or supports multiple simultaneous Xvnc sessions under the same user account, so this is no longer relevant for TigerVNC.  But I had to dig into the issue for TurboVNC 3.0, so I can definitely explain.  :)

In order to run multiple Xvnc sessions under the same user account (assuming that all of the sessions will use a reasonably modern window manager), it is necessary for each Xvnc session to have a separate D-Bus session bus instance.  On Red Hat/Fedora (and derivatives), SuSE/openSUSE, FreeBSD, and Solaris 11, xinitrc and Xsession automatically create a new session bus instance if the DBUS_SESSION_BUS_ADDRESS environment variable is empty.  This is why xstartup.turbovnc and TigerVNC's xstartup file unset that environment variable, historically speaking.

I discovered that this is insufficient on recent Debian-compatible systems (specifically Ubuntu 18.04+ and whatever the Debian equivalents are.)  On those systems, it is necessary to explicitly create a new session bus instance using dbus-launch.  (Refer to https://github.com/TurboVNC/turbovnc/blob/main/unix/xstartup.turbovnc, which should work properly for all window managers listed here: https://turbovnc.org/Documentation/Compatibility30.)

Unsetting SESSION_MANAGER is necessary if you are attempting to start an Xvnc session running GNOME/MATE from inside of an existing GNOME/MATE session.  If the X startup script does not unset SESSION_MANAGER, then the new GNOME session will pick up the value of SESSION_MANAGER from the old GNOME session, and the two sessions will interfere.

DRC

Reply all
Reply to author
Forward
0 new messages