views:

718

answers:

2

I have a WinXP host with VirtualBox 3.1.2 installed. I have a VirtualBox image called "hydrogen" on which I installed WinXP and MS SQL Server 2005 Express. I have another VirtualBox image called "helium" on which I installed WinXP. I am trying to create a ODBC DSN on "helium" that connects to SQL Server on "hydrogen" but it fails.

All of the documentation I've seen so far only says to use a "bridged adapter" in my VirtualBox image settings. I've done that but I still don't have communication.

+1  A: 

The express edition does not listen on remote ports by default. You can enable remote connections using the "Surface Area Configuration Tool" or by running this SQL script:

exec sys.sp_configure N'remote access', N'1'
go
reconfigure with override
go

Also, if you use a bridged adapter, your virtual boxes are sharing your host's IP address. That means you'll have to configure both instances of SQL Server on a separate port.

Andomar
I did have two instances of SQL Server, one on the host and one on "hydrogen". I stopped the one on the host to clear up any issue with duplicate IP's and shared ports. I ran the script above against my SQL Server instance on "hydrogen" and it said that it was already enabled. (Value changed from 1 to 1.) I also did the "reconfigure" statement. Tried to connect from "helium" and it still failed.
Jason 'Bug' Fenter
The first step is to see if telnet works, aka `telnet helium 1433` (1433 is the default SQL Server port) If that times out, you have a network issue. If it connects, you have a SQL Server configuration issue
Andomar
Network errors. "Could not open connection to the host, on port 1422: Connection failed"
Jason 'Bug' Fenter
I ran the Network Setup Wizard on both guests and turned File and Printer Sharing on for both. I can browse shared files between the two computers, but I still cannot connect to SQL Server. Telnet is still failing with the same error message.
Jason 'Bug' Fenter
On the sqlserver host, run netstat -b to see the port it's listening on
Andomar
+1  A: 

I've gone through a couple of tweaks and changes and I have it working. My environment:

Host:
  • WinXP Pro
  • SQL Server 2005
Guest "Hydrogen":
  • WinXP Pro
  • SQL Server 2005
  • Network Adapter #1: NAT
  • Network Adapter #2: Bridged
Guest "Helium":
  • WinXP Pro
  • Network Adapter #1: NAT
  • Network Adapter #2: Bridged

On "Hydrogen", I ran the Network Setup wizard, specifying that it was part of a network that did not have an internet connect (part of the "Other" option). I rebooted "Hydrogen".

On "Helium", I ran the Network Setup wizard, specifying taht it ws part of a network that did not have an internet connect (part of the "Other" option). I rebooted "Helium".

I turned off the firewall on "Hydrogen".

I can now connect to SQL Server on "Hydrogen" from both "Helium" and my host. Some of these settings may be extraneous; I don't know. But I know it's working for me reliably now, even after rebooting the host.

Jason 'Bug' Fenter
Oh, and I had upgraded from VirtualBox 3.1.2 to VirtualBox 3.1.4.
Jason 'Bug' Fenter