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

dbus issues when connecting to Ubuntu, breaking e.g. snap #3740

Closed
sliedes opened this issue Jan 18, 2023 · 4 comments
Closed

dbus issues when connecting to Ubuntu, breaking e.g. snap #3740

sliedes opened this issue Jan 18, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@sliedes
Copy link

sliedes commented Jan 18, 2023

Describe the bug

Connecting to a Ubuntu Jammy Jellyfish (22.04.1 LTS) machine, somehow the dbus settings go wrong (or right, but do not support this use case?), preventing e.g. snap programs such as firefox and chrome from starting. Most other programs still seem to work, and I don't quite understand what snap is doing here and if the environment as set by xpra is somehow incorrect.

To Reproduce

Steps to reproduce the behavior:

  1. Boot the server machine named sli-gpu (in my case, it's a VM).
  2. On the client, run xpra start ssh://sli-gpu/99 --start=gnome-terminal --keyboard-raw=yes --input-method=keep --splash=no
  3. In the gnome-terminal window that opens, run firefox
  4. Observe that the command immediately fails with the message /user.slice/user-1000.slice/session-54.scope is not a snap cgroup. Nothing is output on the client side with -d dbus.
  5. Note that the DBUS_SESSION_BUS_ADDRESS is set to a value that does not point to the "user session socket", as far as I understand it (this may be intentional on xpra's side; I don't understand the internals nor have found documentation):
sami@gpu:~$ echo $DBUS_SESSION_BUS_ADDRESS 
unix:abstract=/tmp/dbus-WKWASbKtkQ,guid=23bc01b472ca9ec2a571051963c7bf07

I do not understand where this address comes from, nor do I understand xpra and dbus deeply enough to have figured it out yet. I have tried all xpra's dbus related options (--dbus-launch=no, --dbus-proxy=yes|no, --dbus-control=yes|no), but nothing helped.

FWIW, I haven't been able to figure out using the xpra documentation what those switches exactly are for. Of --dbus-launch, I have a good guess; of --dbus-proxy, it sounds like it sets some kind of dbus endpoint (terminology?) on the client side and forwards it to the server "somehow", but I do not understand the implications of this or what it would be used for or how it should impact the bus used. It's also not clear to me if --dbus-control listens on the client or server side... (I might send a documentation patch if I figure these out.)

  1. Observe that the user dbus service is running and the socket is there:
sami@gpu:~$ systemctl status --user dbus.service
... (active (running))
sami@gpu:~$ ls -l /run/user/1000/bus 
srw-rw-rw- 1 sami sami 0 Jan 18 10:53 /run/user/1000/bus
  1. Observe that setting DBUS_SESSION_BUS_ADDRESS to point to this socket fixes the issue:
sami@gpu:~$ export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
sami@gpu:~$ firefox
[3 error messages from update.go, probably unrelated, but I provide them under Additional context.]
[firefox starts and is displayed correctly]

... but, again, I do not understand the implications of running it in the user dbus session instead of the one set up(?) by xpra.

In case it's useful information, if I connect to an Arch xpra server v4.3.3-r0 with the same command line on the same client, DBUS_SESSION_BUS_ADDRESS is set to a slightly different looking value of unix:path=/tmp/dbus-ThUwuEVKKU,guid=0f5cd6819b4e39f39e274b5463c7c2b4, i.e. it lives in the filesystem (unix:path instead of unix:abstract). I do not have snap on this server, so I don't know if it would work.

System Information (please complete the following information):

  • Server OS: Ubuntu Jammy
  • Client OS: Ubuntu Jammy (with Regolith as the WM). My keyboard layout is the one you get with setxkbmap se -variant dvorak; mentioning as this is unusual (it's also the reason I landed on --keyboard-raw=yes --input-method=keep; only with those everything seems to work for me).
  • Xpra Server Version: 5.0-r32495-1
  • Xpra Client Version: 5.0-r32495-1

Additional context

My xpra.conf:

pulseaudio=no
speaker=off
microphone=off
keyboard-raw=yes
input-method=keep
opengl=yes

For completeness, the error messages printed by starting firefox after setting DBUS_SESSION_BUS_ADDRESS:

update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/gimp/2.0/help /usr/share/gimp/2.0/help none bind,ro 0 0): cannot open directory "/var/lib": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/libreoffice/help /usr/share/libreoffice/help none bind,ro 0 0): cannot open directory "/var/lib": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/xubuntu-docs /usr/share/xubuntu-docs none bind,ro 0 0): cannot open directory "/var/lib": permission denied

