8

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?

eldarerathis
  • 36,787
  • 16
  • 144
  • 175
staticd
  • 203
  • 1
  • 3
  • 6

1 Answers1

6

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.

Francesco
  • 192
  • 3
  • 12
Kynolin
  • 61
  • 1
  • 3