Server Fault is a question and answer site for system and network administrators. 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 have a Ubuntu machine and I have a Linux instance running in a Virtual-box on this machine. I need to connect to the oracle instance (through the oracle extension in php) . The extension is running. I am not sure about how to do the port forwarding and if I need to edit the host file. I read the manual, but still no luck. Any help is appreciated. Thanks

share|improve this question

Oracle process listens by default to requests on port 1521.

Note : this solution needs only to be set up if you VM network is configured as NAT.

The simplest solution if no process on your host is using port 1521 is to redirect port 1521 on your host to port 1521 on your guest Oracle VM (you can choose another port on host but then you will probably need to do a bit more configuration on php side but I do not know this part.

To achieve port redirection, if you have a recent version of VirtualBox, go to your VM configuration using the GUI, Select section Network, click on the tab corresponding to your network card, click on the button at the bottom named "Port redirection" and fill values using the values described above. For the IP adresses, use for both.

For more information on port forwarding and documentation on how to setup it with command line you can read Virtualbox manual section here :

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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