gbuday
1
Hi there, this is a follow-up to
I cannot start GUI snap applications remotely. One writes:
Unable to init server: Could not connect: Connection refused
Fatal error: exception Gtk.Error("GtkMain.init: initialization failed\nml_gtk_init: initialization failed")
another says:
X11 connection rejected because of wrong authentication.
The above linked snapcraft forum article suggests to set XAUTHORITY and linking $HOME/.Xauthority from /snap/myapp/current, but neither helped.
What should I do to make it work?
alan_g
2
What are you doing to stop it working? This works for me:
ssh -X octopull-x1c3-22-10 "sh -lc 'XAUTHORITY=~/.Xauthority ubuntu-frame'"
gbuday
3
I ssh -X into the remote machine and there I start
$ /snap/bin/myapp
apt-installed X apps do work remotely.
What is “ubuntu-frame” in the above command?
gbuday
4
Now I see. It is the GUI application. I tried it with my one and told me te first error message above again.
alan_g
5
ubuntu-frame
is a snap that I happen to have installed.
It looks like you are not setting XAUTHORITY
to “~/.Xauthority” when launching the snap.
gbuday
6
I have put an
export XAUTHORITY=/home/user/.Xauthority
line into my .bashrc, ran it. Now starting
/snap/bin/myapp
resulted in a longer wait than usual, but got the same error message as before:
Unable to init server: Could not connect: Connection refused
Fatal error: exception Gtk.Error("GtkMain.init: initialization failed\nml_gtk_init: initialization failed")
For non-snap applications my .Xauthority file works. Should I re-generate it somehow?
gbuday
7
Interestingly, gimp did start now, but not myapp.
alan_g
8
Try my snap. If that works, then the problem is your snap.
alan_g
9
OK, so other snaps work and yours doesn’t. You’ll have to work out what is different
gbuday
10
This seems to be something GTK-specific, or how my application was packaged in snap. I go with my investigations in that direction.
alan_g
11
GTK apps (e.g. Gimp) don’t have a problem running on X11: I suggest you investigate your packaging first