Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

desktop-lite feature: The desktop-lite feature is not enabling VNC password authentication

Aperta
#1,168 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
docker, docker-compose, shell

Direzione di ricerca

Riproduci il problema con i file devcontainer.json e compose.yaml mostrati, quindi ispeziona install.sh e il file /usr/local/share/desktop-init.sh generato. Confronta la condizione VNC_PASSWORD con la presenza di /usr/local/etc/vscode-dev-containers/vnc-passwd; il lavoro è completato quando la password configurata viene applicata all’apertura della porta 6080 senza richiedere una variabile d’ambiente aggiuntiva.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I've found that VNC password authentication is not being enforced in the desktop-lite feature. Here's a reproducible scenario:

Directory Structure

dvc-desktop-lite/
├── .devcontainer
│   └── devcontainer.json
└── compose.yaml

devcontainer.json

{
    "name": "dvc-desktop-lite",
    "dockerComposeFile": "../compose.yaml",
    "features": {
        "ghcr.io/devcontainers/features/desktop-lite:1.2.5": {
            "version": "latest",
            "password": "vscode11"
        }
    },
    "service": "dvc-desktop-lite",
    "runServices": [
        "dvc-desktop-lite"
    ],
    "remoteUser": "node",
    "shutdownAction": "stopCompose",
    "workspaceFolder": "/home/node",
    "forwardPorts": [
        6080,
        5901
    ],
    "portsAttributes": {
        "6080": {
            "label": "novnc"
        },
        "5901": {
            "label": "tigervnc"
        }
    }
}

compose.yaml

name: dvc-desktop-lite
services:
  dvc-desktop-lite:
    image: mcr.microsoft.com/devcontainers/typescript-node:22-bookworm
    init: true
    tty: true
    user: node
    working_dir: /home/node

With the above files prepared, start the development container by Dev Containers: open Folder in Container

Then, open http://localhost:6080 in a web browser. The VNC screen will be displayed without authentication.

To enable VNC password authentication, modify the compose.yaml file as follows:

name: dvc-desktop-lite
services:
  dvc-desktop-lite:
    image: mcr.microsoft.com/devcontainers/typescript-node:22-bookworm
    init: true
    tty: true
    user: node
    working_dir: /home/node
    environment:
      VNC_PASSWORD: enable

This is caused by the following process in /usr/local/share/desktop-init.sh, which is generated by install.sh.

if [ -n "${VNC_PASSWORD+x}" ]; then
    startInBackgroundIfNotRunning "Xtigervnc" sudoUserIf "${common_options} -passwd /usr/local/etc/vscode-dev-containers/vnc-passwd"
    # (snip)
fi

By modifying the configuration as shown below, I was able to achieve the desired behavior and enable VNC password authentication. The password used for authentication in this case was "vscode11", which was specified in the devcontainer.json file.

if [ -e "/usr/local/etc/vscode-dev-containers/vnc-passwd" ]; then
    startInBackgroundIfNotRunning "Xtigervnc" sudoUserIf "${common_options} -passwd /usr/local/etc/vscode-dev-containers/vnc-passwd"
    # (snip)
fi

Previously, VNC password authentication was enabled without specifying any environment variables, but now it requires the VNC_PASSWORD environment variable to be set.

If this is the intended behavior, I would appreciate it if you could document this change.

Lingua principale
Shell
Stelle
1.5k
Fork
624
Merge medio
4g 8h
PR unite (30g)
7

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di devcontainers/features

Tutte le issue di devcontainers/features

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.