Desktop is broken and doesn't open with custom Dockerfile

Where does the bug appear (feature/product)?

Somewhere else…

Describe the Bug

I am trying to use cursor cloud agents, and I have a custom Dockerfile as I need to run docker in the agent, but now my desktop is broken, I can’t connect to it, the chat can as it can open browser windows, etc. But not when it tries to click the chrome icon using the deck:

# any ubuntu or debian based image should work
FROM ubuntu:24.04

ENV DISPLAY=:1

# Configure docker apt repo
RUN apt-get update && apt-get install -y --no-install-recommends \
        ca-certificates \
        curl \
    && rm -rf /var/lib/apt/lists/* \
    && install -m 0755 -d /etc/apt/keyrings \
    && . /etc/os-release \
    && curl -fsSL https://download.docker.com/linux/${ID}/gpg -o /etc/apt/keyrings/docker.asc \
    && chmod a+r /etc/apt/keyrings/docker.asc \
    && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install development tools and system libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential \
        docker-ce \
        docker-compose-plugin \
        git \
        git-lfs \
        less \
        libcairo2-dev \
        libgif-dev \
        libjpeg-dev \
        libpango1.0-dev \
        libpng-dev \
        librsvg2-dev \
        pkg-config \
        poppler-utils \
        python3 \
        python3-pip \
        ripgrep \
        sudo \
        tmux \
        unzip \
        wget \
        zip \
    && rm -rf /var/lib/apt/lists/*

# Give ubuntu user docker and sudo access
RUN usermod -aG docker ubuntu \
    && echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Install uv system-wide
RUN curl --retry 3 --retry-delay 5 -LsSf https://astral.sh/uv/install.sh \
    | env UV_INSTALL_DIR=/usr/local/bin sh

# Switch to ubuntu user for nvm/node/pnpm install
ENV NVM_DIR=/home/ubuntu/.nvm
ENV NODE_VERSION=20

USER ubuntu
WORKDIR /home/ubuntu

ENV PNPM_HOME=/home/ubuntu/.local/share/pnpm
ENV PATH=$PNPM_HOME:$PATH

RUN mkdir -p "$NVM_DIR" && \
    curl --retry 3 --retry-delay 5 -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash && \
    . "$NVM_DIR/nvm.sh" && \
    nvm install "$NODE_VERSION" && \
    nvm alias default "$NODE_VERSION" && \
    nvm use default && \
    curl --retry 3 --retry-delay 5 -fsSL https://get.pnpm.io/install.sh | env SHELL=/bin/bash sh -

RUN { \
        echo 'export NVM_DIR="$HOME/.nvm"'; \
        echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"'; \
        echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"'; \
        echo 'export PNPM_HOME="$HOME/.local/share/pnpm"'; \
        echo 'export PATH="$PNPM_HOME:$PATH"'; \
    } >> /home/ubuntu/.bashrc && \
    { \
        echo 'export NVM_DIR="$HOME/.nvm"'; \
        echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"'; \
        echo 'export PNPM_HOME="$HOME/.local/share/pnpm"'; \
        echo 'export PATH="$PNPM_HOME:$PATH"'; \
    } >> /home/ubuntu/.profile

USER root

RUN ln -sf "$NVM_DIR/versions/node/$(. "$NVM_DIR/nvm.sh" && nvm version default)/bin/node" /usr/local/bin/node && \
    ln -sf "$NVM_DIR/versions/node/$(. "$NVM_DIR/nvm.sh" && nvm version default)/bin/npm" /usr/local/bin/npm && \
    ln -sf "$NVM_DIR/versions/node/$(. "$NVM_DIR/nvm.sh" && nvm version default)/bin/npx" /usr/local/bin/npx && \
    ln -sf "$PNPM_HOME/pnpm" /usr/local/bin/pnpm && \
    ln -sf "$PNPM_HOME/pnpx" /usr/local/bin/pnpx

USER ubuntu
WORKDIR /home/ubuntu

CMD ["/bin/bash"]

Steps to Reproduce

Create a repo with my dockerfile and try to connect to the desktop

Expected Behavior

I should be able to connect to the desktop

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

Not using any specific version

Does this stop you from using Cursor

Yes - Cursor is unusable

I have encountered the same issue. Here is my Dockerfile:

FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
  && apt-get install -y --no-install-recommends \
    ca-certificates \
    curl \
    gnupg \
    jq \
    lsb-release \
    software-properties-common \
    sudo \
    tmux \
    build-essential \
    git \
    make \
    pkg-config \
    unzip \
    libpq-dev \
    libssl-dev \
    libffi-dev \
  && add-apt-repository -y ppa:deadsnakes/ppa \
  && apt-get update \
  && apt-get install -y --no-install-recommends \
    python3.13 \
    python3.13-dev \
    python3.13-venv \
  && curl -sS https://bootstrap.pypa.io/get-pip.py | python3.13 \
  && rm -rf /var/lib/apt/lists/*

RUN ln -sf /usr/bin/python3.13 /usr/local/bin/python3 \
  && ln -sf /usr/bin/python3.13 /usr/local/bin/python

RUN install -m 0755 -d /etc/apt/keyrings \
  && curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
    | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
  && chmod a+r /etc/apt/keyrings/docker.gpg \
  && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu noble stable" \
    > /etc/apt/sources.list.d/docker.list \
  && apt-get update \
  && apt-get install -y --no-install-recommends \
    docker-ce \
    docker-ce-cli \
    containerd.io \
    docker-compose-plugin \
  && rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
  && apt-get install -y --no-install-recommends nodejs \
  && corepack enable \
  && corepack prepare [email protected] --activate \
  && rm -rf /var/lib/apt/lists/*

ENV POETRY_VERSION=2.3.4
RUN curl -sSL https://install.python-poetry.org \
    | POETRY_VERSION="${POETRY_VERSION}" POETRY_HOME=/opt/poetry python3.13 - \
  && ln -sf /opt/poetry/bin/poetry /usr/local/bin/poetry

RUN curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip \
  && unzip -q /tmp/awscliv2.zip -d /tmp \
  && /tmp/aws/install \
  && rm -rf /tmp/aws /tmp/awscliv2.zip

RUN curl -fsSL "https://rolesanywhere.amazonaws.com/releases/1.7.3/X86_64/Linux/Amzn2023/aws_signing_helper" \
    -o /usr/local/bin/aws_signing_helper \
  && chmod +x /usr/local/bin/aws_signing_helper

RUN if [ -x /usr/libexec/docker/cli-plugins/docker-compose ]; then \
      ln -sf /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose; \
    elif [ -x /usr/lib/docker/cli-plugins/docker-compose ]; then \
      ln -sf /usr/lib/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose; \
    fi

RUN mkdir -p /etc/sudoers.d \
  && id -u ubuntu >/dev/null 2>&1 || useradd -m -s /bin/bash ubuntu \
  && echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu \
  && chmod 0440 /etc/sudoers.d/ubuntu \
  && groupadd -f docker \
  && usermod -aG docker ubuntu

WORKDIR /workspace

taking a look at this

Can you try adding locales and xz-utils to the list of installed apt-get dependencies in your dockerfile? That fixes it in my local tests.

I’m also adding locales and xz-utils to our automatic environment installer, so that you shouldn’t need to explicitly list them going forwards - will likely be live sometime tomorrow.

I would just like to congratulate the Cursor team for such a speedy response, it might be expensive but little things like this makes all the dollar spent feel worth it

thanks, glad we could help!