When trying to include everything, including the environment for development might not be enough, even with the same ubuntu system. Recently, I encountered a bug where display is not properly shown, I have several doubts regarding the scenario.

In the devcontainer part of the disk, it mount certain part of the disk into the development disk

{
    "name": "Servo Development",
    "image": "servo",
    "workspaceFolder": "/workspace",
    "mounts": [
        "source=${localWorkspaceFolder},target=/workspace,type=bind"
    ],
    "customizations": {
        "vscode": {
            "extensions": [
                "rust-lang.rust-analyzer",
                "ms-python.python",
                "ms-vscode.cpptools"
            ]
        }
    },
    "postCreateCommand": "rustc --version && python --version",
    "remoteUser": "root"
}

However, the mounts may not be complete, one need to also mount the necessary X-11 folder with the one in docker container. Adding the source below to the docker’s devcontainer.json in VS Code might also be necessary.

"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached"

Then the X11 is mounted to the container running for development, and the usual command inside the container could also appear with ./mach run -d

One more important thing after reboot the PC, need to add docker to xhost guarantee it works.

xhost +local:docker
# non-network local connections being added to access control list