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

x11docker xpra and android #204

Closed
twyeld opened this issue Dec 5, 2019 · 49 comments
Closed

x11docker xpra and android #204

twyeld opened this issue Dec 5, 2019 · 49 comments

Comments

@twyeld
Copy link

twyeld commented Dec 5, 2019

I have successfully installed jksiezni's xpra-client on my android device and I can connect to a x11docker session which launches a xterm on my ubuntu server but i cannot access the xterm from the android device. It looks like the client resolution is too high? I have tried setting resolution using xrandr but it seems to be ignored.

How to get xterm visible on Android device?

I would have posed this question to jksiezni but he/she seems to be offline since 2017.

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

It seems there is no official xpra client for android.

Can you show me what you have done?

  • Command setup of x11docker and xpra server.
  • Output of xpra server with option --daemon=no
  • Output of xpra client on android

It looks like the client resolution is too high? I have tried setting resolution using xrandr but it seems to be ignored.

I don't entirely understand the problem. However, you can specify the screen size in x11docker with e.g. --size 1024x768.

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

#! /bin/bash
read Xenv < <(x11docker --xorg --gpu --display=9999 --xtest --no-auth --showenv nvidia-base-game-app-xorg-gl xterm)
env $Xenv xpra start :9999 --start="xrandr -s 1024x768" --use-display --start-via-proxy=no --daemon=no --bind-tcp=0.0.0.0:10000

this what I used
I will try your suggestion --size 1024x768 in the x11docker field

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

I will try your suggestion --size 1024x768 in the x11docker field

Try to provide the resolution of your android display.
For further debugging, please show me the terminal outputs.

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

android res: 1440x2392

here is the entire terminal output:

twyeld@twyeld2:~$ cd '/home/twyeld/vnc/withUnity_xorg' 
twyeld@twyeld2:~/vnc/withUnity_xorg$ ./script
x11docker note: Option --xtest: experimental only.

x11docker WARNING: User twyeld is member of group docker.
  That allows unprivileged processes on host to gain root privileges.

x11docker WARNING: Your configuration seems not to allow to start
  a second core Xorg server from within X. Option --xorg may fail.
  (Per default, only root or console users are allowed to run an Xorg server).

  Possible solutions:
  1.) Install one of nested X servers 'Xephyr', 'Xnest' or 'nxagent'.
      For --gpu support: install 'weston' and 'Xwayland'.
  2.) Switch to console tty1...tty6 with <CTRL><ALT><F1>...<F6>
      and start x11docker there.
  3.) Run x11docker as root.
  4.) Edit file '/etc/X11/Xwrapper.config' and replace line:
          allowed_users=console
      with lines
          allowed_users=anybody
          needs_root_rights=yes
      If the file does not exist already, you can create it.
      On Ubuntu 16.04 and debian 9 you need package xserver-xorg-legacy.

x11docker note: Option --xorg: x11docker assumes that you need
  a window manager. If you don't want this, run with option --desktop. 
  Enabling option --wm to provide a window manager.

x11docker WARNING: Option --gpu degrades container isolation.
  Container gains access to GPU hardware.
  This allows reading host window content (palinopsia leak)
  and GPU rootkits (compare proof of concept: jellyfish).

x11docker note: You are using proprietary closed source NVIDIA driver.
  GPU acceleration will only work if you have installed the very same driver
  version in image. That makes images less portable.
  It is recommended to use free open source nouveau driver on host instead.
  Ask NVIDIA corporation to at least publish their closed source API,
  or even better to actively support open source driver nouveau.

x11docker note: x11docker can try to automatically install NVIDIA driver
  version 418.56 in container on every container startup.
  Drawbacks: Container startup is a bit slower and its security will be reduced.

  You can look here for a driver installer:
    https://www.nvidia.com/Download/index.aspx
    https://http.download.nvidia.com/
  A direct download URL is probably:
    https://http.download.nvidia.com/XFree86/Linux-x86_64/418.56/NVIDIA-Linux-x86_64-418.56.run
  If you got a driver, store it at one of the following locations:
    /home/twyeld/.local/share/x11docker/
    /usr/local/share/x11docker/

  Be aware that the version number must match exactly the version on host.
  The file name must begin with 'NVIDIA', contain the version number 418.56
  and end with suffix '.run'.

x11docker note: Current X server :1 runs on tty 3.
  Access it with [CTRL][ALT][F3].

x11docker note: New Xorg server  will run on tty 8.
  Access it with [CTRL][ALT][F8].

x11docker WARNING: On debian 9, switching often between multiple X servers can
  cause a crash of one X server. This bug may be debian specific and is probably
  some sort of race condition. If you know more about this or it occurs on
  other systems, too, please report at https://github.com/mviereck/x11docker.

  You can avoid this issue with switching to a black tty before switching to X.

x11docker WARNING: Option --no-auth: SECURITY RISK!
  Allowing access to new X server for everyone.

x11docker WARNING: Did not disable X extension XTEST
  for X server --xorg.
  If your host window manager container can start applications
  on its own (for example with a context menu), container applications
  can abuse this to run and remotely control host applications.
  If you provide content of X server --xorg over network to others,
  they may take control over your host system!

x11docker WARNING: Sharing device file: /dev/dri

x11docker WARNING: Sharing device file: /dev/nvidia0

x11docker WARNING: Sharing device file: /dev/nvidiactl

x11docker WARNING: Sharing device file: /dev/nvidia-modeset

x11docker WARNING: Sharing device file: /dev/nvidia-uvm

x11docker WARNING: Sharing device file: /dev/nvidia-uvm-tools

x11docker WARNING: Sharing device file: /dev/vga_arbiter

x11docker WARNING: --xorg: X server :9999 runs without cookie authentication.

x11docker note: Will try to set native resolution 1024x768.
  If that looks ugly, use --scale=1 to enforce a fake scaled resolution.

x11docker note: Option --wm: Did not find window manager image
      x11docker/openbox
  to provide a containerized window manager. Please run:
      docker pull x11docker/openbox
  If you want to use a host window manager instead and avoid this warning,
  use option                         --wm=host  or  --wm=COMMAND
  or provide a local image with e.g. --wm=x11docker/lxde
  To run without a window manager:   --wm=none  or  --desktop
  Fallback: Will try to run a host window manager: mutter

x11docker note: Option --wm: Starting host window manager: mutter

/home/twyeld/.cache/x11docker/nvidia-base-game-app-xorg-gl-3154045/dockerrc: line 399:  5250 Segmentation fault      (core dumped) env DISPLAY=:9999 XSOCKET=/tmp/.X11-unix/X9999 X11DOCKER_CACHE=/home/twyeld/.cache/x11docker/nvidia-base-game-app-xorg-gl-3154045 mutter >> /home/twyeld/.cache/x11docker/nvidia-base-game-app-xorg-gl-3154045/xinit.log 2>&1
x11docker WARNING: Unable to change /etc/passwd. That may be a security risk.

2019-12-06 22:25:50,358 created unix domain socket: /run/user/1000/xpra/twyeld2-9999
2019-12-06 22:25:50,359 cannot create group socket '/run/xpra/twyeld2-9999'
2019-12-06 22:25:50,359  [Errno 13] Permission denied
x11docker WARNING: Cannot change /etc/shadow. That may be a security risk.

x11docker note: Failed to add container user to group video.

x11docker note: Failed to add container user to group audio.

x11docker note: Failed to add container user to group render.

2019-12-06 22:25:50,493 Warning: no XShm support on display :9999
2019-12-06 22:25:50,983 pointer device emulation using XTest
2019-12-06 22:25:53,333  OpenGL is supported on this display
2019-12-06 22:25:53,371 html server unavailable, cannot find websockify module
2019-12-06 22:25:53,565 Warning: cannot forward notifications, the interface is already claimed
2019-12-06 22:25:53,566  if you do not have a dedicated dbus session for this xpra instance,
2019-12-06 22:25:53,566  use the 'notifications=no' option
2019-12-06 22:25:53,913 Warning: webcam forwarding is disabled
2019-12-06 22:25:53,913  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2019-12-06 22:25:53,913  make sure that the 'v4l2loopback' kernel module is installed and loaded
2019-12-06 22:25:53,913 found 0 virtual video devices for webcam forwarding
2019-12-06 22:25:55,205 Warning: failed to load the mdns publisher
2019-12-06 22:25:55,205  No module named avahi
2019-12-06 22:25:55,206  either fix your installation or use the 'mdns=no' option
2019-12-06 22:25:55,207 xpra X11 version 2.4.3-r21350M 64-bit
2019-12-06 22:25:55,208  uid=1000 (twyeld), gid=1000 (twyeld)
2019-12-06 22:25:55,208  running with pid 5005 on Linux Ubuntu 19.04 disco
2019-12-06 22:25:55,208  connected to X11 display :9999 with 24 bit colors
2019-12-06 22:25:55,241 xpra is ready.
2019-12-06 22:25:55,355 23.5GB of system memory
2019-12-06 22:26:01,211 New tcp connection received from 10.33.0.151:37092 on 0.0.0.0:10000
2019-12-06 22:26:01,216 Handshake complete; enabling connection
2019-12-06 22:26:01,259  using png as primary encoding, also available:
2019-12-06 22:26:01,260   png/L, png/P, jpeg
2019-12-06 22:26:01,269 Warning: the python netifaces package is missing
2019-12-06 22:26:01,269 Java Linux client version 0.15.0
2019-12-06 22:26:01,274 setting keyboard layout to 'en'
2019-12-06 22:26:01,289 Error loading new keyboard description
2019-12-06 22:26:01,296  client root window size is 1440x2392 with 1 display:
2019-12-06 22:26:01,296  [1440, 2392]
2019-12-06 22:26:01,296 Warning: no matching resolution found for 1440x2392
2019-12-06 22:26:01,296  using 1440x900 instead
2019-12-06 22:26:01,296 cannot save fake xinerama settings: incomplete display data from client ClientConnection(1 : Protocol(tcp socket: 10.30.5.250:10000 <- 10.33.0.151:37092))
2019-12-06 22:26:01,419 server virtual display now set to 1440x900 (best match for 1440x2392)
2019-12-06 22:26:01,545 DPI set to 96 x 96
2019-12-06 22:26:22,293 client has requested disconnection: 
2019-12-06 22:26:22,294 Disconnecting client Protocol(tcp socket: 10.30.5.250:10000 <- 10.33.0.151:37092):
2019-12-06 22:26:22,294  client request
2019-12-06 22:26:22,297 xpra client 1 disconnected.
2019-12-06 22:26:23,910 New tcp connection received from 10.33.0.151:42482 on 0.0.0.0:10000
2019-12-06 22:26:23,913 Handshake complete; enabling connection
2019-12-06 22:26:23,917  using png as primary encoding, also available:
2019-12-06 22:26:23,918   png/L, png/P, jpeg
2019-12-06 22:26:23,919 Java Linux client version 0.15.0
2019-12-06 22:26:23,923 keyboard mapping already configured (skipped)
2019-12-06 22:26:23,923  client root window size is 1440x2392 with 1 display:
2019-12-06 22:26:23,923  [1440, 2392]
2019-12-06 22:26:23,940 Warning: no matching resolution found for 1440x2392
2019-12-06 22:26:23,940  using 1440x900 instead
2019-12-06 22:26:23,940 cannot save fake xinerama settings: incomplete display data from client ClientConnection(2 : Protocol(tcp socket: 10.30.5.250:10000 <- 10.33.0.151:42482))
2019-12-06 22:26:23,940 best resolution matching 1440x2392 is unchanged: 1440x900
2019-12-06 22:26:25,723 xpra client 2 disconnected.
2019-12-06 22:26:39,036 New tcp connection received from 10.33.0.151:43226 on 0.0.0.0:10000
2019-12-06 22:26:39,039 Handshake complete; enabling connection
2019-12-06 22:26:39,043  using png as primary encoding, also available:
2019-12-06 22:26:39,043   png/L, png/P, jpeg
2019-12-06 22:26:39,044 Java Linux client version 0.15.0
2019-12-06 22:26:39,045 keyboard mapping already configured (skipped)
2019-12-06 22:26:39,045  client root window size is 1440x2392 with 1 display:
2019-12-06 22:26:39,045  [1440, 2392]
2019-12-06 22:26:39,045 Warning: no matching resolution found for 1440x2392
2019-12-06 22:26:39,045  using 1440x900 instead
2019-12-06 22:26:39,045 cannot save fake xinerama settings: incomplete display data from client ClientConnection(3 : Protocol(tcp socket: 10.30.5.250:10000 <- 10.33.0.151:43226))
2019-12-06 22:26:39,045 best resolution matching 1440x2392 is unchanged: 1440x900
Xpra: Fatal IO error 11 (Resource temporarily unavailable) on X server :9999.

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

without even using docker - if I try a simple xpra server-client test I get the same result:

xpra start :100 --start=xterm
xpra attach ssh/SERVERUSERNAME@SERVERHOST/100

BTW this works fine on a second ubuntu box I have here - it just doesn't work on the android device

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

BTW this works fine on a second ubuntu box I have here - it just doesn't work on the android device

ok, it is good to try with a simplified setup first.

Maybe it is a firewall issue? Is your android part of the local network, or would it connect over the global internet?

Can you show me xpra server and xpra client output of your example?

xpra start :100 --start=xterm
xpra attach ssh/SERVERUSERNAME@SERVERHOST/100

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

not a firewall issue as I have had a few other VNCs running ok on the android - but we need xpra because of the graphics and openGL etc...

Can you show me xpra server and xpra client output of your example? <

do you mean from another ubuntu terminal? because there is no output that I can show you from the android device

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

do you mean from another ubuntu terminal? because there is no output that I can show you from the android device

I mean the android device to check for possible error messages.
However, maybe the xpra server output already gives enough information if some sort of connection is established.

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

here is the server info:
twyeld@twyeld2:~$ xpra start :101 --start=xterm
twyeld@twyeld2:~$ Entering daemon mode; any further errors will be reported to: /run/user/1000/xpra/:101.log

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

Please run with --daemon=no to get the full output. Or provide /run/user/1000/xpra/:101.log.

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

nope - not sure what the problem is now I can't seem to connect with my android device...
I think I have too many rouge daemons running....

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

What if you try:

xpra start :101 --daemon=no --bind-tcp=0.0.0.0:10000

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

twyeld@twyeld2:~$ xpra start :101 --daemon=no --bind-tcp=0.0.0.0:10000
xpra initialization error:
 failed to setup tcp socket on 0.0.0.0:10000 [Errno 98] Address already in use
twyeld@twyeld2:~$ xpra start :101 --daemon=no --bind-tcp=0.0.0.0:10001
2019-12-06 23:20:55,938 cannot access python uinput module:
2019-12-06 23:20:55,939  No module named uinput

X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-143-generic x86_64 Ubuntu
Current Operating System: Linux twyeld2 5.0.0-32-generic #34-Ubuntu SMP Wed Oct 2 02:06:48 UTC 2019 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.0.0-32-generic root=UUID=806bb17e-4e13-4670-9992-3a88d9a271f3 ro quiet splash vt.handoff=1
Build Date: 03 April 2019  09:03:57AM
xorg-server 2:1.20.4-1ubuntu3 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.36.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.:101.log", Time: Fri Dec  6 23:20:55 2019
(++) Using config file: "/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
2019-12-06 23:20:58,626 created unix domain socket: /run/user/1000/xpra/twyeld2-101
2019-12-06 23:20:58,626 cannot create group socket '/run/xpra/twyeld2-101'
2019-12-06 23:20:58,626  [Errno 13] Permission denied
Unable to create /home/twyeld/.dbus/session-bus
2019-12-06 23:20:58,689 pointer device emulation using XTest
2019-12-06 23:20:59,278  OpenGL is supported on this display
2019-12-06 23:20:59,324 html server unavailable, cannot find websockify module
2019-12-06 23:20:59,378 Warning: cannot forward notifications, the interface is already claimed
2019-12-06 23:20:59,378  if you do not have a dedicated dbus session for this xpra instance,
2019-12-06 23:20:59,378  use the 'notifications=no' option
2019-12-06 23:20:59,441 Warning: webcam forwarding is disabled
2019-12-06 23:20:59,441  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2019-12-06 23:20:59,441  make sure that the 'v4l2loopback' kernel module is installed and loaded
2019-12-06 23:20:59,441 found 0 virtual video devices for webcam forwarding
2019-12-06 23:20:59,504 Warning: failed to load the mdns publisher
2019-12-06 23:20:59,504  No module named avahi
2019-12-06 23:20:59,504  either fix your installation or use the 'mdns=no' option
2019-12-06 23:20:59,504 xpra X11 version 2.4.3-r21350M 64-bit
2019-12-06 23:20:59,504  uid=1000 (twyeld), gid=1000 (twyeld)
2019-12-06 23:20:59,504  running with pid 23082 on Linux Ubuntu 19.04 disco
2019-12-06 23:20:59,504  connected to X11 display :101 with 24 bit colors
2019-12-06 23:20:59,599 xpra is ready.
2019-12-06 23:20:59,610 23.5GB of system memory

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

ok, so far the server looks well.

Now if you try to connect with the xpra android client, some further output should appear.

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

for whatever reason it is not connecting - I could get it to connect using the bash script for the docker version but not this simple version.

