Remove All Ads from XDA

Windows on Samsung Galaxy S2

18 posts
Thanks Meter: 12
By Akez42, Junior Member on 17th September 2011, 10:32 PM
Post Reply Email Thread
Hello all.

I've been messing a fair amount with android recently and have been able to get Windows ME running on my Galaxy S2.
Now before you start getting excited, it is not perfect. It is frustratingly slow and buggy, although I have not had much trouble actually running the OS itself.

I would just like to point out that I am still a novice and there are most likely various easier/faster ways of doing this process, but this guide does require a moderate to large amount of experience of using Linux's Terminal.

This guide is written for Windows ME because it was more usuable than XP and was the only other version I had, but I was successful in XP booting up. Will try to add videos!

I know the image looks like a monitor, so I will take another picture when I get chance.

Note: I take no responsibility for any damage caused by my walkthrough as you are doing it at your own free will.

Now for the walkthrough. These are the steps I took in order to get this working:

Follow this guide to installing Backtrack 5 on your Galaxy S2 (Thanks to DooMLoRD & anantshri for the work they put into porting Backtrack from the X10 version)

You will need to re-size the Backtrack image by going into linux on your Desktop or Laptop, creating a new image and copying the Backtrack files over to the new image.
Navigate to the directory of bt.img (Backtrack image) in linux using the Terminal then use the commands below (anantshri provided them in another post):

Note: This requires 4GB of space (cannot create a larger image as the FAT file system only allows a maximum filesize of 4GB)

Note 2: I used a Backtrack 4 to do the below, so if you use Ubuntu or similar, you may need to add "sudo" to the start of each line just to make sure it works.

dd if=/dev/zero of=bt1.img bs=1M count=4000
losetup /dev/loop2 bt1.img
mkfs -t ext2 /dev/loop2
mkdir BT
mount -o loop bt.img BT
mkdir BT1
mount -o loop bt1.img BT1
cp -f -R BT/* BT1/
umount BT1
From there, you will need to copy that new image file over to your phone/sdcard, making sure you rename bt1.img to bt.img.

Now load up Backtrack on your phone and from within it, download Glib-2.0 (or 2.24.2 here) and extract the files.
Open Terminal and navigate to the new Glib then type the following commands:

make install
Now download Qemu 0.15.0 and extract it.
In Terminal, navigate to the Qemu directory and, like above, type the following commands (This can take a while and your phone can get quite warm so you could continue to the next step):

make install
Assuming there were no errors, Qemu should now be set up on your system (or you are waiting for it to finish installing). Either way, now would be a good time to create the Windows ME image for use with Qemu.

In a Linux OS of some sort on your Desktop or Laptop (I used Ubuntu), run the command "sudo apt-get install qemu". This will download and install Qemu onto your linux system.
With Qemu installed, run the following commands (ref. here) to create an image:

qemu-img create -f qcow2 winme.img 3G

if you have a cd image on your system:
qemu -m 256 -hda winme.img -cdrom winme.iso -boot d

or if you have the cd in the drive:
qemu -m 256 -hda winme.img -cdrom /dev/cdrom -boot d
The above commands will create the winme.img file to store Windows ME, and will then boot up that image so that you can install the OS. Go ahead with installing the OS and once finished, copy that to the same directory as the bt.img on your system.
Like earlier, we will be creating an image to store the files. Do the following commands in linux terminal and to copy the files over:

Note: You will need another 2GB of space free to create the below image (this goes for the phone you are copying it to as well)

dd if=/dev/zero of=btextras.img bs=1M count=2000
losetup /dev/loop3 btextras.img
mkfs -t ext2 /dev/loop3
mkdir BTExtras
mount -o loop btextras.img BTExtras
cp btextras.img BTExtras/
umount BTExtras
Now copy btextras.img over to the same directory as the bt.img on your phone.

You will now need to edit the startbt and stopbt scripts in that same folder.

Add the following lines to startbt:

Directly after line 15: "$bboxpath mknod /dev/block/loop253 b 7 253"
Directly after line 18: "$bboxpath losetup /dev/block/loop253 $kit/btextras.img"
Directly after line 21: "$bboxpath mkdir $mnt/extras"
Directly after line 22: "$bboxpath chmod a+rwx $mnt/extras -R"
Directly after line 23: "$bboxpath mount -t ext2 /dev/block/loop253 $mnt/extras"
And add the following lines to stopbt:

Directly after line 18: "$bboxpath umount -l $mnt/extras"
Directly after line 19: "$bboxpath rm -r $mnt/extras"
Directly after line 23: "$bboxpath losetup -d /dev/block/loop253"
With the above changes done, and with Qemu finally installed on Backtrack, it would now be worth restarting your phone after exiting Backtrack.
Once the phone has restarted, you can now reload Backtrack.

Within Backtrack, open Terminal and cd to /extras. Once here, run the following command:

/usr/local/bin/qemu -m 256 -hda winme.img -vnc :2
To explain the above command, the "-m 256" specifies the amount of memory to provide the emulator, "-hda winme.img" specifies the image to use as the hard drive, and "-vnc :2" specifies the port to use (2 + 5900 = actual port to use) for vnc which also allows for connecting to the vnc over the network.
The command will appear to "hang" the system, but if you open up a vnc client on your phone, you can connect to Windows ME with the address of and port 5902.

Hopefully everything runs smoothly, but if you have any problems setting this up then let me know.

Known Problems

- When VNC'ing into Windows (or any other OS emulated with Qemu), the host and local mouse are out of sync.
- Emulation is very slow.
- Currently no network connection (Working on this)
- Also looking at running Qemu from within Android, removing the need for Backtrack.
Attached Thumbnails
Click image for larger version

Name:	IMG_20110917_213244.jpg
Views:	7080
Size:	94.6 KB
ID:	722736  
The Following 9 Users Say Thank You to Akez42 For This Useful Post: [ View ] Gift Akez42 Ad-Free
17th September 2011, 11:10 PM |#2  
anshmiester78900's Avatar
Senior Member
Flag Noida
Thanks Meter: 491
hey nice share man thanx ..!!
17th September 2011, 11:49 PM |#3  
Senior Member
Flag Wellington
Thanks Meter: 271
Donate to Me
Why choose WinME, the most orphaned of all Windows versions?

Impressive effort though.
18th September 2011, 12:35 AM |#4  
OP Junior Member
Thanks Meter: 12
I did XP but it was practically unusable. Im gonna look at slimming xp out to see if i can speed it up!

Sent from my GT-I9100
The Following 2 Users Say Thank You to Akez42 For This Useful Post: [ View ] Gift Akez42 Ad-Free
18th September 2011, 12:36 AM |#5  
Senior Member
Flag Bratislava
Thanks Meter: 151
Originally Posted by knightnz

Why choose WinME, the most orphaned of all Windows versions?

Impressive effort though.

because other windows versions require x86 compatible cpu.
The Following User Says Thank You to xeq544 For This Useful Post: [ View ] Gift xeq544 Ad-Free
18th September 2011, 02:13 AM |#6  
Senior Member
Thanks Meter: 28
Now try windows 8
The Following User Says Thank You to nraudigy2 For This Useful Post: [ View ] Gift nraudigy2 Ad-Free
18th September 2011, 03:11 AM |#7  
Senior Member
Thanks Meter: 96
Originally Posted by xeq544

because other windows versions require x86 compatible cpu.

And Windows ME doesn't?
18th September 2011, 04:16 AM |#8  
dhruvmalik's Avatar
Senior Member
Chicago / India
Thanks Meter: 487
Because Windows ME was the last OS to be based upon FAT32, its leaner. 2000, XP, 2003 and going up all were NTFS based.
18th September 2011, 05:34 AM |#9  
ThisWasATriumph's Avatar
Senior Member
Thanks Meter: 168
You should try microxp or tinyxp. They're super slimmed. Microxp runs with 45mb of ram.
The Following User Says Thank You to ThisWasATriumph For This Useful Post: [ View ] Gift ThisWasATriumph Ad-Free
18th September 2011, 10:51 AM |#10  
OP Junior Member
Thanks Meter: 12
Originally Posted by ThisWasATriumph

You should try microxp or tinyxp. They're super slimmed. Microxp runs with 45mb of ram.

Thanks, that has saved me some work! Will try these and let you know how it goes

Sent from my GT-I9100
18th September 2011, 11:17 AM |#11  
Junior Member
Thanks Meter: 2
What about windows 8? there is a free developer version available and it should (i think) support galaxy s2 processor.. and about the ram. it has been proved it can run on 128 RAM.
The Following User Says Thank You to Cristitamas For This Useful Post: [ View ] Gift Cristitamas Ad-Free
Post Reply Subscribe to Thread

android, backtrack, qemu, windows

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes