Skip to content

Supporting for novnc on Ubuntu 20.04 #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions ubuntu/Dockerfile.20.04.xfce.amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
FROM ubuntu:focal as system

ENV DISPLAY=:1 \
VNC_PORT=5901 \
NO_VNC_PORT=6901 \
VNC_COL_DEPTH=32 \
VNC_RESOLUTION=1024x768

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install --no-install-recommends -y apt-utils ;\
apt install --no-install-recommends -y \
xvfb xauth dbus-x11 xfce4 xfce4-terminal \
wget sudo curl gpg git bzip2 vim-tiny procps python x11-xserver-utils \
libnss3 libnspr4 libasound2 libgbm1 ca-certificates ttf-ubuntu-font-family xdg-utils \
tigervnc-standalone-server tigervnc-common firefox firefox-locale-ko fonts-nanum \
libappindicator3-1 libindicator3-7 ncurses-term && \
apt upgrade -y ibus-hangul && \
rm -vf /opt/lib*.deb; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


#ENV TERM xterm
# Install NOVNC.
RUN git clone --branch v1.2.0 --single-branch https://github.com/novnc/noVNC.git /opt/noVNC; \
git clone --branch v0.9.0 --single-branch https://github.com/novnc/websockify.git /opt/noVNC/utils/websockify; \
ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html; \
ls -al /opt/noVNC/utils/

# disable shared memory X11 affecting Chromium
ENV QT_X11_NO_MITSHM=1 \
_X11_NO_MITSHM=1 \
_MITSHM=0

# give every user read write access to the "/root" folder where the binary is cached
RUN ls -la /root
RUN chmod 777 /root && mkdir /src && mkdir /tmp/user_config && mkdir /usr/local/xfcedeskconfig
COPY assets/config/ /tmp/user_config/
RUN cd /tmp/user_config && tar czvf /usr/local/xfcedeskconfig/deskconfig.tar.gz * && rm -rf /tmp/user_config
COPY scripts/entrypoint.sh /usr/local/bin/

# this have to be moved to bootstrap code
#COPY assets/config/ /home/dockeruser/.config

# RUN chown -R dockeruser:dockeruser /home/dockeruser;\
# chmod -R 777 /home/dockeruser ;\
# adduser dockeruser sudo;\
# echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

#USER dockeruser

#COPY scripts/entrypoint.sh /src

#Expose port 5901 to view display using VNC Viewer (6901 --> noVNC)
#EXPOSE 5901 6901
#ENTRYPOINT ["/src/entrypoint.sh"]

WORKDIR /home/work

ENV USER work
ENV PASSWORD work
ENV USERID 1000
ENV GROUPID 1000

COPY assets/service-defs /etc/backend.ai/service-defs
COPY assets/policy.yml /etc/backend.ai/jail/policy.yml

LABEL ai.backend.kernelspec="1" \
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
ai.backend.features="batch query uid-match user-input" \
ai.backend.resource.min.cpu="1" \
ai.backend.resource.min.mem="256m" \
ai.backend.base-distro="ubuntu20.04" \
ai.backend.runtime-type="app" \
ai.backend.runtime-path="/usr/false" \
ai.backend.service-ports="novnc:http:5900"

RUN ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color
11 changes: 11 additions & 0 deletions ubuntu/assets/config/xfce4/desktop/icons.screen0-1904x1064.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[xfdesktop-version-4.10.3+-rcfile_format]
4.10.3+=true

[/]
row=0
col=0

[/home/dockeruser]
row=1
col=0

11 changes: 11 additions & 0 deletions ubuntu/assets/config/xfce4/desktop/icons.screen0-2544x1201.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[xfdesktop-version-4.10.3+-rcfile_format]
4.10.3+=true

[/]
row=0
col=0

[/home/dockeruser]
row=1
col=0

11 changes: 11 additions & 0 deletions ubuntu/assets/config/xfce4/desktop/icons.screen0-2544x1281.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[xfdesktop-version-4.10.3+-rcfile_format]
4.10.3+=true

[/]
row=0
col=0

[/home/dockeruser]
row=1
col=0

14 changes: 14 additions & 0 deletions ubuntu/assets/config/xfce4/panel/launcher-10/16161682692.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Desktop Entry]
Version=1.0
Type=Application
Exec=exo-open --launch FileManager %u
Icon=system-file-manager
StartupNotify=true
Terminal=false
Categories=Utility;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-XFCE-MimeType=inode/directory;x-scheme-handler/trash;
X-AppStream-Ignore=True
Name=File Manager
Comment=Browse the file system
X-XFCE-Source=file:///usr/share/applications/exo-file-manager.desktop
15 changes: 15 additions & 0 deletions ubuntu/assets/config/xfce4/panel/launcher-11/16161682693.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Desktop Entry]
Version=1.0
Type=Application
Exec=/usr/lib/firefox-esr/firefox-esr %u
Icon=firefox-esr
StartupNotify=true
Terminal=false
Categories=Network;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-XFCE-MimeType=x-scheme-handler/http;x-scheme-handler/https;
X-AppStream-Ignore=True
Name=Firefox ESR
Comment=Browse the World Wide Web
X-XFCE-Source=file:///usr/share/applications/exo-web-browser.desktop
Path=
13 changes: 13 additions & 0 deletions ubuntu/assets/config/xfce4/panel/launcher-9/16161682691.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Desktop Entry]
Version=1.0
Type=Application
Exec=exo-open --launch TerminalEmulator
Icon=utilities-terminal
StartupNotify=true
Terminal=false
Categories=Utility;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-AppStream-Ignore=True
Name=Terminal Emulator
Comment=Use the command line
X-XFCE-Source=file:///usr/share/applications/exo-terminal-emulator.desktop
34 changes: 34 additions & 0 deletions ubuntu/assets/config/xfce4/terminal/terminalrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[Configuration]
BackgroundMode=TERMINAL_BACKGROUND_TRANSPARENT
BackgroundDarkness=0.810000
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBellUrgent=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=80x24
MiscInheritGeometry=FALSE
MiscMenubarDefault=TRUE
MiscMouseAutohide=FALSE
MiscMouseWheelZoom=TRUE
MiscToolbarDefault=FALSE
MiscConfirmClose=TRUE
MiscCycleTabs=TRUE
MiscTabCloseButtons=TRUE
MiscTabCloseMiddleClick=TRUE
MiscTabPosition=GTK_POS_TOP
MiscHighlightUrls=TRUE
MiscMiddleClickOpensUri=FALSE
MiscCopyOnSelect=FALSE
MiscShowRelaunchDialog=TRUE
MiscRewrapOnResize=TRUE
MiscUseShiftArrowsToScroll=FALSE
MiscSlimTabs=FALSE
MiscNewTabAdjacent=FALSE
MiscSearchDialogOpacity=100
MiscShowUnsafePasteDialog=TRUE
ColorForeground=#dcdcdc
ColorBackground=#2c2c2c
ColorCursor=#dcdcdc
ColorPalette=#3f3f3f;#705050;#60b48a;#dfaf8f;#9ab8d7;#dc8cc3;#8cd0d3;#dcdcdc;#709080;#dca3a3;#72d5a3;#f0dfaf;#94bff3;#ec93d3;#93e0e3;#ffffff
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>

<channel name="thunar" version="1.0">
<property name="last-view" type="string" value="ThunarIconView"/>
</channel>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-desktop" version="1.0">
<property name="backdrop" type="empty">
<property name="screen0" type="empty">
<property name="monitor0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-teal.jpg"/>
</property>
<property name="workspace1" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-teal.jpg"/>
</property>
<property name="workspace2" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-teal.jpg"/>
</property>
<property name="workspace3" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="5"/>
<property name="last-image" type="string" value="/usr/share/backgrounds/xfce/xfce-teal.jpg"/>
</property>
</property>
</property>
</property>
</channel>
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-keyboard-shortcuts" version="1.0">
<property name="commands" type="empty">
<property name="default" type="empty">
<property name="&lt;Alt&gt;F1" type="empty"/>
<property name="&lt;Alt&gt;F2" type="empty">
<property name="startup-notify" type="empty"/>
</property>
<property name="&lt;Alt&gt;F3" type="empty">
<property name="startup-notify" type="empty"/>
</property>
<property name="&lt;Primary&gt;&lt;Alt&gt;Delete" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;l" type="empty"/>
<property name="XF86Display" type="empty"/>
<property name="&lt;Super&gt;p" type="empty"/>
<property name="&lt;Primary&gt;Escape" type="empty"/>
<property name="XF86WWW" type="empty"/>
<property name="XF86Mail" type="empty"/>
</property>
<property name="custom" type="empty">
<property name="&lt;Alt&gt;F3" type="string" value="xfce4-appfinder">
<property name="startup-notify" type="bool" value="true"/>
</property>
<property name="&lt;Alt&gt;F1" type="string" value="xfce4-popup-applicationsmenu"/>
<property name="&lt;Alt&gt;F2" type="string" value="xfce4-appfinder --collapsed">
<property name="startup-notify" type="bool" value="true"/>
</property>
<property name="&lt;Primary&gt;&lt;Alt&gt;Delete" type="string" value="xflock4"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;l" type="string" value="xflock4"/>
<property name="XF86Mail" type="string" value="exo-open --launch MailReader"/>
<property name="XF86Display" type="string" value="xfce4-display-settings --minimal"/>
<property name="XF86WWW" type="string" value="exo-open --launch WebBrowser"/>
<property name="&lt;Super&gt;p" type="string" value="xfce4-display-settings --minimal"/>
<property name="&lt;Primary&gt;Escape" type="string" value="xfdesktop --menu"/>
<property name="override" type="bool" value="true"/>
</property>
</property>
<property name="xfwm4" type="empty">
<property name="default" type="empty">
<property name="&lt;Alt&gt;Insert" type="empty"/>
<property name="Escape" type="empty"/>
<property name="Left" type="empty"/>
<property name="Right" type="empty"/>
<property name="Up" type="empty"/>
<property name="Down" type="empty"/>
<property name="&lt;Alt&gt;Tab" type="empty"/>
<property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="empty"/>
<property name="&lt;Alt&gt;Delete" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Down" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Left" type="empty"/>
<property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="empty"/>
<property name="&lt;Alt&gt;F4" type="empty"/>
<property name="&lt;Alt&gt;F6" type="empty"/>
<property name="&lt;Alt&gt;F7" type="empty"/>
<property name="&lt;Alt&gt;F8" type="empty"/>
<property name="&lt;Alt&gt;F9" type="empty"/>
<property name="&lt;Alt&gt;F10" type="empty"/>
<property name="&lt;Alt&gt;F11" type="empty"/>
<property name="&lt;Alt&gt;F12" type="empty"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;End" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Home" type="empty"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="empty"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_1" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_2" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_3" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_4" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_5" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_6" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_7" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_8" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_9" type="empty"/>
<property name="&lt;Alt&gt;space" type="empty"/>
<property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Right" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;d" type="empty"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Up" type="empty"/>
<property name="&lt;Super&gt;Tab" type="empty"/>
<property name="&lt;Primary&gt;F1" type="empty"/>
<property name="&lt;Primary&gt;F2" type="empty"/>
<property name="&lt;Primary&gt;F3" type="empty"/>
<property name="&lt;Primary&gt;F4" type="empty"/>
<property name="&lt;Primary&gt;F5" type="empty"/>
<property name="&lt;Primary&gt;F6" type="empty"/>
<property name="&lt;Primary&gt;F7" type="empty"/>
<property name="&lt;Primary&gt;F8" type="empty"/>
<property name="&lt;Primary&gt;F9" type="empty"/>
<property name="&lt;Primary&gt;F10" type="empty"/>
<property name="&lt;Primary&gt;F11" type="empty"/>
<property name="&lt;Primary&gt;F12" type="empty"/>
</property>
<property name="custom" type="empty">
<property name="Up" type="string" value="up_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_9" type="string" value="move_window_workspace_9_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_8" type="string" value="move_window_workspace_8_key"/>
<property name="Left" type="string" value="left_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_6" type="string" value="move_window_workspace_6_key"/>
<property name="&lt;Alt&gt;Insert" type="string" value="add_workspace_key"/>
<property name="&lt;Alt&gt;Tab" type="string" value="cycle_windows_key"/>
<property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="string" value="cycle_reverse_windows_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_7" type="string" value="move_window_workspace_7_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Right" type="string" value="right_workspace_key"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="string" value="move_window_right_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;d" type="string" value="show_desktop_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Up" type="string" value="up_workspace_key"/>
<property name="&lt;Primary&gt;F7" type="string" value="workspace_7_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Home" type="string" value="move_window_prev_workspace_key"/>
<property name="&lt;Alt&gt;F4" type="string" value="close_window_key"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="string" value="move_window_left_key"/>
<property name="&lt;Alt&gt;F6" type="string" value="stick_window_key"/>
<property name="&lt;Alt&gt;F10" type="string" value="maximize_window_key"/>
<property name="&lt;Alt&gt;F12" type="string" value="above_key"/>
<property name="&lt;Alt&gt;F9" type="string" value="hide_window_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Down" type="string" value="down_workspace_key"/>
<property name="&lt;Alt&gt;F8" type="string" value="resize_window_key"/>
<property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/>
<property name="Escape" type="string" value="cancel_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;End" type="string" value="move_window_next_workspace_key"/>
<property name="&lt;Primary&gt;F10" type="string" value="workspace_10_key"/>
<property name="&lt;Primary&gt;F11" type="string" value="workspace_11_key"/>
<property name="&lt;Alt&gt;F11" type="string" value="fullscreen_key"/>
<property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="string" value="move_window_up_key"/>
<property name="Right" type="string" value="right_key"/>
<property name="Down" type="string" value="down_key"/>
<property name="&lt;Alt&gt;F7" type="string" value="move_window_key"/>
<property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="string" value="lower_window_key"/>
<property name="&lt;Primary&gt;F12" type="string" value="workspace_12_key"/>
<property name="&lt;Primary&gt;F1" type="string" value="workspace_1_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;Left" type="string" value="left_workspace_key"/>
<property name="&lt;Primary&gt;F2" type="string" value="workspace_2_key"/>
<property name="&lt;Primary&gt;F4" type="string" value="workspace_4_key"/>
<property name="&lt;Primary&gt;F5" type="string" value="workspace_5_key"/>
<property name="&lt;Primary&gt;F6" type="string" value="workspace_6_key"/>
<property name="&lt;Alt&gt;space" type="string" value="popup_menu_key"/>
<property name="&lt;Primary&gt;F8" type="string" value="workspace_8_key"/>
<property name="&lt;Primary&gt;F9" type="string" value="workspace_9_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_1" type="string" value="move_window_workspace_1_key"/>
<property name="&lt;Alt&gt;Delete" type="string" value="del_workspace_key"/>
<property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="string" value="raise_window_key"/>
<property name="&lt;Primary&gt;F3" type="string" value="workspace_3_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_2" type="string" value="move_window_workspace_2_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_3" type="string" value="move_window_workspace_3_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_4" type="string" value="move_window_workspace_4_key"/>
<property name="&lt;Primary&gt;&lt;Alt&gt;KP_5" type="string" value="move_window_workspace_5_key"/>
<property name="override" type="bool" value="true"/>
</property>
</property>
<property name="providers" type="array">
<value type="string" value="xfwm4"/>
<value type="string" value="commands"/>
</property>
</channel>
Loading