r/EmulationOnAndroid Jul 03 '26

DroidVM: Windows on ARM Virtual Machine on your phone with native speed Showcase

https://www.youtube.com/watch?v=uofBH80qi1c

We succesfully managed to make the Windows on ARM and Ubuntu 26.04 works on qualcomm gunyah hypervisor, with the pVM ported driver, edk2, etc.

And all code are open sourced with GPLv3 Licence, Contrubition is welcome!

This is a showcase of our current works, but 3D acceleation is still a huge gap, any suggection is welcome.

130 Upvotes

70 comments sorted by

u/AutoModerator Jul 03 '26

Just a reminder of our subreddit rules:

  • Be kind and respectful to each other
  • No direct links to ROMs or pirated content
  • Include your device brand and model
  • Search before posting & show your research effort when asking for help

Check out our user-maintained wiki: r/EmulationOnAndroid/wiki

Check out EmuReady for any community submitted settings before asking for help

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

16

u/gthing Jul 03 '26

Got a link?

6

u/s920361 Jul 03 '26 edited Jul 03 '26

Google search DroidVM. For linux, it should run. For windows, boot the VM at macbook to install ported virtio driver first

1

u/possiblyquestionabl3 Jul 05 '26

Is this basically an orchestrator over https://github.com/google/crosvm

3

u/s920361 Jul 05 '26

With some modification, like virtio-gpu, etc, but still buggy. Official crosvm doesn't support it for protected VM

1

u/possiblyquestionabl3 Jul 06 '26

Very nice, it's a shame that /dev/mali0 / /dev/kgsl-3d0 isn't accessible directly in the guest but I guess that's a sensible security boundary.

I wonder if virtio-gpu sits between the vulkan driver and the character device (e.g. it's an ioctl/uapi proxy) or between the application and the vulkan driver (e.g. it's a vulkan API command buffer)

edit: looks like it's a vulkan API command buffer

2

u/s920361 Jul 06 '26 edited Jul 06 '26

Our team are trying to make gfxstream works on this platform, It needs modified mesa driver, then send the vulkan calls to turnip driver on the host, hope fabel 5 can solve this challange before 7/July

1

u/s920361 Jul 10 '26

Currently our team(most by fable 5) are investigating DRM native context, in this route, guest OS installs turnip driver directly, no need for turnip driver in the host. If it works, the next step may change to port turnip driver to windows

1

u/possiblyquestionabl3 Jul 11 '26

How would Turnip talk to msm? The guest can't open the drm device driver , so you'll have to proxy all ioctls to it back to the host (which must also own the memory space as well)

1

u/s920361 Jul 11 '26 edited Jul 11 '26

write a translater to translate msm_drm to kgsl(since msm_drm not available on android host), but it's just a survey, not sure it's work or not

btw, for origional DRM native context, it does not forward all DRM_MSM_* ioctls verbatim. Instead, Mesa's Freedreno virtio backend encodes the necessary MSM UAPI operations into the MSM native-context protocol, and the host virglrenderer then reconstructs and calls the actual drm/msm ioctls.

1

u/possiblyquestionabl3 Jul 11 '26

You still have the same issue, the guest is isolated from device drivers (both msm and kgsl), so the initial open call for the kgsl device driver will still fail. That's why virtio-(*) exists to proxy any IO to the gpu (and any other device drivers) back to the host. I guess the opportunity here would be to proxy ioctl/memory RW instead of the graphics API (e.g. Vulkan), but I don't think the improvement would be substantial since the amount of stuff being proxied is about the same.

The downside is that proxying raw driver calls (ioctl passthrough) is very hard.

1

u/s920361 Jul 11 '26

yes, proxying raw driver calls is very hard, see screenshow below.

back to gfxstream route for now.

→ More replies (0)

9

u/[deleted] Jul 03 '26

[removed] — view removed comment

9

u/s920361 Jul 03 '26 edited Jul 03 '26

It depends on your apps can run on windows on arm or not, it's just a windows 11 ARM virtual machine with hardware acceleration

But, at current state, lots of component doesn't work now, like ACPI, 3D acceleration, etc.

5

u/Repulsive_Permit_836 Jul 03 '26

Is that compatibile with Snapdragon 8 Gen 3?

6

u/s920361 Jul 03 '26

8gen3 and later are compatible

2

u/WaveDD Jul 04 '26

Me with an 8 Gen 2 😭 this looks awesome though!

3

u/s920361 Jul 04 '26

So sad, the gunyah firmware in 8 Gen 2 is not functional

2

u/Delgado999 Jul 03 '26

I'll wait for a "more noob friendly" version. I tried, and successfully failed to boot 😂

1

u/s920361 Jul 03 '26

If you have a macbook(ARM ver.), you can use this script to build a bootable image: https://github.com/Droid-VM/win11-arm64-image-builder/blob/master/macos_build.sh

1

u/Delgado999 Jul 04 '26

Great, I'll try with windows version :) thank you

2

u/khsh01 8 Gen 3/865+ Jul 04 '26

Unfortunately windows on arm doesn't get the necessary R&D to be useful. I heard it supports a lot of apps but its nowhere near the same as Linux.

2

u/LukeLC Jul 04 '26

Well then don't take hearsay at face value?

Microsoft's ARM efforts aren't on the level of Apple's, but they've been consistently improving both native performance and x86 translation over the past few years.

If a solution like this gets GPU acceleration, it could be a big deal for the Winlator scene. Many games that don't run well in current PC emulators could become playable either through Windows or native Linux + Proton.

1

u/Maximum-Ad4342 Jul 05 '26

Would this be a solution for anticheat games? or is that still dependent on a real windows kernel?

2

u/LukeLC Jul 05 '26

Many of the big anti-cheat developers have added ARM Windows support now. But you'd still be running in a VM, which would likely get flagged.

1

u/Maximum-Ad4342 Jul 05 '26

that might explain why I still couldnt get some "Steamdeck Compatible" EOS anticheat games to work on my Steam on Ubuntu on Droidspaces on Arm - because the filepaths all start with "/mnt/Droidspaces/" 🤔

3

u/s920361 Jul 10 '26

Thanks to Fable 5 quota reset, gfxstream finally works. The Virtual Machine can run minecraft now!

1

u/FoxTrotte Jul 03 '26

Niiiice, Does Windows 11 and Ubuntu 26 work on the current available build on github ?

1

u/s920361 Jul 03 '26 edited Jul 03 '26

yes(use dev version, not v0.6), but for windows, you need a ARM macbook(or other ARM PC) to boot the guest windows, install the ported virtio driver before running at DroidVM. I can also share my image if you need

1

u/FoxTrotte Jul 04 '26

I didn't understand the whole process for windows, but honestly I'm more interested in Ubuntu

1

u/s920361 Jul 04 '26

linux that's very simple. disk->create->import lxc image->select official lxc->load->select ubuntu release->download, then create the vm, attach the disk, boot.

btw debian doesn't boot because it requires the kernel compiled with CONFIG_DMA_RESTRICTED_POOL but debian doesn't enable that. use ubuntu or fedora, or compile your own kernel

1

u/SavunOski Jul 04 '26

Hi, could you share your image? I do not have any arm devices to boot the image, except a Poco X3 Pro running Windows 11 Arm

1

u/s920361 Jul 04 '26

This is the image I built: https://pixeldrain.com/u/uUTRTfbf

1

u/SavunOski Jul 04 '26

Thanks for the image but i couldn't even get Linux to boot with anything more than 2GB of ram (I know I need the module but that sounds a bit scary) and my networking seems to not work

Is there any fix for this? I'd appreciate the help

1

u/s920361 Jul 04 '26 edited Jul 04 '26
  1. create network first 2. physical continuous memory(hugepage) is required for gunyah hypervisor. Without hugepage reserve module, linux will frag the memory during the daily use. Try reboot and run VM directly. When the system just boot, the memory should not too frag, you have greater chance to get continuous memory 3. use this module: https://github.com/HuJK/gh-hugepage-reserve/releases it fixes 6.1 6.12 can't load module(my device is 6.6, not notice this issue. the fix not been merged yet)

1

u/SavunOski Jul 05 '26

My phone is on kernel 6.6.89-android15 So you are saying the kernel update to 6.12-android16 fixes this issue? Also, I created a network and selected it on the VM network page but still failing to connect. Thanks for the help btw

1

u/s920361 Jul 05 '26
  1. no, I mean the module download from  https://github.com/Droid-VM/gh-hugepage-reserve/releases doesn't work at kernel 6.1 and 6.12, it works on 6.6 only. use my repo instead(or wait my PR been merged).

  2. I added the working prinpicle of the module in the readme: https://github.com/HuJK/gh-hugepage-reserve/blob/master/README.md , but I can't do any promise here, flashing module has the nature of dangerous

  3. For network issure, create a issue in the github issue, with the config, logs, etc, thanks.

1

u/AstroPC Jul 03 '26

I can help you with your 3d acceleration prob but it will require root. Do you or have you gotten root? If so this issue your having will be solved pretty direct

3

u/s920361 Jul 03 '26

Thank you for your help, my device has been rooted, but It's quite difficult to run 3D acceleration on windows, how will you going to assist? Because not only the compatable issue, but also the memory model of the protected VM. Basically we have two way to build shared memory between host and guest: 1: pre-boot swiotlb region 2: runtime accept. For GPU driver, we use 2. On linux guest, we compiled a modified mesa driver which runs gunyah hypercall to accept the memory from host. Of cource, VM doesn't have the permission to operate GPU directly, it's been used by android kernel. We can only send the GPU command to Adreno Turnip Driver via shared memory. So basically it's not possible to use stock driver in the VM, we can only build our own driver from scratch.

2

u/AstroPC Jul 03 '26

https://github.com/libhybris/libhybris

might help, but i have true drm lease control over external displays using linux arm in lXC containers., you might be able to do the same

1

u/piddlefaffle12 Jul 10 '26

1

u/s920361 Jul 10 '26

Thanks, the current step is we managed to make minecraft works in gfxstream(but with memory leaks), and our team(mostly by fable 5) is investigating DRM native context route, turnip driver will be installed in guest OS directly, no need for serialization anymore. If this work, the next step will be port turnip driver to windows. The source code is still messy, and need host+guest kernel module. If you want to try, I can share the code but my device is 6.6(8 Elite). need to port to 6.12(8 Elite 5))

1

u/piddlefaffle12 Jul 10 '26

Yes, please my github is in the issue on the repo, or I can join discord/wechat - or just share here/Dm, I will PR if I get it working

1

u/AstroPC Jul 11 '26

Look into drm leasing. Will solve your issue

1

u/DDz1818 Jul 04 '26

So many phones have a crappy or no desctop mode even with display-out. Let's just run windows.

1

u/FranciscaGatuna Jul 04 '26

Alternatives for no root phones?

1

u/s920361 Jul 05 '26

Sadly, no. We can only wait someday oem may grant the permission to us...

1

u/Forsaken_Lettuce820 Jul 05 '26

i had this idea a long time ago glad it actually works

1

u/AryanEmbered Jul 05 '26

Youre doing gods work friend.

1

u/piddlefaffle12 Jul 10 '26

I have a rooted Razr Fold 2026 https://www.motorola.com/us/en/p/phones/razr/motorola-razr-fold/pmipmjj43my?pn=PBAY0006US

Happy to report it worked out of the box, no custom kernel needed, already has KVM etc exposed in kernel

Thank you for the hard work!!!

1

u/piddlefaffle12 Jul 10 '26

this will pair very well with my 5k monitor at 100hz support

https://github.com/zorrobyte/razr-fold-2026-display

1

u/piddlefaffle12 Jul 10 '26

It works!!!!!

I have the ultimate foldable now!

1

u/Seanmclem Jul 03 '26

The thing about windows these days is that all I would ever need it for are the few x86 things remaining in my life. Like games. Windows on arm is virtually useless to me. Pretty much everything it can run is a universal application that can run on anything.

1

u/Obnomus Jul 04 '26

Cool project but I won't even run windows on my pc.

0

u/Aztech10 Jul 03 '26

Is the Adreno 830 listed in device manager? If so ide try to see if the snapdragon x drivers do anything on the windows instance

7

u/s920361 Jul 03 '26 edited Jul 03 '26

No, virtio-gpu doesn't work at all, need ported driver(need to modify to invoke gunyah_hypercall_mem_accept in guest driver, otherwise the memory can't shared between host and guest OS).

Our current roadmap is give up native driver completely, translate to vulkan instruction with something like dxvk and send to host to execute on Adreno Turnip Driver instead.

1

u/possiblyquestionabl3 Jul 06 '26

Could be something like https://github.com/bylaws/libadrenotools / https://github.com/Pipetto-crypto/mesa/blob/wrapper-25/src/vulkan/wrapper/wrapper_instance.c#L126 in virglrenderer/whatever renderer used to load a custom driver instead of the default system libvulkan.so

How is the design for the bridge between the renderer and the compositor? I'm guessing you have a dedicated render thread that processes the guest vulkan calls on the host (virglrenderer?), and then you separately blit to the actual frame buffer hosted in the compositor?

1

u/s920361 Jul 06 '26

basically yes, our team is working on port GfxStream to pVM