Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seffyroff/effaf405477db5504cd2a4dda633e41a to your computer and use it in GitHub Desktop.
Save seffyroff/effaf405477db5504cd2a4dda633e41a to your computer and use it in GitHub Desktop.
Ubuntu 18.04, DBUS Fix Instructions with Troubleshooting
After asking if there were updated instructions, and promising to write it up if I could figure it out...https://www.reddit.com/r/bashonubuntuonwindows/comments/9l46br/asking_wsl_ubuntu_1804_dbus_fix_updated/
From a truly clean 18.04.1 install it should be this:
sudo apt install dbus-x11
sudo systemd-machine-id-setup
export DISPLAY=localhost:0
Once the above is set up, then things should "just work". NOT COVERED HERE IS:
You'll need an X Server installed on the Windows side.
Actual install of an X program that needs this DBUS fix.
You'll probably want to set up a nice script that allows you to start your favorite X terminal from a shortcut.
Some troubleshooting:
Is dbus and dbus-x11 installed?
blackbird:~$ apt list dbus dbus-x11
Listing... Done
dbus/bionic,now 1.12.2-1ubuntu1 amd64 [installed]
dbus-x11/bionic,now 1.12.2-1ubuntu1 amd64 [installed]
blackbird:~$
If either is not installed, install: sudo apt install dbus-x11
Note: dbus-x11 requires dbus, so apt will figure them both out.
Is dbus running? sudo service dbus status
If it is not running, try starting it: sudo service dbus start
Older instructions (for previous iterations of Windows 10 and Ubuntu) required the dbus listen directive to point to tcp:host=localhost..., and that no longer works. If you have some old change to that around (/etc/dbus-1/session.conf or /usr/share/dbus-1/session.conf), it should be set-back to default <listen>unix:tmpdir=/tmp</listen>.
Does dbus have a valid /etc/machine-id?
blackbird:~$ dbus-uuidgen --ensure=/etc/machine-id
blackbird:~$ echo $?
0
blackbird:~$
If not (an error comes up), create one: sudo systemd-machine-id-setup
Check the output of dbus-uuidgen again.
Is DISPLAY set? export DISPLAY=localhost:0 works for me.
Check on dbus again (as above).
I didn't need to, but some instructions suggest setting export LIBGL_ALWAYS_INDIRECT=1
I suspect the above may be needed for some things that try to do 3D graphics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment