28

I'm kind of new to the whole porting issue and I got to it because of the slowness in the emulator provided with the Android SDK.

I downloaded the android-x86-3.2-RC2-eeepc and android-x86-3.2-RC2-tegav2 ISO-es (from this site) and tried them on the VirtualBox but have no internet connection on the eeepc version and the tegev2 wont event start.

I tried the VirtualBoxHowTo but got nothing, on both Windows and Linux platforms. the only thing I managed to understand is that to use this on a VM you need to build it for VM.

Can anyone help me on this?

P.S.: I need the HoneyComb version (3.2) and the pc I have is a AMD 6 core on and Asus Crosshair Extreme motherboard, Windows 7 or Ubunutu 11.10. (both OS are 64bit)

Volo
  • 28,673
  • 12
  • 97
  • 125
Mr G
  • 297
  • 1
  • 3
  • 7

8 Answers8

19

I solved the problem. This is what I do to get internet connection.

In my case, the gateway address was 192.168.0.254 and the DNS server was 192.168.0.10. I select an IP address for the VirtualBox host from the unused ones (192.168.0.250).

1) First of all, I set my VirtualBox network configuration:

Attached to: Bridged Adapter

Adapter type: PCnet-FAST III

2) After that, I start Android from VirtualBox; after boot, I open a root shell, pressing Alt+F1

3) Here, I use these commands:

ifconfig eth0 up 192.168.0.250
route add default gw 192.168.0.254 dev eth0
setprop net.dns1 192.168.0.10

4) Now, I return to Android (Alt + F7), and I can surf on internet!

Unfortunately, this process must be followed each time you start Android


In order to obtain gateway and DNS IP addresses, from Windows you can use this command

ipconfig /all

You must refer to your network card

Vito Gentile
  • 13,336
  • 9
  • 61
  • 96
  • I tried both iso the eeepc and the tegav2 but when i do ifconfig eth0 it gives me device not found. I have the adapter type PCnet-FAST III but android fails to detect it. I'm sure its not a problem with Virtualbox because other distros have internet connection fine. Could you upload your virtualbox disk somewhere? – Bibek Shrestha Jan 19 '12 at 17:14
  • Thanks for this. I have collectively spent hours googling and following various solutions on Stack Overflow, but yours is the only one that worked for me. – Josh1billion Jul 10 '12 at 21:17
12

After some research, I found simplest way to solve this! The Key is dhcpcd and dns setting.

  1. Config VirutalBox network card as Bridged Adapter. Adapter type: PCnet-FAST III (Maybe other type is ok, i did not test)

  2. Start Android from VirtualBox; after boot, open a root shell by pressing Alt+F1, type following command:

    dhcpcd
    
  3. Type following command to set DNS server:

    setprop net.dns1 yourDnsServerIp
    

finish!

Justin
  • 84,773
  • 49
  • 224
  • 367
osexp2000
  • 129
  • 2
5

This worked for me:

attached to: NAT
PCnet-Fast III
  1. press ctrl-f1
  2. type dhcpcd eth0
  3. type setprop net.dns1 [your DNS for your internet provider] mine is 75.75.75.75
  4. press ctrl-f7 to go back to GUI
Perception
  • 79,279
  • 19
  • 185
  • 195
Brandon
  • 51
  • 1
  • 2
4

For Honeycomb, make sure Virtualbox is set to use PCNET III drivers. Then you can bring up ethernet manually. Apps like market and sync still do not work, as it seems they are looking for the WLAN interface to be up.

Karl
  • 91
  • 1
  • Yes, it use PCNET III drivers. The problem isn't the market... it's the browser! I cannot view Google or other websites.... – Vito Gentile Nov 25 '11 at 10:28
3

In my case i had to be on a cable connection. It would not connect through wi-fi at any point. It may be a help to someone who had the same problem.

I used the following configuration in VM:

Bridged Adapter PCnet-FAST III

Then on the running emulator:

Start by pressing ctrl+f1

type: setprop net.dns1 *yourDns (something like 192.168.1.1 without the *)

(if you dont know your dns, bring up the commandline by running cmd.exe and type: ipconfig/all, scroll down to where it says DNS servers

press ctrl+f7 to go back to the emulator

Edit: It seems that you have to type "dhcpcd eth0" aswell, depending on your internet provided. I did not have to use it in 2/3 places, but it may be required.

Emil Kaminski
  • 1,886
  • 2
  • 16
  • 26
1

You don't need to port anything to run Android x86 on your computer, assuming that you're trying to run it inside VirtualBox with a host OS of Windows 7.

Make a new VM with a hard drive and about 8 MB of video RAM (see the VirtualBoxHowTo page for even more VirtualBox settings). Then, attach the eeepc ISO to the VM and boot from the CD-ROM drive by hitting F12 at the Oracle BIOS screen. Next, select "Installation" with your arrow keys and press Enter.

Walk through the process (tutorials abound), shutdown the VM, remove the ISO, and boot the virtual machine.

I just wrote several paragraphs about pitfalls with Android x86 so you might want to take a look at the blog entries. I don't know if including a link here would be considered spamming so leave a comment if you want the URL.

Sample tutorial for installing Android x86: http://brunocosta.com/blog/pt/2011/11/02/speeding-up-android-development-with-android-x86-and-virtualbox/

Zian Choy
  • 2,846
  • 6
  • 33
  • 64
  • The process you describe works with Android 2.3 and other version. The problem is when I try to use internet on Honeycomb! Have you tried to install the 3.2 version before this answer? – Vito Gentile Nov 24 '11 at 23:41
  • No, but I believed it was reasonable to expect something so fundamental to remain the same between versions of Android x86. I'm clearly mistaken; thanks for letting me know. I'll continue to look for a way to get the Internet connection to work. – Zian Choy Nov 24 '11 at 23:44
  • What are your VirtualBox networking settings? What is the output of netcfg from busybox? – Zian Choy Nov 24 '11 at 23:49
  • This is the output of netcfg: lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00 eth0 DOWN 0.0.0.0/0 0x00001002 08:00:27:1b:cf:23 I selected NAT and bridged mode, and I try every possibility, without success... – Vito Gentile Nov 25 '11 at 00:04
  • @ZianChoy I'm trying to setup network for Android 2.3 on a VirtualBox VM, but my problem is that `netcfg` returns only `lo` (127.0.0.1) interface... Can you help me? ( http://stackoverflow.com/q/9257668/1061499 ) – davioooh Feb 13 '12 at 10:43
  • @DavidC. You should start a new StackOverflow question for that. – Zian Choy Feb 15 '12 at 23:12
1

Check the drivers compiled in the kernel. That must be the reason.IIRC you had to have the drivers for VirtualBox compiled in the kernel (or as a module) to get that to work. As Honeycomb was, according to Google, a mess, I wouldn't doubt that the kernel doesn't have that support. I'll try to check on that myself later today and I'll update this answer accordingly.

DallaRosa
  • 5,737
  • 2
  • 35
  • 53
-1

In my case I had local network so my router acts as dhcp server

So in VirtualBox,

 set network to bridge
 PCNET Fast III (may be others work I have not tested)

to switch to console type Ctrl + F1

then on command line type

setprop net.dns1 dnsserveraddress

in my case I did

setprop net.dns1 8.8.8.8

8.8.8.8 is google dns ..

and it worked thereafter

Ahmed
  • 14,503
  • 22
  • 92
  • 150