-
Notifications
You must be signed in to change notification settings - Fork 10
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
Remote connection to servers with WIndows OS #44
Comments
Is this a situation where WSL is running on a different machine on the same network? |
yep |
The issue has been active in GitHub for a few years. There's workarounds but the default settings make this quite challenging. In this case though the user should be able to ssh into the windows machine itself rather than WSL and run the ZeroCost commands. |
To add a little bit of precision of what I did and the original issue. The issue that I had originally when launching WSL from a ssh session is the following > wsl
The file cannot be accessed by the system This issue was reported here microsoft/WSL#9197 . There seemed to be a problem related to the version of wsl, I tried their method but that did not solve the problem. Note that I can reproduce the error also when running Here are the versions
|
Hi @antho214, I'm here speaking with @ctr26 about this :) It feels that trying to connect to windows remotely with ssh and wsl is quite complicated. Alternatively, there seems to be a way to create a server, with an IP that would allow running the ssh connection: ngrok The way it works (as far as I understood) is that ngrok needs to be installed in Windows, then you login in the specific user of Windows, you start the WSL and from there an ngrok server is started. It will give you an "IP" that can be used for a second machine to connect through SSH. Afterwards, one could clone DL4MicEverywhere (if it's not already there) and launch it from the terminal. I'm not sure if you will try it in the end but if you do and it works, it would be nice to know (and I'll add it to the docs). |
I am currently away from the lab but I have asked @Miz0oN0o to look into it! |
Heyo people! 👋 Just for the sake of context, my computer's OS is Ubuntu, while the remote computer's OS is Windows. Step 1: Set up the remote computerOn the Windows computer, I logged in and installed ngrok and set it up with the authentification token required. From there, I started the TCP tunnel with this line in the ngrok command prompt:
The tunnel will be opened, and the terminal will prompt us with various information, namely the one we care about:
Step 2: We move to the computer we'll be connecting fromWe can connect from my computer to the remote server using this line:
We're now connected to the remote Windows from my computer's terminal. We cd in the DL4MicEverywhere folder, and from there we can launch Windows_launch.bat. It will launch... But the notebook's window will open on the remote computer. I won't see it on my own computer, and won't be able to interact with it either. The same happens if I decide to use the Windows Subsystem for Linux and try to launch Linux_launch.sh with it. There are no errors either. Anything I might have missed, or might have understood wrong? |
For me the command that works on the remote machine via ngrok is
And crucially I check that X11 forwarding is working on the remote machine with
And I had to set
in |
Hey Kamylle! Thank you for giving it a try so quickly!! For remote connections, I think that you need to open the window manually with the token (at least this way worked for me) unless you know very well the port that will be used for Jupyter. These are the steps:
|
This is a great point that I'd overlooked. Indeed if you do setup a reverse proxy with ngrok you'll still need port 8888 forwarded for accessing Jupyter. Options are: Run
Separately, https://sshuttle.readthedocs.io/en/stable/ An easier way might be using sshuttle:
Which will forward all the ports over ssh It does feel like this process is somewhat more involved than it should be unfortunately. |
Hey! Sorry for the delay. Just wanted to quickly update you. I'm still debugging it, it seems X11 forwarding is not working on my side (for now). I'll come back to you as soon as I get it to work! However, I'd like to mention opening two ports using ngrok might not be an option for everyone, as it requires a paid subscription (otherwise, only one port can be opened). I haven't tried sshuttle yet. I was wondering what the use case would be for the solution we're coming up with? If it's for users with limited knowledge with computers, the whole process might be a tad to troublesome. I'll let you all know as soon as I have better advancements. 😊 |
Tbh, remote access to windows machines wasn't a use case that was planned ahead for. HPC access is typically linux+ssh and we made sure to include this. One solution I could see that might be a bit easier for users would be making the dl4miceverywhere launcher gui exist in the browser, but this would be quite a bit of work. |
Hi ! 👋 I'm here to propose a solution. It might be a tad complicated, but you don't have to use ngrok in this version. The biggest issue I faced was forwarding Windows, then WSL. This can all be bypassed if we open an SSH connection directly to the sub-system. To do so, we can follow the directions that are given here. There's also steps for WSL1 given here, but I haven't tested this version. Once these preliminary steps are complete, we can do the steps of remote connection that we usually do:
This will connect us directly to the Linux-subsystem without having to go through Windows. Then all we have to do is navigate the folders to go to DL4MicEverywhere and launch up. This solution still requires you to open two connections like Estibaliz suggested, so one with port 2222 and the other with 8888/8889. However, it minimalizes the amount of dependencies (no need for ngrok). I'm not 100% sure how safe in terms of cybersecurity this solution is, but it's probably the "easiest" one, as it shouldn't require a lot of debugging and documentation reading. What do you think? |
Hi @ctr26 @IvanHCenalmor
Discussing with @antho214, it seems that it's not possible to connect with ssh to the WSL system in Windows (i.e., when someone wants to run remotely in a windows machine DL4MicEverywhere).
Any idea?
The text was updated successfully, but these errors were encountered: