Sql – Unable to connect to SQL Server 2008 Express from Virtual PC machine

sql-server-2008virtual-pcvisual-studio-2008

I have the following configuration:

  • A host Windows Vista Home Premium SP2 with SQL Server 2008 Express SP1 and SQL Server Management Studio.
  • A Virtual PC 2007 machine with Windows Vista Ultimate, Visual Studio 2008 Express and Visual Studio 2010 Beta 1.

With SP1 on the host machine and before installing Vista SP2 and SQL Server SP1 I could connect to the SQLEXPRESS instance from both Visual Studio 2008 and 2010 from the virtual machine. Now I cannot.

The instance is configured to allow remote connections. Both machines, physical and virtual can see each other on the net and respond to ping. The SQL Server Browser service is running and all protocols are enabled in SQL Server Configuration Manager.

I tried to re-install SQL Server but still can't connect. In the Server name dropdown list in VS now I can only see MACHINENAME where I used to see MACHINENAME\SQLEXPRESS and when I try to connect I get the message:

network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

I don't know what I'm missing. Has anyone experienced this issue?

edit:

Definitely, I think this is more a network-related issue. I checked the firewall on the host SO. The SQL Server Browser service receives no connection whatsoever. Both allowed and denied in connections are 0 as reported by the firewall. The service is correctly listening on UDP port 1434.

I also try to access a web application on the host machine’s IIS and get no response. However I can access the Internet from the virtual machine.

Thanks very much

Best Answer

I finally found what I was missing. I entered the Network Sharing Center and configured my network as public instead of private. I did it both on the host and the virtual machine and now communication is back again. I’m not sure why this works, as the public network configuration is supposed to be more restrictive.

Thanks everybody for the suggestions.

Regards