Remote Desktop Connection between PCs -- Must they both be in the same Subnet?

  • Thread starter WWGD
  • Start date
  • #1
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384

Summary:

Trying to connect desktop-desktop or device-device remotely.

Main Question or Discussion Point

Hi, just looking at RDP connections
https://support.microsoft.com/en-us/help/4028379/windows-10-how-to-use-remote-desktop

It would seem the two devices would have to be within the same LAN, right? Otherwise, how is just the computer name enough information to set up a connection? It seems for a connection string we would need to know more details than just the name (I doubt all the needed information is encoded under the computer name)
 

Answers and Replies

  • #2
1,325
1,134
  • #3
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
You are right, both computers need to be on the same network. But there are some workarounds too; see this site, for example:
https://www.howtogeek.com/131961/how-to-access-windows-remote-desktop-over-the-internet/

I personally prefer Teamviewer for remote connections compared to Windows remote desktop. The former is easier to set up compared to the latter, especially when the machines are not on the same network.
Thank you, I agree and have tried it but I am following up on a list for a data job interview. Same for using Python Jupyter/Anaconda.

Would a connection string allow you to connect outside of the LAN/Subnet (EDIT: if permissions were granted)?
 
  • #4
pbuk
Science Advisor
Gold Member
1,279
287
  • #5
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
I am having some strange issues trying to access my SQL Server from within the command line; cannot use ODBC because my SQL Server is connecting through named pipes. Maybe I can go to configuration manager or Control Panel and change the protocols used.
 
  • #6
pbuk
Science Advisor
Gold Member
1,279
287
Remote desktop is not the way forward here.

... my SQL Server is connecting through named pipes.
This does not make sense - your SQL Server instance doesn't have to connect to anything. Do you mean you are using named pipes to connect a SQL Studio instance to your SQL Server instance?

Named pipes are only used for connecting locally i.e. on the same machine. Do you already know how to connect from another machine over the LAN? Connecting from a remote network is the same, except you need to let your router know what to let through and where to connect it to - this is called port forwarding. This is a home setup with a direct connection to the internet right? You aren't behind some corporate or other firewall?

What are you actually trying to do?
 
  • #7
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
Remote desktop is not the way forward here.


This does not make sense - your SQL Server instance doesn't have to connect to anything. Do you mean you are using named pipes to connect a SQL Studio instance to your SQL Server instance?

Named pipes are only used for connecting locally i.e. on the same machine. Do you already know how to connect from another machine over the LAN? Connecting from a remote network is the same, except you need to let your router know what to let through and where to connect it to - this is called port forwarding. This is a home setup with a direct connection to the internet right? You aren't behind some corporate or other firewall?

What are you actually trying to do?
I was trying to access SQL Server from the command line within the same machine.

Error message was:
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server
 
  • #8
pbuk
Science Advisor
Gold Member
1,279
287
How do you know the SQL Server instance is running?
 
  • #9
pbuk
Science Advisor
Gold Member
1,279
287
I was trying to access SQL Server from the command line within the same machine.
If you can't do that then the last thing you want to do is introduce other variables by trying to connect from outside the LAN.
 
  • #10
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
How do you know the SQL Server instance is running?
I started it through MSSM.
 
  • #11
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
If you can't do that then the last thing you want to do is introduce other variables by trying to connect from outside the LAN.
I understand, thanks, I was also trying to connect locally; all part of interview skills list. I don't have access to another computer to try remote access. Sorry for my sloppy way of doing things; seems confusing to all but me :).
 
  • #12
pbuk
Science Advisor
Gold Member
1,279
287
I started it through MSSM.
What is shown in the Named Pipes Properties dialog box in MSSM SSMS?

Edit: and what connection string are you using:
Code:
\\.\pipe\sql\query
?
 
  • #13
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
If you can't do that then the last thing you want to do is introduce other variables by trying to connect from outside the LAN.
I understand, thanks, I was also trying to connect locally; all part of interview skills list. I don't have access to another computer to try remote access.
The network protocol is set to <default> and options are not enabled:

1579225147558.png
 
  • #14
pbuk
Science Advisor
Gold Member
1,279
287
Hmmm, dunno, sorry :frown:

If you just want to play with a SQL Server instance you could open an Azure account?
 
  • #15
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
Hmmm, dunno, sorry :frown:

If you just want to play with a SQL Server instance you could open an Azure account?
Hey, nothing to be sorry about; I've learnt more from you in a few weeks than in years. Seriously, thanks so much. Will check out Azure.
 
  • #17
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
Use the VPN option in that link. If you use the port forwarding option you will very quickly be hacked.

BoB
True but , it takes $$$ for quality VPN last I checked.
 
Last edited:
  • #18
OCR
838
677
True but , it takes $$$$ for quality VPN last I checked.

Lol. . . what went wrong with your post ?

It should look like this. . . . 🤔

1579246059993.png


.
 
  • #19
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
Lol. . . what went wrong with your post ?

It should look like this. . . . 🤔

View attachment 255701

.
No clue. Did you guess it or how else you figured?
 
  • #20
OCR
838
677
Did you guess it or how else you figured?

Refresh the page and watch. . . 😉

.
 
  • #21
pbuk
Science Advisor
Gold Member
1,279
287
Lol. . . what went wrong with your post ?

It should look like this. . . . 🤔

View attachment 255701

.
$$ is the delimiter for a ## \LaTeX ## block so $$$$ is parsed as an empty block of ## \LaTeX ##. Use $$$ which stays as $$$.
 
  • #22
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
Thanks, got it, but fittingly not a single $ appeared ;).
 
  • #23
pbuk
Science Advisor
Gold Member
1,279
287
Use $$$ which stays as $$$.
Unless $$$ you use it twice $$$ of course! Unless $$$ you use it twice $$$ of course!
 
  • #24
WWGD
Science Advisor
Gold Member
2019 Award
5,159
2,384
Use the VPN option in that link. If you use the port forwarding option you will very quickly be hacked.

BoB
How about portforwarding to a VM?
 
  • #25
rbelli1
Gold Member
915
337
True but , it takes $$$ for quality VPN last I checked.
I was thinking that you could set up a VPN on your firewall. Use client certificates for the best security.

BoB
 

Related Threads for: Remote Desktop Connection between PCs -- Must they both be in the same Subnet?

  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
2K
Replies
4
Views
18K
  • Last Post
Replies
1
Views
2K
Replies
18
Views
5K
Replies
3
Views
2K
  • Last Post
Replies
10
Views
841
Top