Skip to content

Xvfb fails with "XKB: Failed to compile keymap" in Lambda container images Environment #376

@khanzzirfan

Description

@khanzzirfan
  • Lambda container image based on public.ecr.aws/lambda/nodejs:20
  • Amazon Linux 2023
  • Xvfb from xorg-x11-server-Xvfb

Issue: Running Xvfb directly in Lambda fails with:

XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
Fatal server error: Failed to activate virtual core keyboard: 2

Root Cause: Lambda's read-only filesystem prevents xkbcomp from writing compiled keymaps to /var/lib/xkb. Even with xkeyboard-config and xkbcomp installed, Xvfb cannot initialize because XKB compilation fails. Workaround: Using xvfb-run wrapper instead of direct Xvfb invocation works, as it handles XKB setup internally. Request: Please provide either:

  1. A Lambda layer with pre-configured Xvfb/XKB support
  2. Documentation for headless GL rendering in Lambda containers
  3. Allow /var/lib/xkb to be writable or support XKB_OUTPUT_DIR environment variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions