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

In summary, you are trying to connect to a remote server using RDP but you are having problems because your SQL Server is connected through a named pipe. You should try connecting from another machine on the LAN or using port forwarding.
  • #1
WWGD
Science Advisor
Gold Member
7,009
10,469
TL;DR Summary
Trying to connect desktop-desktop or device-device remotely.
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)
 
Computer science news on Phys.org
  • #2
  • Like
Likes WWGD
  • #3
Wrichik Basu said:
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)?
 
  • #5
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
Remote desktop is not the way forward here.

WWGD said:
... 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
pbuk said:
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
How do you know the SQL Server instance is running?
 
  • #9
WWGD said:
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
pbuk said:
How do you know the SQL Server instance is running?
I started it through MSSM.
 
  • #11
pbuk said:
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
WWGD said:
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
?
 
  • Like
Likes WWGD
  • #13
pbuk said:
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
Hmmm, dunno, sorry :frown:

If you just want to play with a SQL Server instance you could open an Azure account?
 
  • #15
pbuk said:
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 learned more from you in a few weeks than in years. Seriously, thanks so much. Will check out Azure.
 
  • #17
rbelli1 said:
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
WWGD said:
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
OCR said:
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
WWGD said:
Did you guess it or how else you figured?
Refresh the page and watch. . . 😉

.
 
  • Like
Likes WWGD
  • #21
OCR said:
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 $$$.
 
  • Like
Likes WWGD
  • #22
Thanks, got it, but fittingly not a single $ appeared ;).
 
  • Like
Likes pbuk
  • #23
pbuk said:
Use $$$ which stays as $$$.
Unless $$$ you use it twice $$$ of course! Unless $$$ you use it twice $$$ of course!
 
  • Like
Likes WWGD
  • #24
rbelli1 said:
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
WWGD said:
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
 
  • #26
rbelli1 said:
I was thinking that you could set up a VPN on your firewall. Use client certificates for the best security.

BoB
Aren't quality VPNs expensive?
 
  • #27
WWGD said:
Aren't quality VPNs expensive?
pbuk said:
Unless you use it twice of course!
Only if you use it twice. . . . 😛 .
Lol. . . . 🤦‍♂️

.
 
  • #28
OCR said:
Only if you use it twice. . . . 😛 .
Lol. . . . 🤦‍♂️

.
Actually, any odd numbers will do. I will print dollars signs 1,2,3,4,5,6. Let's see which show up:
1)$
2)$$
3)$$$
4)$$$$
5)$$$$$
 
  • #29
WWGD said:
How about portforwarding to a VM?
If you can't even access it on the same machine/VM then how are you going to access it remotely? Just to check a couple of things, you are running this console in the same OS instance as the SQL Server, yes? Or are you running the console on a host and the SQL Server instance in a VM - in which case local named pipes won't work? Have you tried accessing via a port i.e. localhost:1433?

Also, I can't see the important setting in the screenshot below:
WWGD said:
... the crucial setting is in the 'Server Properties' dialog box hidden under the 'Connection Properties' box. If you select 'Connections' it should show a list including 'Named Pipes: Enabled', and 'TCP/IP: Enabled' if you want to access via a port (i.e. localhost:1433).
 
  • #30
In other words, try all of the following in a console on whatever OS instance is running SQL Server.
Code:
sqlcmd
sqlcmd –S tcp:127.0.0.1,1433
sqlcmd –S np:\\127.0.0.1\pipe\sql\query
 
  • #31
Thanks, I thought I had included the server properties; clearly not. Coffee shop closed for today, will post ASAP

v
 
  • #32
For something very straightforward and with no technicalities, I use a program called anydesk. Very sweet if you ask me.
 
  • Like
Likes WWGD
  • #33
WWGD said:
True but , it takes $$$ for quality VPN last I checked.

Some VPNs provide a small amount of traffic at no charge. I've used the free tier of Windscribe and TunnelBear before, and they are okay for testing, at least.

But I agree with @rbelli1, using RDP without really understanding what you are doing is a quick way to be hacked...and you won't even know it!

There are numerous bad actors polling the internet looking for poorly protected machines to attack - I set up a Linux server on Azure for a project with an IP that was not advertised and within a day the root user account was being pinged at the rate of two password tries every second.
 
  • #34
Tghu Verd said:
I set up a Linux server on Azure for a project with an IP that was not advertised and within a day the root user account was being pinged at the rate of two password tries every second.
Never enable password login on a public machine, login should be by public key only.
 
  • #35
pbuk said:
Never enable password login on a public machine, login should be by public key only.

Correct, and this wasn't. But that does not stop attackers from trying root...and other common system user names.
 

Similar threads

Replies
13
Views
1K
  • Computing and Technology
Replies
12
Views
2K
  • Computing and Technology
Replies
4
Views
20K
Replies
2
Views
1K
  • Computing and Technology
Replies
12
Views
2K
Replies
11
Views
1K
  • Differential Equations
Replies
1
Views
706
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
626
Replies
10
Views
2K
Back
Top