I'm playing around with the latest android-x86 (4.4) in virtualbox. The setup can connect to the external network only through a NAT ethernet device that is emulated by virtual box. This gets autoconfigured just fine and i can ping computers on my LAN.

If I export http_proxy=<host>:<port> in a terminal, I can wget web pages. However I am unable to set the proxy settings globally for all apps.

The proxy settings are displayed only after a wifi network is connected, and I lack any wifi devices in the virtual machine.

I have tried the following in the root terminal accesible from alt+f1:

setprop global_http_proxy_host <host>
setprop global_http_proxy_port <port>
setprop net.gprs.http-proxy http://<host>:<port>

But this fails to have any effect. Even new terminals lack the env variable for the proxy. These settings appear to be set when I check it by executing getprop

I found this link to the fragment that seems to display the proxys selector for the wifi.

Is there any way that I can manually set all the settings that are affected by this fragment?


This solution worked for me.

Just enter the following command in a terminal (change PROXYIP:PROXYPORT )

iptables -t nat -A OUTPUT -o eth0 -p tcp --dport 80 -j DNAT --to PROXYIP:PROXYPORT

Source: https://groups.google.com/forum/#!topic/android-x86/XfIRyHQ5nmk

I had too tried all your commands without success. I was stuck behind a proxy trying to setup Android x86 with a VirtualBox VM which only had eth0. I was stuck at the activation screen not resolving the needed webpages to continue into the OS. After running the above command, I was able to reach the web and continue. Results may vary per proxy environment.

Edit: This didn't get me too far, but it got me somewhere. The same trick didn't work for 443.

  • 4
    Were you able to get it working for 443? I can't get ssl connections proxied no matter what I do. Http works fine. Jan 2 '16 at 8:07
  • Check SandroProxy has options to foward to proxy to proxy
    – user956584
    Nov 27 '16 at 18:30
  • protoent* getprotobyname(char const*)(3) is not implemented on Android
    – ife
    Feb 5 '18 at 16:15
  • @Saurabh3321 transparently proxying https requires SSL bump (MITM). You need to add proxy's CA to device/app. Oct 18 '19 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.