├── config ├── .fluxbox │ ├── indowmenu │ ├── slitlist │ ├── startup │ ├── menu │ ├── apps │ ├── overlay │ ├── lastwallpaper │ ├── windowmenu │ ├── init │ └── keys ├── .config │ └── rox.sourceforge.net │ │ └── ROX-Filer │ │ ├── panels │ │ ├── pb_Default │ │ ├── globicons │ │ ├── menus2 │ │ └── Options ├── spring-desktop-wallpaper-1920x1200-0911085.jpg ├── fixlocale ├── fixkb ├── docker-desktop └── .bashrc ├── image └── docker-desktop.png ├── MAINTAINER ├── startup.sh ├── CHANGELOG.md ├── Dockerfile └── README.md /config/.fluxbox/indowmenu: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/.fluxbox/slitlist: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/.config/rox.sourceforge.net/ROX-Filer/panels: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/.fluxbox/startup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rox --pinboard=Default & 3 | exit 0 4 | -------------------------------------------------------------------------------- /config/.fluxbox/menu: -------------------------------------------------------------------------------- 1 | [begin] (fluxbox) 2 | [include] (/etc/X11/fluxbox/fluxbox-menu) 3 | [end] 4 | -------------------------------------------------------------------------------- /config/.fluxbox/apps: -------------------------------------------------------------------------------- 1 | [app] (name=fbrun) 2 | [Position] (WINCENTER) {0 0} 3 | [Layer] {2} 4 | [end] 5 | -------------------------------------------------------------------------------- /image/docker-desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogaha/docker-desktop/HEAD/image/docker-desktop.png -------------------------------------------------------------------------------- /config/.fluxbox/overlay: -------------------------------------------------------------------------------- 1 | ! The following line will prevent styles from setting the background. 2 | ! background: none 3 | -------------------------------------------------------------------------------- /MAINTAINER: -------------------------------------------------------------------------------- 1 | Roberto Hashioka (@rogaha) 2 | Paim Pozhil (@paimpozhil) 3 | -------------------------------------------------------------------------------- /config/.fluxbox/lastwallpaper: -------------------------------------------------------------------------------- 1 | $full $full|/usr/share/images/fluxbox/fluxbox.png|style|:2.0 2 | $full $full|/usr/share/images/fluxbox/fluxbox.png|style|:1.0 3 | -------------------------------------------------------------------------------- /config/spring-desktop-wallpaper-1920x1200-0911085.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rogaha/docker-desktop/HEAD/config/spring-desktop-wallpaper-1920x1200-0911085.jpg -------------------------------------------------------------------------------- /config/.fluxbox/windowmenu: -------------------------------------------------------------------------------- 1 | [begin] 2 | [shade] 3 | [stick] 4 | [maximize] 5 | [iconify] 6 | [raise] 7 | [lower] 8 | [settitledialog] 9 | [sendto] 10 | [layer] 11 | [alpha] 12 | [extramenus] 13 | [separator] 14 | [close] 15 | [end] 16 | -------------------------------------------------------------------------------- /config/.config/rox.sourceforge.net/ROX-Filer/pb_Default: -------------------------------------------------------------------------------- 1 | 2 | 3 | /home/docker/spring-desktop-wallpaper-1920x1200-0911085.jpg 4 | /usr/bin/xterm 5 | /usr/bin/libreoffice 6 | /usr/bin/firefox 7 | /home/docker 8 | 9 | -------------------------------------------------------------------------------- /config/.config/rox.sourceforge.net/ROX-Filer/globicons: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /usr/share/pixmaps/firefox.png 5 | 6 | 7 | /usr/share/icons/hicolor/48x48/apps/libreoffice-calc.png 8 | 9 | 10 | /usr/share/pixmaps/xterm-color_48x48.xpm 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/.config/rox.sourceforge.net/ROX-Filer/menus2: -------------------------------------------------------------------------------- 1 | ; rox GtkAccelMap rc-file -*- scheme -*- 2 | ; this file is an automated accelerator map dump 3 | ; 4 | ; (gtk_accel_path "/" "") 5 | ; (gtk_accel_path "/Edit Item" "") 6 | ; (gtk_accel_path "/ROX-Filer/About ROX-Filer..." "") 7 | ; (gtk_accel_path "/File/Shift Open" "") 8 | ; (gtk_accel_path "/Remove Item(s)" "") 9 | ; (gtk_accel_path "/ROX-Filer/Show Help Files" "h") 10 | ; (gtk_accel_path "/ROX-Filer/Manual" "") 11 | ; (gtk_accel_path "/Show Location" "") 12 | ; (gtk_accel_path "/File/Properties" "") 13 | ; (gtk_accel_path "/ROX-Filer/Options..." "") 14 | ; (gtk_accel_path "/ROX-Filer/Home Directory" "") 15 | ; (gtk_accel_path "/ROX-Filer/" "") 16 | ; (gtk_accel_path "/File/Set Run Action..." "") 17 | ; (gtk_accel_path "/File/Set Icon..." "") 18 | -------------------------------------------------------------------------------- /startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Create the directory needed to run the sshd daemon 4 | mkdir /var/run/sshd 5 | 6 | # Add docker user and generate a random password with 12 characters that includes at least one capital letter and number. 7 | DOCKER_PASSWORD=`pwgen -c -n -1 12` 8 | echo User: docker Password: $DOCKER_PASSWORD 9 | DOCKER_ENCRYPYTED_PASSWORD=`perl -e 'print crypt('"$DOCKER_PASSWORD"', "aa"),"\n"'` 10 | useradd -m -d /home/docker -p $DOCKER_ENCRYPYTED_PASSWORD docker 11 | sed -Ei 's/adm:x:4:/docker:x:4:docker/' /etc/group 12 | adduser docker sudo 13 | 14 | # Set the default shell as bash for docker user. 15 | chsh -s /bin/bash docker 16 | 17 | # Copy the config files into the docker directory 18 | cd /src/config/ && sudo -u docker cp -R .[a-z]* [a-z]* /home/docker/ 19 | 20 | # restarts the xdm service 21 | /etc/init.d/xdm restart 22 | 23 | # Start the ssh service 24 | /usr/sbin/sshd -D 25 | -------------------------------------------------------------------------------- /config/fixlocale: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #Default locale en_US 4 | LOCALE="en_US" 5 | 6 | 7 | #Verify if the user defined another locale configuration 8 | while getopts ":l:h-:" opt; do 9 | case $opt in 10 | l) 11 | echo -e "\n---------------------------------------------------" 12 | echo "Setting locale to $OPTARG" 13 | echo -e "---------------------------------------------------\n" 14 | LOCALE=$OPTARG 15 | ;; 16 | h) 17 | echo -e "\n-----------------------------------------------------------" 18 | echo -e "Usage: fixlocale [-l locale_name]" 19 | echo -e "-h : help" 20 | echo -e "-----------------------------------------------------------\n" 21 | exit 1 22 | ;; 23 | \?) 24 | echo "Invalid option: -$OPTARG" >&2 25 | exit 1 26 | ;; 27 | :) 28 | echo "Option -$OPTARG requires an argument." >&2 29 | exit 1 30 | ;; 31 | esac 32 | done 33 | 34 | # Setting the locale according the user's input 35 | sudo localedef -v -c -i $LOCALE -f UTF-8 $LOCALE.UTF-8 36 | -------------------------------------------------------------------------------- /config/fixkb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #Default Display 10 4 | DISPLAY_N=10 5 | 6 | 7 | #Verify if the user defined another screen resolution 8 | FLAG=0 9 | while getopts ":d:h-:" opt; do 10 | case $opt in 11 | d) 12 | echo -e "\n---------------------------------------------------" 13 | echo "Copying the keyboard mapping from DISPLAY=$OPTARG to DISPLAY=$(( $OPTARG + 1 ))" 14 | echo -e "---------------------------------------------------\n" 15 | DISPLAY_N=$OPTARG 16 | ;; 17 | h) 18 | echo -e "\n-----------------------------------------------------------" 19 | echo -e "Usage: fixkb [-d session_number]" 20 | echo -e "-h : help" 21 | echo -e "-----------------------------------------------------------\n" 22 | exit 1 23 | ;; 24 | \?) 25 | echo "Invalid option: -$OPTARG" >&2 26 | exit 1 27 | ;; 28 | :) 29 | echo "Option -$OPTARG requires an argument." >&2 30 | exit 1 31 | ;; 32 | esac 33 | done 34 | 35 | # Copy the keyboard map from the server to the Xephyr's X11 client 36 | export DISPLAY=:$DISPLAY_N 37 | xmodmap -pke > .Xkbmap 38 | export DISPLAY=:$(( $DISPLAY_N + 1 )) 39 | xmodmap .Xkbmap 40 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.4.0 (2014-08-19) 4 | + OS: Upgraded from 12.10 to 14.04 5 | + Fixed Issue: Added a packet (Xvfb) to make the program work under ubuntu 14.04 (by @clu2) 6 | + Fixed Issue: Fix login PAM issue with ssh 7 | 8 | ## 0.3.0 (2013-07-18) 9 | + Funcionality: Allow users to configure the screen resolution 10 | + Funcionality: Allow users to create multi-sessions 11 | * X Screen: Xpra + Xephyr 12 | + X Window Manager: Fluxbox 13 | 14 | ## 0.2.0 (2013-07-10) 15 | + Funcionality: Allow user's disconnection and reconnection without disrupting the session and its application's status 16 | + Funcionality: Applications are rootless (It appears on your desktop as normal windows managed by your window manager) 17 | + Funcionality: A new password is generated every time that a new container is created 18 | * X Screen: Xpra instead of Xephyr 19 | - X Window Manager: Remove Fluxbox 20 | - Applications: Fix the locale warning messages 21 | - Applications: Fix the error javaldx: Could not find a Java Runtime Environment! from Libreoffice 22 | + Add a changelog 23 | 24 | ## 0.1.0 (2013-06-28) 25 | + Funcionality: Allow users to connect remotely to their virtual desktop running inside a docker container over ssh 26 | + X Screen: Xephyr 27 | + X Window Manager: Fluxbox 28 | + X File Manager: ROX-Filer 29 | + Applications: Libreoffice, Firefox and xterm 30 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # This file creates a container that runs X11 and SSH services 2 | # The ssh is used to forward X11 and provide you encrypted data 3 | # communication between the docker container and your local 4 | # machine. 5 | # 6 | # Xpra allows to display the programs running inside of the 7 | # container such as Firefox, LibreOffice, xterm, etc. 8 | # with disconnection and reconnection capabilities 9 | # 10 | # Xephyr allows to display the programs running inside of the 11 | # container such as Firefox, LibreOffice, xterm, etc. 12 | # 13 | # Fluxbox and ROX-Filer creates a very minimalist way to 14 | # manages the windows and files. 15 | # 16 | # Author: Roberto Gandolfo Hashioka 17 | # Date: 07/28/2013 18 | 19 | 20 | FROM ubuntu:16.04 21 | MAINTAINER Roberto G. Hashioka "roberto_hashioka@hotmail.com" 22 | 23 | RUN apt-get update -y 24 | RUN apt-get upgrade -y 25 | 26 | # Set the env variable DEBIAN_FRONTEND to noninteractive 27 | ENV DEBIAN_FRONTEND noninteractive 28 | 29 | # Installing the environment required: xserver, xdm, flux box, roc-filer and ssh 30 | RUN apt-get install -y xpra rox-filer openssh-server pwgen xserver-xephyr xdm fluxbox xvfb locales sudo 31 | 32 | # Configuring xdm to allow connections from any IP address and ssh to allow X11 Forwarding. 33 | RUN sed -i 's/DisplayManager.requestPort/!DisplayManager.requestPort/g' /etc/X11/xdm/xdm-config 34 | RUN sed -i '/#any host/c\*' /etc/X11/xdm/Xaccess 35 | RUN echo X11Forwarding yes >> /etc/ssh/ssh_config 36 | 37 | # Fix PAM login issue with sshd 38 | RUN sed -i 's/session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/sshd 39 | 40 | # Upstart and DBus have issues inside docker. We work around in order to install firefox. 41 | RUN dpkg-divert --local --rename --add /sbin/initctl && ln -sf /bin/true /sbin/initctl 42 | 43 | # Installing fuse package (libreoffice-java dependency) and it's going to try to create 44 | # a fuse device without success, due the container permissions. || : help us to ignore it. 45 | # Then we are going to delete the postinst fuse file and try to install it again! 46 | # Thanks Jerome for helping me with this workaround solution! :) 47 | # Now we are able to install the libreoffice-java package 48 | RUN apt-get -y install fuse || : 49 | RUN rm -rf /var/lib/dpkg/info/fuse.postinst 50 | RUN apt-get -y install fuse 51 | 52 | # Installing the apps: Firefox, flash player plugin, LibreOffice and xterm 53 | # libreoffice-base installs libreoffice-java mentioned before 54 | RUN apt-get install -y libreoffice-base firefox libreoffice-gtk libreoffice-calc xterm 55 | 56 | # Set locale (fix the locale warnings) 57 | RUN localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 || : 58 | 59 | # Copy the files into the container 60 | ADD . /src 61 | 62 | EXPOSE 22 63 | # Start xdm and ssh services. 64 | CMD ["/bin/bash", "/src/startup.sh"] 65 | -------------------------------------------------------------------------------- /config/docker-desktop: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #Default screen resolution 800x600 4 | if [ ! -f ~/.Xscreen ]; then 5 | SCREEN_SIZE="800x600" 6 | else 7 | SCREEN_SIZE=$(head -n 1 ~/.Xscreen) 8 | fi 9 | 10 | #Default Display 10 11 | DISPLAY=10 12 | 13 | 14 | #Verify if the user defined another screen resolution 15 | FLAG=0 16 | while getopts ":s:d:h-:" opt; do 17 | case $opt in 18 | s) 19 | echo -e "\n-----------------------------------------------" 20 | echo "Configuring the screen resolution -> $OPTARG" 21 | echo -e "-----------------------------------------------\n" 22 | NEW_SCREEN_SIZE=$OPTARG 23 | 24 | if [ "$SCREEN_SIZE" != "$NEW_SCREEN_SIZE" ]; then 25 | FLAG=1 26 | SCREEN_SIZE=$NEW_SCREEN_SIZE 27 | fi 28 | ;; 29 | d) 30 | echo -e "\n-----------------------------------------------" 31 | echo "Configuring the session number -> $OPTARG " 32 | echo -e "-----------------------------------------------\n" 33 | DISPLAY=$OPTARG 34 | ;; 35 | h) 36 | echo -e "\n-----------------------------------------------------------" 37 | echo -e "Usage: docker-desktop [-s screen_size] [-d session_number]" 38 | echo -e "-s : screen resolution (Default = 800x600" 39 | echo -e "-d : session number (Default = 10)" 40 | echo -e "-h : help" 41 | echo -e "-----------------------------------------------------------\n" 42 | exit 1 43 | ;; 44 | \?) 45 | echo "Invalid option: -$OPTARG" >&2 46 | exit 1 47 | ;; 48 | :) 49 | echo "Option -$OPTARG requires an argument." >&2 50 | exit 1 51 | ;; 52 | esac 53 | done 54 | 55 | #Saving the screen configuration 56 | echo $SCREEN_SIZE > ~/.Xscreen 57 | 58 | # Start the xpra session, if it's not running and attach to it. 59 | PROCESS_NUM=$(ps -ef | grep "xpra" | grep -v "grep" | wc -l) 60 | if [ $PROCESS_NUM -eq 0 ] || [ $FLAG ]; then 61 | # Start xpra session 62 | DISPLAY_1=$(( $DISPLAY + 1 )) 63 | 64 | xpra start :$DISPLAY & sleep 5; xpra stop :$DISPLAY & sleep 5; xpra start :$DISPLAY --start-child="Xephyr -ac -screen $SCREEN_SIZE -query localhost -host-cursor -reset -terminate :$DISPLAY_1" --xvfb="Xvfb +extension Composite -screen 0 ${SCREEN_SIZE}x24+32 -nolisten tcp -noreset -auth /home/docker/.Xauthority" & sleep 5 ; DISPLAY=:$DISPLAY_1 fluxbox & DISPLAY=:$DISPLAY_1 rox --pinboard=Default & 65 | echo -e "\n----------------" 66 | echo -e "Session started!" 67 | echo -e "----------------\n" 68 | echo -e "\n--------------------------------------------------------------------------------" 69 | echo -e "Please press Control-C if you are running it directly from the ssh command line." 70 | echo -e "--------------------------------------------------------------------------------\n" 71 | else 72 | echo -e "------------------------\n" 73 | echo -e "Session already running!\n" 74 | echo -e "------------------------\n" 75 | fi 76 | 77 | -------------------------------------------------------------------------------- /config/.fluxbox/init: -------------------------------------------------------------------------------- 1 | session.screen0.tab.placement: TopLeft 2 | session.screen0.tab.width: 64 3 | session.screen0.iconbar.usePixmap: true 4 | session.screen0.iconbar.iconTextPadding: 10 5 | session.screen0.iconbar.iconWidth: 128 6 | session.screen0.iconbar.alignment: Relative 7 | session.screen0.iconbar.mode: {static groups} (workspace) 8 | session.screen0.toolbar.alpha: 255 9 | session.screen0.toolbar.visible: true 10 | session.screen0.toolbar.maxOver: false 11 | session.screen0.toolbar.height: 0 12 | session.screen0.toolbar.onhead: 1 13 | session.screen0.toolbar.placement: BottomCenter 14 | session.screen0.toolbar.widthPercent: 100 15 | session.screen0.toolbar.autoHide: false 16 | session.screen0.toolbar.layer: Dock 17 | session.screen0.toolbar.tools: prevworkspace, workspacename, nextworkspace, clock, prevwindow, nextwindow, iconbar, systemtray 18 | session.screen0.clientMenu.usePixmap: true 19 | session.screen0.tabs.usePixmap: true 20 | session.screen0.tabs.maxOver: false 21 | session.screen0.tabs.intitlebar: true 22 | session.screen0.titlebar.left: Stick 23 | session.screen0.titlebar.right: Minimize Maximize Close 24 | session.screen0.menu.alpha: 255 25 | session.screen0.window.focus.alpha: 255 26 | session.screen0.window.unfocus.alpha: 255 27 | session.screen0.slit.alpha: 255 28 | session.screen0.slit.maxOver: false 29 | session.screen0.slit.placement: RightBottom 30 | session.screen0.slit.autoHide: false 31 | session.screen0.slit.acceptKdeDockapps: true 32 | session.screen0.slit.onhead: 0 33 | session.screen0.slit.layer: Dock 34 | session.screen0.colPlacementDirection: TopToBottom 35 | session.screen0.focusModel: ClickFocus 36 | session.screen0.showwindowposition: false 37 | session.screen0.maxIgnoreIncrement: true 38 | session.screen0.workspaces: 4 39 | session.screen0.maxDisableMove: false 40 | session.screen0.autoRaise: true 41 | session.screen0.tabFocusModel: ClickToTabFocus 42 | session.screen0.strftimeFormat: %d %b, %a %02k:%M:%S 43 | session.screen0.tooltipDelay: 500 44 | session.screen0.edgeSnapThreshold: 10 45 | session.screen0.windowPlacement: RowMinOverlapPlacement 46 | session.screen0.opaqueMove: true 47 | session.screen0.focusNewWindows: true 48 | session.screen0.clickRaises: true 49 | session.screen0.maxDisableResize: false 50 | session.screen0.windowMenu: /home/docker/.fluxbox/windowmenu 51 | session.screen0.allowRemoteActions: false 52 | session.screen0.workspaceNames: Workspace 1,Workspace 2,Workspace 3,Workspace 4, 53 | session.screen0.rowPlacementDirection: LeftToRight 54 | session.screen0.workspacewarping: true 55 | session.screen0.fullMaximization: false 56 | session.screen0.defaultDeco: NORMAL 57 | session.screen0.noFocusWhileTypingDelay: 0 58 | session.screen0.menuDelay: 200 59 | session.styleOverlay: /home/docker/.fluxbox/overlay 60 | session.keyFile: /home/docker/.fluxbox/keys 61 | session.cacheMax: 200 62 | session.tabsAttachArea: Window 63 | session.slitlistFile: /home/docker/.fluxbox/slitlist 64 | session.forcePseudoTransparency: false 65 | session.tabPadding: 0 66 | session.colorsPerChannel: 4 67 | session.styleFile: /usr/share/fluxbox/styles/Squared_green 68 | session.autoRaiseDelay: 250 69 | session.cacheLife: 5 70 | session.appsFile: /home/docker/.fluxbox/apps 71 | session.ignoreBorder: false 72 | session.configVersion: 13 73 | session.doubleClickInterval: 250 74 | session.menuFile: /home/docker/.fluxbox/menu 75 | -------------------------------------------------------------------------------- /config/.bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc: executed by bash(1) for non-login shells. 2 | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) 3 | # for examples 4 | 5 | # If not running interactively, don't do anything 6 | case $- in 7 | *i*) ;; 8 | *) return;; 9 | esac 10 | 11 | # don't put duplicate lines or lines starting with space in the history. 12 | # See bash(1) for more options 13 | HISTCONTROL=ignoreboth 14 | 15 | # append to the history file, don't overwrite it 16 | shopt -s histappend 17 | 18 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 19 | HISTSIZE=1000 20 | HISTFILESIZE=2000 21 | 22 | # check the window size after each command and, if necessary, 23 | # update the values of LINES and COLUMNS. 24 | shopt -s checkwinsize 25 | 26 | # If set, the pattern "**" used in a pathname expansion context will 27 | # match all files and zero or more directories and subdirectories. 28 | #shopt -s globstar 29 | 30 | # make less more friendly for non-text input files, see lesspipe(1) 31 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" 32 | 33 | # set variable identifying the chroot you work in (used in the prompt below) 34 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then 35 | debian_chroot=$(cat /etc/debian_chroot) 36 | fi 37 | 38 | # set a fancy prompt (non-color, unless we know we "want" color) 39 | case "$TERM" in 40 | xterm-color) color_prompt=yes;; 41 | esac 42 | 43 | # uncomment for a colored prompt, if the terminal has the capability; turned 44 | # off by default to not distract the user: the focus in a terminal window 45 | # should be on the output of commands, not on the prompt 46 | #force_color_prompt=yes 47 | 48 | if [ -n "$force_color_prompt" ]; then 49 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 50 | # We have color support; assume it's compliant with Ecma-48 51 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such 52 | # a case would tend to support setf rather than setaf.) 53 | color_prompt=yes 54 | else 55 | color_prompt= 56 | fi 57 | fi 58 | 59 | if [ "$color_prompt" = yes ]; then 60 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 61 | else 62 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 63 | fi 64 | unset color_prompt force_color_prompt 65 | 66 | # If this is an xterm set the title to user@host:dir 67 | case "$TERM" in 68 | xterm*|rxvt*) 69 | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 70 | ;; 71 | *) 72 | ;; 73 | esac 74 | 75 | # enable color support of ls and also add handy aliases 76 | if [ -x /usr/bin/dircolors ]; then 77 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 78 | alias ls='ls --color=auto' 79 | #alias dir='dir --color=auto' 80 | #alias vdir='vdir --color=auto' 81 | 82 | alias grep='grep --color=auto' 83 | alias fgrep='fgrep --color=auto' 84 | alias egrep='egrep --color=auto' 85 | fi 86 | 87 | # some more ls aliases 88 | alias ll='ls -alF' 89 | alias la='ls -A' 90 | alias l='ls -CF' 91 | 92 | # Add an "alert" alias for long running commands. Use like so: 93 | # sleep 10; alert 94 | alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' 95 | 96 | # Alias definitions. 97 | # You may want to put all your additions into a separate file like 98 | # ~/.bash_aliases, instead of adding them here directly. 99 | # See /usr/share/doc/bash-doc/examples in the bash-doc package. 100 | 101 | if [ -f ~/.bash_aliases ]; then 102 | . ~/.bash_aliases 103 | fi 104 | 105 | # enable programmable completion features (you don't need to enable 106 | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile 107 | # sources /etc/bash.bashrc). 108 | if ! shopt -oq posix; then 109 | if [ -f /usr/share/bash-completion/bash_completion ]; then 110 | . /usr/share/bash-completion/bash_completion 111 | elif [ -f /etc/bash_completion ]; then 112 | . /etc/bash_completion 113 | fi 114 | fi 115 | -------------------------------------------------------------------------------- /config/.fluxbox/keys: -------------------------------------------------------------------------------- 1 | # click on the desktop to get menus 2 | OnDesktop Mouse1 :HideMenus 3 | OnDesktop Mouse2 :WorkspaceMenu 4 | OnDesktop Mouse3 :RootMenu 5 | 6 | # scroll on the desktop to change workspaces 7 | OnDesktop Mouse4 :PrevWorkspace 8 | OnDesktop Mouse5 :NextWorkspace 9 | 10 | # scroll on the toolbar to change current window 11 | OnToolbar Mouse4 :PrevWindow {static groups} (iconhidden=no) 12 | OnToolbar Mouse5 :NextWindow {static groups} (iconhidden=no) 13 | 14 | # alt + left/right click to move/resize a window 15 | OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving} 16 | OnWindowBorder Move1 :StartMoving 17 | 18 | OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner} 19 | OnLeftGrip Move1 :StartResizing bottomleft 20 | OnRightGrip Move1 :StartResizing bottomright 21 | 22 | # alt + middle click to lower the window 23 | OnWindow Mod1 Mouse2 :Lower 24 | 25 | # control-click a window's titlebar and drag to attach windows 26 | OnTitlebar Control Mouse1 :StartTabbing 27 | 28 | # double click on the titlebar to shade 29 | OnTitlebar Double Mouse1 :Shade 30 | 31 | # left click on the titlebar to move the window 32 | OnTitlebar Mouse1 :MacroCmd {Raise} {Focus} {ActivateTab} 33 | OnTitlebar Move1 :StartMoving 34 | 35 | # middle click on the titlebar to lower 36 | OnTitlebar Mouse2 :Lower 37 | 38 | # right click on the titlebar for a menu of options 39 | OnTitlebar Mouse3 :WindowMenu 40 | 41 | # alt-tab 42 | Mod1 Tab :NextWindow {groups} (workspace=[current]) 43 | Mod1 Shift Tab :PrevWindow {groups} (workspace=[current]) 44 | 45 | # cycle through tabs in the current window 46 | Mod4 Tab :NextTab 47 | Mod4 Shift Tab :PrevTab 48 | 49 | # go to a specific tab in the current window 50 | Mod4 1 :Tab 1 51 | Mod4 2 :Tab 2 52 | Mod4 3 :Tab 3 53 | Mod4 4 :Tab 4 54 | Mod4 5 :Tab 5 55 | Mod4 6 :Tab 6 56 | Mod4 7 :Tab 7 57 | Mod4 8 :Tab 8 58 | Mod4 9 :Tab 9 59 | 60 | # open a terminal 61 | Mod1 F1 :Exec x-terminal-emulator 62 | 63 | # open a dialog to run programs 64 | Mod1 F2 :Exec fbrun 65 | 66 | # volume settings, using common keycodes 67 | # if these don't work, use xev to find out your real keycodes 68 | 176 :Exec amixer sset Master,0 1+ 69 | 174 :Exec amixer sset Master,0 1- 70 | 160 :Exec amixer sset Master,0 toggle 71 | 72 | # current window commands 73 | Mod1 F4 :Close 74 | Mod1 F5 :Kill 75 | Mod1 F9 :Minimize 76 | Mod1 F10 :Maximize 77 | Mod1 F11 :Fullscreen 78 | 79 | # open the window menu 80 | Mod1 space :WindowMenu 81 | 82 | # exit fluxbox 83 | Control Mod1 Delete :Exit 84 | 85 | # change to previous/next workspace 86 | Control Mod1 Left :PrevWorkspace 87 | Control Mod1 Right :NextWorkspace 88 | 89 | # send the current window to previous/next workspace 90 | Mod4 Left :SendToPrevWorkspace 91 | Mod4 Right :SendToNextWorkspace 92 | 93 | # send the current window and follow it to previous/next workspace 94 | Control Mod4 Left :TakeToPrevWorkspace 95 | Control Mod4 Right :TakeToNextWorkspace 96 | 97 | # change to a specific workspace 98 | Control F1 :Workspace 1 99 | Control F2 :Workspace 2 100 | Control F3 :Workspace 3 101 | Control F4 :Workspace 4 102 | Control F5 :Workspace 5 103 | Control F6 :Workspace 6 104 | Control F7 :Workspace 7 105 | Control F8 :Workspace 8 106 | Control F9 :Workspace 9 107 | Control F10 :Workspace 10 108 | Control F11 :Workspace 11 109 | Control F12 :Workspace 12 110 | 111 | # send the current window to a specific workspace 112 | Mod4 F1 :SendToWorkspace 1 113 | Mod4 F2 :SendToWorkspace 2 114 | Mod4 F3 :SendToWorkspace 3 115 | Mod4 F4 :SendToWorkspace 4 116 | Mod4 F5 :SendToWorkspace 5 117 | Mod4 F6 :SendToWorkspace 6 118 | Mod4 F7 :SendToWorkspace 7 119 | Mod4 F8 :SendToWorkspace 8 120 | Mod4 F9 :SendToWorkspace 9 121 | Mod4 F10 :SendToWorkspace 10 122 | Mod4 F11 :SendToWorkspace 11 123 | Mod4 F12 :SendToWorkspace 12 124 | 125 | # send the current window and change to a specific workspace 126 | Control Mod4 F1 :TakeToWorkspace 1 127 | Control Mod4 F2 :TakeToWorkspace 2 128 | Control Mod4 F3 :TakeToWorkspace 3 129 | Control Mod4 F4 :TakeToWorkspace 4 130 | Control Mod4 F5 :TakeToWorkspace 5 131 | Control Mod4 F6 :TakeToWorkspace 6 132 | Control Mod4 F7 :TakeToWorkspace 7 133 | Control Mod4 F8 :TakeToWorkspace 8 134 | Control Mod4 F9 :TakeToWorkspace 9 135 | Control Mod4 F10 :TakeToWorkspace 10 136 | Control Mod4 F11 :TakeToWorkspace 11 137 | Control Mod4 F12 :TakeToWorkspace 12 138 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DOCKER-DESKTOP 2 | ============== 3 | 4 | ## Description 5 | 6 | This Dockerfile creates a docker image and once it's executed it creates a container that runs X11 and SSH services. 7 | The ssh is used to forward X11 and provide you encrypted data communication between the docker container and your local machine. 8 | 9 | Xpra + Xephyr allows to display the applications running inside of the container such as Firefox, LibreOffice, xterm, etc. with recovery connection capabilities. Xpra also uses a custom protocol that is self-tuning and relatively latency-insensitive, and thus is usable over worse links than standard X. 10 | 11 | The applications can be rootless, so the client machine manages the windows that are displayed. 12 | 13 | Fluxbox and ROX-Filer creates a very minimalist way to manage windows and files. 14 | 15 | 16 | ![Docker L](image/docker-desktop.png "Docker-Desktop") 17 | 18 | OBS: The client machine needs to have a X11 server installed (Xpra). See the "Notes" below. 19 | 20 | ## Docker Installation 21 | 22 | ### On Ubuntu: 23 | Docker is available as a Ubuntu PPA (Personal Package Archive), hosted on launchpad which makes installing Docker on Ubuntu very easy. 24 | 25 | ``` 26 | # Add the PPA sources to your apt sources list. 27 | sudo apt-get install python-software-properties && sudo add-apt-repository ppa:dotcloud/lxc-docker 28 | 29 | # Update your sources 30 | sudo apt-get update 31 | 32 | # Install, you will see another warning that the package cannot be authenticated. Confirm install. 33 | sudo apt-get install lxc-docker 34 | ``` 35 | ### On Windows: 36 | Requirements: 37 | - Installation Tutorial (http://docs.docker.io/en/latest/installation/windows/) 38 | 39 | ### On Mac OS X: 40 | Requirements: 41 | - Installation Tutorial (http://docs.docker.io/en/latest/installation/vagrant/) 42 | 43 | ## Installation 44 | 45 | 46 | ### Building the docker image 47 | 48 | ``` 49 | $ docker build -t rogaha/docker-desktop git://github.com/rogaha/docker-desktop.git 50 | 51 | OR 52 | 53 | $ git clone https://github.com/rogaha/docker-desktop.git 54 | $ cd docker-desktop 55 | $ docker build -t [username]/docker-desktop . 56 | ``` 57 | 58 | ### Running the docker image created (-d: detached mode, -P: expose the port 22 on the host machine) 59 | 60 | ``` 61 | $ CONTAINER_ID=$(docker run -d -P [username]/docker-desktop) 62 | ``` 63 | 64 | ### Getting the password generated during runtime 65 | 66 | ``` 67 | $ echo $(docker logs $CONTAINER_ID | sed -n 1p) 68 | User: docker Password: xxxxxxxxxxxx 69 | # where xxxxxxxxxxxx is the password created by PWGen that contains at least one capital letter and one number 70 | ``` 71 | 72 | ## Usage 73 | 74 | ### Getting the container's external ssh port 75 | 76 | ``` 77 | $ docker port $CONTAINER_ID 22 78 | 49153 # This is the external port that forwards to the ssh service running inside of the container as port 22 79 | ``` 80 | 81 | ### Connecting to the container 82 | 83 | #### Starting the a new session 84 | 85 | ``` 86 | $ ifconfig | grep "inet addr:" 87 | inet addr:192.168.56.102 Bcast:192.168.56.255 Mask:255.255.255.0 # This is the LAN's IP for this machine 88 | 89 | $ ssh docker@192.168.56.102 -p 49153 "sh -c './docker-desktop -s 800x600 -d 10 > /dev/null 2>&1 &'" # Here is where we use the external port 90 | docker@192.168.56.102's password: xxxxxxxxxxxx 91 | 92 | $ ./docker-desktop -h 93 | 94 | ----------------------------------------------------------- 95 | Usage: docker-desktop [-s screen_size] [-d session_number] 96 | -s : screen resolution (Default = 800x600 97 | -d : session number (Default = 10) 98 | -h : help 99 | ----------------------------------------------------------- 100 | ``` 101 | 102 | #### Attaching to the session started 103 | 104 | ``` 105 | $ xpra --ssh="ssh -p 49153" attach ssh:docker@192.168.56.102:10 # user@ip_address:session_number 106 | docker@192.168.56.102's password: xxxxxxxxxxxx 107 | 108 | ``` 109 | If you want to execute rootless programs, you just need to connect to the container via ssh and type: 110 | DISPLAY=:[session_number] [program_name] & 111 | 112 | Eg. DISPLAY=:10 firefox & 113 | 114 | ## Notes 115 | 116 | ### On Windows: 117 | Requirements: 118 | - Xpra <= 14.0 (https://www.xpra.org/dists/windows/) 119 | - Path: C:\Program Files(x86)\Xpra\Xpra_cmd.exe 120 | 121 | ### On OS X: 122 | Requirements: 123 | - Xpra Version <= 14.0 (https://www.xpra.org/dists/osx/x86/) 124 | - Path: /Applications/Xpra.app/Contents/Helpers/xpra 125 | 126 | 127 | ### On Linux: 128 | Requirements: 129 | - Xpra: You can use apt-get to install it -> apt-get install xpra 130 | - Path: /usr/bin/xpra 131 | -------------------------------------------------------------------------------- /config/.config/rox.sourceforge.net/ROX-Filer/Options: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | --------------------------------------------------------------------------------