2

I have a remote machine running on Ubuntu 18.04 with gedit installed. Every time I want to edit a text file with gedit, I got this annoying warning message:

> gedit myfile.txt

(gedit:27544): dconf-WARNING **: failed to commit changes to dconf: Error spawning command line 'dbus-launch 
--autolaunch=d7efc4b01d3c488f8221f8cd5bc3aefd --binary-syntax --close-stderr': Child process exited with code 1

How to remove this warning ?

2 Answers 2

1

I had a similar warning message (gedit:26764): dconf-WARNING **: 13:08:06.253: failed to commit changes to dconf: Failed to execute child process "dbus-launch" (No such file or directory) i solved it with dbus-run-session: dbus-run-session -- gedit <filename>. Hopefully it solves it for you, too.

Long version: I had a problem on my Raspberry Pi (Buster) when i tried to set some properties (tab size, ...) in gedit. To serve as smart meter, this raspberry is installed to be used for ssh and plain console only. I knew it also from having Problems on different machines with starting gedit leading to a 25 second timeout and not working. So we tried to start it with dbus-launch and it worked. Using dbus-launch gnome-terminal as my terminal also helped.

Reason is the missing D-Bus session daemon here. "dbus-run-session" will start it. The daemon runs until the given executable exits, thus a shell seams suitable to me.

To solve this:

  • start a new session (log off and log on with "ssh -X @host")
  • execute "export XDG_CURRENT_DESKTOP=GNOME; dbus-run-session -- bash"
  • from this shell you should be able to start gedit.

Then i was able to set the properties.

0

From man gedit:

gedit - text editor for the GNOME Desktop

The remote environment doesn't have access to a "GNOME Desktop". If you're running a "GNOME Desktop" (can run gedit locally without the message), you can share your local one.

Is gedit really the right choice for editing remote files?

There are a couple of ways to fix your problem:

A) Use the "-X" option on your ssh command, to let remote gedit access your local "GNOME Desktop".

From man ssh:

 -X      Enables X11 forwarding.  This can also be specified on a per-host basis in a
         configuration file.

         X11 forwarding should be enabled with caution.  Users with the ability to bypass
         file permissions on the remote host (for the user's X authorization database) can
         access the local X11 display through the forwarded connection.  An attacker may then
         be able to perform activities such as keystroke monitoring.

         For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions
         by default.  Please refer to the ssh -Y option and the ForwardX11Trusted directive
         in ssh_config(5) for more information.

         (Debian-specific: X11 forwarding is not subjected to X11 SECURITY extension
         restrictions by default, because too many programs currently crash in this mode.
         Set the ForwardX11Trusted option to “no” to restore the upstream behaviour.  This
         may change in future depending on client-side improvements.)

OR

B) Use a different, non-GNOME editor.

There are a plethora of editors available on Ubuntu.

There are too many to list in this response, but we can count them:

walt@bat:~(0)$ apt-cache search editor | grep -w editor | wc -l
331
walt@bat:~(0)$ apt-cache search editor  | wc -l
959
walt@bat:~(0)$ 
1
  • thanks for the answer. I actually use the -X option....
    – GuillaumeA
    Sep 20, 2018 at 20:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .