TCP/IP connection to the server failed

Solved!
Khaled_BH
Level 3
TCP/IP connection to the server failed

I've been trying to connect to SQL server located in my local pc (I'm using Virtual Machine for DSS), server name is PC-NAME, server type is database engine,  I'm using SQL Server Authentification,login and password .

 

When Ive tried to test the connection between DSS and my dataset I got this error, anyone has faced this kind of error before ? 

0 Kudos
1 Solution
dima_naboka
Dataiker
Hi, first of all you need to make sure DSS VM can access Host with provided hostname. If you canโ€™t โ€œpingโ€ DESKTOP-H6PRTQG  you might want to try using IP address instead. If you are running VirtualBox with default NAT mode, it is likely that your VM IP is 10.0.2.15 and your host IP is 10.0.2.2. More on VirtualBox Network Settings here
 
Once you made sure that host is accessible from VM you need to review SQL Server TCP/IP properties. By default, listening on static ports are not enabled afaic. You can enable one of IP0-IP9 listening ports or enable IPAll, click Apply and restart SQL Server SQL Server service to apply the change. More on that in  Microsoft docs

View solution in original post

6 Replies
Khaled_BH
Level 3
Author

I turned off the firewall on my Windows , and made sure the TCP port is 1433, still same error 

0 Kudos
dima_naboka
Dataiker
Hi, first of all you need to make sure DSS VM can access Host with provided hostname. If you canโ€™t โ€œpingโ€ DESKTOP-H6PRTQG  you might want to try using IP address instead. If you are running VirtualBox with default NAT mode, it is likely that your VM IP is 10.0.2.15 and your host IP is 10.0.2.2. More on VirtualBox Network Settings here
 
Once you made sure that host is accessible from VM you need to review SQL Server TCP/IP properties. By default, listening on static ports are not enabled afaic. You can enable one of IP0-IP9 listening ports or enable IPAll, click Apply and restart SQL Server SQL Server service to apply the change. More on that in  Microsoft docs
Khaled_BH
Level 3
Author

I had to add an exception for port 1433 in inbound connections from firewall settings , thank you!

tgb417

@Khaled_BH 

For which firewall did you make these changes.  The Hosting Operating System that had the SQL Server, or the guest operating system where DSS is hosted?  Or was there some other Firewall involved in this setup.

My guess is that this was an inbound rule for the Host Operating System with the SQL server.

 

--Tom
Khaled_BH
Level 3
Author

Your guess is 100% correct. it was the host's firewall (inbound rule) where SQL Server is running.

Khaled_BH
Level 3
Author

Also configured the VM network settings from NAT to Bridged adapter