settings on android device:
connection type: tcp
connection name: test
hostname: using IP address here
port: 10000 (or whatever specified in xpra start)
display ID: 3 (tried a few different numbers doesn't seem to matter)

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

display ID: 3 (tried a few different numbers doesn't seem to matter)

Maybe this is the point: Specify :101 or 101 or whatever display number you've specified with xpra start :101

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

ok some success - I have a black screen on my android

twyeld@twyeld2:~/vnc/withUnity_xorg$ xpra start --start=xterm --bind-tcp=0.0.0.0:10088
twyeld@twyeld2:~/vnc/withUnity_xorg$ Entering daemon mode; any further errors will be reported to:
/run/user/1000/xpra/S5016.log
Actual display used: :4

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

and here is the log:

2019-12-06 23:56:44,707 cannot access python uinput module:�[0m
2019-12-06 23:56:44,707  No module named uinput�[0m
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running

X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-143-generic x86_64 Ubuntu
Current Operating System: Linux twyeld2 5.0.0-32-generic #34-Ubuntu SMP Wed Oct 2 02:06:48 UTC 2019 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.0.0-32-generic root=UUID=806bb17e-4e13-4670-9992-3a88d9a271f3 ro quiet splash vt.handoff=1
Build Date: 03 April 2019  09:03:57AM
xorg-server 2:1.20.4-1ubuntu3 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.36.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.S5016.log", Time: Fri Dec  6 23:56:44 2019
(++) Using config file: "/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
2019-12-06 23:56:48,100 created unix domain socket: /run/user/1000/xpra/twyeld2-4�[0m
2019-12-06 23:56:48,101 cannot create group socket '/run/xpra/twyeld2-4'�[0m
2019-12-06 23:56:48,101  [Errno 13] Permission denied�[0m
Unable to create /home/twyeld/.dbus/session-bus
2019-12-06 23:56:48,165 pointer device emulation using XTest�[0m
2019-12-06 23:56:48,749  OpenGL is supported on this display�[0m
2019-12-06 23:56:48,795 html server unavailable, cannot find websockify module�[0m
�[33m2019-12-06 23:56:48,848 Warning: cannot forward notifications, the interface is already claimed�[0m
�[33m2019-12-06 23:56:48,848  if you do not have a dedicated dbus session for this xpra instance,�[0m
�[33m2019-12-06 23:56:48,848  use the 'notifications=no' option�[0m
�[33m2019-12-06 23:56:48,909 Warning: webcam forwarding is disabled�[0m
�[33m2019-12-06 23:56:48,909  the virtual video directory '/sys/devices/virtual/video4linux' was not found�[0m
�[33m2019-12-06 23:56:48,909  make sure that the 'v4l2loopback' kernel module is installed and loaded�[0m
2019-12-06 23:56:48,909 found 0 virtual video devices for webcam forwarding�[0m
�[33m2019-12-06 23:56:48,973 Warning: failed to load the mdns publisher�[0m
�[33m2019-12-06 23:56:48,973  No module named avahi�[0m
�[33m2019-12-06 23:56:48,973  either fix your installation or use the 'mdns=no' option�[0m
2019-12-06 23:56:48,973 xpra X11 version 2.4.3-r21350M 64-bit�[0m
2019-12-06 23:56:48,973  uid=1000 (twyeld), gid=1000 (twyeld)�[0m
2019-12-06 23:56:48,973  running with pid 5037 on Linux Ubuntu 19.04 disco�[0m
2019-12-06 23:56:48,973  connected to X11 display :4 with 24 bit colors�[0m
2019-12-06 23:56:49,066 xpra is ready.�[0m
2019-12-06 23:56:49,084 23.5GB of system memory�[0m
2019-12-06 23:57:08,161 New tcp connection received from 10.33.0.151:44755 on 0.0.0.0:10088�[0m
2019-12-06 23:57:08,166 Handshake complete; enabling connection�[0m
2019-12-06 23:57:08,177  using png as primary encoding, also available:�[0m
2019-12-06 23:57:08,177   png/L, png/P, jpeg�[0m
�[33m2019-12-06 23:57:08,178 Warning: the python netifaces package is missing�[0m
2019-12-06 23:57:08,178 Java Linux client version 0.15.0�[0m
2019-12-06 23:57:08,272 setting keyboard layout to 'en'�[0m
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Error:            Can't find file "en" for symbols include
>                   Exiting
>                   Abandoning symbols file "default"
Errors from xkbcomp are not fatal to the X server
�[31m2019-12-06 23:57:08,283 Error loading new keyboard description�[0m
2019-12-06 23:57:08,288  client root window size is 1440x2392 with 1 display:�[0m
2019-12-06 23:57:08,288  [1440, 2392]�[0m
�[33m2019-12-06 23:57:08,289 cannot save fake xinerama settings: incomplete display data from client ClientConnection(1 : Protocol(tcp socket: 10.30.5.250:10088 <- 10.33.0.151:44755))�[0m
2019-12-06 23:57:08,326 server virtual display now set to 3000x2560 (best match for 1440x2392)�[0m
�[33m2019-12-06 23:57:08,370 DPI set to 35 x 60 (wanted 96 x 96)�[0m
�[33m2019-12-06 23:57:08,370  you may experience scaling problems, such as huge or small fonts, etc�[0m
�[33m2019-12-06 23:57:08,370  to fix this issue, try the dpi switch, or use a patched Xorg dummy driver�[0m
2019-12-06 23:59:46,959 client has requested disconnection: �[0m
2019-12-06 23:59:46,960 Disconnecting client Protocol(tcp socket: 10.30.5.250:10088 <- 10.33.0.151:44755):�[0m
2019-12-06 23:59:46,960  client request�[0m
2019-12-06 23:59:46,963 xpra client 1 disconnected.�[0m

@mviereck
Copy link
Owner

mviereck commented Dec 6, 2019

The log basically looks good.
A connection is established.

2019-12-06 23:59:46,959 client has requested disconnection:

Did you terminate xpra on android, or did that happen on itself?

ok some success - I have a black screen on my android

This sounds like a problem of the xpra android client. I am not sure how to proceed here if you cannot get a log output from it.
Are there further options you can choose in the android client? If you can choose to disable OpenGL, try that out.

@twyeld
Copy link
Author

twyeld commented Dec 6, 2019

not sure if the disconnect was unintentional - looks like it might be disconnecting straight after connecting

will see if i can disable opengl - that could be a problem too...

@mviereck
Copy link
Owner

mviereck commented Dec 7, 2019

looks like it might be disconnecting straight after connecting

The timestamps in the log between connection and disconnection have a difference of two minutes.

will see if i can disable opengl - that could be a problem too...

It is just an idea - the black screen on your android could be an xpra client issue with OpenGL.
If I have rendering issues with the regular/official xpra client, disabling OpenGL is the first step to debug.

@twyeld
Copy link
Author

twyeld commented Dec 7, 2019

I agree - but the problem is twofold:

  1. I really want to use openGL with GPU acceleration server side, and
  2. how to disable openGL on my android device?

@mviereck
Copy link
Owner

mviereck commented Dec 7, 2019

I really want to use openGL with GPU acceleration server side

That is not a problem. OpenGL on client side is just an acceleration to show the resulting window on android. That does not affect OpenGL on server side that generates the window content.

how to disable openGL on my android device?

I don't know. Aren't there any config options in your android client?
Maybe you have to dig into the source code for an OpenGL variable to switch it off.

You could open a ticket at https://github.com/jksiezni. Maybe you'll get a response.

@twyeld
Copy link
Author

twyeld commented Dec 7, 2019

doesn't look like jksiezni has responded for 2 years

@twyeld
Copy link
Author

twyeld commented Dec 7, 2019

I am going to try and plug my android device into android studio to see if it will log the app
I have turned on openGL trace - which is the only ref I have to openGL on my android

@twyeld
Copy link
Author

twyeld commented Dec 7, 2019

ok - some progress - using openGL trace on my android device I got the following (actually a lot more - but hopefully this is the relevant part):

12-07 22:46:47.889 31124-31146/com.github.jksiezni.xpra D/libEGL: glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
12-07 22:46:47.889 31124-31146/com.github.jksiezni.xpra D/libEGL: const GLfloat value[] = {
12-07 22:46:47.889 31124-31146/com.github.jksiezni.xpra D/libEGL:     84, 0, 0, 0,
12-07 22:46:47.889 31124-31146/com.github.jksiezni.xpra D/libEGL:     0, 84, 0, 0,
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL:     0, 0, 1, 0,
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL:     1321, 144, 0, 1
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: };
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glUniformMatrix4fv(1, 1, GL_FALSE, value);
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glBindTexture(0xde1, 19);
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glUniform4f(2, 0, 0, 0, 0.541176);
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glBindBuffer(0x8892, 1);
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 16, (const void *) 0x00000000);
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 16, (const void *) 0x00000008);
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glEndTilingQCOM(0x00000001);
12-07 22:46:47.890 31124-31146/com.github.jksiezni.xpra D/libEGL: glGetError();
12-07 22:46:49.390 31124-31275/com.github.jksiezni.xpra V/x.n.HeaderChunk: Header received HeaderChunk[80, 1, 0, 0, 0, 0, 0, 20] size=20
12-07 22:46:49.392 31124-31275/com.github.jksiezni.xpra I/x.p.XpraSender: send([ping_echo, 4163340, 1, 1, 1, -1])
12-07 22:46:49.393 31124-31275/com.github.jksiezni.xpra D/x.p.XpraSender: send(): payload size is 20 bytes
12-07 22:46:54.572 31124-31275/com.github.jksiezni.xpra V/x.n.HeaderChunk: Header received HeaderChunk[80, 1, 0, 0, 0, 0, 0, 20] 

@mviereck
Copy link
Owner

mviereck commented Dec 7, 2019

I can't say much to this log.
It really makes sense to ask the developer of the android client itself.

@twyeld
Copy link
Author

twyeld commented Dec 7, 2019

i agree - seems to be ok
anyway, I managed to get the ssh part working but still no xterm - just drops connection straight after connecting. I suspect it needs a shared key
I have installed a bash shell on my android device to see if I can connect that way to see what is missing

@twyeld
Copy link
Author

twyeld commented Dec 8, 2019

I've done about as much as I can to get this thing to work.

Can you suggest another android/x11docker compatible vnc viewer that supports gpu acceleration server side? That is why we went down the xpra path - because of the unity3d and gpu need.

@mviereck
Copy link
Owner

mviereck commented Dec 8, 2019

I've done about as much as I can to get this thing to work.

You did not open a ticket at https://github.com/jksiezni/xpra-client. That's the next step to do.
If you don't get an answer there, you can open a ticket at www.xpra.org.

Can you suggest another android/x11docker compatible vnc viewer that supports gpu acceleration server side?

I know close to nothing about android and don't have a smartphone myself. So I cannot suggest android clients.

To use hardware acceleration from an x11docker setup you need a VNC server that grabs an already existing display. Compare https://github.com/mviereck/x11docker/wiki/VNC. I don't know if android provides a VNC client.

Note that VNC does not encrypt the transmission by default.
Note that xpra is probably more performant if you get it to work.

@twyeld
Copy link
Author

twyeld commented Dec 8, 2019

There are plenty of VNC clients for Android - but they chug.
You are right that if I can get xpra to work it would be the best solution.
I think I will need to go back to the java code itself and try to find out what is holding it up...

@mviereck
Copy link
Owner

It might be worth to try the xpra html5 client as suggested in jksiezni/xpra-client#5.
It has the advantage to be actively maintained.

x11docker wiki shows a sample setup: https://github.com/mviereck/x11docker/wiki/Container-applications-running-in-Browser-with-HTML5

@twyeld
Copy link
Author

twyeld commented Dec 15, 2019

thanks again mviereck - and apols for the slow response - been smokey in Oz
The particular configuration they want to use here means they don't want to use a browser to connect - must be a standalone Android app

Anyway, I have gone back to plain x11vnc. It supports hardware acceleration and openGL so fits our model. And, can connect from nearly any vnc viewer.

Just need to work out the best frame rate i can get form which vnc viewer - most of them are too over specced for what we need - that's why the xpra client was so attractive - very thin.

@mviereck
Copy link
Owner

mviereck commented Dec 15, 2019

Thank you for the feedback!

Anyway, I have gone back to plain x11vnc.

Just need to work out the best frame rate i can get form which vnc viewer

I believe that TurboVNC (Github) might be more effective than x11vnc. I don't know if there is a TurboVNC viewer on android.

Though, I don't know how to set up TurboVNC to grab an existing accelerated display. That is why I've chosen x11vnc as example in the x11docker wiki.

If you find a satisfying VNC setup, it would be nice if you report it here in a new ticket. Maybe I can give additional hints in x11docker wiki. Overall I did not recommend VNC before because I always found it too slow.

@twyeld
Copy link
Author

twyeld commented Jan 15, 2020

OK - so I have finally got back onto this and had some success.
Using mgtsai's https://hub.docker.com/r/mgtsai/dockerui.base-xpra/ I can run the xpra-HTML-connect in an Android or iphone device to launch a xterm in the safari browser (iphone).

The iphone device works fine in safari but not so in chrome - can type into the xterm.
But, for the Android device cannot type into the xterm when launched in Chrome. Launched in Firefox can use an external keyboard to type into the xterm.

Not sure whether this is a browser layer or android layer...

Any ideas?

@totaam
Copy link

totaam commented Jan 15, 2020

@twyeld it looks like that docker image is based on an xpra version that is years out of date, and full of known bugs and security issues. I'm not saying that newer versions will work better on Android, but there's a chance.

@mviereck
Copy link
Owner

This is a HTML5 solution as suggested before.

The dockerui.base-xpra image provides xpra in a docker image.
x11docker wiki provides an example with xpra on host.

The html5 way has the advantage to work everywhere where a browser is available.
A native xpra client would probably be more performant, but as we already found, there is no recent one for android.

I recommend a html5 setup with recent and regulary updated xpra versions on host instead in image.
The html5 solution allows connections from arbitrary devices with a browser.

@mviereck mviereck reopened this Jan 15, 2020
@twyeld
Copy link
Author

twyeld commented Jan 16, 2020

I could not get the example html5 client working - I could connect to the xrpa server through my browser but I always got the server error "this browser does not support http requests".

mgtsai's docker version seemed to work - but you are right, it uses an older version of xpra

I have updated mgtsai's repo and created my own here: https://github.com/twyeld/dockerui.base-xpra-html

I updated the Dockerfile to the latest version of ubuntu, xpra public key, xpra and the libgtk package

it now works on my android device - i can type into the xterm

i just need to edit the html client app so that the xterm spawns in the top left corner of the browser window

thank you mviereck and antoine for your tireless help and patience

@totaam
Copy link

totaam commented Jan 16, 2020

I could not get the example html5 client working - I could connect to the xrpa server through my browser but I always got the server error "this browser does not support http requests".

That's because the xpra packages from the Ubuntu repositories are buggy and do not include the html5 client.

@twyeld
Copy link
Author

twyeld commented Jan 16, 2020

I could not get the example html5 client working - I could connect to the xrpa server through my browser but I always got the server error "this browser does not support http requests".

That's because the xpra packages from the Ubuntu repositories are buggy and do not include the html5 client.

I just checked and found /var/www/public_html/html5-xpra

@totaam
Copy link

totaam commented Jan 16, 2020

I just checked and found /var/www/public_html/html5-xpra

So they're modifying the build and doing it wrong.
Not for the first time, or the last.

@twyeld
Copy link
Author

twyeld commented Jan 16, 2020

I just checked and found /var/www/public_html/html5-xpra

So they're modifying the build and doing it wrong.
Not for the first time, or the last.

haha - well, it would be nice if it was consistent, but understandable when not

I am surprised to see the ubuntu packages are the buggy ones - does that mean most of the contributors are working on windows/mac machines?

@totaam
Copy link

totaam commented Jan 16, 2020

I am surprised to see the ubuntu packages are the buggy ones - does that mean most of the contributors are working on windows/mac machines?

No, Linux is the primary development platform.
It's just that the downstream DEB packaging has always been shambolic. We even have a dedicated wiki page for it because this is by far the number 1 support request we get (via IRC, mailing list and even tickets):
https://xpra.org/trac/wiki/Packaging/DistributionPackages
9 times out of 10, installing the xpra.org package will fix things.

@twyeld
Copy link
Author

twyeld commented Jan 16, 2020

Linux is the primary development platform

that's what I thought

actually I manually installed from the official xpra.org site not from an Ubuntu repo - so, the html client app was definitely included

The html client works on everything i have tried - but it is seriously slow. I am lucky to get 3fps. Using the standalone xpra client-server combo I can get at least 30-50fps on the client machine.

I don't understand why running a program on the host machine can render at 100fps - but, when viewed from a remote machine it drops to 30-50fps. I thought it just forwards the video signal - ie it video streams whatever is rendered on the host machine to the remote machine?

Basically, as predicted, running the client from a browser introduces some big/untenable overhead load.

@mviereck
Copy link
Owner

The html client works on everything i have tried - but it is seriously slow. I am lucky to get 3fps.

That's really slow, too slow to work with.
One reason is probably a less effective data compression with html5 (if compressed at all).

Maybe one bottleneck is the internet connection? Both the upload rate of the server as the download rate of the client take effect.
Also have a look at the CPU usage of both machines.

@totaam
Copy link

totaam commented Jan 23, 2020

I am lucky to get 3fps

That's not normal.
The html5 client is slow, but not that slow. Is your client underpowered?

I thought it just forwards the video signal

No it doesn't, that can't be done.

@mviereck
Copy link
Owner

mviereck commented Feb 6, 2020

Closing due to inactivity. Feel free to comment again, I'll reopen than.

@mviereck mviereck closed this as completed Feb 6, 2020
@twyeld
Copy link
Author

twyeld commented Feb 6, 2020

...actually I got everything working with HTML and android (although only with an external bluetooth keyboard - the '.' and '/' characters are not correct in xterm when using touchpad - so can't launch an executable from touchpad, have to use external keyboard... ) - and the problem with the low framerate was at my end with how I had xorg and nvidia set up - its fixed now - I can see 300+fps on server from HTML (the app has a fps counter embedded) but only runs at about 15-30fps in browser client - but this seems to vary from device to device - faster on a device with better graphics capability...

I plan to post a detailed overview soon - I just have a looming deadline to overcome first...

thx again for your help and Antoine's

@totaam
Copy link

totaam commented Feb 6, 2020

the '.' and '/' characters are not correct in xterm when using touchpad

This will be fixed soon:
http://xpra.org/trac/ticket/2574

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

No branches or pull requests

3 participants