Skip to content

Instantly share code, notes, and snippets.

@pskopek
Created April 2, 2025 13:16
Show Gist options
  • Save pskopek/de9d79cf0511839dd5c97703be5cc624 to your computer and use it in GitHub Desktop.
Save pskopek/de9d79cf0511839dd5c97703be5cc624 to your computer and use it in GitHub Desktop.
Playwright compatible distrobox setup on Fedora 41

Setup on Fedora 41 (or other not supported Linux distro)

Playwright doesn't support Fedora distribution. Following is a description how to run the tests using Ubuntu 22.04 image using distrobox which is fairy supported on various Linux distributions.

Install distrobox and podman packages

sudo dnf install distrobox podman

Create home directory for your distrobox environment. It is useful not to mess with your host system home directory.

mkdir ~/distrobox

Create distrobox container environment to run tests

This command creates container using podman in your host. For more information see the documentation.

distrobox create \
--name pw --image ubuntu:22.04 \
--home ~/distrobox  \
--root \
--additional-packages "podman libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb" \
--unshare-all \
--absolutely-disable-root-password-i-am-really-positively-sure

Note

The last option of the previous command is not necessary. If avoided one will be asked for password used in sudo command in the container. One can enter the created distrobox environment using:

distrobox enter --root pw

Install nodejs in the newly created environment

We recommend to use Nodesource to help you with the nodejs setup in the container.

Enter the container using:

distrobox enter --root pw

Download and run the setup for nodejs on Ubuntu installation:

curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs -y

This made nodejs environment setup complete.

Next is to install playwright and run the test.

npx playwright install
npm test
@rao107
Copy link

rao107 commented Jun 20, 2025

If there are still missing libraries after following this, try running sudo apt update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment