1

I'm on a Windows machine behind a corporate NTLM proxy and I need to vagrant up a VM from the given Vagrantfile.

I've read a few things on this topic:

What I've so far:

CNTLM on my Windows machine, listening to 192.168.33.1:5865. Here's a snippet from cntlm -v -f

section: global, Listen = '5865'
section: global, Listen = '192.168.33.1:5865'

Exported HTTP_PROXY and HTTPS_PROXY:

set HTTP_PROXY=http://192.168.33.1:5865
set HTTPS_PROXY=http://192.168.33.1:5865

Installed the vagrant-proxyconf plugin

Created the .vagrant.d\Vagrantfile:

Vagrant.configure("2") do |config|
  # configuration based on http://digitaldrummerj.me/vagrant-behind-proxy-server/
  if Vagrant.has_plugin?("vagrant-proxyconf")
    config.proxy.http     = "http://192.168.33.1:5865/"
    config.proxy.https    = "http://192.168.33.1:5865/"
    config.proxy.no_proxy = "localhost,127.0.0.1,10.43.125.137,10.43.125.137,10.43.124.177"
  end
end

Set up a Windows firewall rule to allow everything from 192.168.33.10 to 192.168.33.1, on any port, for all programs and profiles.

And I'm still getting:

==> default: Cannot add PPA: 'ppa:webupd8team/java'.
==> default: Please check that the PPA name or format is correct.
==> default: Err http://security.ubuntu.com trusty-security InRelease
==> default:   
==> default: Err http://security.ubuntu.com trusty-security Release.gpg
==> default:   Unable to connect to 192.168.33.1:5865:
==> default: Err http://archive.ubuntu.com trusty InRelease
==> default:   
==> default: Err http://archive.ubuntu.com trusty-updates InRelease
==> default:   
==> default: Err http://archive.ubuntu.com trusty-backports InRelease
==> default:   
==> default: Err http://archive.ubuntu.com trusty Release.gpg
==> default:   Unable to connect to 192.168.33.1:5865:
==> default: Err http://archive.ubuntu.com trusty-updates Release.gpg
==> default:   Unable to connect to 192.168.33.1:5865:
==> default: Err http://archive.ubuntu.com trusty-backports Release.gpg
==> default:   Unable to connect to 192.168.33.1:5865:
==> default: Reading package lists...
==> default: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease  
==> default: 
==> default: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease  
==> default: 
==> default: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease  
==> default: 
==> default: W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease  
==> default: 
==> default: W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Unable to connect to 192.168.33.1:5865:
==> default: 
==> default: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to 192.168.33.1:5865:
==> default: 
==> default: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Unable to connect to 192.168.33.1:5865:
==> default: 
==> default: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Unable to connect to 192.168.33.1:5865:
==> default: 
==> default: W: Some index files failed to download. They have been ignored, or old ones used instead.

Note all these Unable to connect to 192.168.33.1:5865.

Why can't my guest connect to the proxy on my host? How can I diagnose this?

I am quite sure CNTLM proxy works, Vagrant itself accesses it a couple of times to check if the box is still actual. But the provisioning scripts which are executed later on can't.

I'm trying this for several hours already, getting desperate. Does anyone have an idea?

lexicore
  • 221
  • 3
  • 9

1 Answers1

2

I also tried the links you did with no luck, then I came across: Using vagrant with cntlm proxy. The mistake we both made was to use the HOST only network (e.g. 192.168.33.*) We want to access the internet so we should have used the Internet connection network (Vagrant NAT adapter).

Install vagrant-proxyconf plugin and set your proxy variables to 10.0.2.2:5865.