xpra debug output:

sami@sli:~$ xpra start ssh://sli-gpu/99 --start=gnome-terminal --keyboard-raw=yes --input-method=keep --splash=no -d dbus
2023-01-18 10:53:42,261 debug enabled for xpra.platform.xposix.gui / ('posix', 'dbus')

(python3:500779): dbind-WARNING **: 10:53:42.290: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/buslocalhost_10.0: No such file or directory
2023-01-18 10:53:42,341 Xpra GTK3 X11 client version 5.0-r32495 (g5f3427d2a) beta 64-bit
2023-01-18 10:53:42,418  running on Linux Ubuntu 22.04 jammy
2023-01-18 10:53:42,418  window manager is 'i3'

(Xpra-Audio-query:500820): dbind-WARNING **: 10:53:42.576: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/buslocalhost_10.0: No such file or directory
2023-01-18 10:53:42,599 GStreamer version 1.20.3
2023-01-18 10:53:42,620 created unix domain socket '/run/user/1000/xpra/clients/sli-500779'
2023-01-18 10:53:42,726 No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
2023-01-18 10:53:42,865 Warning: cannot handle window transparency
2023-01-18 10:53:42,865  screen is not composited
2023-01-18 10:53:42,873 Warning: vendor 'Intel' is greylisted,
2023-01-18 10:53:42,873  you may want to turn off OpenGL if you encounter bugs
2023-01-18 10:53:42,921 Warning: window 0xffffffff changed its transparency attribute
2023-01-18 10:53:42,921  from False to True, behaviour is undefined
2023-01-18 10:53:42,934 OpenGL enabled on 'Mesa Intel(R) UHD Graphics (CML GT2)'
2023-01-18 10:53:42,935 setup_dbus_signals() system bus=<dbus._dbus.SystemBus (system) at 0x7fa453e2f5b0>
2023-01-18 10:53:42,935 bus has owner(org.freedesktop.UPower)=True
2023-01-18 10:53:42,936 listening for 'Resuming' and 'Sleeping' signals on org.freedesktop.UPower
2023-01-18 10:53:42,936 bus has owner(org.freedesktop.login1)=True
2023-01-18 10:53:42,937 listening for 'PrepareForSleep' signal on org.freedesktop.login1.Manager
2023-01-18 10:53:42,952 Connected (version 2.0, client OpenSSH_8.9p1)
2023-01-18 10:53:43,091 Authentication (publickey) successful!
2023-01-18 10:53:43,303 ssh server OS is 'linux-gnu'
2023-01-18 10:53:43,454 paramiko SSH agent forwarding enabled
2023-01-18 10:53:43,571  keyboard settings: rules=evdev, model=pc105, layout=se,us
2023-01-18 10:53:43,573  desktop size is 3840x1200:
2023-01-18 10:53:43,573   :0.0 (1016x318 mm - DPI: 96x96)
2023-01-18 10:53:43,573     HWP DP-1-2       1920x1200 at    0x0    (518x324 mm - DPI: 94x94) workarea: 1920x1200
2023-01-18 10:53:43,573     HWP DP-1-3       1920x1200 at 1920x0    (518x324 mm - DPI: 94x94) workarea: 1920x1200 at 1920x0
2023-01-18 10:53:43,697  SSH: 'Entering daemon mode; any further errors will be reported to:'
2023-01-18 10:53:43,697  SSH: "  '/run/user/1000/xpra/99/server.log'"

(python3:500779): Gdk-CRITICAL **: 10:53:43.753: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
2023-01-18 10:53:46,216 enabled remote logging
2023-01-18 10:53:46,217 Xpra X11 seamless server version 5.0
2023-01-18 10:53:46,217  running on unknown
2023-01-18 10:53:46,318 running
2023-01-18 10:53:52,001 Warning: window 0x1 changed its transparency attribute
2023-01-18 10:53:52,001  from False to True, behaviour is undefined

An observation that may be related, non-related, another bug or a non-bug: I noticed that if I have logged in to the server from gdm (or whatever the display manager is on standard installation of Ubuntu), to the standard wm of Ubuntu (is it still unity?), after that the same xpra command causes the terminal window to appear on the "physical" screen of the server. Inspecting its environment, it still says DISPLAY=:99, and starting non-gnome programs from it, such as xev, causes them to be forwarded to the client side.

Output from xpra showconfig:

sami@sli:~$ xpra showconfig
add-printer-options            = '-u allow:$USER', '-E', '-o printer-is-shared=false'
attach                         = auto
auth                           = 
auto-refresh-delay             = 0.15
av-sync                        = True
bandwidth-detection            = False
bandwidth-limit                = 'auto'
bell                           = True
bind                           = 'auto'
bind-quic                      = 
bind-rfb                       = 
bind-ssh                       = 
bind-ssl                       = 
bind-tcp                       = 
bind-vsock                     = 
bind-ws                        = 
bind-wss                       = 
border                         = 'auto,5:off'
challenge-handlers             = 'all'
chdir                          = ''
client-socket-dirs             = '/run/user/1000/xpra/clients'
clipboard                      = 'yes'
clipboard-direction            = 'both'
clipboard-filter-file           = ''
compression_level              = 1
compressors                    = 'none', 'lz4', 'zlib', 'brotli'
csc-modules                    = 'all'
cursors                        = True
daemon                         = True
dbus-control                   = True
dbus-launch                    = 'dbus-launch --sh-syntax --close-stderr'
dbus-proxy                     = True
debug                          = ''
delay-tray                     = False
desktop-fullscreen             = False
desktop-scaling                = 'on'
display                        = ''
displayfd                      = 0
download-path                  = '~/Downloads'
dpi                            = 0
encoding                       = 'auto'
encodings                      = 'all'
encryption                     = ''
encryption-keyfile             = ''
env                            = 
exec-wrapper                   = ''
exit-ssh                       = True
exit-with-children             = False
exit-with-client               = False
exit-with-windows              = False
fake-xinerama                  = 'no'
file-size-limit                = '100M'
file-transfer                  = 'auto'
forward-xdg-open               = auto
gid                            = 1000
headerbar                      = 'auto'
html                           = 'auto'
http-scripts                   = 'all'
idle-timeout                   = 0
input-devices                  = 'auto'
input-method          (used)   = 'keep'                            <class 'str'>
input-method         (default) = 'auto'                            <class 'str'>
key-shortcut                   = 'Control+Menu:toggle_keyboard_grab', 'Shift+Menu:toggle_pointer_grab', 'Shift+F11:toggle_fullscreen', '#+F1:show_menu', '#+F2:show_start_new_command', '#+F3:show_bug_report', '#+F4:quit', '#+F5:show_window_info', '#+F6:show_shortcuts', '#+F7:show_docs', '#+F8:toggle_keyboard_grab', '#+F9:toggle_pointer_grab', '#+F10:magic_key', '#+F11:show_session_info', '#+F12:toggle_debug', '#+plus:scaleup', '#+minus:scaledown', '#+underscore:scaledown', '#+KP_Add:scaleup', '#+KP_Subtract:scaledown', '#+KP_Multiply:scalereset', '#+bar:scalereset', '#+question:scalingoff'
keyboard-layout                = ''
keyboard-layouts               = 
keyboard-options               = ''
keyboard-raw          (used)   = True                              <class 'bool'>
keyboard-raw         (default) = False                             <class 'bool'>
keyboard-sync                  = True
keyboard-variant               = ''
keyboard-variants              = 
local-clipboard                = 'CLIPBOARD'
lock                           = auto
log-dir                        = 'auto'
log-file                       = 'server.log'
lpadmin                        = '/usr/sbin/lpadmin'
lpinfo                         = '/usr/sbin/lpinfo'
max-size                       = ''
mdns                           = True
microphone                     = 'off'
microphone-codec               = 
min-port                       = 1024
min-quality                    = 1
min-size                       = ''
min-speed                      = 1
mmap                           = 'yes'
mmap-group                     = 'auto'
modal-windows                  = False
mousewheel                     = 'on'
notifications                  = True
open-command                   = '/usr/bin/xdg-open'
open-files                     = 'auto'
open-url                       = 'auto'
opengl                (used)   = 'yes'                             <class 'str'>
opengl               (default) = 'probe'                           <class 'str'>
packet-encoders                = 'rencodeplus', 'rencode', 'bencode', 'yaml'
password                       = ''
password-file                  = 
pdf-printer           (used)   = ''                                <class 'str'>
pdf-printer          (default) = '/usr/share/ppd/cupsfilters/Generic-PDF_Printer-PDF.ppd'  <class 'str'>
pidfile                        = '${XPRA_SESSION_DIR}/server.pid'
pings                          = 5
pixel-depth                    = 0
postscript-printer    (used)   = ''                                <class 'str'>
postscript-printer   (default) = 'drv:///sample.drv/generic.ppd'   <class 'str'>
printing                       = 'yes'
proxy-start-sessions           = True
proxy-video-encoders           = 'none'
pulseaudio            (used)   = False                             <class 'bool'>
pulseaudio           (default) = auto                              <class 'NoneType'>
pulseaudio-command             = 'pulseaudio --start -n --daemonize=false --system=false --exit-idle-time=-1 --load=module-suspend-on-idle '--load=module-null-sink sink_name="Xpra-Speaker" sink_properties=device.description="Xpra\ Speaker"' '--load=module-null-sink sink_name="Xpra-Microphone" sink_properties=device.description="Xpra\ Microphone"' '--load=module-native-protocol-unix socket=$XPRA_PULSE_SERVER' --load=module-dbus-protocol --load=module-x11-publish --log-level=2 --log-target=stderr --enable-memfd=no'
pulseaudio-configure-commands           = 'pactl set-default-sink Xpra-Speaker', 'pactl set-default-source Xpra-Microphone.monitor'
quality                        = 0
quic-auth                      = 
readonly                       = False
reconnect                      = True
refresh-rate                   = 'auto'
remote-clipboard               = 'CLIPBOARD'
remote-logging                 = 'both'
remote-xpra                    = 'xpra', '$XDG_RUNTIME_DIR/xpra/run-xpra', '/usr/local/bin/xpra', '~/.xpra/run-xpra', 'Xpra_cmd.exe'
resize-display                 = 'yes'
rfb-auth                       = 
rfb-upgrade                    = 5
server-idle-timeout            = 0
session-name                   = ''
sessions-dir                   = '$XDG_RUNTIME_DIR/xpra'
sharing                        = auto
shortcut-modifiers             = 'auto'
socket-dir                     = ''
socket-dirs           (used)   = '/run/user/$UID/xpra', '/run/xpra', '~/.xpra'  <class 'list'>
socket-dirs          (default) = '/run/user/1000/xpra', '/run/xpra', '~/.xpra'  <class 'list'>
socket-permissions             = '600'
sound-source                   = ''
source                         = '/etc/profile'
source-start                   = 
speaker               (used)   = 'off'                             <class 'str'>
speaker              (default) = 'on'                              <class 'str'>
speaker-codec                  = 
speed                          = 0
splash                         = auto
ssh                            = 'auto'
ssh-auth                       = 
ssh-upgrade                    = True
ssl                            = 'auto'
ssl-auth                       = 
ssl-ca-certs                   = 'default'
ssl-ca-data                    = ''
ssl-cert                       = ''
ssl-check-hostname             = True
ssl-ciphers                    = 'DEFAULT'
ssl-client-verify-mode           = 'optional'
ssl-key                        = ''
ssl-key-password               = ''
ssl-options                    = 'ALL,NO_COMPRESSION'
ssl-protocol                   = 'TLSv1_2'
ssl-server-hostname            = ''
ssl-server-verify-mode           = 'required'
ssl-verify-flags               = 'X509_STRICT'
start                          = 
start-after-connect            = 
start-child                    = 
start-child-after-connect           = 
start-child-late               = 
start-child-on-connect           = 
start-child-on-last-client-exit           = 
start-env                      = '#avoid Ubuntu's global menu, which is a mess and cannot be forwarded:', 'UBUNTU_MENUPROXY=', 'QT_X11_NO_NATIVE_MENUBAR=1', '#fix for MainSoft's MainWin buggy window management:', 'MWNOCAPTURE=true', 'MWNO_RIT=true', 'MWWM=allwm', '#force GTK3 applications to use X11 so we can intercept them:', 'GDK_BACKEND=x11', '#force Qt applications to use X11 so we can intercept them:', 'QT_QPA_PLATFORM=xcb', '#disable Qt scaling:QT_AUTO_SCREEN_SET_FACTOR=0', 'QT_SCALE_FACTOR=1', '#overlay scrollbars complicate things:GTK_OVERLAY_SCROLLING=0', '#some versions of GTK3 honour this option, sadly not all:', 'GTK_CSD=0', '#silence some AT-SPI and atk-bridge warnings:', 'NO_AT_BRIDGE=1'
start-late                     = 
start-new-commands             = True
start-on-connect               = 
start-on-last-client-exit           = 
start-via-proxy                = False
sync-xvfb             (used)   = False                             <class 'bool'>
sync-xvfb            (default) =                                   <class 'NoneType'>
system-proxy-socket            = '/run/xpra/system'
system-tray                    = True
systemd-run                    = 'auto'
systemd-run-args               = ''
tcp-auth                       = 
tcp-encryption                 = ''
tcp-encryption-keyfile           = ''
terminate-children             = False
title                          = '@title@ on @hostinfo@'
tray                           = True
tray-icon                      = ''
uid                            = 1000
use-display                    = 'auto'
username                       = 'sami'
video-decoders                 = 'all'
video-encoders                 = 'all'
video-scaling                  = 'auto'
vsock-auth                     = 
webcam                         = 'auto'
window-close                   = 'auto'
window-icon                    = ''
windows                        = True
wm-name                        = 'Xpra'
ws-auth                        = 
wss-auth                       = 
xsettings                      = 'auto'
xvfb                  (used)   = 'Xvfb +extension GLX +extension Composite -screen 0  8192x4096x24+32 -nolisten tcp -noreset -auth $XAUTHORITY  -dpi 96x96'  <class 'str'>
xvfb                 (default) = 'Xvfb +extension GLX +extension Composite -screen 0 8192x4096x24+32 -nolisten tcp -noreset -auth $XAUTHORITY -dpi 96x96'  <class 'str'>

server.log:

sami@gpu:~$ cat /run/user/1000/xpra/99/server.log 
2023-01-18 11:17:04,994 no uinput module (not usually needed)
2023-01-18 11:17:06,172 pointer device emulation using XTest
2023-01-18 11:17:06,214 serving html content from '/usr/share/xpra/www'
2023-01-18 11:17:06,215 wrote pid 4316 to '/run/user/1000/xpra/99/server.pid'
2023-01-18 11:17:06,226 created unix domain socket '/run/user/1000/xpra/gpu-99'
2023-01-18 11:17:06,226 cannot create group socket '/run/xpra/gpu-99'
2023-01-18 11:17:06,226  [Errno 13] Permission denied
2023-01-18 11:17:06,226 created unix domain socket '/home/sami/.xpra/gpu-99'
2023-01-18 11:17:06,226 created unix domain socket '/run/user/1000/xpra/99/socket'
2023-01-18 11:17:06,226 xvfb pid=4319
2023-01-18 11:17:06,250 D-Bus notification forwarding is available
2023-01-18 11:17:06,259 pulseaudio server started with pid 4346
2023-01-18 11:17:06,259  private server socket path:
2023-01-18 11:17:06,259  '/run/user/1000/xpra/99/pulse/pulse/native'
2023-01-18 11:17:06,301 watching for applications menu changes in:
2023-01-18 11:17:06,301  '/usr/share/applications'
2023-01-18 11:17:06,301  '/var/lib/snapd/desktop/applications'
2023-01-18 11:17:06,307 Warning: webcam forwarding is disabled
2023-01-18 11:17:06,307  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2023-01-18 11:17:06,307  make sure that the 'v4l2loopback' kernel module is installed and loaded
2023-01-18 11:17:06,307  or use the 'webcam=no' option
2023-01-18 11:17:06,307 found 0 virtual video devices for webcam forwarding
2023-01-18 11:17:06,408 waiting for initialization thread to complete
2023-01-18 11:17:06,408 xpra is ready.
2023-01-18 11:17:06,442 GStreamer version 1.20.3
2023-01-18 11:17:06,545 New socket connection received
2023-01-18 11:17:06,546  on '/home/sami/.xpra/gpu-99'
2023-01-18 11:17:06,638 New socket connection received
2023-01-18 11:17:06,638  on '/home/sami/.xpra/gpu-99'
2023-01-18 11:17:06,647 Handshake complete; enabling connection
2023-01-18 11:17:06,792 Error setting up the pipeline:
2023-01-18 11:17:06,792  gst_parse_error: no element "vaapih264enc" (1)
2023-01-18 11:17:06,792  GStreamer pipeline for:
2023-01-18 11:17:06,792   appsrc name=src emit-signals=1 block=0 is-live=1 stream-type=0 format=4 caps=video/x-raw,width=64,height=64,format=(string)I420,framerate=60/1,interlace=progressive ! \
2023-01-18 11:17:06,792   videoconvert ! \
2023-01-18 11:17:06,792   vaapih264enc max-bframes=0 tune=3 compliance-mode=1 prediction-type=1 ! \
2023-01-18 11:17:06,792   appsink name=sink emit-signals=true max-buffers=10 drop=true sync=false async=false qos=false
2023-01-18 11:17:06,792 Warning: gstreamer encoder testing failed with h264:
2023-01-18 11:17:06,792  failed to setup gstreamer pipeline
2023-01-18 11:17:06,885 Python/GTK3 Linux Ubuntu 22.04 jammy x11 client version 5.0
2023-01-18 11:17:06,885  connected as 'sami'
2023-01-18 11:17:06,885  OpenGL is enabled with Mesa IntelR UHD Graphics CML GT2
2023-01-18 11:17:06,917 setting key repeat rate from client: 500ms delay / 30ms interval
2023-01-18 11:17:06,921 setting keymap: rules=evdev, model=pc105, layout=se,us, options=compose:caps, variant=dvorak,
2023-01-18 11:17:06,947  client root window size is 3840x1200
2023-01-18 11:17:06,947   :0.0 (1016x318 mm - DPI: 96x96)
2023-01-18 11:17:06,947     HWP DP-1-2       1920x1200 at    0x0    (518x324 mm - DPI: 94x94) workarea: 1920x1200
2023-01-18 11:17:06,947     HWP DP-1-3       1920x1200 at 1920x0    (518x324 mm - DPI: 94x94) workarea: 1920x1200 at 1920x0
2023-01-18 11:17:07,298 loaded 38 start menu entries from 7 sub-menus in 1.0 seconds
2023-01-18 11:17:07,299 xpra X11 seamless version 5.0-r32495 (g5f3427d2a) beta 64-bit
2023-01-18 11:17:07,300  uid=1000 (sami), gid=1000 (sami)
2023-01-18 11:17:07,300  running with pid 4316 on Linux Ubuntu 22.04 jammy
2023-01-18 11:17:07,454 server virtual display now set to 3840x1200
2023-01-18 11:17:07,461  connected to X11 display :99 with 24 bit colors
2023-01-18 11:17:07,461 DPI set to 96 x 96
2023-01-18 11:17:07,480 client   1 @03.803 Xpra X11 seamless server version 5.0
2023-01-18 11:17:07,481 client   1 @03.804  running on unknown
2023-01-18 11:17:07,583 client   1 @03.911 running
2023-01-18 11:17:09,982 Warning: not adding duplicate printer 'HP_LaserJet_M203dw_7D3D62'
2023-01-18 11:17:09,982 Warning: not adding duplicate printer 'PDF'
2023-01-18 11:17:11,832 printer forwarding enabled using postscript and pdf
2023-01-18 11:17:11,833 started command `gnome-terminal` with pid 4452
2023-01-18 11:17:11,838 62.8GB of system memory
2023-01-18 11:17:12,182 OpenGL is supported on display ':99'
2023-01-18 11:17:12,182  using 'llvmpipe (LLVM 13.0.1, 128 bits)' renderer
2023-01-18 11:17:12,182  automatic picture encoding enabled, also available:
2023-01-18 11:17:12,182   h264, vp9, vp8, png, png/P, png/L, webp, rgb24, rgb32, jpeg, jpega, av1, mpeg1, mpeg2, scroll
2023-01-18 11:17:13,219 client   1 @09.546 Warning: window 0x1 changed its transparency attribute
2023-01-18 11:17:13,219 client   1 @09.546  from False to True, behaviour is undefined

xpra-info full output; here's the parts that are, to me, not clearly about something else:

dbus.env.DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-1GuiPZ9sfh,guid=fa95282d9763c7f26f895f3563c7c722
dbus.env.DBUS_SESSION_BUS_PID=4329
dbus.env.DBUS_SESSION_BUS_WINDOWID=2097153
dbus.pid=4329
env.CKCON_X11_DISPLAY=:99
env.DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-1GuiPZ9sfh,guid=fa95282d9763c7f26f895f3563c7c722
env.DBUS_SESSION_BUS_PID=4329
env.DBUS_SESSION_BUS_WINDOWID=2097153
env.DISPLAY=:99
env.GDK_BACKEND=x11
env.GDK_DPI_SCALE=1
env.GDK_SCALE=1
env.GTK_CSD=0
env.HOME=/home/sami
env.NO_AT_BRIDGE=1
env.PATH=/usr/libexec/xpra:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
env.PULSE_SERVER=unix:/run/user/1000/xpra/99/pulse/pulse/native
env.PWD=/
env.SHELL=/bin/bash
env.SHLVL=0
env.SSH_AGENT_UUID=0d0fc22934eed874f646e16aeeb40143210be60615e6da7ba7e43849de0ce8e1
env.SSH_AUTH_SOCK=/run/user/1000/xpra/99/ssh/agent
env.USER=sami
env.XAUTHORITY=/home/sami/.Xauthority
env.XDG_CURRENT_DESKTOP=Xpra
env.XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop
env.XDG_RUNTIME_DIR=/run/user/1000
env.XDG_SESSION_CLASS=user
env.XDG_SESSION_TYPE=x11
env.XPRA_LOG_DIR=/run/user/1000/xpra/99
env.XPRA_PROXY_START_UUID=da341e5d73854003bcef24791c42d0d0
env.XPRA_PULSE_SERVER=/run/user/1000/xpra/99/pulse/pulse/native
env.XPRA_PULSE_SINK_DEVICE_NAME=Xpra-Microphone
env.XPRA_PULSE_SOURCE_DEVICE_NAME=Xpra-Speaker
env.XPRA_SERVER_LOG=/run/user/1000/xpra/99/server.log
env.XPRA_SERVER_SOCKET=/run/user/1000/xpra/gpu-99
env.XPRA_SESSION_DIR=/run/user/1000/xpra/99
features.connection-data=True
features.dbus_proxy=True
features.rpc-types=('dbus',)
features.server-commands-info=True
features.server-commands-signals=('SIGINT', 'SIGTERM', 'SIGHUP', 'SIGKILL', 'SIGUSR1', 'SIGUSR2')
features.sharing=True
features.shell=True
server.argv=('/usr/bin/xpra', 'seamless', ':99', '--keyboard-raw=yes', '--input-method=keep', '--splash=no', '--start=gnome-terminal', '--env=SSH_AGENT_UUID=0d0fc22934eed874f646e16aeeb40143210be60615e6da7ba7e43849de0ce8e1', '--env=XPRA_PROXY_START_UUID=da341e5d73854003bcef24791c42d0d0', '--daemon=yes', '--systemd-run=no')
server.display=:99
server.hostname=gpu
server.idle-timeout=0
server.log-file=/run/user/1000/xpra/99/server.log
server.pidfile.path=/run/user/1000/xpra/99/server.pid
@sliedes sliedes added the bug Something isn't working label Jan 18, 2023
@totaam
Copy link
Collaborator

