Skip to content
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

Desktop not working in Docker build #47

Closed
nathanin opened this issue Jul 15, 2023 · 16 comments · Fixed by #53
Closed

Desktop not working in Docker build #47

nathanin opened this issue Jul 15, 2023 · 16 comments · Fixed by #53
Labels
bug Something isn't working

Comments

@nathanin
Copy link

Bug description

Remote desktop running on a remote server and port forwarded to a local desktop starts, but clicking Desktop gives an error and the desktop does not start.

Expected behaviour

Clicking the desktop icon opens a remote desktop.

Actual behaviour

image

How to reproduce

On a remote server:

  • clone this repository
  • docker build -t jupyter-remote-desktop-proxy .
  • docker run --rm -p 8888:8888 jupyter-remote-desktop-proxy

Locally:

  • navigate to jupyter server
  • click on Desktop icon

Your personal set up

  • OS:
    Server:
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:        21.04
Codename:       hirsute

Local: OSX 13.4 Ventura

  • Version(s):
Full environment
# paste output of `pip freeze` or `conda list` here
Configuration
# jupyterhub_config.py
Logs
@nathanin nathanin added the bug Something isn't working label Jul 15, 2023
@welcome
Copy link

welcome bot commented Jul 15, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@nathanin
Copy link
Author

This is a log produced inside the container

cat /home/jovyan/.vnc/791fae899021:1.log
TurboVNC Server (Xvnc) 64-bit v2.2.6 (build 20210221)
Copyright (C) 1999-2021 The VirtualGL Project and many others (see README.txt)
Visit http://www.TurboVNC.org for more information on TurboVNC

15/07/2023 19:00:20 Using security configuration file /etc/turbovncserver-security.conf
15/07/2023 19:00:20 Enabled security type 'none'
_XSERVTransmkdir: Cannot create /tmp/.X11-unix with root ownership
15/07/2023 19:00:20 Desktop name 'TurboVNC: 791fae899021:1 ()' (791fae899021:1)
15/07/2023 19:00:20 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
15/07/2023 19:00:20 Listening for VNC connections on TCP port 5901
15/07/2023 19:00:20   Interface 0.0.0.0
15/07/2023 19:00:20 Listening for HTTP connections on TCP port 5801
15/07/2023 19:00:20   URL http://791fae899021:5801
15/07/2023 19:00:20   Interface 0.0.0.0
15/07/2023 19:00:20 Framebuffer: BGRX 8/8/8/8
15/07/2023 19:00:20 New desktop size: 1680 x 1050
15/07/2023 19:00:20 New screen layout:
15/07/2023 19:00:20   0x00000040 (output 0x00000040): 1680x1050+0+0
15/07/2023 19:00:20 Maximum clipboard transfer size: 1048576 bytes
15/07/2023 19:00:20 VNC extension running!
(II) IGLX: enabled GLX_MESA_copy_sub_buffer
(II) IGLX: Loaded and initialized swrast
(II) GLX: Initialized DRISWRAST GL provider for screen 0
(II) XKB: Reusing cached keymap
(II) XKB: Reusing cached keymap
_IceTransmkdir: ERROR: euid != 0,directory /tmp/.ICE-unix will not be created.

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.633: Failed to spawn ssh-agent: Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.634: failed to call dbus-update-activation-environment. Output was (null), error was Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.636: Failed to spawn gpg-agent: Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.638: Unable to launch "xfwm4": Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.639: Unable to launch "xfsettingsd": Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.641: Unable to launch "xfce4-panel": Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.642: Unable to launch "Thunar": Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.643: Unable to launch "xfdesktop": Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.644: Unable to launch "/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd" (specified by autostart/xfce4-notifyd.desktop): Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.645: Unable to launch "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1" (specified by autostart/polkit-gnome-authentication-agent-1.desktop): Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.646: Unable to launch "start-pulseaudio-x11" (specified by autostart/pulseaudio.desktop): Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.647: Unable to launch "/usr/bin/snap userd --autostart" (specified by autostart/snap-userd-autostart.desktop): Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.648: Unable to launch "xfce4-screensaver" (specified by autostart/xfce4-screensaver.desktop): Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.649: Unable to launch "xdg-user-dirs-update" (specified by autostart/xdg-user-dirs.desktop): Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.651: Unable to launch "xiccd" (specified by autostart/xiccd.desktop): Failed to close file descriptor for child process (Operation not permitted)

(xfce4-session:297): xfce4-session-WARNING **: 19:00:21.652: Unable to launch "xfsettingsd" (specified by autostart/xfsettingsd.desktop): Failed to close file descriptor for child process (Operation not permitted)

@benz0li
Copy link

benz0li commented Jul 22, 2023

Most likely Due to commit 447bf86.

@domna
Copy link

domna commented Aug 9, 2023

I have the same problem and removing the changes from commit 447bf86 fixes it. Is this an issue whether the image is run standalone vs. inside a jupyter hub?

@benz0li
Copy link

benz0li commented Aug 9, 2023

Is this an issue whether the image is run standalone vs. inside a jupyter hub?

This issue affects both.

@domna
Copy link

domna commented Aug 9, 2023

Is this an issue whether the image is run standalone vs. inside a jupyter hub?

This issue affects both.

Ok, I don't know the exact details of the interaction of jupyterhub with the containers, so I thought it may provide this port variable used there and needs this to redirect. But this is all routed through the web ports so it should be fine to set it to port 5901, even for multiple containers running in jupyterhub, right?

@benz0li
Copy link

benz0li commented Aug 9, 2023

But this is all routed through the web ports so it should be fine to set it to port 5901, even for multiple containers running in jupyterhub, right?

Correct.

domna added a commit to domna/jupyter-remote-desktop-proxy that referenced this issue Aug 9, 2023
@ryanlovett
Copy link

