Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with dbus-launch and x11 forwarding and /etc/machine-id? #2016

Closed
tnguyen14 opened this issue Apr 27, 2017 · 18 comments
Closed

Issues with dbus-launch and x11 forwarding and /etc/machine-id? #2016

tnguyen14 opened this issue Apr 27, 2017 · 18 comments

Comments

@tnguyen14
Copy link

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.15063]

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
    I'm trying to open gnome-terminal (with X11 forwarding - I already have Xming installed), when I encountered the following error:
00:28 tri ~
:; gnome-terminal
process 4294: D-Bus library appears to be incorrectly set up; failed to read machine uuid: UUID file '/etc/machine-id' should contain a hex string of length 32, not length 0, with no other text
See the manual page for dbus-uuidgen to correct this issue.
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error spawning command line 'dbus-launch --autolaunch= --binary-syntax --close-stderr': Child process exited with code 1

When I try to launch it with dbus-launch, it works, but I still see the warning about /etc/machine-id.

:; dbus-launch gnome-terminal
process 4456: D-Bus library appears to be incorrectly set up; failed to read machine uuid: UUID file '/etc/machine-id' should contain a hex string of length 32, not length 0, with no other text
See the manual page for dbus-uuidgen to correct this issue.
  • What's wrong / what should be happening instead:
    I think there might be 2 issues here, one with dbus-launch, the other with /etc/machine-id. I'm not familiar with either.

    Could someone help me debugging through it?

@sunjoong
Copy link

@tnguyen14 - Those messages pointed you should make "/etc/machine-id" file through "dbus-uuidgen" command.

@tnguyen14
Copy link
Author

@sunjoong I tried running that, but it seems to just get erased right away

01:18 tri ~
:; dbus-uuidgen
d88a7801e574ff94989d229459017f2c
01:18 tri ~
:; gnome-terminal

** (gnome-terminal.real:794): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-aZpyqLLN96: Connection refused
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error spawning command line 'dbus-launch --autolaunch= --binary-syntax --close-stderr': Child process exited with code 1
01:18 tri ~
:; cat /etc/machine-id
01:18 tri ~
:;

@therealkenc
Copy link
Collaborator

therealkenc commented Apr 27, 2017

Gnome terminal has run out of the box on WSL for quite some time, so you've dropped a Ubuntu stitch somewhere along the way. If you start from scratch (lxrun /uninstall lxrun /install) then do:

sudo apt-get install ubuntu-desktop
export DISPLAY=localhost:0
gnome-terminal

...it should pop up. Note you'll have more joy with VcXrsv than Xming, but that isn't what is causing this problem (whatever is causing this problem).

@tnguyen14
Copy link
Author

@therealkenc I tried following your instruction of uninstalling and re-installing, then

`sudo apt install gnome-terminal
export DISPLAY=:0
gnome-terminal```

I still get the same error as described above.

I didn't not install the entire ubuntu-desktop. Do you know if that'd make a difference.

@therealkenc
Copy link
Collaborator

I didn't not install the entire ubuntu-desktop. Do you know if that'd make a difference.

It does and it doesn't. Somewhere in the behemoth that is the ubuntu-desktop meta package there is some package that populates /etc/machine-id during its postinstall script. That file is set up correctly on my system, and I didn't perform any special steps manually to make it that way. So no, you certainly don't need to install Firefox and OpenOffice to get /etc/machine-id (and a dozen other things like it) right. But then, without effort, I can't tell you the magic sequence of apt-get commands to make gnome-terminal happy either.

@tnguyen14
Copy link
Author

Seems like installing ubuntu-gnome-desktop solved this issue.

I will close this issue for now. The only remaining thing I have is this warning when I launch gnome-terminal. If anyone knows what causes that, I'd be interested.

** (gnome-terminal.real:27543): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-oMjbep53qq: Connection refused

@sunjoong
Copy link

sunjoong commented Apr 28, 2017

@tnguyen14 - Good. dbus-uuidgen --ensure=/etc/machine-id was run during their postinstall scripts.
For dbus, https://www.reddit.com/r/Windows10/comments/4rsmzp/bash_on_windows_getting_dbus_and_x_server_working/ might be hint. You might need to (re)start dbus daemon.

@tnguyen14
Copy link
Author

Thanks for the link @sunjoong.

I don't see the file /etc/dbus-1/session.conf in my WSL. I only see an empty directory /etc/dbus-1/session.d.

@sunjoong
Copy link

sunjoong commented Apr 28, 2017

@tnguyen14 - I'm using gentoo on wsl, not ubuntu, and can not remember ubuntu very well; sorry. You could better to open new issue if you need it.

@tnguyen14
Copy link
Author

tnguyen14 commented Apr 28, 2017 via email

@sunjoong
Copy link

sunjoong commented Apr 28, 2017

@tnguyen14 - Didn't you know you can use other distrubution? You can do it with WSL-Distribution-Switcher . I had not known that program then, and though had known that, I don't want to install unknown program, I did it manually; cynede/gentoo-wsl#2 .

@0x006E
Copy link

0x006E commented May 26, 2017

@tnguyen14 In Xenial I think, the file is found here. /usr/share/dbus-1/session.conf. But Now I am having the same error

@therealkenc
Copy link
Collaborator

@tnguyen14 - Up in my message here I suggested ubuntu-desktop not ubuntu-gnome-desktop. I have no idea what ubuntu-gnome-desktop might invite to the party. But you might try:

export NO_AT_BRIDGE=1

and also

sudo service dbus start

In any event, the warning is from Ubuntu's (technically Gnome's) userspace, not an error from the WSL kernel.

@ChasonDeshotel
Copy link

sudo apt-get install dbus-x11

fixed this issue for me.

@guneysus
Copy link

guneysus commented Nov 1, 2018

As @ChasonDeshotel and @therealkenc said,

installing dbus-x11 and and starting dbus service solved the problem.

sudo apt-get install dbus-x11
sudo service dbus start

@l0gicgate
Copy link

l0gicgate commented Feb 12, 2019

For those who are getting Failed to connect to socket: /tmp/dbus-xxx even after installing dbus/dbus-x11 try running the command below before trying to run your failing program:

export $(dbus-launch)

This will export the correct DBUS_SESSION_BUS_ADDRESS and DBUS_SESSION_BUS_PID

That's the only thing that worked for me after literally trying everything.

@zioalex
Copy link

zioalex commented Jan 6, 2021

For those who are getting Failed to connect to socket: /tmp/dbus-xxx even after installing dbus/dbus-x11 try running the command below before trying to run your failing program:

export $(dbus-launch)

This will export the correct DBUS_SESSION_BUS_ADDRESS and DBUS_SESSION_BUS_PID

That's the only thing that worked for me after literally trying everything.

This solved a similar problem I had in Cygwin. But I had to install dbus-x11 package before. Thanks @l0gicgate

@KoushikSahu
Copy link

For those who are getting Failed to connect to socket: /tmp/dbus-xxx even after installing dbus/dbus-x11 try running the command below before trying to run your failing program:

export $(dbus-launch)

This will export the correct DBUS_SESSION_BUS_ADDRESS and DBUS_SESSION_BUS_PID

That's the only thing that worked for me after literally trying everything.

For some reason dbus-x11 did not work correctly for me. The GUI window while using dbus-x11 used to go outside the screen. But using just the regular dbus along with export $(dbus-launch) worked perfectly for me. A little context: I am using archlinux on wslg installed by distrod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants