13 | | hostname# docker run -it centos:latest /bin/bash |
14 | | a370b5e014ca# cd /etc/yum.repo.d |
15 | | a370b5e014ca# curl -O https://winswitch.org/downloads/CentOS/winswitch.repo |
16 | | a370b5e014ca# yum repolist |
17 | | a370b5e014ca# yum install xpra |
| 13 | hostname# docker run -it -h container -p 192.168.99.100:10010:10010 centos:latest /bin/bash |
| 14 | root@container# cd /etc/yum.repo.d |
| 15 | root@container# curl -O https://winswitch.org/downloads/CentOS/winswitch.repo |
| 16 | root@container# yum repolist |
| 17 | root@container# yum install xpra |
| 19 | |
| 20 | === Install dependency packages === |
| 21 | * You may hit bellow error if you run xpra in container now: |
| 22 | {{{ |
| 23 | /bin/xpra_Xdummy: line 52: which: command not found |
| 24 | failed to locate Xorg binary to run |
| 25 | 2015-12-23 16:19:11,020 |
| 26 | 2015-12-23 16:19:11,024 Xvfb command has terminated! xpra cannot continue |
| 27 | }}} |
| 28 | this is because xvfb and which is not installed on centos7.2 official image. We need to install it |
| 29 | {{{ |
| 30 | root@container#yum install xorg-x11-server-Xvfb |
| 31 | root@container#yum install which |
| 32 | }}} |
| 33 | |
| 34 | === Generate uuid for container === |
| 35 | * You may hit UUID problem: |
| 36 | {{{ |
| 37 | D-Bus library appears to be incorrectly set up; failed to read machine uuid: UUID file |
| 38 | '/etc/machine-id' should contain a hex string of length 32, not length 0, with no other text |
| 39 | }}} |
| 40 | which can be resolved by: |
| 41 | {{{ |
| 42 | root@container#dbus-uuidgen >/etc/machine-id |
| 43 | }}} |
| 44 | === Run xpra in container === |
| 45 | * Create a new user in container: |
| 46 | {{{ |
| 47 | root@container# useradd -m xpra1 |
| 48 | root@container# passwd xpra1 |
| 49 | }}} |
| 50 | * Start xpra server with the created user (you may need to yum install emacs if you also want to run emacs): |
| 51 | {{{ |
| 52 | root@container# su - xpra1 |
| 53 | xpra1@container$ xpra start :100 --start-child=emacs --bind-tcp=0.0.0.0:10010 |
| 54 | }}} |
| 55 | |
| 56 | * After that you can connect with xpra client!! |