title: Apt-Get not working behind corporate firewall on Win 7 in VirtualBox with proxy set
body: <h2>The issue</h2>
  
  <p>I'm trying to run apt-get on Ubuntu virtual box, but I keep getting connection and time-out errors.  I'm not sure what is causing them because the proxies are set.  Here is my system:</p>
  
  <h2>System config</h2>
  
  <pre><code>HOST: Win 7 Enterprise, SP1 (64-bit OS)
  RAM: 8 GB
  CPU: Intel i5 2.6GHz
  VirtualBox 4.2.12
  Ubuntu 64 (ubuntu-12.04.2-server-amd64.iso)
  </code></pre>
  
  <h2>Steps to reproduce issue</h2>
  
  <p>Here is the workflow and the error that it produces:</p>
  
  <p>1) SSH to the Ubuntu VM from GitBash (or any other *nix command line).  Note: The <code>&lt;localhost_alias&gt;</code> has already been configured in the hosts file.</p>
  
  <pre><code>ssh -l&lt;username&gt; -p&lt;ftp_port&gt; &lt;localhost_alias&gt;
  </code></pre>
  
  <p>2) Set your proxies.  I simply copy-pasted these from a text file onto the command line and hit enter to process the last one also.</p>
  
  <pre><code>export http_proxy=http://proxy.somecorpdom:8080/
  export https_proxy=https://proxy.somecorpdom:8080/
  export no_proxy=localhost,127.0.0.1,*.somecorpdom
  </code></pre>
  
  <p>3) Run apt-get update.</p>
  
  <pre><code>sudo apt-get update
  </code></pre>
  
  <h2>Results and errors</h2>
  
  <p>After running the update command, the following immediately displays, but hangs for several minutes:</p>
  
  <pre><code>0% [Connecting to us.archive.ubuntu.com (91.189.91.15)] [Connecting to security.ubuntu.com (91.189.92.202)]
  </code></pre>
  
  <p>Eventually the former message goes away and I get this (un-abridged):</p>
  
  <pre><code>Ign http://us.archive.ubuntu.com precise InRelease
  Ign http://us.archive.ubuntu.com precise-updates InRelease
  Ign http://us.archive.ubuntu.com precise-backports InRelease
  Err http://us.archive.ubuntu.com precise Release.gpg
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates Release.gpg
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports Release.gpg
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Ign http://us.archive.ubuntu.com precise Release
  Ign http://us.archive.ubuntu.com precise-updates Release
  Ign http://us.archive.ubuntu.com precise-backports Release
  Ign http://us.archive.ubuntu.com precise/main TranslationIndex
  Ign http://us.archive.ubuntu.com precise/multiverse TranslationIndex
  Ign http://us.archive.ubuntu.com precise/restricted TranslationIndex
  Ign http://us.archive.ubuntu.com precise/universe TranslationIndex
  Ign http://us.archive.ubuntu.com precise-updates/main TranslationIndex
  Ign http://us.archive.ubuntu.com precise-updates/multiverse TranslationIndex
  Ign http://us.archive.ubuntu.com precise-updates/restricted TranslationIndex
  Ign http://us.archive.ubuntu.com precise-updates/universe TranslationIndex
  Ign http://us.archive.ubuntu.com precise-backports/main TranslationIndex
  Ign http://us.archive.ubuntu.com precise-backports/multiverse TranslationIndex
  Ign http://us.archive.ubuntu.com precise-backports/restricted TranslationIndex
  Ign http://us.archive.ubuntu.com precise-backports/universe TranslationIndex
  23% [Connecting to security.ubuntu.com (91.189.91.14)]
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/restricted Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/universe Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/multiverse Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/main amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/restricted amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/universe amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/multiverse amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/main i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/restricted i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/universe i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/multiverse i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/main Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/restricted Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/universe Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/multiverse Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/main amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/restricted amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/universe amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/multiverse amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/main i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/restricted i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/universe i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/multiverse i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/main Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/restricted Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/universe Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/multiverse Sources
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/main amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/restricted amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/universe amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/multiverse amd64 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/main i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/restricted i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/universe i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/multiverse i386 Packages
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/main Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/main Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/multiverse Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/multiverse Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/restricted Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/restricted Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/universe Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise/universe Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/main Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/main Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/multiverse Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/multiverse Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/restricted Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/restricted Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/universe Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-updates/universe Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/main Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/main Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/multiverse Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/multiverse Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/restricted Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/restricted Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/universe Translation-en_US
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  Err http://us.archive.ubuntu.com precise-backports/universe Translation-en
    Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  23% [Connecting to security.ubuntu.com (91.189.91.14)]
  </code></pre>
  
  <p>It hangs at "23%" for quite awhile. After another several minutes this output is displayed:</p>
  
  <pre><code>W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/universe/binary-i386/Packages  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/multiverse/binary-i386/Packages  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/main/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/main/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/multiverse/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/multiverse/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/restricted/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/restricted/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/universe/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/universe/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/main/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/main/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/multiverse/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/multiverse/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/restricted/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/restricted/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/universe/i18n/Translation-en_US  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/universe/i18n/Translation-en  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/main/source/Sources  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/restricted/source/Sources  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/universe/source/Sources  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/multiverse/source/Sources  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/main/binary-amd64/Packages  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/restricted/binary-amd64/Packages  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/universe/binary-amd64/Packages  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/multiverse/binary-amd64/Packages  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/main/binary-i386/Packages  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/restricted/binary-i386/Packages  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/universe/binary-i386/Packages  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/multiverse/binary-i386/Packages  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/main/i18n/Translation-en_US  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/main/i18n/Translation-en  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/multiverse/i18n/Translation-en_US  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/multiverse/i18n/Translation-en  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/restricted/i18n/Translation-en_US  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/restricted/i18n/Translation-en  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/universe/i18n/Translation-en_US  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/universe/i18n/Translation-en  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
  
  E: Some index files failed to download. They have been ignored, or old ones used instead.
  </code></pre>
  
  <p>I am behind a corporate firewall/proxy.</p>