# Dockerfile-Ubuntu-Gnome **Repository Path**: deezeng/Dockerfile-Ubuntu-Gnome ## Basic Information - **Project Name**: Dockerfile-Ubuntu-Gnome - **Description**: from https://github.com/darkdragon-001/Dockerfile-Ubuntu-Gnome - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-23 - **Last Updated**: 2021-08-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Ubuntu Desktop (GNOME 3) Dockerfile This repository contains the *Dockerfile* and *associated files* for setting up a container with Ubuntu, GNOME 3, TigerVNC and noVNC. * The VNC Server currently defaults to 1366*768 24bit. ### Dependencies * [ubuntu:20.04](https://hub.docker.com/_/ubuntu) ### Usage #### Container actions * Start container: sudo docker run --name=ubuntu-gnome -d --rm \ --tmpfs /run --tmpfs /run/lock --tmpfs /tmp \ --cap-add SYS_BOOT --cap-add SYS_ADMIN \ -v /sys/fs/cgroup:/sys/fs/cgroup \ -p 5901:5901 -p 6901:6901 \ darkdragon001/ubuntu-gnome-vnc * Open (root) shell: sudo docker exec -it ubuntu-gnome bash * Open shell as user: sudo docker exec -it -u default ubuntu-gnome bash * Stop container: sudo docker stop ubuntu-gnome #### Connecting to instance * Connect to `vnc://:5901` via your VNC client. * Connect to `http://:6901` via your web browser. _**NOTE** The password is hardcoded to `acoman`._ #### Using the desktop * Gain root access via `sudo` ### Known issues * Sidebar/dock hidden by default * User switching / gdm3 not working ### Not tested * Sound (PulseAudio) ### Dee 如果要 VNC 不要那么多权限启动 (因为现在要宿主机的权限过多) * 可以先设置docker内访问dbus:https://georgik.rocks/how-to-start-d-bus-in-docker-container/ * Ubuntu: dbus-uuidgen > /var/lib/dbus/machine-id mkdir -p /var/run/dbus dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address * 再 vncserver 启动时 。带参数 (带上 localhost no 那一串,如果加 会启动不了) 如: /usr/bin/vncserver :1 -geometry 1366x768 -depth 24 -localhost no -fg 启动指令可以简化为: docker run -it --rm xxx:tag /bin/bash