Reuse XRDP's X server for VirtualGL

This commit is contained in:
Héctor Molinero Fernández
2020-03-06 20:01:07 +01:00
parent 366e2200e3
commit 859a3ab28a
4 changed files with 6 additions and 8 deletions

View File

@@ -404,7 +404,7 @@ ENV UNPRIVILEGED_USER_GROUPS=
ENV UNPRIVILEGED_USER_SHELL=/bin/bash
ENV RDP_TLS_KEY_PATH=/etc/xrdp/key.pem
ENV RDP_TLS_CERT_PATH=/etc/xrdp/cert.pem
ENV ENABLE_VIRTUALGL=false
ENV ENABLE_XDUMMY=false
ENV PATH=/opt/VirtualGL/bin:${PATH}
ENV VGL_DISPLAY=:0
## Workaround for AMDGPU X_GLXCreatePbuffer issue:
@@ -435,6 +435,7 @@ RUN printf '%s\n' 'exec xfce4-session' > /etc/skel/.xsession
# Create /etc/skel/.xsessionrc file
RUN printf '%s\n' \
'export VGL_DISPLAY=${DISPLAY:?}' \
'export XDG_CACHE_HOME=${HOME:?}/.cache' \
'export XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg' \
'export XDG_CONFIG_HOME=${HOME:?}/.config' \

View File

@@ -23,9 +23,6 @@ docker run \
> **Important:** some software (like Firefox) need the shared memory to be increased, if you
encounter any problem related to this you may use the `--shm-size` option.
> **Important:** enabling VirtualGL support requires the `--privileged` option and the X server
required for VirtualGL will conflict with the host X server.
## Environment variables
* `UNPRIVILEGED_USER_UID`: unprivileged user UID (`1000` by default).
@@ -34,7 +31,7 @@ required for VirtualGL will conflict with the host X server.
* `UNPRIVILEGED_USER_PASSWORD`: unprivileged user password (`password` by default).
* `UNPRIVILEGED_USER_GROUPS`: comma-separated list of additional GIDs for the unprivileged user (none by default).
* `UNPRIVILEGED_USER_SHELL`: unprivileged user shell (`/bin/bash` by default).
* `ENABLE_VIRTUALGL`: enable VirtualGL support in the container (`false` by default).
* `ENABLE_XDUMMY`: enable an X dummy server (`false` by default and requires the `--privileged` option).
## License

View File

@@ -40,7 +40,7 @@ printf -- '%s\n' "Creating \"${CONTAINER_NAME:?}\" container..."
--shm-size 2g \
--publish 3322:3322/tcp \
--publish 3389:3389/tcp \
--env ENABLE_VIRTUALGL=true \
--env ENABLE_XDUMMY=true \
--device /dev/dri:/dev/dri \
"${IMAGE_NAME:?}" "$@" >/dev/null

View File

@@ -44,8 +44,8 @@ unset UNPRIVILEGED_USER_PASSWORD
# Dump environment variables
export-env > /etc/profile.d/env.sh
# Enable xdummy service if ENABLE_VIRTUALGL is true
if [ "${ENABLE_VIRTUALGL:?}" = 'true' ]; then
# Enable xdummy service if ENABLE_XDUMMY is true
if [ "${ENABLE_XDUMMY:?}" = 'true' ]; then
ln -s /etc/sv/xdummy /etc/service/
fi