Configure Host Access to an Oracle Database on a VirtualBox vm

Admittedly it’s been a while since I’ve used VirtualBox to host a database. I’ve been using a bunch of different cloud services.

I like to program on my main machine(host) and connect to the VM as if it were just a database server.  I expected to have quite a few issues given how long it’s been since I did it this way. But really the only issue I had was  making the connection from the Host to the VM.

This is how I configured my VM using VirtualBox 4.3.26 for Windows hosts.

If any of the steps need a better explanation, leave me a comment and I’ll clarify.

Steps

  • Download the Database App Development VM from Oracle’s Pre-Built Developer VMs.  Others should also work if you have a favorite.
  • Import the .ova file into VirtualBox
  • Add network adapter
    • Select the imported VM
    • Click Settings (gear icon in toolbar or in the VM’s right-click menu)
      Settings
  • Configure Adapter
    • Select Network
    • Click on the Adapter 2 tab
    • Check Enable Network Adapter
    • In the Attached to list, select Host-only Adapter
    • Click OK button
      Add 2nd Adapter
  • Start the VM
  • Enable network adapter inside the VM
    • Click the network icon on the right side of the toolbar
    • Turn on the new adapter. Both adapters should be on.
      Note the name of the new adapter you just turned on.
      Enable2ndAdapter
  • Open a Terminal inside the VM
    • From the information at the top of the Terminal, Note the Pluggable DB and ALL PASSWORDS ARE values
      InitialTerminalMessage
    • Type ifconfig -a to get the ip address.  The adapter you just enabled (name from last step) will have the address you need, in my case it’s 192.168.52.101.
      ifconfig results
  • Test the connection on your host machine.
    I’m using Oracle SQL Developer 4.0.3 (4.0.3.16.84)

    • Create a new connection using the above values and push the test button.
      Password: oracleALL PASSWORDS ARE value
      Hostname: 192.168.52.101 — IP address value
      Service Name: orcl — Pluggable DB value
      Test Connection

If all goes well you should have a good connection.

Any questions please leave a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *