Connecting via VNC?

My application runs via VNC, how can I connect to it?

Trying to connect to the <uuid>-<port>.apps.codespaces.githubusercontent.com does establish a successful VNC connection, but the handshake does not work.

@vadi2, if you connect from VS Code on the desktop and run the app in the Codesapce, it will show up on localhost:port and then your VNC connection should work. The web-based port forwarding in the browser does not handle all protocols today and it mainly focused on HTTP(S), but when you run from the desktop on localhost, it forwards all traffic over without the additional proxy.

@vadi2 In addition to what @jkeech mentions, noVNC is an option to provide a web based client installed in your container. We’ve got a desktop script here that uses it: https://github.com/microsoft/vscode-dev-containers/blob/2fbbbc61b3ae414219a51b64399375933a5d9d36/script-library/docs/desktop-lite.md

Or you can just follow the directions at https://novnc.com/info.html It works surprisingly well.

1 Like

Unless I set it up wrong, it did not seem to work:

@vadi2, are you running the VS Code desktop app when connected to the Codespace, or via the browser? Are you forwarding the port 5900 locally? If you look in the Remote Explorer view let you can see which ports are forwarded.

VS Code is running locally on my Ubuntu, as I understood in your post.

Are you forwarding the port 5900 locally?

I was not… but now that I did, it works!

@Chuxel clued onto what I was hoping to do though, now I am trying the browser-based version. Would be great if people can code on our MUD client with Codespaces :slight_smile:

Glad to hear you got it working on the desktop! We’ve heard that some folks need to use other desktop apps (which don’t always have browser-based equivalents), so the desktop app port forwarding is the way to go in those cases. But if you have a way to keep everything in the browser, that is often more convenient/preferred.

2 Likes

Just an FYI, I’ve put this together into an article: https://www.mudlet.org/2020/10/develop-run-desktop-apps-in-the-cloud-github-codespaces

Yeah as a tip, the default for the desktop script uses port 5901 instead of 5900 since 5900 can already be in use on your local machine (particularly on Linux). The SSH script uses 2222 for the same reason.