hilverd / vagrant-ubuntu-oracle-xe

Install Oracle 11g XE in a Vagrant virtual machine running Ubuntu 12.04.
MIT License
287 stars 96 forks source link

Forward To A Different Port #9

Closed opticyclic closed 10 years ago

opticyclic commented 10 years ago

I got the following error when doing Vagrant up, probably because I have OracleXE installed on my host as well. It might be worth choosing a more random host port to forward to.

Vagrant cannot forward the specified ports on this VM, since they
would collide with some other application that is already listening
on these ports. The forwarded port to 1521 is already in use
on the host machine.

To fix this, modify your current projects Vagrantfile to use another
port. Example, where '1234' would be replaced by a unique host port:

  config.vm.network :forwarded_port, guest: 1521, host: 1234

Sometimes, Vagrant will attempt to auto-correct this for you. In this
case, Vagrant was unable to. This is usually because the guest machine
is in a state which doesn't allow modifying port forwarding
hilverd commented 10 years ago

This is an interesting one, thanks for pointing it out. Vagrant can be configured to auto-correct port collisions, so that it would automatically pick a random free port on the host if 1521 is already taken. But 1521 is the standard port for Oracle. I think it is better to get a clear error message than to have Vagrant automatically pick an unexpected port, so I'm inclined to leave the configuration as it is now.

hilverd commented 10 years ago

Just to clarify... obviously another option is to have Vagrant set up a (non-standard) port other than 1521 to begin with, but then the user would have to do more configuration in e.g. SQL Developer to connect to a non-default port.