Building a Docker desktop system based on SSH + Xpra

Source: Internet
Author: User
Tags ssh port

by Falcon of tinylab.org
2015/05/01

Docker Desktop System

The first knowledge of Docker found that most of the articles were simply about non-GUI applications. Think of a lot of scenes that require a graphical interface, so we have a look at the Docker image:

$ sudo docker search desktopname                                    DESCRIPTION                                     STARS     official   automateddorowu/ Ubuntu-desktop-lxde-vnc          Ubuntu with Openssh-server and NoVNC on PO   ...                   [ok]rogaha/docker-desktop                   Docker Desktop enables to create Virtu ...   Ten                   [OK]

The first two found were:

    • DOROWU/UBUNTU-DESKTOP-LXDE-VNC: Based on Vncserver + NoVNC Project
    • Rogaha/docker-desktop: Ssh-based + XPRA project

The initial trial found both very Cool, a Web-based, a traditional graphical interface. I will write two articles to introduce them separately, first introduce the second one.

Xpra First Knowledge

Xpra is ' screens for X ', and More:it allows-to-run X programs, usually on a remote host and direct their display to yo ur local machine. It also allows you to display existing desktop sessions remotely.

Xpra is "rootless" or "seamless", and sessions can being accessed over SSH, or password protected and encrypted over plain TC P sockets.

Install Image: Rogaha/docker-desktop
$ sudo docker pull Rogaha/docker-desktop
Start container
$ container_id=$ (sudo docker run-d-P 2222:22 rogaha/docker-desktop)

Note : -p 2222:22 map the Ssh port address 22 in the container to port 2222 on the host.

Get login Password
$ echo $ (sudo docker logs $CONTAINER _id | sed-n 1p) User:docker password:aefiesahk2ci

The password is Password followed by a string.

Note : This image pwgen generates a login password randomly, see startup.sh.

Connect Desktop Services to start a Xpra session via Ssh

Execute the following command and enter the above password:

$ SSH [email protected]-P 2222 "sh-c"./docker-desktop-s 800x600-d >/dev/null 2>&1 & ' "

Note :

    • -p 2222Connecting to the SSH service over the Docker.
    • -s 800x600Set the resolution of your desktop
    • -d 10Set the display service session number
Attach the above session through XPRA

This will really pull up the graphical interface.

$ xpra--ssh= "ssh-p 2222" Attach Ssh:[email protected]:10
Precautions

There are other articles that describe these two steps that can be loaded directly from the following command:

SSH-YC blowfish [email protected]-P 2222./docker-desktop-s 800x600-d 11

However, it does not work, and the following error occurs and then exits automatically.

Entering daemon mode; Any further errors is reported to:

/home/docker/.xpra/:11.log

By searching, it is found that the image author has informed that two-step operation is required in order to work correctly, see: Error after Login:connection failed: [Errno 2] No such file or directory.

Start effect

Self-building

Can directly pull down the image of the Dockerfile and related files, self-built. Even according to their own needs, adjust the Dockerfile and then build, in order to meet the actual needs.

$ git clone https://github.com/rogaha/docker-desktop.git$ cd docker-desktop$ Docker build-t tinylab/docker-desktop.
Resources
    • Rogaha/docker-desktop

Building a Docker desktop system based on SSH + Xpra

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.