{"id":13615460,"url":"https://github.com/gezp/docker-ubuntu-desktop","last_synced_at":"2025-04-13T21:30:54.288Z","repository":{"id":37799389,"uuid":"295658086","full_name":"gezp/docker-ubuntu-desktop","owner":"gezp","description":"Docker Image for Ubuntu Desktop which support HW GPU accelerated GUI apps. you can access the Container with ssh or remote desktop,  just like Cloud VM.","archived":false,"fork":false,"pushed_at":"2024-10-24T01:31:53.000Z","size":988,"stargazers_count":299,"open_issues_count":4,"forks_count":65,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-07T23:39:27.990Z","etag":null,"topics":["cuda","docker","kasmvnc","nomachine","nvidia-gpu","opengl","remote-desktop","ubuntu","virtualgl"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gezp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-15T08:07:01.000Z","updated_at":"2024-11-07T06:23:05.000Z","dependencies_parsed_at":"2023-01-21T13:18:57.502Z","dependency_job_id":"d34320ee-dc92-4ed8-9fce-289ff7fe7c50","html_url":"https://github.com/gezp/docker-ubuntu-desktop","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gezp%2Fdocker-ubuntu-desktop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gezp%2Fdocker-ubuntu-desktop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gezp%2Fdocker-ubuntu-desktop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gezp%2Fdocker-ubuntu-desktop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gezp","download_url":"https://codeload.github.com/gezp/docker-ubuntu-desktop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248786035,"owners_count":21161387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","docker","kasmvnc","nomachine","nvidia-gpu","opengl","remote-desktop","ubuntu","virtualgl"],"created_at":"2024-08-01T20:01:14.014Z","updated_at":"2025-04-13T21:30:53.112Z","avatar_url":"https://github.com/gezp.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"\n\n# Ubuntu Desktop based on Docker\n\n[![DockerHub](https://img.shields.io/badge/DockerHub-brightgreen.svg?style=popout\u0026logo=Docker)](https://hub.docker.com/r/gezp/ubuntu-desktop)\n\n[简体中文](README_cn.md)\n\nThis project provides a docker image which supports ubuntu desktop (xfce4, lightweight, fast and low on system resources), so that you can run virtual ubuntu desktop in container, you can access it by using ssh or remote desktop just like a virtual machine.\n\nHardware GPU accelerated rendering for 3D GUI application is supported in container, it's based on EGL by using [VirtualGL](https://github.com/VirtualGL/virtualgl), and doesn't require `/tmp/.X11-unix`. if you needn't hardware GPU accelerated rendering, you can also run this container on headless host without GPU (for exmaple, Cloud Server), remote desktop and 3d GUI based on software rendering (high cpu usgae) is also supported.\n\n\u003e Tip: Hardware GPU accelerated rendering is only verified on `ubuntu desktop system` host with `monitor`.  i'm not sure if hardware GPU accelerated rendering can work for  headless `ubuntu server system` host.\n\n## Features\n\n* Remote access by ssh and remote desktop (nomachine/kasmvnc/novnc).\n* OpenGL rendering based on software rasterizer (LLVMpipe) with high CPU usgae. (default)\n* OpenGL rendering based on Nvidia GPU hardware-accelerated.\n* Pre-installed Firefox web browser.\n* pre-installed CUDA toolkit, which is useful for deep learning, such as pytorch, tensorflow.\n\n\u003e Tip:  it's useful to share public computer resources in labs, you can run a independent computer environment like a virtual machine, but more lightweight, and easier to deploy.\n\u003e\n\u003e * fast to deploy multiple independent developing environment on a single computer.\n\u003e * easy to share files with host or another container.\n\u003e * easy to transfer environment to another new computer (save and load image).\n\nxfce4 desktop:\n\n![](img/desktop.png)\n\n## Docker Image Tags:\n\nSupported Tags (you can find here [Github Tag](https://github.com/gezp/docker-ubuntu-desktop/tags))：\n* Tags of base image：`18.04`, `20.04`, `22.04`, `24.04`\n* Tags of image with cuda (based on `nvidia/cuda`)：`18.04-cu11.0.3`, `20.04-cu11.0.3` etc. \n* naming rules is `{UBUNTU VERSION}-cu{CUDA VERSION}`, you can find supported `{CUDA VERSION}` in [Docker Image \u003cnvidia/cuda\u003e](https://gitlab.com/nvidia/container-images/cuda/-/blob/master/doc/supported-tags.md)\n\n\u003e Supported {CUDA VERSION}:\n\u003e * Ubuntu18.04：`11.0.3`, `11.1.1`, `11.2.2`\n\u003e * Ubuntu20.04：`11.0.3`, `11.1.0`, `11.2.2`, `11.3.1`, `11.4.3`, `11.5.2`, `11.6.2`, `11.7.1`\n\u003e * Ubuntu22.04：`11.7.1`, `11.8.0`, `12.0.1`, `12.1.1`, `12.2.2`, `12.3.2`, `12.4.1`, `12.5.1 `\n\u003e * Ubuntu24.04：`12.5.1 `, `12.6.2`\n\n## Preliminary\n\n* install `nvidia driver`\n* install `docker` and `nvidia-container-runtime`.\n\n\u003e Tip: the newer cuda version isn't supported if you use older nvidia driver.\n\n## Quickly Start\n\npull docker image\n```bash\ndocker pull gezp/ubuntu-desktop:20.04-cu11.0.3\n# use aliyuncs mirror for chinese users (国内用户可使用阿里云仓库)\n# docker pull registry.cn-hongkong.aliyuncs.com/gezp/ubuntu-desktop:20.04-cu11.0.3\n```\n\ncreate container\n```bash\n# create container with nomachine\ndocker run -d --restart=on-failure \\\n    --name my_workspace \\\n    --cap-add=SYS_PTRACE \\\n    --gpus all  \\\n    --shm-size=1024m \\\n    -e USER=ubuntu \\\n    -e PASSWORD=ubuntu \\\n    -e GID=$(id -g) \\\n    -e UID=$(id -u) \\\n    -p 10022:22 \\\n    -p 14000:4000 \\\n    -p 15000:5000 \\\n    gezp/ubuntu-desktop:20.04-cu11.0.3\n\n# create container with kasmvnc/novnc\ndocker run -d --restart=on-failure \\\n    --name my_workspace \\\n    --gpus all  \\\n    --shm-size=1024m \\\n    -e USER=ubuntu \\\n    -e PASSWORD=ubuntu \\\n    -e GID=$(id -g) \\\n    -e UID=$(id -u) \\\n    -e REMOTE_DESKTOP=kasmvnc \\\n    -p 10022:22 \\\n    -p 14000:4000 \\\n    -p 15000:5000 \\\n    gezp/ubuntu-desktop:20.04-cu11.0.3\n```\n* the default username and password are both ubuntu.\n\naccess container by ssh\n```bash\nssh ubuntu@host-ip -p 10022\n```\n* it's recommended to use vscode + remote ssh plugin\n\naccess container by remote desktop (nomachine)\n\n* download and install [nomachine software](https://www.nomachine.com/).\n* the ip is host's ip, the port is 14000.\n\naccess container by remote desktop (kasmvnc/novnc)\n\n* use browser to access `https://\u003chost-ip\u003e:14000` (chrome is recommended)\n\n\u003e Tip `novnc` option based on [TurboVNC](https://github.com/TurboVNC/turbovnc) + [noVNC](https://github.com/novnc/noVNC), which are free and open-source softwares.\n\nfeatures of moachine/kasmvnc/novnc:\n\n* moachine: need client software to access remote desktop, and support audio, uploads, downloads.\n* kasmvnc/novnc: provide remote web-based access to desktop, but it doesn't support audio, uploads, downloads, and microphone pass-through.\n\naccess container by [code-server](https://github.com/coder/code-server) (VS Code in the browser)\n\n* use browser to access `https://\u003chost-ip\u003e:15000` (chrome is recommended)\n\n## Advanced Usage\n\n#### Custom User Argument\n\nconfigure by setting environment variables when you create container.\n\n* `REMOTE_DESKTOP`: nomachine (default) , kasmvnc, novnc.\n* `VNC_THREADS`: RectThread num for vncserver, only used when `REMOTE_DESKTOP` = kasmvnc. default is 2, set 0 for auto.\n* `HTTPS_CERT`: SSL pem certificate file path to use for https server(kasmvnc/nonvc)\n* `HTTPS_CERT_KEY`: SSL pem key file path to use for https server(kasmvnc/nonvc)\n\n#### Enable GPU hardware-accelerated rendering\n\n#### Test VirtualGL\n\n```bash\nvglrun glxinfo | grep -i \"opengl\"\n```\n\n* hardware-accelerated is enable successfully if it's output contain `NVIDIA Product Series`.\n\nyou need add prefix  `vglrun`  for command when you run 3D software, for example `vglrun gazebo`.\n\n#### Test vulkan\n\n```bash\n# vulkan info\nvulkaninfo | grep -i \"GPU\"\n# vulkan demo\nvkcube\n```\n\n* it's output should contain `NVIDIA Product Series` if vulkan works well.\n\n#### CUDA\n\nadd shell in `.bashrc` to update environment variable\n```bash\nexport CUDA_HOME=/usr/local/cuda\nexport PATH=/usr/local/cuda/bin:$PATH\nexport LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH\n```\n* for detailed usage, you can refer to `nvidia/cuda` Docker Image.\n\n## Build\n\nfor example\n```bash\ngit clone https://github.com/gezp/docker-ubuntu-desktop.git\ncd docker-ubuntu-desktop\n# for 20.04\n./docker_build.sh 20.04\n# for 20.04-cu11.0.3  (based on nvidia/cuda)\n./docker_build.sh 20.04-cu11.0.3\n```\n\n## Acknowledgement\n\nthanks to the authors of following related projects:\n* https://github.com/selkies-project/docker-nvidia-egl-desktop\n* https://github.com/kasmtech/KasmVNC\n* https://github.com/VirtualGL/virtualgl\n* https://github.com/linuxserver/docker-baseimage-kasmvnc\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgezp%2Fdocker-ubuntu-desktop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgezp%2Fdocker-ubuntu-desktop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgezp%2Fdocker-ubuntu-desktop/lists"}