Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

download and run ubuntu-desktop with gnome support via docker

Tags:

docker

I am completely new to docker. I have a Redhat 7 desktop with docker installed. I now want to run a full fledged ubuntu-desktop 18.04 (including its gnome GUI) via docker. How can this be done? I have been googling for instructions/tutorials on where I can download an ubuntu 18.04 docker image (with GUI support) and run it, but surprisingly I cannot find anything. Can someone help me? Thanks.

like image 970
astrophobia Avatar asked Oct 11 '18 17:10

astrophobia


People also ask

Can you run Ubuntu desktop in Docker?

Using a Docker image, you can run Ubuntu with LXDE and LXQt desktop environments and access it via an HTML5 VNC interface. This is even more fascinating since you can make several other configurations using the docker image such as: HTTP Base Authentication. SSL encryption.


1 Answers

I have a different situation, where I run docker on a Windows10 platform. I also tried to install Gnome for some Ubuntu image and start a gnome-session from the terminal. I did not manage to do so.

My current solution is to use Mate instead of Gnome. Maybe my steps are helpful for others that just started with docker:

  • Install Docker Desktop on Windows 10 and start the Docker application

  • Install vcxsrv and start it with Xlaunch (also see https://dev.to/darksmile92/run-gui-app-in-linux-docker-container-on-windows-host-4kde)

  • Get the IP of your computer with ipconfig, e.g 192.111.999.9

  • Open a console with admin rights and start a docker container. Pass some DISPLAY-Information including your IP:

docker run -it -e DISPLAY=192.111.999.9:0.0 --privileged --name=ubuntu ubuntu

  • You should then see a linux prompt

  • Update the package-manager and upgrade existing packages:

apt-get update
apt-get upgrade -y
apt-get update

  • start dbus service to avoid dbus warnings (also see https://georgik.rocks/how-to-start-d-bus-in-docker-container/):

dbus-uuidgen > /var/lib/dbus/machine-id
mkdir -p /var/run/dbus
dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address

  • install mate (and some themes to avoid theme warning)

apt-get install mate-desktop-environment -y
apt-get ubuntu-mate-themes -y

  • start a Desktop session with

mate-session

Good luck!

(If you want some more programs, instead of "mate-desktop-environment", you can also use the larger package "ubuntu-mate-desktop". Will take > 10 min to be installed.)

like image 136
Stefan Avatar answered Sep 29 '22 23:09

Stefan