Skip to content

Commit

Permalink
Trying to get software OpenGL rendering to work
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Aug 7, 2024
1 parent 9bab0f1 commit c4f1ec3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
Empty file added .Xauthority
Empty file.
40 changes: 39 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,47 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu

RUN apt update
RUN apt install --yes xfce4 xfce4-goodies gnome-icon-theme dbus-x11 xfce4-terminal tightvncserver

# Set non-interactive mode to avoid prompts
ENV DEBIAN_FRONTEND=noninteractive

# Update the package list and install necessary packages
RUN apt-get update && \
apt-get install -y \
mesa-utils \
mesa-utils-extra \
software-properties-common \
build-essential \
wget \
libx11-dev \
libxext-dev \
libxdamage-dev \
libxfixes-dev \
libvulkan-dev \
libdrm-dev \
libgbm-dev \
llvm-dev \
llvm

# Install Mesa with software rendering (LLVMPipe)
RUN add-apt-repository -y ppa:kisak/kisak-mesa && \
apt-get update && \
apt-get install -y \
mesa-opencl-icd \
libgl1-mesa-dri

# Set environment variables to use LLVMPipe
ENV LIBGL_ALWAYS_SOFTWARE=1
ENV MESA_LOADER_DRIVER_OVERRIDE=llvmpipe

RUN apt install --yes xfce4 xfce4-goodies gnome-icon-theme dbus-x11 xfce4-terminal xvfb x11vnc
# Register xfce4-terminal as an alternative for x-terminal-emulator
RUN update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/xfce4-terminal 50
# Set xfce4-terminal as the default x-terminal-emulator
RUN update-alternatives --set x-terminal-emulator /usr/bin/xfce4-terminal

# Create and set the XDG_RUNTIME_DIR
RUN mkdir -p /tmp/runtime

# Set environment variables for the user
ENV XDG_RUNTIME_DIR=/tmp/runtime
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5901],
"forwardPorts": [5900],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sudo ./.devcontainer/setup.sh",
Expand Down
11 changes: 5 additions & 6 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#! /bin/bash

touch .Xauthority
Xvfb :1 -screen 0 1920x1080x24 &
export DISPLAY=:1

umask 0077
mkdir -p "$HOME/.vnc"
chmod go-rwx "$HOME/.vnc"
vncpasswd -f <<<"unipept" >"$HOME/.vnc/passwd"
vncserver -geometry 1920x1080
startxfce4 &

x11vnc -display :1

0 comments on commit c4f1ec3

Please sign in to comment.