totaam commented Jan 18, 2023

unix:abstract=/tmp/dbus-WKWASbKtkQ,guid=23bc01b472ca9ec2a571051963c7bf07
I do not understand where this address comes from

By default, xpra will use dbus-launch to start a new dbus daemon and configure the environment of the xpra session to point to it.
This can be turned off with the --dbus-launch=no command line option.
That's why you should always launch applications with xpra --start=app or indirectly via a terminal launched using --start=, and not using DISPLAY=:NUMBER app.

I have a good guess; of --dbus-proxy, it sounds like it sets some kind of dbus endpoint (terminology?)

This allows the xpra client to forward some dbus calls to the dbus session running on the server.
This is rarely used and never needed.

It's also not clear to me if --dbus-control listens on the client or server side...

Server side.

Observe that the user dbus service is running and the socket is there:

That's not the one that should be used by the xpra session.

Observe that setting DBUS_SESSION_BUS_ADDRESS to point to this socket fixes the issue:

This should be avoided as this will pollute your desktop's dbus session with the applications running in your xpra sessions, potentially creating conficts, and definitely causing problems for the applications using dbus in your xpra session if your main desktop session is terminated before them.

after that the same xpra command causes the terminal window to appear on the "physical" screen of the server

I'm not sure I understand / guess the commands involved.
Some applications like browsers and some Gnome applications will launch new windows / tabs on the same display as the first instance launched instead of honouring the DISPLAY environment variable. That's a "feature" they say.

As to your overall question about dbus, I would advise you to use a different distribution to avoid such problems. I don't see these problems on Fedora, but then again, I don't use snap either..

@sliedes
Copy link
Author

sliedes commented Jan 19, 2023

By default, xpra will use dbus-launch to start a new dbus daemon and configure the environment of the xpra session to point to it. This can be turned off with the --dbus-launch=no command line option. That's why you should always launch applications with xpra --start=app or indirectly via a terminal launched using --start=, and not using DISPLAY=:NUMBER app.
[...]
This should be avoided as this will pollute your desktop's dbus session with the applications running in your xpra sessions, potentially creating conficts, and definitely causing problems for the applications using dbus in your xpra session if your main desktop session is terminated before them.

Thanks for the explanations, this already clarifies quite a bit!

after that the same xpra command causes the terminal window to appear on the "physical" screen of the server

I'm not sure I understand / guess the commands involved. Some applications like browsers and some Gnome applications will launch new windows / tabs on the same display as the first instance launched instead of honouring the DISPLAY environment variable. That's a "feature" they say.

Yes, I figured out that's most likely what's happening here. This only happens, though, if I have logged in physically in that machine, and I generally don't need to do that.

As to your overall question about dbus, I would advise you to use a different distribution to avoid such problems. I don't see these problems on Fedora, but then again, I don't use snap either..

That would certainly be a solution. I guess I can read this as you not having much insight on what might go wrong here with snap, and probably not much motivation to figure out. I can sympathize with that, especially seeing that Ubuntu has generated quite a bit of grief for xpra.

Huh, I forgot to attach the error message printed by firefox or any other snap program. I'm terribly sorry for that; I was sure I had mentioned what I found online. It's /user.slice/user-1000.slice/session-85.scope is not a snap cgroup.

There's some discussion of something probably closely related here, which I understand like 50%: https://forum.snapcraft.io/t/cannot-launch-snap-applications-with-cgroup-v2/27700

"Snap run attempts to create a separate scope (a cgroup actually) for the application by talking to org.freedesktop.systemd1.Manager over session bus. In your case, the session bus is unavailable, so a separate cgroup cannot be created thus it is not possible to set up device access rules or identify processes belonging to a snap."

In our case, it's not unavailable, but I guess that systemd1.Manager might not be there? But I haven't figured out what should create that, i.e. if the session needs to be created in some specific way (--systemd-run=yes certainly doesn't help with this).

@totaam
Copy link
Collaborator

totaam commented Jul 4, 2023

/user.slice/user-1000.slice/session-85.scope is not a snap cgroup

@sliedes Try starting your server with --systemd-run=no (this may not work with a remote ssh start)

@totaam
Copy link
Collaborator

totaam commented Oct 19, 2023

Closing as there are not issues with tier-1 platforms: https://github.com/Xpra-org/xpra/wiki/Platforms

@totaam totaam closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants