FORUMS
Remove All Ads from XDA

ZF2 Running Windows 7, 8 & 10 using KVM

384 posts
Thanks Meter: 281
 
By ycavan, Senior Member on 9th July 2015, 02:25 AM
Post Reply Email Thread
Let me preface that ever since I heard of an Intel based phone, the idea of running Windows at near native speeds has always intrigued me.

It's not perfect, but I think we're very close to that goal

Here's a video of my ZE551 running Windows 7:


Edit:
Here's @knightmare running Windoze 10 on his ZF2
http://forum.xda-developers.com/show...&postcount=144

Edit:
Here's a video of my ZE551 installing Windoze 8: ( pretty boring for most people since it's just the install )


Edit:
Here's a video of my ZE551 playing ( I use that term loosely here ) a D3D9 game: Runes of Magic. Even though the Windows 8 QXL driver says it's hardware enabled in DxDiag, it's painfully slow.. taking nearly 15 minutes to start up/log in.


Edit:
Here's a video of Passmark 8 on Windows 8. Some people asked for benchmarks:

Here are the tools you will need to get this running yourself ( ZE551 ):
1. KVM enabled kernel - http://forum.xda-developers.com/zenf...piled-t3145055
2. Linux chroot - the one I use is called Linux Deploy ( in the Play Store )
3. Spice client - the one I use is called aSPICE ( in the Play Store )
4. Root - kinda duh
5. Unlocked Bootloader - without an unlocked bootloader, you can't install a new kernel
6. Terminal Emulator - the one I use is called Terminal Emulator ( in the Play Store )
7. SSH client - the one I use is called VX ConnectBot ( in the Play Store )
8. Busybox - most every root-based app uses this ( in the Play Store )
9. OS iso - any cdrom image of the OS you want to run, ie windows 7?

Optional:
1. (optional) a decent sized MicroSD card, I use a 128 gb one that's partitioned 50 gigs or so as ext4 for Linux & 70'ish gigs for vFAT
2. (optional) an SD Card partitioner - the one I use is called Aparted ( in the Play Store )

After unlocking your bootloader and getting root running, this is the process you will follow:
1. Flash the 2.19 kernel img using fastboot flash boot boot_2.19_kvm_bridge.img and reboot. Pray you boot up.
2. Start Terminal Emulator
2a. at the $ prompt, type: su
2b. Grant Permission to Terminal Emulator for Root access ( 1 time thing )
2c. check to see if kvm.ko and kvm-intel.ko are loaded by typing: lsmod
2d. If they aren't loaded, load them using the commands: insmod /lib/modules/kvm.ko and insmod /lib/modules/kvm-intel.ko
2e. exit out of Terminal Emulator by tying the command: exit and then exit again

3. Partition your microSD card using Aparted * OPTIONAL *
4. Use Linux Deploy to install your favorite Linux distro. Unless you are hoping to compile the Android AOSP kernel ( what the FHD phone kernel is ), you can use just about any of them. ONLY use SSH, you won't need framebuffer or X access. This could take upwards of half an hour.
5. After Linux Deploy has installed your linux distro, click Start to start up the chroot.

6. Use an SSH client to connect to your linux distro. ( I prefer to ssh in via my laptop, but also use VX ConnectBot when I'm out and about )
7. Use the package manager to install qemu-kvm for your distro. Most Debian & Ubuntu distros use apt-get, Arch uses pacman, Fedora uses rpm, etc...
7a. (optional) I find it easier to grant superuser privileges to my qemu-kvm executable, so I chmod a+s /usr/bin/qemu-system-x86_64 ; if you are paranoid about security, read through the documentation to do this correctly
8. I recommend creating a shell script to start up qemu-kvm because it can be a pain in the butt to remember all of the switches you like. ie...

qemu-system-x86_64 -full-screen -m 1G -enable-kvm -cpu host \
-drive file=/mnt/0/machine1.img,format=raw -boot menu=on \
--usbdevice tablet -smp 4 -vga qxl -monitor stdio -balloon virtio \
-soundhw hda -net nic,model=virtio \
-net user,smb=/mnt/MicroSD \
-spice port=5900,addr=127.0.0.1,disable-ticketing $@

I have this line ( it's broken up by \'s <-- MAKE SURE THERE IS NO WHITE SPACE AFTER THE \ ) in my bash script called start_win7.sh

Here's a quick explanation of the line:
8a. qemu-system-x86_64 - This is the name of the qemu-kvm executable on my Arch x86_64 distro
8b. -full-screen - Full screen
8c. -m 1G - 1 gig of ram for our virtual machine
8d. -enable-kvm - enable KVM, the whole point of this endeavor
8e. -cpu host - use the same cpu information as our ZF2
8f. -drive file=/mnt/0/machine1.img,format=raw - the location of my hard drive, this is a 10 gig file
8g. -boot menu=on - boot menu enabled ( hit F12 etc.. )
8h. -usbdevice tablet - Qemu SUCKS at tracking the mouse, this forces qemu to track where we touch the screen
8i. -smp 4 - we're using 4 threads ( cores )
8j. -vga qxl - we're using the qxl vga adapter
8l. -monitor stdio - allow us to use the console to make immediate changes to the VM
8m. -balloon virtio - use the virtio balloon feature in the KVM kernel
8n. -soundhw hda - use the Intel HD Audio driver for sound
8o. -net nic,model=virtio - create a network card using the virtual IO feature in the KVM kernel
8p. -net user,smb=/mnt/MicroSD - create a shared folder, in this case the vFAT portion of the microSD card
8q. -spice port=5900,addr=127.0.0.1,disable-ticketing - Start up the SPICE engine for passing video & audio
8r. $@ - pass any further arguments to our qemu-kvm executable

so my file: start_win7.sh looks like this:

#!/bin/bash

qemu-system-x86_64 -full-screen -m 1G -enable-kvm -cpu host \
-drive file=/mnt/0/machine1.img,format=raw -boot menu=on \
--usbdevice tablet -smp 4 -vga qxl -monitor stdio -balloon virtio \
-soundhw hda -net nic,model=virtio \
-net user,smb=/mnt/MicroSD \
-spice port=5900,addr=127.0.0.1,disable-ticketing $@

8s. chmod +x start_win7.sh to make it executable
9. Start up the qemu-kvm virtual machine referencing the location of your windows 7 install cd. ie...
./start_win7.sh -cdrom /mnt/MicroSD/Vcd/en_windows7.iso
9a. Qemu will start up and then show you this:
QEMU 2.3.0 monitor - type 'help' for more information
(qemu)

9b. you can then issue QEMU commands from the (qemu) prompt

10. Start up aSPICE
11. Click the OFF button to the left of Show Advanced Settings
12. Make sure Enable Sound is checked, if it isn't, do so.
13. The default connection is 127.0.0.1:5900, so click Connect

At this point, you should see your Windows install starting.

After this you will need the virtio drivers for your Windows box. I'll try to get those urls, but you should be able to Google them. Redhat has VirtIO & Spice guest driver cd's for Windows.

Redhat Windows Virtio Drivers CD: https://fedoraproject.org/wiki/Windows_Virtio_Drivers
SPICE Guest Drivers: http://www.spice-space.org/download.html ( download the QXL Driver and Spice Agent, the executable does not work )
Windows 8 QXL Drivers from Red Hat People: http://people.redhat.com/~vrozenfe/qxlwddm/

How to connect to Windows via RDP: http://forum.xda-developers.com/show...&postcount=165

Edit:

Verified that Windows 8.1 pro can be upgraded to Windows 10. Redhat's qxl windows 8 driver works with Windows 10.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2015-07-09-21-59-08.jpg
Views:	14660
Size:	106.1 KB
ID:	3398119  
The Following 110 Users Say Thank You to ycavan For This Useful Post: [ View ] Gift ycavan Ad-Free
 
 
9th July 2015, 04:07 AM |#2  
Junior Member
Thanks Meter: 0
 
More
Great job bro. This is iam waiting for using zenfone 2.Is there any sound for windows 7?
if like can i change into windows 8 or 10??.

Tq
9th July 2015, 04:10 AM |#3  
OP Senior Member
Thanks Meter: 281
 
More
Yes, there is sound using aspice if you use the Intel hd audio driver. Unfortunately, the pc link video grabber doesn't record sound. ( why there isn't audio in my video )

Since this virtual machine is simply a pc, you should be able to install Windows 8 or 10.

Please let us know how that turns out!

Sent from my ASUS_Z00AD using XDA Free mobile app
The Following 7 Users Say Thank You to ycavan For This Useful Post: [ View ] Gift ycavan Ad-Free
9th July 2015, 04:57 AM |#4  
cjvzla's Avatar
Senior Member
Thanks Meter: 22
 
More
this is amazing...this means there is a chance in the future, to run windows 10 or windows phone 10 (whenever that comes out) ? what about connecting mouse/keyboards via bluetooth? i cant wait for this to grow more! amazing work...!!!
9th July 2015, 05:38 AM |#5  
Senior Member
Flag Orléans
Thanks Meter: 32
 
More
Amazing! Care to try with Windows 10 to see how it behaves?

Seems already fast in your video, you already have ideas to make closer to native speed or it's already the best?
9th July 2015, 06:22 AM |#6  
Senior Member
Thanks Meter: 328
 
More
You've outdone yourself. A full modern Windows desktop OS in our pockets.
9th July 2015, 10:08 AM |#7  
Senior Member
Flag 台灣
Thanks Meter: 1,115
 
More
@ycavan
The very important question: What about video driver? Is it just dummy SVGA or full featured 3D graphics card?
Without Direct3D, windows for me will be nearly useless.
9th July 2015, 11:18 AM |#8  
OP Senior Member
Thanks Meter: 281
 
More
At the moment there is no direct 3d. The problem there is that my chroot doesn't seem to have proper access to all the hardware.

I've heard that the vmware driver is supposed to support d3d9 natively via gallium.

So... The next step would be to look at getting qemu-kvm compile for Android.

If any awesome Android developers out there are willing to do that, we might have a chance at full speed Windows with direct 3d.

I will say this... Epsxe was able to start up ps1 games with Pete's opengl driver via spice.

Sent from my ASUS_Z00AD using XDA Free mobile app
The Following 8 Users Say Thank You to ycavan For This Useful Post: [ View ] Gift ycavan Ad-Free
9th July 2015, 01:47 PM |#9  
itechnoguy's Avatar
Member
Flag Los Angeles
Thanks Meter: 40
 
More
I've been messing around with the Android NDK lately, and if I have time today, I can try cross-compiling qemu-kvm.
The Following 3 Users Say Thank You to itechnoguy For This Useful Post: [ View ] Gift itechnoguy Ad-Free
9th July 2015, 03:18 PM |#10  
Senior Member
Flag Puyallup, WA
Thanks Meter: 133
 
More
This type of stuff is why I love supporting the XDA Community. Very cool. I'll give it a shot today - if USB OTG works, I'll have to see if I can get my Tactrix OpenPort cable to work with it and MazdaEdit.
9th July 2015, 04:19 PM |#11  
Senior Member
Thanks Meter: 64
 
More
This is a wonderful job bro... Can we follow the same procedure on other phones (Oneplus One in my case) with a kernel that supports KVM?
Post Reply Subscribe to Thread

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

Advanced Search
Display Modes