Wow, talk about a crappy post title, but I just got this working on my corporate network and was quite happy about it.
Reason for this post; Every time I start a new assignment at a (rather big) corporation, I need to follow these steps to be able to access the internet from my vm’s.
(and I keep forgetting the steps, I’m getting old..)
What we’ll use to get this working:
Cygwin : https://www.cygwin.com/
Vagrant : https://www.vagrantup.com/
Virtualbox : https://www.virtualbox.org/
Cntlm : http://cntlm.sourceforge.net/
I’m running CentOS vm’s inside Vagrant with Virtualbox provisioning on Cygwin on Windows 7. I’m running Cntlm to create a local proxy for all stuff what I’m doing through cygwin, because I don’t like putting clear text passwords in bashrc or in Win / Bash variables.
Get your corporate proxy URL (Via Google Chrome)
Use teh interwebs from your VM, practicing ninja turtle coding skillz and be instantly awesome!!1!
It seems there’s a firewall present on the latest Developer Days Database image which I’ve just downloaded from Oracle.
I enjoy using these images because it is a complete reference install of Oracle Linux, Oracle Database and Oracle SQL Developer (among others). Besides that, it only takes 10 minutes to setup a base install from the image.
Usually I like to connect from my local SQL Developer instead of the one inside the VM.
But with this setup I could not connect when I added the NAT Port Forwarding in Virtualbox, it timed out when trying to connect. I could connect from the SQL Developer inside the VM, just not through the NAT port which was forwarded (important: see the bottom of this post to check the NAT Port Forwarding settings in Virtualbox)
It’s fairly easy to add a firewall rule which allows access to port 1521 on Oracle Linux, we can even do it with a GUI:
Select Menu “System” – “Administration” – “Firewall” Then follow these steps:
Click [Other Ports]
Select [User Defined]
Enter Port: “1521”
Select Protocol: “TCP”
You’ve just added port 1521 to the iptables which makes it okay to connect to this port from another IP outside the local machine.
We can test from SQL Developer, running on the Host:
And it works! 🙂
Extra: NAT Port Forwarding in Virtualbox
Just to be sure, these are the settings you’ll need to set inside the Virtualbox Manager to setup the port forwarding on port 1521 from the guest to the host:
Select the “Settings” of the Developer Day VM and then: