Windows XP on Android

Recently I have been playing around to get Windows XP to run on my Android ARM phone. After a decent amount of research and work done (found out later that most of it was unnecessary) I managed to get proof of concept Windows XP to boot with usable resolution, network, and no sound😉 Like my colleague said: Just because I can😉

Photos for the curious

Windows XP on Android - boot logo

Windows XP on Android - minesweeper

Windows XP on Android - web browser

The host (Samsung Galaxy S2, a tablet, etc)

First of all you need to face the obvious – your device is ARM-based, and Windows XP runs on x86 architecture. So what you need is an x86 emulator, and it means that it will not be that fast. QEMU is a popular and efficient choice nowadays when you need different architectures for your guest systems. Years ago I used it to run a proof of concept PPC Mac OS X on an Intel box, it was terribly slow on an Athlon 900 but it worked.

Fortunately on my Android I had already prepared a playground for myself to run various things – see my post about Gentoo on Android (it is not a must, but the article assumes you do have Gentoo – otherwise you are on your own to get qemu for your device). Aside from allowing you to run a ssh server, cron and maybe a web server – Gentoo provides you the power to compile a lot of software natively (build=host=target) to ARM as your CHOST in /etc/make.conf states.

To save your time I will tell you ahead, that none of currently available (in portage) versions of qemu worked for this setup. I did not take precise notes, but it is ok to assume that versions 0.11.1* will cause your Windows XP to bluescreen and reboot before the boot logo appears and will drop you to “last good configuration” boot menu. The 1.0* will just say “Aborted” on the command line. Version 0.9 and before should theoretically work (these have a different approach to TCG/TCI), but require either working gcc-3 to build or heavy patching for gcc-4.

I have tried both approaches. The gcc-3 (for qemu-0.9) does not support armv7a. Cross building for amrv6j with gcc-4 was a horror and it failed anyway, triggering even unmasking newer binutils as the linker had emulation mode / ABI issues. Trust me, this is not a good way to go. To build with gcc-4 – there are no high quality qemu patches (tried many various combinations) to successfully build specifically on an ARM host for x86 target. These just failed, and actually even if it built successfully I would not trust the emulation to work reliably anyway.

So the quick answer is: go with qemu-0.15.1. It is not included in the portage tree (not even as masked), but you can add it to your local overlay using qemu-0.11.1-r1.ebuild as a base ebuild (the -r1 includes a security patch). You will need to disable the code handling –disable-kqemu configure option, get the usual files directory and digest the ebuild. Here is mine qemu-0.15.1.ebuild file.

Edit your /etc/make.conf to include:

QEMU_SOFTMMU_TARGETS="arm i386"
QEMU_USER_TARGETS="arm i386"

I put the ARM target just for any future use. Then issue:

# emerge -va qemu

And have it compiled and ready for use. But wait, there’s more.

To access your Windows XP you will need a VNC client. This simplifies the overall GUI situation greatly. Get androidVNC from the market and set Input Method to Touchpad, as it seems to work reasonably well (scrolls the display following the cursor, single tap – single click, double tap – right click, slow double tap – double click). You might also want to get Hackers Keyboard to be able to type in a more comfortable way if you don’t have it yet. In androidVNC – tap and hold, and then tap the small keypad icon on the bottom to get to the keyboard.

And last but not least – have at minimum 2GB free storage on your device for disk image file.

The guest

Now when your Android is ready you should set-up the system image (actually a disk image is enough). I used qemu-0.11.1 on my main workstation. This version exposes a different network card to the guest than qemu-0.15 by default, but we will handle that later on, when running it on the destination device (model=ne2k_pci).

Create an x86 machine, with 128 (works) or 256 (better) MB of memory and a 2G (at least) disk image. Get a GUI (qemulator?) or in short:

Now do the usual installation (skip time zone auto adjustment for daylight saving) and remember to install all the updates. Additional things you might want to change then:

set-up a classic start menu to easily fit it on screen (or leave the fancy one for easy tapping)

disable grouping on the task bar (well, maybe this one is just my personal)

disable system restore

disable automatic updates (with all the consequences…)

tweak screen resolution to 800×480 (for Galaxy S2 at least) – there are many ways to do that, including using emulated vmware vga driver (man qemu) or using Powerstrip – however I did not do this, as I can live with scrolling up and down, and some settings windows just fit

