From 0e7116e7da6eb691a1a6a7510d985c3eb51318fc Mon Sep 17 00:00:00 2001 From: xfnw Date: Tue, 25 May 2021 14:38:25 -0400 Subject: [PATCH] switch to spice so videos are actually playable --- Dockerfile | 2 +- etc/X11/spiceqxl.xorg.conf | 233 +++++++++++++++++++++++++++++++++++++ etc/supervisord.conf | 10 +- etc/xdg/openbox/menu.xml | 21 ---- 4 files changed, 236 insertions(+), 30 deletions(-) create mode 100644 etc/X11/spiceqxl.xorg.conf delete mode 100644 etc/xdg/openbox/menu.xml diff --git a/Dockerfile b/Dockerfile index 29cd9c2..1a60d5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:latest -RUN apk add x11vnc xvfb supervisor firefox \ +RUN apk add xorg-server xf86-input-libinput eudev xspice supervisor font-noto firefox \ && addgroup bnuuy \ && adduser -G bnuuy -s /bin/sh -D bnuuy \ && rm -rf /apk /tmp/* /var/cache/apk/* diff --git a/etc/X11/spiceqxl.xorg.conf b/etc/X11/spiceqxl.xorg.conf new file mode 100644 index 0000000..7cbdb11 --- /dev/null +++ b/etc/X11/spiceqxl.xorg.conf @@ -0,0 +1,233 @@ +Section "Device" + Identifier "XSPICE" + Driver "spiceqxl" + + # ---- Network and security options + + # Do not require a client password. + # default: False + #Option "SpiceDisableTicketing" "False" + + # Set the password required to connect to the Spice server. + #Option "SpicePassword" "" + + # Enable usage of SASL supported by the spice-gtk client. Not required, + # default: False + #Option "SpiceSasl" "False" + + # Use Spice's regular unencrypted port. One of SpicePort or SpiceTlsPort + # must be specified. SpicePort can also be set through the XSPICE_PORT + # environment variable or the --port Xspice option. + # Specify 0 to disable the use of the regular port + # default: 5900 + #Option "SpicePort" "5900" + + # Use a TLS (encrypted) port. One of SpicePort or SpiceTlsPort must be + # specified. SpiceTlsPort can also be set through the XSPICE_TLS_PORT + # environment variable or the --tls-port Xspice option. + #Option "SpiceTlsPort" "5900" + + # Set the directory where the CA certificate, server key and server + # certificate are searched for TLS, using the same predefined names QEMU + # uses: + # cacert.pem, server-key.pem, server-cert.pem + #Option "SpiceX509Dir" "" + + # Set the CA certificate file location for TLS. + #Option "SpiceCacertFile" "" + + # Set the server key file location for TLS. + #Option "SpiceX509KeyFile" "" + + # Set the server key's password for TLS. + #Option "SpiceX509KeyPassword" "" + + # Set the server certificate file location for TLS. + #Option "SpiceX509CertFile" "" + + # Set the server DH file location for TLS. + #Option "SpiceDhFile" "" + + # Set the TLS ciphers preference order. + #Option "SpiceTlsCiphers" "" + + # Listen to a specific interface. + # default: Listen to all (0.0.0.0). + #Option "SpiceAddr" "" + + # Set to True to only listen on IPv4 interfaces. + # default: False + #Option "SpiceIPV4Only" "False" + + # Set to True to only listen on IPv6 interfaces. + # default: False + #Option "SpiceIPV6Only" "False" + + # If set, the Spice server will exit when the first client disconnects. + # default: False + #Option "SpiceExitOnDisconnect" "True" + + + # ---- Monitor configuration options + + # The number of heads to allocate by default. + # default: 4 + #Option "NumHeads" "4" + + + # ---- Compression options + + # Set zlib glz wan compression. Options are auto, never, always. + # default: auto + #Option "SpiceZlibGlzWanCompression" "" + + # Set jpeg wan compression. Options are auto, never, always. + # default: auto + #Option "SpiceJpegWanCompression" "" + + # Set image compression. Options are off, auto_glz, auto_lz, quic, glz, lz. + # default: auto_glz + #Option "SpiceImageCompression" "" + + # If non zero, the driver will render all operations to the frame buffer, + # and keep track of a changed rectangle list. The changed rectangles + # will be transmitted at the rate requested (e.g. 10 frames per second). + # This can dramatically reduce network bandwidth for some use cases. + #Option "SpiceDeferredFPS" "10" + + # Set the streaming video method. Options are filter, off, all. + # default: filter + #Option "SpiceStreamingVideo" "" + + # Sets a semicolon-separated list of preferred video codecs. + # Each takes the form encoder:codec, with spice:mjpeg being the default, + # and other options being provided by gstreamer for the mjpeg, vp8 and h264 + # codecs. + #Option "SpiceVideoCodecs" "" + + # Enable caching of images directly written with uxa->put_image. + # default: True + #Option "EnableImageCache" "True" + + # Enable caching of images created by uxa->prepare_access. + # default: True + #Option "EnableFallbackCache" "True" + + # Enable the use of off-screen surfaces. + # default: True + #Option "EnableSurfaces" "True" + + + # ---- Xspice-specific buffer options + + # Buffer Size notes: + # The following buffer sizes are used for Xspice only. + # If you are using the DFPS mode, surface ram is not used, + # and you can set it to 1. + # Otherwise, the surface buffer should be at least as large + # as the frame buffer, and probably a multiple like 8. + # The command buffer ram should also be substantially larger + # than the frame buffer, and note that the frame buffer occupies + # the front of the command buffer. Hence, our default size + # is a command buffer 7x the size of the frame buffer. + # If you see 'Out of memory' errors in your xorg.log, you probably need + # to increase the surface or command buffer sizes. + + # The amount of surface buffer ram, in megabytes, to allocate. + # default: 128 + #Option "SurfaceBufferSize" "128" + + # The amount of command buffer ram, in megabytes, to allocate. + # default: 128 + #Option "CommandBufferSize" "128" + + # The amount of frame buffer ram, in megabytes, to reserve + # This is reserved out of the CommandBuffer RAM + # This governs the maximum size the X screen can be; + # 4 Heads at 1920x1080 require 32M of RAM + # default: 16 + #Option "FrameBufferSize" "16" + + + # ---- VDAgent options + + # Whether or not to accept Vdagent connections. + # default: False + #Option "SpiceVdagentEnabled" "False" + + # Default path to listen for agent virtual io connections. + # default: /tmp/xspice-virtio" + #Option "SpiceVdagentVirtioPath" "/tmp/xspice-virtio" + + # Default path to listen for agent uinput connections. + # default: /tmp/xspice-uinput + #Option "SpiceVdagentUinputPath" "/tmp/xspice-uinput" + + # Default user id to set for the Virtio and Uinput sockets. + # Note: both uid and gid must be given for either to take effect. + # default: 0, or none + #Option "SpiceVdagentUid" "0" + + # Default group id to set for the Virtio and Uinput sockets. + # Note: both uid and gid must be given for either to take effect. + # default: 0, or none + #Option "SpiceVdagentGid" "0" + + # Set Spice Agent Mouse - Use Agent mouse if an agent connects. + # default: True + #Option "SpiceAgentMouse" "True" + + # Set Spice Playback compression. + # default: True + #Option "SpicePlaybackCompression" "True" + + # Disable copy and paste. + # default: False + #Option "SpiceDisableCopyPaste" "False" + + # If a directory is given, any file in that directory will be read + # for audio data to be sent to the client. + # default: Not set. + #Option "SpicePlaybackFIFODir" "/tmp/" + + # A unix domain name for a unix domain socket to communicate with + # a spiceccid smartcard driver. + # default: Not set. + #Option "SpiceSmartCardFile" "/tmp/spice.pcsc.comm" +EndSection + +Section "InputDevice" + Identifier "XSPICE POINTER" + Driver "xspice pointer" +EndSection + +Section "InputDevice" + Identifier "XSPICE KEYBOARD" + Driver "xspice keyboard" +EndSection + +Section "Monitor" + Identifier "Configured Monitor" +EndSection + +Section "Screen" + Identifier "XSPICE Screen" + Monitor "Configured Monitor" + Device "XSPICE" + DefaultDepth 24 + SubSection "Display" + Modes "1366x768" + EndSubSection +EndSection + +Section "ServerLayout" + Identifier "XSPICE Example" + Screen "XSPICE Screen" + InputDevice "XSPICE KEYBOARD" + InputDevice "XSPICE POINTER" +EndSection + +# Prevent udev from loading vmmouse in a vm and crashing. +Section "ServerFlags" + Option "AutoAddDevices" "False" +EndSection diff --git a/etc/supervisord.conf b/etc/supervisord.conf index ded2548..e7c57cf 100644 --- a/etc/supervisord.conf +++ b/etc/supervisord.conf @@ -1,14 +1,8 @@ [supervisord] nodaemon=true -[program:xvfb] -command=/usr/bin/Xvfb :1 -screen 0 1366x768x24 -autorestart=true -user=bnuuy -priority=100 - -[program:x11vnc] -command=/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :1 -nopw -wait 5 -shared -permitfiletransfer -tightfilexfer +[program:xspice] +command=/usr/bin/Xspice --port 5900 --disable-ticketing :1 user=bnuuy autorestart=true priority=200 diff --git a/etc/xdg/openbox/menu.xml b/etc/xdg/openbox/menu.xml deleted file mode 100644 index e8977e8..0000000 --- a/etc/xdg/openbox/menu.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - /usr/bin/xfce4-terminal - - - - -