I have set up sql server express 2014 in a Windows 7 virtualbox guest, but I cannot connect to it using the jTDS JDBC driver from my Ubuntu host. I get a Could not retrieve database information error. I feel like I must be missing a step somewhere, but can't find anything online that I haven't already tried:

  • Connection URL is jdbc:jtds:sqlserver://;instance=SQLEXPRESS
  • Windows firewall has been disabled completely on the guest.
  • I can ping the guest IP address from the host.
  • The server and SQL Browser services are running.
  • netstat -a on the guest confirms that TCP and UDP are listening.
  • The server logs say Listening on <All IPv4>:1433
  • The Surface Area Configuration tool has TCP/IP enabled and set up to listen on port 1433 for all IPs.
  • SSMS confirms remote access is enabled for that server instance.
  • I can connect to the database from SSMS on the guest using the host-only IP address (, same as above) and the same SQL Authentication credentials that I am using over JDBC.
  • telnet 1433 and telnet from the host both fail immediately with Connection refused, while the same commands from the guest do not.

It feels to me like a firewall issue since I seem to be able to connect on the interface IP address from inside the guest and the output from netstat, but with Windows firewall turned off I am not sure what to do next, or even what diagnostic steps to take from here.


My first port of call would be to try and eliminate the host-only adapter setting. I have only had bad experience with it in the past.

I suggest you make a clone of the virtual machine in question, change both of the windows machines' network types to bridged (so that they can connect out to your physical LAN) and then start them both up and see if they can communicate with each other (Ping from the one to the other, maybe also try sharing and accessing network folders).

This is a simple test that I usually perform when having similar issues, as it eliminates the Host operating system from the equation for the purpose of fault finding.

If the two Windows machines can communicate, shut down one of them, and then try Ubuntu again on the new IP allocated to the machine after you changed the adapter to bridged mode.

Note: if you don't have any kind of DHCP service like a router running on your LAN, you will have to provide static IP addresses for the Windows machines.

Hope that helps.

  • Worked first time on the bridged adapter. – erm410 Mar 23 '15 at 15:39
  • Glad I could help ;-) – Louis Parkin Mar 23 '15 at 20:05
  • After thinking on this a bit more, I suspect your initial issue was not the host-only adapter's fault, but rather a more trivial issue related to IP addresses being in different ranges. The host-only IP is usually nowhere near being in the same range as your actual Ethernet IP. Adding an alias IP on your host machine could probably have resolved this issue as well. – Louis Parkin Apr 1 '15 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.