Skip to content
Martin H. Bramwell edited this page Jan 7, 2016 · 4 revisions

Welcome to the xubuntu-x2go-phusion wiki!

xubuntu-x2go-phusion

A Docker image as a Xubuntu VM with X2Go server inheriting from phusion/baseimage

I built this Xubuntu VM for trying out build systems that might bork my main machine. I've used KVM virtual machines up 'til now, but I ain't ever going back.

The Dockerfile takes ideas from paimpozhil/docker-x2go-xubuntu but starts from phusion/baseimage instead of official ubuntu image.

Forks and pull requests : xubuntu-x2go-phusion on GitHub

Usage:

Initial State

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
yourself@Toshy:~/docker$
yourself@Toshy:~/docker$

Image installation

If you want to build from GitHub

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ export PROJ="yourTest01";
yourself@Toshy:~/docker$ export IMAGE=${PROJ}_img;
yourself@Toshy:~/docker$ docker build --rm -t "${IMAGE}" .
yourself@Toshy:~/docker$

If you want to pull from Docker Hub

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ export IMAGE="warehouseman/xubuntu-x2go-phusion";
yourself@Toshy:~/docker$ docker pull ${IMAGE};
Using default tag: latest
latest: Pulling from warehouseman/xubuntu-x2go-phusion
de9c48daf08c: Pull complete 
10de806794b2: Pull complete 
031fd5268e85: Pull complete 
0dc9ec408dd9: Pull complete 
a891530d7330: Pull complete 
151b6cd6fe5c: Pull complete 
ea26b9670a7c: Pull complete 
6f1148d65de8: Pull complete 
5fa95f45c424: Pull complete 
ed8ccee8c5a7: Pull complete 
3e9daf830e2c: Pull complete 
3fdbe889f9f1: Pull complete 
30a8b62d3c74: Pull complete 
4c7539bc5158: Pull complete 
5991d8123e2a: Pull complete 
6c2724addfff: Pull complete 
3b49cb8a5595: Pull complete 
62315c6f5051: Pull complete 
3ea46660fb4d: Pull complete 
13e2cdc79af1: Pull complete 
7f05a7640ee4: Pull complete 
673ed1075efa: Pull complete 
329d09710a98: Pull complete 
79617dcd1333: Pull complete 
a149f79b7286: Pull complete 
Digest: sha256:b37fe809c406e7ba054c375f1e6cc20c8119341296512399df628d3f0c4973eb
Status: Downloaded newer image for warehouseman/xubuntu-x2go-phusion:latest
yourself@Toshy:~/docker$ 
yourself@Toshy:~/docker$ 
yourself@Toshy:~/docker$ docker images
REPOSITORY                          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
warehouseman/xubuntu-x2go-phusion   latest              a149f79b7286        About an hour ago   2.166 GB
yourself@Toshy:~/docker$
yourself@Toshy:~/docker$

Container Instantiation

Runtime arguments

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ export PROJ="yourTest01";
yourself@Toshy:~/docker$ export USER_PWRD="okok";
yourself@Toshy:~/docker$ export HOST_NUM="02";
yourself@Toshy:~/docker$

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ export HOST_NAME=${PROJ}${HOST_NUM};
yourself@Toshy:~/docker$ export CONTAINER=cnt_${PROJ}${HOST_NUM};
yourself@Toshy:~/docker$ export IPADDR=ip_${PROJ};
yourself@Toshy:~/docker$ export CNT_PID=pid_${PROJ};
yourself@Toshy:~/docker$

Run

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ docker run -d \
   --name ${CONTAINER} \
   --hostname=${HOST_NAME} \
   -e SSH_KEYS="$(cat ~/.ssh/id_rsa.pub)" \
   -e USER_PWRD=${USER_PWRD} \
   -e SSH_USER="$(whoami)" \
   "${IMAGE}" > "${CNT_PID}"
yourself@Toshy:~/docker$
yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ eval "export ${IPADDR}=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' ${CONTAINER})";
yourself@Toshy:~/docker$ 
yourself@Toshy:~/docker$ 
yourself@Toshy:~/docker$ eval echo -e "\\\n  \* \* \*  Address for \'${CONTAINER}\' is : \'\${${IPADDR}}\' \* \* \* \\\n";

 * * * Address for 'cnt_yourTest0102' is : '172.17.0.2' * * * 

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ echo ${ip_yourTest01}
172.17.0.2
yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ docker logs -f $(cat "${CNT_PID}");
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/add_ssh_env_keys.sh...
Adding user `yourself' ...
Adding new group `yourself' (1000) ...
Adding new user `yourself' (1000) with group `yourself' ...
Creating home directory `/home/yourself' ...
Copying files from `/etc/skel' ...
yourself  ALL=(ALL:ALL) ALL
4096 3c:28:58:04:73:0c:58:d8:87:9b:5e:5b:9e:8a:c8:46  yourself.yourorg@gmail.com (RSA)
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 50
Jan  6 23:54:44 yourTest0102 syslog-ng[57]: syslog-ng starting up; version='3.5.3'

^C
yourself@Toshy:~/docker$ 
yourself@Toshy:~/docker$ ssh ${ip_yourTest01}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
96:fa:97:73:96:39:9a:18:f0:f8:68:d2:a0:4d:e4:58.
Please contact your system administrator.
Add correct host key in /home/yourself/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/yourself/.ssh/known_hosts:77
  remove with: ssh-keygen -f "/home/yourself/.ssh/known_hosts" -R 172.17.0.2
ECDSA host key for 172.17.0.2 has changed and you have requested strict checking.
Host key verification failed. 
yourself@Toshy:~/docker$ 
yourself@Toshy:~/docker$ 
yourself@Toshy:~/docker$ ssh-keygen -f "/home/yourself/.ssh/known_hosts" -R 172.17.0.2
# Host 172.17.0.2 found: line 77 type ECDSA
/home/yourself/.ssh/known_hosts updated.
Original contents retained as /home/yourself/.ssh/known_hosts.old
yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ ssh ${ip_yourTest01}
yourself@Toshy:~/docker$ 
yourself@Toshy:~/docker$ ssh ${ip_yourTest01}
The authenticity of host '172.17.0.2 (172.17.0.2)' can't be established.
ECDSA key fingerprint is 96:fa:97:73:96:39:9a:18:f0:f8:68:d2:a0:4d:e4:58.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.17.0.2' (ECDSA) to the list of known hosts.
yourself@yourTest0102:~$ 
yourself@yourTest0102:~$ hostname
yourTest0102
yourself@yourTest0102:~$
yourself@yourTest0102:~$ sudo apt-get update
[sudo] password for yourself: 
Ign http://archive.ubuntu.com trusty InRelease
Get:1 http://archive.ubuntu.com trusty-updates InRelease [64.4 kB]
Ign http://ppa.launchpad.net trusty InRelease  
      : 
      : 
 etc.

Stop the Container

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ docker stop ${CONTAINER}
cnt_yourTest0102
yourself@Toshy:~/docker$

Delete the Container

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ docker rm ${CONTAINER}
cnt_yourTest0102
yourself@Toshy:~/docker$ 

Delete the Image

yourself@Toshy:~/docker$
yourself@Toshy:~/docker$ docker rmi ${IMAGE}
cnt_yourTest0102
yourself@Toshy:~/docker$ 

Connecting

Test

Create New Session

New Session Button

Starting Session

New Machine Starting

New Machine Starting