When done, shut down your Windows XP properly and transfer the disk image to the phone location of your choice, say:

Save, and then add a Tasker Task widget to the home screen, select this task and an icon, and you’re done.

And that’s about it. I did not configure sound, since my Gentoo has some issues with the phone’s alsa device – sound is pretty much stuck and heard just after a volume change – probably device access is conflicting with Android’s processes (well, fuser says nothing), so I left it as is for now. I hope you have a dual-core device to handle qemu load. I haven’t tried with qemu -smp 2, but YMMV.

Like this:

Related

18 Responses to “Windows XP on Android”

hello !
i want to run windows xp in android tab. it has all the requirements but i dont know how to do it.
i have problems understanding your post about windows xp in android.
i wnt to do it using vnc server in my android and i have the windows xp .img file too.
so please tell me the proper guide and i dont know about gentoo and all so help me please!
either reply me with the proper method to run xp in android or email me the same sushobhit333@yahoo.com
(i will be highly obliged to you)

The article describes a bit geeky way I have done it, but as I see there are plenty of ways to do it with this kind of emulation. You might want to do a search or two on XDA-Developers forums, I think there’s a guide with using a special app for that. Don’t forget to check Google Play too.

thanks Marcin, i have already searched a lot on xda and other top forums of the world but no result for exactly what i require. i appreciate that you are trying to help but i have tried bochs, qemu, dosbox etc in my android tab but either it crashes or super slow so nothing is working in aproper way.
.
.
i think xp can be made to run in vnc server using img of xp as you did . the only thing i require is a android terminal emulator .sh script (the latest back track 5 is running in my android the similar way ie using .sh and android vnc)
i thing similar work can be done with xp also.
.

If it is super slow, then it …works. In short – you cannot expect much performance because of architecture difference.

Your device is most probably equipped with an ARM processor, and Windows things run on x86 architecture. Both of these are quite different and have their own advantages and disadvantages. Therefore it is technically impossible to run x86 software natively, so the qemu/bochs in this case is emulating an x86 system in software. This is very different from virtualization (which makes use of native execution), since it requires interpreting binary bytecode by software, and this basically means that it requires a lot of processing power. Bottom line is that it is more of an academic experiment and proof of concept, than a real-world application for production use.

what a long process,anyone cannot easily understand the steps of doing whatever you mentiond above,why won’t you give explanation about the steps in easy manner mentioning them one after another.thank you.

I honestly don’t know what to say. I mean, I guess the idea of running Windows XP on a phone is a novel one for sure, but the question in my mind is why? I know you said just to prove that you can, but what purpose does it serve in the long run? I mean, I’ve heard there’s a way to install a pirated copy of OSX on PC hardware by using specific tweaks and settings, but in the long run the experience would be diminished because you’d encounter a myriad of problems as well as bugs and non-functioning features. It’s cool for the bragging rights, but not much more than that.

Still, I admire your hard work and determination. I once spent two days fighting with installing OSX in a virtual machine under Windows until it finally worked (which is where I heard about the possibility of installing it directly) and the feeling of satisfaction when I actually succeeded was awesome. Success can be its own reward, I suppose. It was a fun read, and seeing Windows XP on your phone screen is neat, but I won’t be trying this myself. Your warnings about how XP would literally kill an SD card and the other problems it has (like a lack of sound) make the idea of using it for any practical purpose seem asinine.

You sound like quite skilled with technology and computing, particularly Linux commands. With those skills, I wonder if you would be able to get the watered down phone version of Windows 8 (“Windows RT”, whatever that means) to run on an Android phone. THAT would be quite impressive. Getting it to run on an iPhone would be even more so, but let’s not get carried away.

Kudos on your accomplishment. I’m constantly amazed by the things people can do with technology, like the people who used their Playstation 2 consoles to run a version of Linux, or the guy who managed to connect his 8-bit NES to the internet and turn it into a rudimentary bitcoin miner. Somebody’s got a little time on his hands. He did have one thing in common with you, though. He says he did it just to prove that he could. Seems to be a common theme on the internet, yeah?

Hello,
Marcin, can you please write this tutorial in detail once again in TXT and upload? I do not know where to download and how to install qemu. I have root on my phone and I have hda with Windows XP too. Thank you
(sorry for my English)