@benz0li Using a fixed port is fine when jupyterhub launches containerized (or partially namespaced) single user environments, but it causes problems when jupyterhub-launched servers are running unnamespaced on shared systems, e.g. The Littlest JupyterHub. (That in itself is a security issue if proxied services don't have any security or auth measures in place.)

So jupyter-remote-desktop would be compatible with more jupyterhub deployments if the port assignment was dynamic.

@yuvipanda
Copy link
Contributor

@domna you need to pass --security-opt seccomp=unconfined for this to work in docker by default. This matches what kubernetes does by default, so that works there.

@benz0li
Copy link

benz0li commented Aug 22, 2023

This does not solve the problem:

docker run -it --rm --security-opt seccomp=unconfined -p 8888:8888 jupyterlab/qgis/base:3.32.2
Entered start.sh with args: jupyter lab
/usr/local/bin/start.sh: running hooks in /usr/local/bin/start-notebook.d as uid / gid: 1000 / 100
/usr/local/bin/start.sh: running script /usr/local/bin/start-notebook.d/populate.sh
/usr/local/bin/start.sh: done running hooks in /usr/local/bin/start-notebook.d
/usr/local/bin/start.sh: running hooks in /usr/local/bin/before-notebook.d as uid / gid: 1000 / 100
/usr/local/bin/start.sh: running script /usr/local/bin/before-notebook.d/init.sh
/usr/local/bin/start.sh: running script /usr/local/bin/before-notebook.d/limits.sh
/usr/local/bin/start.sh: done running hooks in /usr/local/bin/before-notebook.d
Executing the command: jupyter lab
[I 2023-08-22 08:15:16.206 ServerApp] Package jupyterlab took 0.0000s to import
[I 2023-08-22 08:15:16.210 ServerApp] Package jupyter_lsp took 0.0039s to import
[W 2023-08-22 08:15:16.210 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_lsp. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-08-22 08:15:16.212 ServerApp] Package jupyter_server_fileid took 0.0010s to import
[I 2023-08-22 08:15:16.212 ServerApp] Package jupyter_server_mathjax took 0.0004s to import
[I 2023-08-22 08:15:16.233 ServerApp] Package jupyter_server_proxy took 0.0202s to import
[I 2023-08-22 08:15:16.234 ServerApp] Package jupyter_server_terminals took 0.0016s to import
[I 2023-08-22 08:15:16.242 ServerApp] Package jupyter_server_ydoc took 0.0073s to import
[I 2023-08-22 08:15:16.254 ServerApp] Package jupyterlab_git took 0.0120s to import
[I 2023-08-22 08:15:16.254 ServerApp] Package nbclassic took 0.0000s to import
[W 2023-08-22 08:15:16.255 ServerApp] A `_jupyter_server_extension_points` function was not found in nbclassic. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-08-22 08:15:16.255 ServerApp] Package nbdime took 0.0000s to import
[I 2023-08-22 08:15:16.255 ServerApp] Package notebook_shim took 0.0000s to import
[W 2023-08-22 08:15:16.255 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-08-22 08:15:16.255 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2023-08-22 08:15:16.257 ServerApp] jupyter_server_fileid | extension was successfully linked.
[I 2023-08-22 08:15:16.258 ServerApp] jupyter_server_mathjax | extension was successfully linked.
[I 2023-08-22 08:15:16.258 ServerApp] jupyter_server_proxy | extension was successfully linked.
[I 2023-08-22 08:15:16.260 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2023-08-22 08:15:16.261 ServerApp] jupyter_server_ydoc | extension was successfully linked.
[I 2023-08-22 08:15:16.262 ServerApp] jupyterlab | extension was successfully linked.
[I 2023-08-22 08:15:16.262 ServerApp] jupyterlab_git | extension was successfully linked.
[W 2023-08-22 08:15:16.263 NotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-08-22 08:15:16.263 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2023-08-22 08:15:16.264 ServerApp] nbclassic | extension was successfully linked.
[I 2023-08-22 08:15:16.264 ServerApp] nbdime | extension was successfully linked.
[I 2023-08-22 08:15:16.264 ServerApp] Writing Jupyter server cookie secret to /home/jovyan/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2023-08-22 08:15:16.385 ServerApp] notebook_shim | extension was successfully linked.
[I 2023-08-22 08:15:16.406 ServerApp] notebook_shim | extension was successfully loaded.
[I 2023-08-22 08:15:16.407 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2023-08-22 08:15:16.407 FileIdExtension] Configured File ID manager: ArbitraryFileIdManager
[I 2023-08-22 08:15:16.408 FileIdExtension] ArbitraryFileIdManager : Configured root dir: /home/jovyan
[I 2023-08-22 08:15:16.408 FileIdExtension] ArbitraryFileIdManager : Configured database path: /home/jovyan/.local/share/jupyter/file_id_manager.db
[I 2023-08-22 08:15:16.408 FileIdExtension] ArbitraryFileIdManager : Successfully connected to database file.
[I 2023-08-22 08:15:16.408 FileIdExtension] ArbitraryFileIdManager : Creating File ID tables and indices with journal_mode = DELETE
[I 2023-08-22 08:15:16.412 FileIdExtension] Attached event listeners.
[I 2023-08-22 08:15:16.412 ServerApp] jupyter_server_fileid | extension was successfully loaded.
[I 2023-08-22 08:15:16.412 ServerApp] jupyter_server_mathjax | extension was successfully loaded.
[I 2023-08-22 08:15:16.415 ServerApp] jupyter_server_proxy | extension was successfully loaded.
[I 2023-08-22 08:15:16.416 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2023-08-22 08:15:16.416 ServerApp] jupyter_server_ydoc | extension was successfully loaded.
[I 2023-08-22 08:15:16.417 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.11/site-packages/jupyterlab
[I 2023-08-22 08:15:16.417 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 2023-08-22 08:15:16.417 ServerApp] jupyterlab | extension was successfully loaded.
[I 2023-08-22 08:15:16.419 ServerApp] jupyterlab_git | extension was successfully loaded.

  _   _          _      _
 | | | |_ __  __| |__ _| |_ ___
 | |_| | '_ \/ _` / _` |  _/ -_)
  \___/| .__/\__,_\__,_|\__\___|
       |_|
                                                                           
Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.

[I 2023-08-22 08:15:16.420 ServerApp] nbclassic | extension was successfully loaded.
[I 2023-08-22 08:15:16.437 ServerApp] nbdime | extension was successfully loaded.
[I 2023-08-22 08:15:16.438 ServerApp] Serving notebooks from local directory: /home/jovyan
[I 2023-08-22 08:15:16.438 ServerApp] Jupyter Server 2.7.2 is running at:
[I 2023-08-22 08:15:16.438 ServerApp] http://fcb77501fbde:8888/lab?token=c705595828ae1e1aec58acd2a381b3228f7715e806c33751
[I 2023-08-22 08:15:16.438 ServerApp]     http://127.0.0.1:8888/lab?token=c705595828ae1e1aec58acd2a381b3228f7715e806c33751
[I 2023-08-22 08:15:16.438 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2023-08-22 08:15:16.441 ServerApp] No web browser found: Error('could not locate runnable browser').
[C 2023-08-22 08:15:16.442 ServerApp] 
    
    To access the server, open this file in a browser:
        file:///home/jovyan/.local/share/jupyter/runtime/jpserver-7-open.html
    Or copy and paste one of these URLs:
        http://fcb77501fbde:8888/lab?token=c705595828ae1e1aec58acd2a381b3228f7715e806c33751
        http://127.0.0.1:8888/lab?token=c705595828ae1e1aec58acd2a381b3228f7715e806c33751
[I 2023-08-22 08:15:16.448 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[W 2023-08-22 08:15:22.374 LabApp] Could not determine jupyterlab build status without nodejs
WebSocket server settings:
  - Listen on :42695
  - Web server. Web root: /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/web/noVNC-1.2.0
  - No SSL/TLS support (no cert file)
  - proxying from :42695 to '/bin/sh -c cd /home/jovyan && /opt/TurboVNC/bin/vncserver -verbose -xstartup /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg' (port 39307)
Starting '/bin/sh -c cd /home/jovyan && /opt/TurboVNC/bin/vncserver -verbose -xstartup /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg'
xauth:  file /home/jovyan/.Xauthority does not exist
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET / HTTP/1.1" 200 -
handler exception: [Errno 104] Connection reset by peer
127.0.0.1: new handler Process
exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/websockify/websockifyserver.py", line 662, in top_new_client
    client = self.do_handshake(startsock, address)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/websockify/websockifyserver.py", line 590, in do_handshake
    self.RequestHandlerClass(retsock, address, self)
  File "/usr/lib/python3/dist-packages/websockify/websockifyserver.py", line 87, in __init__
    super().__init__(req, addr, server)
  File "/usr/lib/python3.11/http/server.py", line 667, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
    self.handle()
  File "/usr/lib/python3/dist-packages/websockify/websockifyserver.py", line 297, in handle
    super().handle()
  File "/usr/lib/python3.11/http/server.py", line 434, in handle
    self.handle_one_request()
  File "/usr/lib/python3/dist-packages/websockify/websocketserver.py", line 40, in handle_one_request
    super().handle_one_request()
  File "/usr/lib/python3.11/http/server.py", line 400, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 706, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vnc_lite.html HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/promise.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /app/images/clipboard.svg HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/rfb.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/int.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/strings.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/logging.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/browser.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/element.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/events.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/eventtarget.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/display.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/inflator.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/deflator.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/keyboard.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/gesturehandler.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/websock.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/des.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/cursor.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/xtscancodes.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/keysym.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/encodings.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/util/polyfill.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/decoders/copyrect.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/decoders/hextile.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/decoders/rre.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/decoders/raw.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/decoders/tight.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/base64.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/inflate.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/decoders/tightpng.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/zstream.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/deflate.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/util.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/crc32.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/utils/common.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/adler32.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/inftrees.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/inffast.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/keysymdef.js HTTP/1.1" 200 -
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1: new handler Process
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/vkeys.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/fixedkeys.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /core/input/domkeytable.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/trees.js HTTP/1.1" 200 -
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /vendor/pako/lib/zlib/messages.js HTTP/1.1" 200 -
[I 2023-08-22 08:15:28.274 ServerApp] Trying to establish websocket connection to ws://localhost:42695/websockify
127.0.0.1: new handler Process
[I 2023-08-22 08:15:28.278 ServerApp] Websocket connection established to ws://localhost:42695/websockify
127.0.0.1 - - [22/Aug/2023 08:15:28] "GET /websockify HTTP/1.1" 101 -
127.0.0.1 - - [22/Aug/2023 08:15:28] 127.0.0.1: Plain non-SSL (ws://) WebSocket connection
127.0.0.1 - - [22/Aug/2023 08:15:28] 127.0.0.1: Path: '/websockify'
127.0.0.1 - - [22/Aug/2023 08:15:28] connecting to command: '/bin/sh -c cd /home/jovyan && /opt/TurboVNC/bin/vncserver -verbose -xstartup /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg' (port 39307)
127.0.0.1 - - [22/Aug/2023 08:15:28] Failed to connect to 127.0.0.1:39307: [Errno 111] Connection refused

Desktop 'TurboVNC: fcb77501fbde:1 ()' started on display fcb77501fbde:1

Starting applications specified in /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup
Log file is /home/jovyan/.vnc/fcb77501fbde:1.log

I have changed https://github.com/b-data/jupyterlab-qgis-docker-stack/blob/59091f1bd17c26cb634fd5f05469611db6aa2dc2/base/Dockerfile#L372 from git+https://github.com/b-data/jupyter-remote-desktop-proxy.git@QGIS to git+https://github.com/jupyterhub/jupyter-remote-desktop-proxy for the above test.

@benz0li
Copy link

benz0li commented Aug 22, 2023

Reverting 447bf86 results in (omitting extensive logs)

WebSocket server settings:
  - Listen on :5901
  - Web server. Web root: /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/web/noVNC
  - No SSL/TLS support (no cert file)
  - proxying from :5901 to '/bin/sh -c cd /home/jovyan && /opt/TurboVNC/bin/vncserver -xstartup /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg :1' (port 52503)
Starting '/bin/sh -c cd /home/jovyan && /opt/TurboVNC/bin/vncserver -xstartup /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg :1'
xauth:  file /home/jovyan/.Xauthority does not exist
handler exception: [Errno 104] Connection reset by peer
[I 2023-08-22 08:30:41.745 ServerApp] Trying to establish websocket connection to ws://localhost:5901/websockify
[I 2023-08-22 08:30:41.749 ServerApp] Websocket connection established to ws://localhost:5901/websockify
127.0.0.1 - - [22/Aug/2023 08:30:41] 127.0.0.1: Plain non-SSL (ws://) WebSocket connection
127.0.0.1 - - [22/Aug/2023 08:30:41] 127.0.0.1: Path: '/websockify'
127.0.0.1 - - [22/Aug/2023 08:30:41] connecting to command: '/bin/sh -c cd /home/jovyan && /opt/TurboVNC/bin/vncserver -xstartup /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg :1' (port 52503)

Desktop 'TurboVNC: c3df75640122:1 ()' started on display c3df75640122:1

Starting applications specified in /usr/local/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup
Log file is /home/jovyan/.vnc/c3df75640122:1.log

Random port does not seem to be the problem. Omitting the display number for TurboVNC might be it.

Omitting the display number for TurboVNC is not the problem. Not setting the port seems to be it.

@yuvipanda yuvipanda reopened this Aug 24, 2023
@yuvipanda
Copy link
Contributor

@benz0li can you try with the new docker images introduced in #51? I am not a big fan of the current Dockerfile in the main repo, curious if these built images have the same issue. You can see current builds at #51

@benz0li
Copy link

benz0li commented Aug 24, 2023

@benz0li can you try with the new docker images introduced in #51?

It works on the second attempt:

docker run -it --rm -p 8888:8888 quay.io/jupyter-remote-desktop-proxy/base

Opening desktop the first time:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Entered start.sh with args: jupyter lab
/usr/local/bin/start.sh: running hooks in: /usr/local/bin/start-notebook.d as uid: 1000 gid: 100
/usr/local/bin/start.sh: running executable: /usr/local/bin/start-notebook.d/setup-desktop-files.bash
/usr/local/bin/start.sh: running executable: /usr/local/bin/start-notebook.d/setup-mime-files.bash
/usr/local/bin/start.sh: done running hooks in: /usr/local/bin/start-notebook.d
/usr/local/bin/start.sh: running hooks in: /usr/local/bin/before-notebook.d as uid: 1000 gid: 100
/usr/local/bin/start.sh: ignoring non-executable: /usr/local/bin/before-notebook.d/*
/usr/local/bin/start.sh: done running hooks in: /usr/local/bin/before-notebook.d
Executing the command: jupyter lab
[I 2023-08-24 17:33:37.368 ServerApp] Package jupyterlab took 0.0000s to import
[I 2023-08-24 17:33:37.375 ServerApp] Package jupyter_lsp took 0.0064s to import
[W 2023-08-24 17:33:37.375 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_lsp. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-08-24 17:33:37.412 ServerApp] Package jupyter_server_proxy took 0.0362s to import
[I 2023-08-24 17:33:37.414 ServerApp] Package jupyter_server_terminals took 0.0022s to import
[I 2023-08-24 17:33:37.416 ServerApp] Package nbclassic took 0.0012s to import
[W 2023-08-24 17:33:37.416 ServerApp] A `_jupyter_server_extension_points` function was not found in nbclassic. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-08-24 17:33:37.417 ServerApp] Package notebook took 0.0000s to import
[I 2023-08-24 17:33:37.418 ServerApp] Package notebook_shim took 0.0000s to import
[W 2023-08-24 17:33:37.418 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-08-24 17:33:37.418 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2023-08-24 17:33:37.418 ServerApp] jupyter_server_proxy | extension was successfully linked.
[I 2023-08-24 17:33:37.421 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2023-08-24 17:33:37.423 ServerApp] jupyterlab | extension was successfully linked.
[I 2023-08-24 17:33:37.425 ServerApp] nbclassic | extension was successfully linked.
[I 2023-08-24 17:33:37.427 ServerApp] notebook | extension was successfully linked.
[I 2023-08-24 17:33:37.428 ServerApp] Writing Jupyter server cookie secret to /home/jovyan/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2023-08-24 17:33:37.559 ServerApp] notebook_shim | extension was successfully linked.
[I 2023-08-24 17:33:37.584 ServerApp] notebook_shim | extension was successfully loaded.
[I 2023-08-24 17:33:37.586 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2023-08-24 17:33:37.591 ServerApp] jupyter_server_proxy | extension was successfully loaded.
[I 2023-08-24 17:33:37.592 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2023-08-24 17:33:37.593 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.11/site-packages/jupyterlab
[I 2023-08-24 17:33:37.593 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 2023-08-24 17:33:37.594 LabApp] Extension Manager is 'pypi'.
[I 2023-08-24 17:33:37.595 ServerApp] jupyterlab | extension was successfully loaded.

  _   _          _      _
 | | | |_ __  __| |__ _| |_ ___
 | |_| | '_ \/ _` / _` |  _/ -_)
  \___/| .__/\__,_\__,_|\__\___|
       |_|
                                                                           
Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.

[I 2023-08-24 17:33:37.597 ServerApp] nbclassic | extension was successfully loaded.
[I 2023-08-24 17:33:37.598 ServerApp] notebook | extension was successfully loaded.
[I 2023-08-24 17:33:37.600 ServerApp] Serving notebooks from local directory: /home/jovyan
[I 2023-08-24 17:33:37.600 ServerApp] Jupyter Server 2.7.1 is running at:
[I 2023-08-24 17:33:37.600 ServerApp] http://3efa5961294d:8888/lab?token=ab33f9d248358783d56ecbf19798960ec822b8d2917559da
[I 2023-08-24 17:33:37.600 ServerApp]     http://127.0.0.1:8888/lab?token=ab33f9d248358783d56ecbf19798960ec822b8d2917559da
[I 2023-08-24 17:33:37.600 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2023-08-24 17:33:37.603 ServerApp] 
    
    To access the server, open this file in a browser:
        file:///home/jovyan/.local/share/jupyter/runtime/jpserver-7-open.html
    Or copy and paste one of these URLs:
        http://3efa5961294d:8888/lab?token=ab33f9d248358783d56ecbf19798960ec822b8d2917559da
        http://127.0.0.1:8888/lab?token=ab33f9d248358783d56ecbf19798960ec822b8d2917559da
[I 2023-08-24 17:33:38.593 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[I 2023-08-24 17:33:46.071 LabApp] Build is up to date
WebSocket server settings:
  - Listen on :39027
  - Web server. Web root: /opt/conda/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/web/noVNC-1.2.0
  - No SSL/TLS support (no cert file)
  - proxying from :39027 to '/bin/sh -c cd /home/jovyan && /usr/bin/vncserver -rfbunixpath /tmp/tmp1dsfp5je/vnc-socket -verbose -xstartup /opt/conda/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg' (port 53949)
Starting '/bin/sh -c cd /home/jovyan && /usr/bin/vncserver -rfbunixpath /tmp/tmp1dsfp5je/vnc-socket -verbose -xstartup /opt/conda/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg'
127.0.0.1: new handler Process
127.0.0.1 - - [24/Aug/2023 17:33:48] "GET / HTTP/1.1" 200 -
handler exception: [Errno 104] Connection reset by peer
[I 2023-08-24 17:33:48.042 ServerApp] Trying to establish websocket connection to ws://localhost:39027/websockify
127.0.0.1: new handler Process
exception
Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/websockify/websockifyserver.py", line 662, in top_new_client
    client = self.do_handshake(startsock, address)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/websockify/websockifyserver.py", line 590, in do_handshake
    self.RequestHandlerClass(retsock, address, self)
  File "/opt/conda/lib/python3.11/site-packages/websockify/websockifyserver.py", line 87, in __init__
    super().__init__(req, addr, server)
  File "/opt/conda/lib/python3.11/http/server.py", line 671, in __init__
    super().__init__(*args, **kwargs)
  File "/opt/conda/lib/python3.11/socketserver.py", line 755, in __init__
    self.handle()
  File "/opt/conda/lib/python3.11/site-packages/websockify/websockifyserver.py", line 297, in handle
    super().handle()
  File "/opt/conda/lib/python3.11/http/server.py", line 438, in handle
    self.handle_one_request()
  File "/opt/conda/lib/python3.11/site-packages/websockify/websocketserver.py", line 57, in handle_one_request
    super().handle_one_request()
  File "/opt/conda/lib/python3.11/http/server.py", line 404, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/socket.py", line 706, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
127.0.0.1 - - [24/Aug/2023 17:33:48] "GET /websockify HTTP/1.1" 101 -
127.0.0.1 - - [24/Aug/2023 17:33:48] 127.0.0.1: Plain non-SSL (ws://) WebSocket connection
127.0.0.1 - - [24/Aug/2023 17:33:48] 127.0.0.1: Path: '/websockify'
127.0.0.1 - - [24/Aug/2023 17:33:48] connecting to command: '/bin/sh -c cd /home/jovyan && /usr/bin/vncserver -rfbunixpath /tmp/tmp1dsfp5je/vnc-socket -verbose -xstartup /opt/conda/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg' (port 53949)
[I 2023-08-24 17:33:48.051 ServerApp] Websocket connection established to ws://localhost:39027/websockify
127.0.0.1 - - [24/Aug/2023 17:33:48] Failed to connect to 127.0.0.1:53949: [Errno 2] No such file or directory
Please be aware that you are exposing your VNC server to all users on the
local machine. These users can access your server without authentication!
/usr/bin/xauth:  file /home/jovyan/.Xauthority does not exist
Starting /usr/bin/Xtigervnc :1 -localhost=1 -desktop 3efa5961294d:1 (jovyan) -rfbunixpath /tmp/tmp1dsfp5je/vnc-socket -rfbport 5901 -SecurityTypes None -auth /home/jovyan/.Xauthority -geometry 1680x1050 -depth 24

New Xtigervnc server '3efa5961294d:1 (jovyan)' on port 5901 and unix socket /tmp/tmp1dsfp5je/vnc-socket for display :1.
Use xtigervncviewer -SecurityTypes None :1 to connect to the VNC server.

Starting session via '/opt/conda/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup'
Log file is /home/jovyan/.vnc/3efa5961294d:5901.log

Opening desktop the second time:

[I 2023-08-24 17:34:09.520 ServerApp] Trying to establish websocket connection to ws://localhost:39027/websockify
127.0.0.1: new handler Process
127.0.0.1 - - [24/Aug/2023 17:34:09] "GET /websockify HTTP/1.1" 101 -
127.0.0.1 - - [24/Aug/2023 17:34:09] 127.0.0.1: Plain non-SSL (ws://) WebSocket connection
127.0.0.1 - - [24/Aug/2023 17:34:09] 127.0.0.1: Path: '/websockify'
127.0.0.1 - - [24/Aug/2023 17:34:09] connecting to command: '/bin/sh -c cd /home/jovyan && /usr/bin/vncserver -rfbunixpath /tmp/tmp1dsfp5je/vnc-socket -verbose -xstartup /opt/conda/lib/python3.11/site-packages/jupyter_remote_desktop_proxy/share/xstartup -geometry 1680x1050 -SecurityTypes None -fg' (port 53949)
[I 2023-08-24 17:34:09.544 ServerApp] Websocket connection established to ws://localhost:39027/websockify

@benz0li
Copy link

benz0li commented Aug 24, 2023

@yuvipanda But yes, it works. Although your image is using TigerVNC whereas mine has TurboVNC installed.

I will do further testing and also try with TigerVNC.

@benz0li
Copy link

benz0li commented Aug 25, 2023

The changes introduces in 447bf86 work with TigerVNC but not TurboVNC.

@yuvipanda Please close in favour of issue #54.

@yuvipanda
Copy link
Contributor

Thanks, @benz0li! Closing in favor of #54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants