Running a game inside Docker and then streaming it over VNC will almost always feel sluggish for a few key reasons:
Lack of real GPU acceleration
• By default, Docker containers don’t “see” your host GPU. All rendering falls back to CPU‐based software rasterizers (Mesa’s LLVMpipe or similar), which are orders of magnitude slower than a real GPU.
• Even with NVIDIA’s nvidia‐docker (or the new --gpus flag), you need to explicitly expose the GPU and drivers—and set up VirtualGL (or similar) so that 3D calls actually go to the card.
VNC’s encoding/decoding overhead
• VNC protocols (RealVNC, TigerVNC, TightVNC, etc.) are optimized for desktop usage (text, windows, occasional video), not full-screen 60 FPS gaming.
• They grab the framebuffer, then CPU‐compress it (ZRLE, Tight, H.264, etc.), send it over TCP, and then the client must decode. That adds latency and often caps you at ~15–30 FPS, even on a fast LAN.
Networking and buffering
• Even on a gigabit LAN, you’ll see round-trip times, packet reordering, and client‐side buffering. Every extra millisecond kills responsiveness.
• TCP back-pressure means if the encoder can’t keep up, you get dropped frames or stutter.
Docker’s indirection
• You’ve now got: game → OpenGL/Vulkan → X11 (or Xvfb) → VNC server → socket → VNC client → your monitor.
• Every “hop” adds milliseconds. Container networking, shared mounts, and X11 forwarding all introduce tiny delays that add up.
How to speed things up
Expose real GPU acceleration
– On Linux, use NVIDIA Container Toolkit (nvidia‐docker2 / --gpus all).
– Install VirtualGL inside the container and run your game under vglrun so that 3D goes straight to the GPU.
– Mount /dev/dri (for Intel/AMD) or use AMD ROCm containers similarly.
Swap VNC for a low-latency protocol
– TurboVNC + VirtualGL can push up to ~60 FPS for many titles if configured correctly.
– Try xRDP with H.264 support (xrdp + xorgxrdp) or Guacamole with WebRTC/H.264.
– Even better: use gaming-oriented remoting like Parsec, Moonlight (NVIDIA Gamestream), Steam Remote Play or Sunshine. These use UDP + hardware H.264/H.265 encoders and give very low lag.
Tweak encoder settings
– Turn on hardware encoding (NVENC, VA-API, AMF) instead of CPU compression.
– Lower resolution or bit-rate if your link can’t handle full 1080p.
– Disable fancy desktop effects (compositors) inside the container.
Consider a VM or bare-metal host
– If you really need Windows games or DX11/12, look into a KVM-based Windows VM with GPU passthrough. The guest sees the card directly and you can still stream with Parsec or Moonlight.
Example: Docker + VirtualGL + TurboVNC snippet
bash
# 1) Run container with GPU
docker run -it \
--gpus all \
--device /dev/dri \
-e DISPLAY=:1 \
-p 5901:5901 \
my‐game‐container
# 2) Inside container, install & start VirtualGL + TurboVNC
apt update && apt install -y virtualgl turbovnc
vncserver :1 -geometry 1920x1080 -depth 24
# 3) Launch game under VirtualGL
vglrun /path/to/your/game-executable
Then connect your VNC client to host:5901.
Next steps / Questions for you
• What GPU and host OS are you on?
• Are you on a LAN or over the internet?
• Which VNC server/compression settings did you try?
With those details we can dial in a more targeted tweak set—up to switching you over to Parsec or Moonlight if you really need smooth 60 FPS action!