[winswitch] Running XPRA with headless GPU in docker container displaying via HTML5 client

Florian Feldhaus florian.feldhaus at gmail.com
Wed Oct 30 16:14:20 GMT 2019


I have started creating a generic XPRA docker image which can be used to
run any application and display it via the HTML5 client. It is in an early
stage, but will likely become the basis of the popular Wireshark image and
some other images I plan to create. You can find the current status here:
https://cloud.docker.com/repository/docker/ffeldhaus/docker-xpra-html5
and the source here
http://github.com/ffeldhaus/docker-xpra-html5

Now I'm trying to enable the container to use a GPU for OpenGL
applications. That seems to be nearly impossible, at least if XPRA runs
inside the container. I found a lot of examples which show how to run a
container with headless GPUs and X11 including this one from NVIDIA:
https://gitlab.com/nvidia/container-images/samples/blob/master/opengl/ubuntu16.04/turbovnc-virtualgl/Dockerfile

But it seems that for all examples I found an X-Server in the Docker host
is used (like in the example above).

Here's my current take on it. This is the preparation (installation etc):
https://github.com/ffeldhaus/docker-xpra-html5-opengl/blob/master/Dockerfile

This is how the xorg config gets created with nvidia-xconfig and how xpra
is started:
https://github.com/ffeldhaus/docker-xpra-html5-opengl/blob/master/docker-entrypoint.sh

I'm currently stuck with the following error but do not think this is the
real issue:
parse_vt_settings: Cannot open /dev/tty0 (No such file or directory)

As the docker container is running non-interactively, it does not have a
tty0. Is this even possible or any idea how to make this work without X11
in the docker host?

Here's the full output:
[ 89356.122] Failed to rename log file "/tmp/Xorg.S21.log" to
"/tmp/Xorg.S21.log": No such file or directory
[ 89356.124]
X.Org X Server 1.19.6
Release Date: 2017-12-20
[ 89356.124] X Protocol Version 11, Revision 0
[ 89356.125] Build Operating System: Linux 4.4.0-148-generic x86_64 Ubuntu
[ 89356.125] Current Operating System: Linux xpra-opengl-69b979c464-kh6f8
4.14.138+ #1 SMP Tue Sep 3 02:58:08 PDT 2019 x86_64
[ 89356.125] Kernel command line: BOOT_IMAGE=/syslinux/vmlinuz.A
init=/usr/lib/systemd/systemd boot=local rootwait ro noresume noswap
loglevel=7 noinitrd console=ttyS0 vsyscall=emulate security=apparmor
virtio_net.napi_tx=1 systemd.u
nified_cgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=true
csm.disabled=1 dm_verity.error_behavior=3 dm_verity.max_bios=-1
dm_verity.dev_wait=1 i915.modeset=1 cros_efi loadpin.enabled=0
lsm.module_locking=0 root=/dev
/dm-0 "dm=1 vroot none ro 1,0 2539520 verity
payload=PARTUUID=499BC516-64BA-734B-A677-3466FBD4DAF5
hashtree=PARTUUID=499BC516-64BA-734B-A677-3466FBD4DAF5 hashstart=2539520
alg=sha1 root_hexdigest=42c12623b5d6e222b2fb41afbb4b54cab96fa
5f5 salt=3d83dfa08b35b7df037d5654602ec193541bf632968f9fbf658df3df780f3d2c"
[ 89356.126] Build Date: 03 June 2019  08:10:35AM
[ 89356.126] xorg-server 2:1.19.6-1ubuntu4.3 (For technical support please
see http://www.ubuntu.com/support)
[ 89356.126] Current version of pixman: 0.34.0
[ 89356.126]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[ 89356.126] Markers: (--) probed, (**) from config file, (==) default
setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 89356.127] (++) Log file: "/tmp/Xorg.S21.log", Time: Wed Oct 30 15:14:48
2019
[ 89356.127] (++) Using config file: "/etc/xpra/xorg.conf"
[ 89356.127] (EE) Unable to locate/open config directory:
"/run/user/0/xpra/xorg.conf.d/21"
[ 89356.127] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 89356.137] (==) ServerLayout "Layout0"
[ 89356.137] (**) |-->Screen "Screen0" (0)
[ 89356.137] (**) |   |-->Monitor "Monitor0"
[ 89356.137] (**) |   |-->Device "Device0"
[ 89356.137] (**) |   |-->GPUDevice "dummy_videocard"
[ 89356.137] (**) |-->Input Device "Keyboard0"
[ 89356.137] (**) |-->Input Device "Mouse0"
[ 89356.137] (**) Option "DontVTSwitch" "true"
[ 89356.137] (**) Option "AllowMouseOpenFail" "true"
[ 89356.137] (**) Option "AutoAddDevices" "false"
[ 89356.137] (**) Option "AutoEnableDevices" "false"
[ 89356.137] (**) Not automatically adding devices
[ 89356.137] (**) Not automatically enabling devices
[ 89356.137] (==) Automatically adding GPU devices
[ 89356.137] (==) Automatically binding GPU devices
[ 89356.137] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 89356.137] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not
exist.
[ 89356.137]    Entry deleted from font path.
[ 89356.137] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not
exist.
[ 89356.137]    Entry deleted from font path.
[ 89356.137] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not
exist.
[ 89356.137]    Entry deleted from font path.
[ 89356.137] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
[ 89356.137]    Entry deleted from font path.
[ 89356.137] (WW) The directory "/usr/share/fonts/X11/100dpi" does not
exist.
[ 89356.137]    Entry deleted from font path.
[ 89356.137] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[ 89356.137]    Entry deleted from font path.
[ 89356.137] (==) FontPath set to:
        /usr/share/fonts/X11/misc,
        built-ins
[ 89356.137] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 89356.137] (II) Loader magic: 0x5576a4975020
[ 89356.137] (II) Module ABI versions:
[ 89356.137]    X.Org ANSI C Emulation: 0.4
[ 89356.137]    X.Org Video Driver: 23.0
[ 89356.137]    X.Org XInput driver : 24.1
[ 89356.137]    X.Org Server Extension : 10.0
[ 89356.138] (EE) dbus-core: error connecting to system bus:
org.freedesktop.DBus.Error.FileNotFound (Failed to connect to socket
/var/run/dbus/system_bus_socket: No such file or directory)
[ 89356.140] (--) PCI: (0:0:4:0) 10de:102d:10de:106c rev 161, Mem @
0xc0000000/16777216, 0x10000000000/17179869184, 0x10400000000/33554432, I/O
@ 0x0000c000/128
[ 89356.140] (II) no primary bus or device found
[ 89356.140] (II) LoadModule: "glx"
[ 89356.140] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 89356.141] (II) Module glx: vendor="X.Org Foundation"
[ 89356.141]    compiled for 1.19.6, module version = 1.0.0
[ 89356.141]    ABI class: X.Org Server Extension, version 10.0
[ 89356.141] (II) LoadModule: "nvidia"
[ 89356.141] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[ 89356.142] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 89356.142]    compiled for 1.6.99.901, module version = 1.0.0
[ 89356.142]    Module class: X.Org Video Driver
[ 89356.142] (II) LoadModule: "dummy"
[ 89356.142] (II) Loading /usr/lib/xorg/modules/drivers/dummy_drv.so
[ 89356.142] (II) Module dummy: vendor="X.Org Foundation"
[ 89356.142]    compiled for 1.19.5, module version = 0.3.8
[ 89356.142]    Module class: X.Org Video Driver
[ 89356.142]    ABI class: X.Org Video Driver, version 23.0
[ 89356.142] (II) LoadModule: "kbd"
[ 89356.142] (WW) Warning, couldn't open module kbd
[ 89356.142] (II) UnloadModule: "kbd"
[ 89356.142] (II) Unloading kbd
[ 89356.142] (EE) Failed to load module "kbd" (module does not exist, 0)
[ 89356.142] (II) LoadModule: "mouse"
[ 89356.143] (WW) Warning, couldn't open module mouse
[ 89356.143] (II) UnloadModule: "mouse"
[ 89356.143] (II) Unloading mouse
[ 89356.143] (EE) Failed to load module "mouse" (module does not exist, 0)
[ 89356.143] (II) NVIDIA dlloader X Driver  430.26  Tue Jun  4 17:52:10 CDT
2019
[ 89356.143] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 89356.143] (II) DUMMY: Driver for Dummy chipsets: dummy
[ 89356.143] (EE)
Fatal server error:
[ 89356.143] (EE) parse_vt_settings: Cannot open /dev/tty0 (No such file or
directory)
[ 89356.143] (EE)
[ 89356.143] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[ 89356.144] (EE) Please also check the log file at "/tmp/Xorg.S21.log" for
additional information.
[ 89356.144] (EE)
[ 89356.144] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[ 89356.144] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[ 89356.144] (EE) Server terminated with error (1). Closing log file.



More information about the shifter-users mailing list