Docker Community Forums

Share and learn in the Docker community.

Install a docker interface xfce

Hello!

I am new to Linux and docker, and i need to create / install a docker which can launch an interface xfce linked to my linux folder (for example to launch an Python IDE).

Problem : i don’t know how to do at all. I installed docker, and alors x11docker/xfce, but this is what i got as answer.

test@test:~$ sudo docker run x11docker/xfce
/usr/bin/startxfce4: Starting X server
/usr/bin/startxfce4: 118: exec: xinit: not found

xorg is already installed, I have 2 servers running :

test@test:~$ ls -lia /tmp/.X11-unix/
total 8
19 drwxrwxrwt 2 root root 4096 Mar 23 10:09 .
18 drwxrwxrwt 21 root root 4096 Mar 23 10:12 …
47 srwxrwxr-x 1 gdm gdm 0 Mar 23 10:09 X1024
49 srwxrwxr-x 1 gdm gdm 0 Mar 23 10:09 X1025

I’m not even sure how it is supposed to be use, if someone can help me it would be really helpful!

Thanks for your time!

That is I was looking for, the simplest form of the desktop in Docker:

FROM ubuntu
RUN apt-get update
RUN apt-get install xfce4 -y
RUN apt-get install xfce4-goodies -y
RUN apt-get purge -y pm-utils xscreensaver*
RUN apt-get install wget -y

EXPOSE 5901

RUN wget -qO- https://dl.bintray.com/tigervnc/stable/tigervnc-1.8.0.x86_64.tar.gz | tar xz --strip 1 -C /
RUN mkdir ~/.vnc
RUN echo “123456” | vncpasswd -f >> ~/.vnc/passwd
RUN chmod 600 ~/.vnc/passwd

CMD ["/usr/bin/vncserver", “-fg”]
Unfortunately I could not sort out with x11vnc and xvfb. But TigerVNC turned out much better.

This sample generate container with xfce gui and run vncserver with 123456 password. There is no need to overwrite ~/.vnc/xstartup manually because TigerVNC starts up X server by default!

To run the server:

sudo docker run --rm -dti -p 5901:5901 3ab3e0e7cb
To connect there with vncviewer:

vncviewer -AutoSelect 0 -QualityLevel 9 -CompressLevel 0 192.168.1.100:5901
Also you could not care about screen resolution because by default it will resize to fit your screen: F8 vncviewer menu

You may also encounter the issue with ipc_channel_posix (chrome and other browsers will not work properly) to eliminate this run container with memory sharing:

docker run -d --shm-size=2g --privileged -p 5901:5901 image-name