Xvfb not working


I’m trying to setup a new project. It’s an electron project with spectron, which runs GUI tests similar to selenium.

My config looks like this:

version: 2
      - image: circleci/node:7.10
    working_directory: ~/repo
      - checkout
      - restore_cache:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-
      - run: npm install
      - save_cache:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - run:
          name: Running X virtual framebuffer
          command: Xvfb :99 -screen 0 1280x1024x24
          background: true
      - run: npm test

I get this error:

#!/bin/bash -eo pipefail
Xvfb :99 -screen 0 1280x1024x24
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
Step was canceled


Can you pull that image to your local machine, and docker exec -it (containername) sh into it, to experiment with stuff? I assume it will be running some sort of shell, so you can have a poke around.

(Aside: please add your logs/errors as text, not images. I was going to copy+paste that error into a search engine, but cannot. Here’s why. Thanks!).


Sorry about that, I’ve updated the question with the text too.


Use the -node-browsers variant of that image and Xvfb will be running

 - image: circleci/node:7.10-node-browsers