Vagrant proxy through CNTLM on Windows using CYGWIN

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.

Steps:

  1. Get your corporate proxy URL (Via Google Chrome)
  2. Configure Cntlm
  3. Configure Cygwin
  4. Configure Vagrant
  5. Use teh interwebs from your VM, practicing ninja turtle coding skillz and be instantly awesome!!1!

Continue reading “Vagrant proxy through CNTLM on Windows using CYGWIN”

Can not connect to Virtualbox Guest Oracle Database 12c Developer Day Database VM due to Oracle Linux firewall

It seems there’s a firewall present on the latest Developer Days Database image which I’ve just downloaded from Oracle.

Description:

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.

Problem:

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)

Solution:

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”
Screenshot from 2014-08-19 12:55:14Then follow these steps:

  1. Click [Other Ports]
  2. Click [Add]
  3. Select [User Defined]
  4. Enter Port: “1521”
  5. Select Protocol: “TCP”
  6. Click [Apply]
  7. Click [Reload]

Screenshot from 2014-08-19 12:55:55
 
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:
Oracle SQL Developer : Local - Sys_009
 
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:

  1. Select “Network”
  2. Click [Port Forwarding]

OTN Developer Day VM_1 - Settings_012
 
Then in the Port Forwarding Rules:

  1. Enter a descriptive name: “DB”
  2. Enter the host port: “1521”
  3. Enter the guest port: “1521”

OTN Developer Day VM_1 - Settings_011