Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,728,832 Members 50,442 Now Online
XDA Developers Android and Mobile Development Forum

Windows on Samsung Galaxy S2

Tip us?
 
Akez42
Old
(Last edited by Akez42; 17th September 2011 at 11:41 PM.)
#1  
Junior Member - OP
Thanks Meter 12
Posts: 18
Join Date: Aug 2011
Default Windows on Samsung Galaxy S2

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.

Code:
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:

Code:
./configure
make
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):

Code:
./configure
make
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:

Code:
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)

Code:
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:

Code:
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:

Code:
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:

Code:
/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 127.0.0.1 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:	6656
Size:	94.6 KB
ID:	722736  
The Following 9 Users Say Thank You to Akez42 For This Useful Post: [ Click to Expand ]
 
anshmiester78900
Old
#2  
anshmiester78900's Avatar
Senior Member
Thanks Meter 410
Posts: 2,747
Join Date: Dec 2010
Location: Noida
hey nice share man thanx ..!!
 
knightnz
Old
#3  
Senior Member
Thanks Meter 243
Posts: 1,572
Join Date: Dec 2009
Location: Wellington

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

Impressive effort though.
---

Spelling essentials:
1) There is NO SUCH WORD as "alot" - It's "a lot"
2) The shortened form of You are is You're - NOT Your
3) Loosing & Loose have completely different meanings to Losing & Lose.
 
Akez42
Old
#4  
Junior Member - OP
Thanks Meter 12
Posts: 18
Join Date: Aug 2011
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: [ Click to Expand ]
 
xeq544
Old
#5  
Senior Member
Thanks Meter 135
Posts: 235
Join Date: Nov 2010
Location: Bratislava
Quote:
Originally Posted by knightnz View Post
Why choose WinME, the most orphaned of all Windows versions?

Impressive effort though.
because other windows versions require x86 compatible cpu.
S3
The Following User Says Thank You to xeq544 For This Useful Post: [ Click to Expand ]
 
nraudigy2
Old
(Last edited by nraudigy2; 18th September 2011 at 01:19 AM.)
#6  
Senior Member
Thanks Meter 27
Posts: 482
Join Date: Sep 2010
Now try windows 8
The Following User Says Thank You to nraudigy2 For This Useful Post: [ Click to Expand ]
 
Logi_Ca1
Old
#7  
Senior Member
Thanks Meter 91
Posts: 430
Join Date: Jun 2011
Quote:
Originally Posted by xeq544 View Post
because other windows versions require x86 compatible cpu.
And Windows ME doesn't?
 
dhruvmalik
Old
#8  
dhruvmalik's Avatar
Senior Member
Thanks Meter 435
Posts: 1,080
Join Date: Dec 2007
Location: Chicago / India
Because Windows ME was the last OS to be based upon FAT32, its leaner. 2000, XP, 2003 and going up all were NTFS based.
Satisfied With My Comment? Hit That Thanks Button
 
ThisWasATriumph
Old
#9  
ThisWasATriumph's Avatar
Senior Member
Thanks Meter 153
Posts: 590
Join Date: Aug 2010
Location: Detroit
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: [ Click to Expand ]
 
Akez42
Old
#10  
Junior Member - OP
Thanks Meter 12
Posts: 18
Join Date: Aug 2011
Quote:
Originally Posted by ThisWasATriumph View Post
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

Tags
android, backtrack, qemu, windows
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes