views:

715

answers:

1

I am running as my Host OS - Win 7 x64 and running an instance of SQL Server 2005 (developer, x64). I am also running an instance of Virtual PC XP and am trying to connect to the Host OS Sql Instance without alot of luck.

I can ping the Host from the Guest OS and vice versa.

The Virtual PC Guest is not using the NAT network adapter, but the physical adapter of the machine.

I ran SQL Server Surface Area Configuration tool on the host and made sure both local and remote connections are allowed for both TCP/IP and Named pipes.

I installed the SQL Server 2005 Native client on the Guest XP OS as well as SQLCMD.

When I issue: "SQLCMD -L" I see:

Servers:
    ROBSWIN7BOX

However when I try "SQLCMD -S ROBSWIN7BOX", I get:

HResult 0x52E, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [1326].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connection
s..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

I've also tried various SQLCMD -S .. -U sa .. -P and SQLCMD -S ... -E (SQL Server is configured for Mixed mode authentication).

Any ideas? What am I overlooking?

THanks!

Rob

+1  A: 

Error 0x52e: (Win32) 0x52e (1326) - Logon failure: unknown user name or bad password.

You need Win auth to open the named pipe. Make sure SQL port is open by firewall on host and force tcp in your connection: SQLCDM -S tcp:ROBSWIN7BOX -U user -P pwd

Remus Rusanu
Thanks Remus,I added an port 1433 inbound exception in my firewall rule. I tried connecting using SQLCMD and received a slightly different response: "Sqlcmd: Error: Microsoft SQL Native Client : Unable to complete login process due to delay in opening server connection." So I added "-l 30" to increase the login timeout to 30 seconds. Not sure why it takes so long on the same box! Thanks
RobDemo
... Connection does work btw. Thanks! I just wish I could improve the speed.
RobDemo
It takes so long usually because it tries Named Pipes first. Remove named pipes from client config (control panel) or force TCP int he connection.
Remus Rusanu