Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to make a JDBC connection from a VirtualBox Ubuntu Guest OS to an Oracle XE database running o Host. However, the connection is refused. Here are the details of my environment:

VirtualBox: 4.1.4 Host OS: Windows 7 Guest OS: Ubuntu server 11.4 Networking mode: Bridged network Oracle XE database running on Host

Issue: WebLogic server runs on the Ubuntu virtualbox. It attempts to connect to an Oracle XE database running on the Host OS (windows 7) with listening port 1521. On the Guest OS (Ubuntu), I am able to ping the Host computer from the Guest OS. However, when I configured a JDBC data source on the WebLogic server on the Guest OS to connect to the Oracle XE, connection took a long time, and eventually I received an "IO Exception: The Network Adapter could not establish the connection". When I tried "telnet host-ip 1521", no connection was established.

With Bridge networking, I can make bi-directional connections between the host and the guest OS (e.g. connection through ssh and ftp). Is there anything I missed in the setup of Bridge networking and the guest/host OS? Note that I was able to make the same connection within a normal networking environment (i.e. not using virtual box).

I am not sure whether Bridge networking is a good option for the work described above. Should I use host-only networking mode? If so, any specific configurations I need to perform? I read through the Virtual box document on setting up the host-only network, however, it lacks of details. I followed the procedures described in the manual, and couldn't even connect to the host.

Could some experts here enlighten me on this issue?

Much appreciated. Licheng

share|improve this question
If you are able to ssh over the connection, then that it is bridged isn't the issue - networking is either working or it isn't. It is most likely Windows blocking the connection. Can you telnet 1521 from Windows to itself? – Paul Nov 3 '11 at 0:05
Try this: Disconnect from the internet (for safety), disable the Windows firewall, then try your connection. If it works, you'll know the issue is related to the Windows firewall. Remember to enable the Windows firewall again before restoring your connection to the internet. – Randolf Richardson Nov 3 '11 at 0:32

I would definitely recommend the host-only network connection for your approach.

If you need the bridged one for other purposes then keep it and create additional host-only connection.

I have found many times that connection between host and guest do not work with bridged connection, which means they are generally unsupported. Secondly, you run into problems such as

  • connection between host and guest breaks if you loose physical connection on the bridged interface - when you reboot router, or with laptop when you're on the move)
  • ip address may change periodically etc
  • exact performance and behaviour depends on the driver implementation

With host-only connection you get a fixed address interface on the host and the guest gets IP assigned from DHCP.

Note for performance reasons choose in VM's properties adapter type Paravirtualized network/Virtio. This one works for me with Ubuntu guest and avoids costly HW emulation .. and gives consistent behaviour.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .