Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I have Android x86 4.2 Installed on my Virtual Box. My main purpose is debug with eclipse and get internet on Android

Some how i am able to get internet and also able to connect from adb (of ADT) but not both at a time

i have tried several combination to get both but no luck

How i get Internet

I get internet when i use NAT in one of these 4 adapters 

How i get connected with adb

I get connected with adb when connected to newly created Host Only adapter 

note: the default host only adapter was not working

I have two questions:

First is how i will get both The Internet and connection to adb Second is Can i get my bluetooth and Wifi device available to My Virtual box Android

Note: My Internet connection type is either 3G HSUPA using Modem or WiFi no LAN

Note: when both of them are connected then either of them works not both I have googled, Stacked, Virtual box site too but no luck Initially i was unable to connect to adb but I figured out the way i can! Please any one know the issue.

NAT For Internet

Host Only Adapter #2

share|improve this question
    
0000000000000000000 –  Anonymous Mohit Sep 28 at 12:09

3 Answers 3

Did you check with netcfg within Android that both are really up? If, e.g., eth1 is down, enable it with netcfg eth1 dhcp up.

share|improve this answer

I'm using the very same setup with NAT mode. To connect via ADB:

  1. in VirtualBox Manager, right-click on your VM and select "show log"
  2. press Ctrl-F to initialize a search, type "DHCP". You will find several lines stating something like NAT: DHCP offered IP address 10.0.2.15 – that's your IP, write it down ;)
  3. select the "gear icon" in the same context menu to "change settings"
  4. go to the "network" tab, and click the "port forwarding" button
  5. add two rules to forward ports 5555 (adb) and 5554 (console) from the guest to your host machine. To make an easy rule for potential multiple Android-VMs, you can simply add a digit to the end – e.g. 5555→55551 and 5554→55541 for this machine (add a "2" for your second, if any).
  6. now on your host machine, execute the command adb connect localhost:55551

Done. Execute any ADB commands as usual. You can use adb disconnect localhost:55551 if it gets in the way (e.g. if you're using some other device, and don't want to always specify which one to use with each ADB command).

share|improve this answer

In case someone finds this thread: Use bridge mode, you will get an IP adress from your LAN.

Edit by Izzy:

To do so:

  1. in VirtualBox Manager, select your VM and click the "gear icon" (change settings)
  2. select the networking tab
  3. in the first drop-down box, select "bridge mode"
share|improve this answer
1  
So how do you set up this bridge mode? –  Dan Hulme Jul 18 at 8:21
    
@DanHulme OP knows where to find it (same place he'd switched between NAT and Host Only). I've added it, though :) –  Izzy Jul 19 at 21:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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