Skip to content

Xvfb Fatal XKB Error in Lambda (Amazon Linux 2023) - EUID Permission Conflict

0

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?

1 Answer
0

May consider to redirect XKB output to /tmp (the only writable directory) or use the xvfb-run wrapper, which handles keyboard setup internally.

EXPERT

answered 21 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.