Can\'t seem to find the following information although I\'m pretty sure this should be possible: I\'m running an Android emulator on a machine A. I\'m developing on another
I did it with the following steps.
Eclipse will find adb and list the device.
Eclipse doesn't attach to the emulator directly.
The adb background process controls communication with the emulator (as well as real devices). Adb listens on TCP port 5037 for incoming commands.
I haven't tried your scenario but this should get you started.
Follow these steps to connect your VM to eclipse IDE:
First run ICS from your VM and open up android command prompt. (Navigate to applications and run Terminal Emulator)
Type "netcfg" in terminal to find out IP of your vm
Then go to cmd(windows command prompt) and move to "platform-tool" folder in your android installation path(in my case cd C:\android-sdk-windows\platform-tools)
Then type "adb connect your ip" command (adb connect 190.156.10.122)
Now you can debug your android application in vm without pain. Try this and this
You can tell adb to connect to a device listening on an IP address and TCP port. That device should then show up in eclipse. So the debug machine is easy.
The emulator machine may be harder. The emulator is listening for TCP connection on a local port. IIRC it has been established that there's no command line switch to make it listen on an external interface, though double check that. So you might have to modify and recompile the emulator, or use some kind of port-forwarder on the hosting machine. ssh might handle that for you though I'm sure there are other tools without the encryption overhead if that's not needed.
After struggling with this, I found this video that explained how to get emulator running on my mac while running my dev environment in a VM. http://youtu.be/CacpPleWsZM
In the meantime, I found a very nice solution to the problem. I installed android-x86 (http://www.android-x86.org) in a virtual machine. On the host, you then use the following commands to restart adb and connect to the vm:
adb kill-server
adb connect <VM-IP>:5555
Replace VM-IP with the actual IP of your virtual machine. If you're on a private network, the easiest way is to configure vm network as bridged so the VM gets its own IP address from the dhcp server. Should also work with Host-Only networks though as described here.
If all went well, you should see the android VM in the Eclipse debugger just like normal emulators.