Issue:
Attempting to run Xvfb (xorg-x11-server-Xvfb) within an AWS Lambda Docker container (Node.js 20 / AL2023) fails with a fatal keyboard initialization error.
Error Logs:
_XSERVTransmkdir: ERROR: euid != 0, directory /tmp/.X11-unix will not be created.
XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
(EE) Fatal server error: (EE) Failed to activate virtual core keyboard: 2
Environment:
Base Image: public.ecr.aws/lambda/nodejs:20 (AL2023)
Context: Headless WebGL rendering for Node.js (using gl and PixiJS).
Attempts made:
Setting XKB_OUTPUT_DIR=/tmp and HOME=/tmp.
Using -nolisten unix to bypass /tmp/.X11-unix permission issues.
Providing a dummy xkbcomp binary.
Question:
In the restricted, non-root Lambda environment, how can we satisfy the xkbcomp requirement for Xvfb when it expects to write to protected paths? Is there a recommended way to initialize a virtual display on AL2023 without Xvfb crashing on keyboard setup?