Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build a full Ubuntu desktop docker image

I want to build a full version of Ubuntu 14 desktop as the base image for gui applications, I know how to build on the Ubuntu desktop version by the debootstrap, as described in https://docs.docker.com/articles/baseimages/, but that is a minimal Linux version and some GUI application cannot run perfectly, because there are some basic components missing, such as a font family, so I want the full control of a basic image, thanks!

like image 454
wei wang Avatar asked Jul 16 '15 06:07

wei wang


2 Answers

fcwu/docker-ubuntu-vnc-desktop

https://github.com/fcwu/docker-ubuntu-vnc-desktop provides a convenient setup:

docker run --name ubvnc -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc:bionic

Then either:

  • visit: http://127.0.0.1:6080/#/ which runs a noVNC more limited JavaScript VNC client

  • run:

    sudo apt-get install tigervnc-viewer
    xtigervncviewer :5900
    

    Then inside vinagre, you might want to go into full screen mode to be able to see the full desktop

    I also tried vinagre, but it was much laggier when scrolling Firefox on YouTube.

enter image description here

To quit just kill docker on the terminal. And to restart the machine

docker start ubvnc

and then reconnect with VNC. Then to quit the machine:

docker stop ubvnc

You have to wait a few seconds for the VNC server on the guest to start before you can connect.

Chromium won't start from the menu. If you try to launch it from the command line it explains why:

Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

Firefox does not care however.

TODO: no audio. --device /dev/snd did not help:

  • How to play sound in a docker container
  • https://forums.docker.com/t/how-to-get-sound/36527
  • https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/49

See also:

  • Can you run GUI applications in a Docker container?
  • How to open Ubuntu GUI inside a Docker image

Tested on Ubuntu 19.04 host, fcwu/docker-ubuntu-vnc-desktop, dorowu/ubuntu-desktop-lxde-vnc image id: 70516b87e92d.


I don't see the benefits of it, but impossible n'est pas français (impossible isn't French).

Docker Desktop is a way that will give you an X11 server to connect on using SSH.

This Dockerfile creates a docker image and once it's executed it creates a container that runs X11 and SSH services. The ssh is used to forward X11 and provide you encrypted data communication between the docker container and your local machine.

like image 1
greut Avatar answered Oct 22 '22 00:10

greut