I'm trying to connect to a SqlServer instance – located in my host machine – from my VM, using Sql Server Management Studio.
From my host I can connect to both SQL instances using SSMS, but when I try to connect to the host instance from the VM, SMSS gives this error message (mine is in PT-BR):
My environment is like this: the blue dotted block represents my host (PC_MASTER) and the orange dotted block represents my VM (MYVM):
Here are the main components in each machine:
PC-MASTER (Host): Windows 8 PRO-English w/ SQL Server 2012 Express. SQL instance name is "PC-MASTER\SQLEXPRESS".
MyVM (VM): Windows Server 2012 BR-Portuguese w/ SQL Server 2012 Standard. SQL instance name is "MYVM".
Firewall: The host has an inbound rule opening the 1433/1434 TCP ports for all programs/services;
SQL Protocols: In both servers all 3 main protocols are on, in the following order: Shared Memory, TCP/IP and Named Pipes;
Remote Access: Both SQL servers are configured to allow remote connections;
SQL Configuration: The host SQL is configured to allow only static access through the port 1433, as Somantra pointed out.
From my VM(MYVM):
- I can only connect to the local SQL instance.
- I can ping the host successfully using either its IP or its name;
- I cannot connect to the host using telnet: I tried the ports 21, 23, 80, 1433 and 1434.
Tks!
Best Answer
So I spent a few minutes looking at all the duplicates of this problem, and there are a few, but to be honest they all kind of sucked in terms of their answers, so here we go:
Port 1433 is only good for default instances of SQL Server. If you are going to connect to a named instance, you have two options:
SERVER\INSTANCE
name and open ports 1434 (for SQL Browser) and the port of your SQL Server Instance (more on that later)SERVER:port
whereport
is the port of your SQL Server InstanceTo determine which port your SQL Server instance is running on in the SQL Server Configuration Manager, under Network Configuration > TCP/IP > IP Addresses:
So for #1 I need to open 1434 and 64670 and for #2 I just need to open 64670, but use a different SQL connection string.