Adds a lightweight Fluxbox based desktop to the container that can be accessed using a VNC viewer or the web. GUI-based commands executed from the built-in VS code terminal will open on the desktop automatically.
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {}
}| Options Id | Description | Type | Default Value |
|---|---|---|---|
| version | Currently Unused! | string | latest |
| noVncVersion | The noVNC version to use | string | 1.2.0 |
| password | Enter a password for desktop connections. If "noPassword", connections from the local host can be established without entering a password | string | vscode |
| webPort | Enter a port for the VNC web client (noVNC) | string | 6080 |
| vncPort | Enter a port for the desktop VNC server (TigerVNC) | string | 5901 |
This feature provides two ways of connecting to the desktop environment it adds. The first is to connect using a web browser. To do so:
- Forward the noVNC port (
6080by default) to your local machine using either theforwardPortsproperty indevcontainer.jsonor the user interface in your tool (e.g., you can press F1 or Ctrl/Cmd+Shift+P and select Ports: Focus on Ports View in VS Code to bring it into focus). - Open the ports view in your tool, select the noVNC port, and click the Globe icon.
- In the browser that appears, click the Connect button and enter the desktop password (
vscodeby default).
To set up the 6080 port from your devcontainer.json file, include the following:
"forwardPorts": [6080],
"portsAttributes": {
"6080": {
"label": "desktop"
}
}You can also connect to the desktop using a VNC viewer. To do so:
- Connect to the environment from a desktop tool that supports the dev container spec (e.g., VS Code client).
- Forward the VNC server port (
5901by default) to your local machine using either theforwardPortsproperty indevcontainer.jsonor the user interface in your tool (e.g., you can press F1 or Ctrl/Cmd+Shift+P and select Ports: Focus on Ports View in VS Code to bring it into focus). If you are using the Dev Container CLI, you should instead use theappPortproperty indevcontainer.json. - Start your VNC Viewer and connect to localhost:5901. Note that you may need to bump up the color depth to 24 bits to see full color.
- Enter the desktop password (
vscodeby default).
The window manager installed is Fluxbox. Right-click to see the application menu. In addition, any UI-based commands you execute inside the dev container will automatically appear on the desktop.
You can customize the desktop using Fluxbox configuration files. The configuration files are located in the .fluxbox folder of the home directory of the user you using to connect to the dev container ($HOME/.fluxbox).
If you add custom content to your base image or a Dockerfile in this location, the Feature will automatically use it rather than its default configuration.
See the Fluxbox menu documentation for format details. More information on additional customization can be found in Fluxbox's help and general documentation.
If you run into applications crashing, you may need to increase the size of the shared memory space allocated to your container. For example, this will bump it up to 1 GB in devcontainer.json:
"runArgs": ["--shm-size=1g"]Or using Docker Compose:
services:
your-service-here:
# ...
shm_size: '1gb'
# ...If you need a browser, you can install Firefox ESR by adding the following to .devcontainer/Dockerfile:
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get install -y firefox-esrIf you want the full version of Google Chrome in the desktop:
-
Add the following to
.devcontainer/DockerfileRUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && curl -sSL https://dl.google.com/linux/direct/google-chrome-stable_current_$(dpkg --print-architecture).deb -o /tmp/chrome.deb \ && apt-get -y install /tmp/chrome.deb -
Chrome sandbox support requires you set up and run as a non-root user. The
common-utilsscript can do this for you, or you set one up yourself. Alternatively, you can start Chrome usinggoogle-chrome --no-sandbox
That's it!
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the apt package manager installed.
bash is required to execute the install.sh script.
Note: This file was auto-generated from the devcontainer-feature.json. Add additional notes to a NOTES.md.