- reduce resolution to 640x480 (to reduce CPU usage) - renamed restart-aot-crash.sh to aot-monitor.sh - added new env variable RESOLUTION for setting x11 and AgeOfTime game resolution on container startup (so it's easy to change) - updated readme
aot-wine-x11-novnc-docker
This docker image will run AgeOfTime game client under wine in an Ubuntu container with a novnc server for you to view the application. Uses supervisor to automatically restart failed processes.
Runs a small script in the background that will automatically kill the process if a wine "Program Error" dialog is displayed (since it starts winedbg instead of just quitting).
This script also runs cpulimit against the PID of the AgeOfTime.exe process to limit how much CPU it can consume (only if AOT_CPU_LIMIT
env variable is defined and not zero).
This container runs:
- Xvfb - X11 in a virtual framebuffer
- x11vnc - A VNC server that scrapes the above X11 server
- noNVC - A HTML5 canvas vnc viewer
- pulseaudio - Audio server (AOT crashes without proper audio)
- audiostream & websockify_audio - these are supposed to pass audio to the VNC web session but currently doesn't work
- Fluxbox - a small window manager
- AgeOfTime.exe - The game executable
- aot-monitor.sh - Bash script that runs in the background to kill the game process if any
Program Error
dialogs pop up (since the game doesn't fully exit supervisor wont detect it crashed). This script also appliescpulimit
ifAOT_CPU_LIMIT
env variable is used.
This is a trusted build on the Docker Hub.
env
There are a few env variables that can be set on the container:
AOT_CPU_LIMIT
(default value:0
)- This is essentially the
-l
option forcpulimit
which description states:percentage of CPU allowed from 1 up. Usually 1 - 100, but can be higher on multi- core CPUs.
- By default, the
docker-compose.yaml
file limits the cpus to 2. You should be limiting how many CPUs the container has access to (one or two cores should work fine) and not just relying on this env variable. - If set to a number this will be written to a file in the AgeOfTime directory called
aot_cpu_limit
that will be used for controlling the cpu limit dynamically (updated every second).
- This is essentially the
RESOLUTION
(default value:1024x768x24
)- Sets the resolution for x11 and AgeOfTime. On container startup this variable is read before starting supervisor and used to update the
baes/client/prefs.cs
AgeOfTime file with the resolution.
- Sets the resolution for x11 and AgeOfTime. On container startup this variable is read before starting supervisor and used to update the
Run It
Modify your docker-compose.yml
file to your liking then:
docker compose up
Or using docker run
docker run \
-p 8080:8080 \
-e "AOT_CPU_LIMIT=0" \
-e "RESOLUTION=640x480x24" \
skylord123/aot-wine-x11-novnc-docker
Run with existing AgeOfTime folder (replace /path/on/host
):
docker run \
-p 8080:8080 \
-e "AOT_CPU_LIMIT=0" \
-e "RESOLUTION=640x480x24" \
--volume "/path/on/host:/root/prefix32/drive_c/Program Files (x86)/AgeOfTime" \
skylord123/aot-wine-x11-novnc-docker
Go to http://localhost:8080
in your browser and you should see AgeOfTime boot up.
Issues
- Audio isn't working correctly. Keeps crashing when supservisor tries to start it and shortly gives up.
- Console output of game isn't being sent to the contrainer stdout (would be nice to fix this so the container logs show the game logs)