title: Android x86 on VirtualBox: Android Connected But Not Online
body: <p>I am trying to configure a Android x86 running machine using Oracle VirtualBox so that it works with Eclipse.  I am having some trouble in making my virtual machine "online". I connected the phone to adb by typing the following in the Android Terminal Emulator:</p>
  
  <pre><code>ifconfig eth0 192.168.40.1 netmask 255.255.255.0
  route add default gw 192.168.40.1 dev eth0
  </code></pre>
  
  <p>Afterwards, I switched to cmd and typed 
      adb connect localhost</p>
  
  <p>But when I try to run my test code using Eclipse on the virtual Android, it does not appear in the Android Device Chooser Menu.  Furthermore, when I typed <code>adb devices</code> in cmd, this was the response:</p>
  
  <pre><code>List of devices attached
  localhost:5555   offline
  </code></pre>
  
  <p>The other thing that worries me is that each time after I shut down the VM, I have to type the <code>ifconfig</code> and <code>route add</code> commands again in the terminal when I restart, in order to connect to the device.</p>
  
  <p>What can I do to make the device online?</p>
  
  <p><strong>EDIT:</strong> 
  In case it matters, the VM is configured to communicate over a NAT Network.  This is what my Port Forwarding Rules look like:
  Protocol: TCP</p>
  
  <p>Host IP: *</p>
  
  <p>Host Port: 5555</p>
  
  <p>Guest IP: *</p>
  
  <p>Guest Port: 5555</p>
  
  <p><strong>EDIT2</strong>
  Related Question: <a href="https://stackoverflow.com/questions/10680417/error-device-offline">Error: device offline</a></p>
  
  <p><strong>EDIT3:</strong> Potential Solution: <a href="https://stackoverflow.com/questions/5584976/android-device-chooser-my-device-seems-offline">Android device chooser - My device seems offline</a></p>