Connecting via VNC? #25453
-
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. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
@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. |
Beta Was this translation helpful? Give feedback.
-
@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. |
Beta Was this translation helpful? Give feedback.
-
Unless I set it up wrong, it did not seem to work: |
Beta Was this translation helpful? Give feedback.
-
@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. |
Beta Was this translation helpful? Give feedback.
-
VS Code is running locally on my Ubuntu, as I understood in your post.
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: |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
It would be really cool if codespaces port forwarding could support tcp communication so i can connect to the vnc server that’s built into codespaces, on ipados using realvnc viewer app. The no-vnc app doesn’t have proper integration with clipboard, keyboard shortcuts etc. on ios. Also it sometimes gets killed to free up memory so i always have to reconnect and enter vscode as password which is annoying |
Beta Was this translation helpful? Give feedback.
@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.