Get started
There is a ready made iso image available on android-x86.org. We want the latest, so we choose the Android-x86-4.3-devel image from July 25.Next, we create a Hyper-V standard virtual machine without any OS settings that has the following specifications:
- 1 CPU
- 512MB memory
- 32GB virtual harddisk (a bit large, but who cares)
- Legacy Network Adapter connected to an external virtual switch
- DVD mapped to the downloaded iso image
Installation
We fire up the virtual machine and the following boot screen appears:
We select the Installation option. Next, several questions are asked, mainly about harddisk partitioning. We create a single partition for our entire virtual harddisk and make it bootable. The installation completes quickly afterwards.
First start
When we run Android for the first time, this boot screen appears:
We let the timer run out and continue with the boot process. The root prompt appeares for a short period, after which the the graphical environment shows up:
Since this is the first time, we have to go through the standard Android first time settings such as user accounts, WiFi and so on. Since we have connected to a (virtual) legacy network adapter, we skip the WiFi part. Finally we reach an empty but familiar homescreen:
Deploy and Run dot42 apps
Now it is time to deploy and run a dot42 app on our fresh virtual Android. We use the dot42 Device Center to connect to a networked device. We use Settings - About - Network on the virtual machine to get its IP address and enter that in the dot42 Device Center.
After that the virtual machine is visible in the Device Center and we can develop with it. We take the SpinningCube sample and here is how it looks:
It ran pretty smoothly, atleast a lot better than in the emulator.
Tips and tricks
Here are a couple tips and tricks we found out in the process:- Bamboo tablets do not work as mouse in Android inside Hyper-V, we had to connect a normal mouse instead.
- Pressing Alt-Left or Alt-Right when inside Android-X86 will switch between the graphical UI and the root console.
- One time we had to reset the virtual machine after Android went to sleep. We tried all recommended key combinations, but nothing worked. After that we used the developer setting in Android to prevent sleeping.
Ewout,
ReplyDeleteDid you test async/await in this Android emulator? I had crashes with it when running on Intel HAXM virtual Android x86, and under Genymotion, while on Android devices it worked fine. I hope you'll use this VM to debug async/await on Intel versions of Android.
Hi Greg, Yes I've tested it an there is indeed a problem. However it turned out that the problem was not x86 related, but rather single CPU related.
DeleteWe've fixed it and we'll release a fix on Monday.
Ewout
This comment has been removed by the author.
ReplyDeleteGreat, thank you, Ewout, will test at once. Good job! One more wish list item, of which I wrote in email but not in blog comments, is the ability to create some kind of library or "jar" from C# code, and use it from within a regular Java Android app. Reason is that I have an existing app in Java, and a slick C# library that I'd like to use with it to add some functionality. I know that I can create another APK with C# service and call there from Java app, but such setup is clunky and slow, requires users to download and install the extra APK etc. You have an opportunity here to do something, which Xamarin won't be ever able to achieve...
ReplyDeleteThis is the next major stop on our feature roadmap.
DeleteThis comment has been removed by the author.
ReplyDeleteI cannot start the image, it says:
ReplyDeleteNO DEFAULT OR UI CONFIGURATION DIRECTIVE FOUND
Any idea?
I already tried this>http://www.geekzground.com/index/?p=27
But it comes to Boot failure..
Sounds like an error in the iso (of AndroidX86) itself.
DeleteDid you download the same as indicated above?
Ewout
Download just hung up for me, that is probably what happened there. Check file size and if in doubt the SHA1 Checksum. Then download again if the file is corrupt.
DeleteHello,
ReplyDeleteIs there a way to connect to an emulator running on a different PC? For example, I have my dev environment on my desktop pc and would like to connect to an emulator running on a laptop. Both machines are in local network.
Thanx in advance!
br
Rok
Hello,
ReplyDeleteI use Virtualbox. I installed the android-x86-4.3-20130725 and it works.
But if I try to connect via WiFi to this virtual machine in android device center, it show message "unable to connect to 192.x.x.x:5555:5555".
x:5555:5555 ? 2 ports, is that a bug or incorrect log?
I have the same problem if connect to my Samsung S3 via WiFi. The message is eqal.
But there I use USB Debugging. It works.
Can I generally use Virtualbox?
How can I see in android-x86-4.3-20130725 VPC correct IP is set?
Thank you!
The double 5555:5555 is the problem. An old version incorrectly saved the port number with the ip. We expect a new release next Tuesday that recognizes this and strips the extra 5555. Can you search the registry for key DeviceConnectionAddress and tell me what the value is?
ReplyDeleteThe DeviceConnectionAddress value in registry is 192.x.x.x. Like set by >dot42>Select device>Connect via WiFi.
ReplyDeletedot42 is updated to 1.0.1.78
The log write 192.x.x.x:5555:5555
Any idea?
Thanks!
please explain the developer settings to prevent the android emulation from sleeping. thanks!
ReplyDeleteI can hardly find words to express how thankful I am for posting this information! very useful!
ReplyDeleteIpad Applications development
Android Development
HIPPA Certified Software
medical software Development
EHR integrations
when i try to access the Gallary and many other Apps it crashs, any idea why?
ReplyDeleteHello
ReplyDeleteIs there any solution about the double port problem ?
C:\Program Files\dot42\Android\Platform-Tools\adb.exe connect 192.168.56.1:5555
unable to connect to 192.168.56.1:5555:5555
I'm using Android Device Center 1.0.1.81
thanks
Ewout,
ReplyDeleteSimply needed to say thanks for your great post on Hyper V and Android x86.I don't think I would have ever figured out you expected to delete the synthetic network adapter before the legacy adapter would work.In spite of the fact that Android 4.3 works OK on my machine (Win 8.1 64),I get no sound and commonly applications crash.I assume this is not out of the ordinary since Android 4.3 x86 is in development.Thanks again for a great article and your assistance.
best games