Recently, I had to install Android OS in a Virtual Box machine, in order to test some features. The whole process is quite smooth and there are many tutorials about this, so I am not gonna write an install guide.
However, the network is a bit of an headache; and without network there is little you can do with this nice OS 😦
Here is how I solve the problem, after “banging my head on the wall” for a couple of hours.
First of all, download Android from the X86 Android port website.
The network won’t work at first. Make sure to set the VM adapter to NAT, PCNET-Fast III.
With the machine switched off, go to a command line and type:
VBoxManage modifyvm [insert name of your machine here] --natpf1 adb,tcp,*,5555,*,5555
Start the Android and open a command line. As root, type:
You should see an eth0 interface coming up, with an ip address. Ping something (e.g. google.com); it won’t work.
netcfg eth0 dhcp setprop net.dns1 22.214.171.124
Ping a host again: it should work now. Go back to your Android UI. Do not try to configure the net, using the wireless interface! Just use the internet and enjoy it! 🙂
Hope this can be useful to Android developers! 🙂
P.S.:Do not forget to disable the mouse integration: it sucks