virtualbox - clone from bitbucket.org in command on guest linux virtual box through proxy in host

07
2014-07
  • user315540

    I am using an ubuntu virtualbox guest on a windows 8 host. I am going to clone a repo from www.bitbucket.org using git command in guest. BUT the problem: I realzied that I cannot connect to www.bitbucket.org without using a proxy on my network. so I am using a proxy client on my host for connection. now I am wondering how can I make my shell in guest, to use proxy server that am connecting my host to it. Thanks in advance

  • Answers
  • Squeezy

    git supports proxy through setting the http_proxy environment variable.

    Try:

    export http_proxy=http://proxyhost:proxyport/
    git clone <repo>
    

    This is the easiest way. For other options see https://stackoverflow.com/questions/128035/how-do-i-pull-from-a-git-repository-through-an-http-proxy.


  • Related Question

    networking - How to set up VPN connection? Virtual Box 3.1.4 installed. Host - Snow Leopard(Mac) Guest - Windows 7 (32-bit)
  • user31954

    I have Virtual Box 3.1.4 installed. Host - Snow Leopard(Mac) Guest - Windows 7 (32-bit). I have installed Windows on my MAC because I need it for work. I cannot establish VPN connection (using NAT). I tried to use bridged adapter, and I lost my internet connection on my guest(wind7) completely.

    I don't know much about networking, so I need detailed instructions for his particular OSs. Could someone please help me with this?

    Some random details about my attempts: On my host Windows I get error 800 trying to VPN. I can ping server address from my guest Win 7 and I have VPN connection established from my host Mac. I do disable VPN on my Mac when tying to establish it through guest. I tried to VPN from Mac and see if Guest sees it. It doesn't.

    Thank you!


  • Related Answers
  • slhck

    It should be fine if you connect the Mac OS via VPN and configure VirtualBox to use NAT as network type. The guest OS does not have to know about VPN.
    Depending on the type of VPN, there is an option under Advanced in the network system preferences, to send every traffic via this VPN connection.

    As I said, it depends on your type of VPN, but in general, follow this:

    1. Get your VPN connection running on Mac OS. If available, select "Send all traffic over VPN connection": System Preferences → Network → (select your VPN connection on the left side) → Advanced...

    2. In VirtualBox, set Attach to.. for the network adapter to NAT.

    As all traffic is now sent over your VPN, the traffic generated by VirtualBox is sent via your VPN. Of course you cannot see any servers or whatever inside your guest OS as it is behind the NAT but you should be able to connect to servers, etc. via IP or name.