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

How to connect from WSL to WSL #3325

Closed
angelog0 opened this issue Jun 26, 2018 · 6 comments
Closed

How to connect from WSL to WSL #3325

angelog0 opened this issue Jun 26, 2018 · 6 comments
Labels

Comments

@angelog0
Copy link

Basically, the problem I want to solve is the following:

I have WSL installed in W10 Pro, on a Desktop PC, and in W10 Home, on a tablet. Both systems are 64 bit.

On WSL-W10-Home-tablet I have the directory /opt/texlive which I want to copy (rsync) on WSL-W10-Pro-DesktopPC.

This would be easy using SSH (from WSL-tablet),

rsync -av --delete /opt/texlive/ WSL-user@WSL-DESKTOP_PC:/opt/texlive/

or (from WSL-Desktop PC)

rsync -av --delete WSL-user@WSL-TABLET:/opt/texlive/ /opt/texlive/

but how in WSL? In short, how can one connect these two WSL machines?

Thanks.

@WSLUser
Copy link

WSLUser commented Jun 27, 2018

rsync and ssh work well enough inside a WSL distro if that's what you're asking. If you're looking at remoting in though, you'll need to install xrdp, then service xrdp start on the remote machine (or both). Then open RDP and specify the IP address and port number of the destination machine. You'll then connect to the other machine, assuming a Linux desktop is installed. Be advised that your FW may block the attempt from either machine and may need to create an exception.

@angelog0
Copy link
Author

@DarthSpock, I know that rsync and ssh works in WSL. Indeed I use them to solve my problem in this way: I synchronize /opt/texlive from GNU/Linux to macOS and then with WSL-rsync from macOS to the Windows machines. For several reasons, it would be better to synchronize directly between the Windows machines. On macOS I need only to select Use this PC as remote machine while in GNU/Linux the SSH server is already installed and configured. Notice all PCs are on the same LAN and GNU/Linux is in dual boot with windows Pro (one of the Windows machines).

@WSLUser
Copy link

WSLUser commented Jun 28, 2018

You can use OpenSSH on Windows but what you're asking is barely within WSL scope. Be advised the Windows OpenSSH project is in beta and have a github page. AFAIK updates to the beta are available on Insiders so if you wanted to sign up for it to get the least buggy experience with ssh.exe, I would go that route. As far as doing the equivalent of rsync on Windows, closest we got is robocopy. However I would advise against moving files created in Linux using Windows tools as it typically strips the permissions and/or makes the files unreadable. But if you're going to attempt it, I would be sure that you are running build 17134 at minimum and create and configure wsl.conf to enable the metadata feature on both machines and specify the permission levels using this. Be sure that if you do this, you place the copied files inside a case-sensitive directory you use on Windows side. Otherwise only one of the files of the same name but different case will be able to be read by WSL. Again, I still would advise against doing this until there's more compatibility with Windows tools. I would create a UserVoice and ask Tara Raj (the WSL PM) on Twitter if you need to use robocopy instead of rsync for whatever reason for Linux files to get compatibility but I would just stick with rsync if it was me.

@therealkenc
Copy link
Collaborator

while in GNU/Linux the SSH server is already installed and configured

sudo apt install openssh-server + sudo sevice ssh start. Once you can ssh into your WSL box rsync will just start working. There are some gotchas you should be aware of in #3303 and #2505 (which are just different use cases for sshd).

@angelog0
Copy link
Author

@therealkenc, what you suggest is the first thing people tries... If things were simple as your suggestions the WEB would not full of these complains. I tried ALL that but does not work!

@therealkenc
Copy link
Collaborator

the WEB would not full of these complains

The Internet is full of many things (complaints, and much much worse).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants