Page 1 of 1

Host Only ports are closed, cannot access SQL Server from Ubuntu host

Posted: 6. Oct 2016, 00:10
by decal
My host is Ubuntu 16.04 and I am running a Windows 8 guest machine that has a SQL Server Express instance running as a service. I need to access this database from my host.

I have set up two network adapters, a NAT and a host only connection with a static ip address of 192.168.1.39.

When I try to access my database using JDBC I get an error saying that the connection is refused. I have confirmed that the SQL Server service is running on my guest. I have also ran a netstat -an |find /i "listening" command on my windows machine which shows the MS SQL port open at 0.0.0.0:1433 which I have come to learn means that everything should have access to it (which is what i have specified in my firewall)
netstat.png
netstat.png (2.23 KiB) Viewed 2036 times
When I ping my guest from my host it works, however running nmap -p 1433 -sT 192.168.1.39 from my host says that the port is closed:
nmap.png
nmap.png (26.87 KiB) Viewed 2036 times
How do I get that port open? I could use some help as I am not very good with the whole networking thing and have spent a couple hours tyring to figure this out, all help would be appreciated. Thanks!

Re: Host Only ports are closed, cannot access SQL Server from Ubuntu host

Posted: 6. Oct 2016, 13:43
by socratis
decal wrote:When I ping my guest from my host it works
decal wrote:netstat -an |find /i "listening" command on my windows machine which shows the MS SQL port open at 0.0.0.0:1433
To me that looks like VirtualBox is doing its job. I would remove the NAT interface, just to simplify the scenario until it works. Why did you assign a static IP to your guest, so that you can find it easily?

Have you looked at it from an networking/SQL angle? I.e. forget about the whole VirtualBox thing and look at it as if you had two physical computers.