Skip to content
/ bvm Public

User friendly, high performance Windows 11 Virtual Machine on ARM Linux

License

Notifications You must be signed in to change notification settings

Botspot/bvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BVM

Botspot Virtual Machine - Windows 11 QEMU KVM on ARM Linux

20250226_23h09m13s_grim
It's ready for beta testers. Please report good and bad results. Do not assume I am already aware of an issue, unless you can find it in Issues, in which case please comment with something like "I'm having this problem too."

What to expect:

  • A full Windows 11 ARM virtual machine on ARM Linux. Thanks to KVM, this uses virtualization instead of emulation, resulting in no significant speed difference compared to installing Windows directly.
  • A first-class setup experience. None of the usual sticking points are present here - everything is automated, even Windows setup and debloating.
  • It uses network passthrough to the Linux network stack, so Ethernet and WiFi all work out of the box.
  • It uses audio passthrough to pipewire/pulseaudio/ALSA, so audio playback (and probably microphone input) works out of the box.
  • The VM uses less than 1GB of RAM and minimal CPU when not in use, leaving plenty of resources free for Linux applications.
  • The connect mode gives the VM access to files stored on Linux, and any changes are immediately synchronized. (Go to This PC and look for the home network share)
  • It is capable of USB passthrough - any USB device can be made to directly communicate with Windows. (Edit the config file to specify which USB devices to passthrough)
  • Thanks to Microsoft's built-in Prism emulator, all Windows applications should work, including x86 and x64. Compare that to Wine, which fails on everything but old, simple programs.
  • The graphics are snappy and quicker than you would expect, at least with the connect mode on Wayland on a Pi 5. Youtube and lightweight web games are actually somewhat playable without any overclocking or extra tweaks.

What not to expect:

  • A gaming rig. For now there is no graphics acceleration, so 3D features and WebGL won't work. That could change once somebody figures out virtualized graphics that talk to Vulkan. (see "Other Notes" below)

Get started:

git clone https://github.com/Botspot/bvm
bvm/bvm help

Or, install BVM from Pi-Apps. It does the same thing, but makes it easier to uninstall. BVM will stay updated no matter which way it is installed.

Click to see what BVM does on first run.

BVM will installl some dependencies. At the time of writing these are:

git jq wget genisoimage qemu-utils qemu-system-arm qemu-system-gui qemu-efi-aarch64 remmina remmina-plugin-rdp nmap wget yad uuid-runtime seabios ipxe-qemu wimtools
#and either
wlfreerdp
#or
xfreerdp
#depending on your desktop display setup

If you are on Arch or some other non-standard OS, you will need to install these manually. Hey Arch users: If you want to help out, consider changing the install_dependencies function in the bvm script to install dependencies, then send it to me in a Pull Request or something. I would love to support Arch but I don't use Arch.
If Debian Bookworm is detected, BVM will set up the bookworm-backports APT repository in order to upgrade QEMU from 7.2 to 9.2. Version 7.2 does work, but it is missing pipewire audio output support, and besides, everyone knows newer is always better! If you have a good reason to not want bookworm-backports, please open an issue, explain why, and I may be willing to change this behavior.

BVM also makes some icon symlinks in ~/.local/share/icons/hicolor/scalable/apps to set the GUI's taskbar icon, and to override the QEMU and FreeRDP taskbar icons. If this does not work on your distro, or if you do not like this feature, please get in contact with me.
BVM now adds a menu launcher to ~/.local/share/applications/bvm.desktop in the Office category to run the GUI. Contact me if you can make an argument that it belongs in a different category.
BVM symlinks itself to ~/.local/bin/bvm so it can be run in a terminal with a simple invokation of bvm.

Usage instructions

Read the help message and follow the instructions. BVM has simplified the VM-creation process to a tidy sequence of completely automated steps. Between each step you have the opportunity to change what is happening, modify the config file, retry a step, or do whatever else you want. This split-step approach helps enable better learning about how it works, adjusting how it works, and creating new features on top.

To get a fresh VM up and running, use a sequence like this:

  • bvm/bvm new-vm ~/win11
    This makes a config file: ~/win11/bvm-config <--- Please read the config file!
  • bvm/bvm download ~/win11
    This downloads Windows and necessary drivers.
  • bvm/bvm prepare ~/win11
    This bundles everything up to get ready for first boot.
  • bvm/bvm firstboot ~/win11
    This boots the Windows installer, installs Windows and some drivers, sets up a local user account, and debloats the OS. Please allow it to complete all steps automatically. When Windows finishes installing, the VM will shut down. Once it's done, you can delete all .iso files and the unattended folder from ~/win11 to reclaim some storage space.
  • bvm/bvm boot ~/win11
    Main command to use the VM. While this does work, it's a little laggy and lacks crucial features. No copy and paste transfer, no resizable screen. It is recommended to boot the VM headless and then connect to it via RDP. (keep reading)
  • Boot Windows headless, without a screen:
    bvm/bvm boot-nodisplay ~/win11
  • Then in a second terminal, connect to the RDP service:
    bvm/bvm connect ~/win11
    The connect mode has:
    • Better audio.
    • Clipboard synchronization.
    • File sharing. (Your home folder and any external drives are accessible from This PC)
    • Dynamic screen resizing.
    • Higher performance graphics.
    • Disconnecting for 60 seconds will log out, allowing Windows to stay running but use negligable CPU and RAM. When you need to use Windows again, connecting will log back in. Splendid!
      Note: if it freezes on login, try connecting with Remmina instead of FreeRDP with the connect-remmina mode.
  • Mount the Windows main hard drive with:
    bvm/bvm mount ~/win11
    Direct file access can be useful for troubleshooting and further debloating. Be aware: if the VM was not shut down properly, the files will mount read-only.

Full list of modes: new-vm, download, prepare, firstboot, boot, connect, mount, help, list-languages, boot-nodisplay, boot-ramfb, boot-gtk, connect-freerdp, connect-remmina, gui
That last one there deserves a mention. BVM has a graphical user interface.
image
Run the GUI:

bvm/bvm gui

Or open the applications menu, go to Office, click Botspot Virtual Machine.
Right now it is quite simplistic, but functional. It might stay that way, it might not. Much of BVM's future depends on how much of an impact it makes in the community. If nobody uses BVM, then I will stop working on it and find a new project.

Tips:

  • Use an ARM 64-bit Linux OS with the kvm kernel module enabled. This is a hard requirement.
  • Use Wayland. This is not a hard requirement, but it makes a big difference.
  • Use ZRAM to avoid running out of RAM as easily. This is basically a hard requirement if you have a 1GB or 2GB Pi model, but strongly recommended everywhere. Instructions here.
  • Use Debian Bookworm or a new-ish Ubuntu image. Debian Bullseye may or may not work. If you try it, please let me know how it went. Maybe it works fine.
  • Your VM can be a folder anywhere, so it could be on an external SSD drive, or even network storage if you wanted. If you encounter issues with sparse preallocation, let me know and I can add a fallback case to do full preallocation.
  • If you are using the boot-nodisplay with connect modes, the VM could boot in the background every time you log in to Linux. Use Autostar for this.
  • Encounter an issue? Open an issue. Deal? Deal. :)

Other announcements:

  • Gratitude: Thanks to Jeff Geerling and Leepspvideo for featuring BVM in their videos just 2 days after release day!
  • Pi 4 working: After this commit, for hardware that lacks A76 CPU cores, such as the Raspberry Pi 4 and other SBCs, Windows 11 version 22631.2861 will be downloaded instead of the most recent public release. This is because the latest Windows 11 requires some extra CPU instructions.
  • RockChip RK3588 working: BVM is now configured to use only the performance cores, making it theoretically functional on Rock Pi 5, Orange Pi 5, and many other single board computers that use this CPU. (Tested by 1 Orange Pi 5 user. If you test it, please get in touch)
  • Other devices: BVM has the potential to work on all modern ARM Linux distros and CPUs. It should be easy to support more SBCs, but I only own Raspberry Pi boards. Contact me if you have an ARM system not mentioned here - getting it working should be fairly straightforward.
  • RAM allocation improvements: If you encountered this error on or before February 27th: bvm/bvm: line 662: 38680 Killed qemu-system-aarch64, it should be fixed now. I restructured how RAM allocation works to try to prevent the Out-Of-Memory killer from activating. The VM now dynamically adjusts its RAM usage once per second to always leave a bit free for Linux. On linux your RAM will always look nearly full, but there is actually plenty to spare, the moment you need it.
  • Expertise wanted: If you have past experience with QEMU, I would like to ask for your ongoing help to help build out more features. Surely somebody will want to do serial passthrough, bluetooth passthrough, or something really specific that I will have no idea how to implement.
  • Windows 10 support: It's possible, but I see little value in adding an option for it. If you have some solid reasons, I would be willing to change my mind, so please get in touch.
  • USB passthrough: Now available. Adding this feature took a bit longer than I expected, but it's here now and works well. Edit the config file to set the new usb_passthrough variable. Everyone who set up BVM before this change needs to read the latest version of bvm-config and copy those lines in.
  • GPU driver: Full 2D/3D acceleration may be possible using virtualized graphics that talk to Vulkan or OpenGL. I found this unfinished series of PRs spanning multiple projects that seems promising. Read about how various graphics options can work here. Not all apply to ARM. This other virtualized graphics code repository may be more mature. If someone reading this is "actually good" with "real programming languages," (instead of only knowing shell script like me) feel free to compile it and check if it works on ARM. (And let the community know how it goes!)
  • RemoteApp: One exciting possibility is the chance to break out individual windows programs and integrate them directly into the linux desktop, using a RDP mode called RemoteApp. See a screenshot of this here. Unfortunately it is very inconsistent right now, and I deemed it too unstable to include as a feature at the moment.

Ask me anything!

  • Who made this?
    I'm Botspot, a college student, bash scripter, Raspberry Pi user, and founder of Pi-Apps and WoR-Flasher. If you met me in real life you would just see a friendly kid. On a more personal note, I have had a lot of family drama lately and am in need of financial support. Read more here.
  • Is this legal?
    Yes. By default the VM uses a free license key provided by Microsoft for virtual machines. Read the files in resources/ for more details.
  • Is this unique?
    Yes. Before BVM there existed no tool, or even decent tutorial, to do any of this. Other projects share some similar ideas though. The QuickEMU project probably comes closest, but it is not ARM-compatible. There is also the UTM project, which apparently has some level of ARM support. Of all the unique features here, the most unique in my opinion is the extent to which it is automated. I could string the main modes back to back, walk away, and come back in a few hours to see a fully-installed VM ready to use.
    Before this, you would need to watch over it and press a key in a 5-second time window to boot the installer, deploy some registry workarounds, then navigate through the installation steps, and debloat the OS later. BVM bypasses the keypress by patching the Windows installer ISO in a very unconventional way, (see the patch_iso_noprompt function), bypasses the installation steps and registry workarounds with an autounattend.xml file, and removes the bloatware using a couple PowerShell scripts. To my knowledge, nothing else can do all of that with zero human intervention.
  • Why did you make this?
    First, it will benefit me personally quite a bit over the long term. As a die-hard Raspberry Pi user without convenient access to another computer, with BVM I now have an alternative to Wine when I need to run a Windows-only program, such as Lego Mindstorms or Microsoft Office.
    But also, I genuinely want to help you all out wherever possible. The ARM desktop community is special, but small. The more daily users we can keep around, the better the community can become for everyone. Some will oppose the promotion of a Microsoft product, saying it defeats the point of FOSS. But for most folks, it's either Linux with compromise, or no Linux at all. If we want a growing userbase, we should strongly support any project that brings a great Linux desktop experience to all beginner users.
  • What was the timeline for making this?
    I have wanted to do a KVM Windows VM on a Pi ever since I was a high-schooler with a Pi 3, so 5+ years. The task is not trivial, and no good tutorials exist. Occasionally someone would get it working, but leave behind very incomplete instructions and not respond to questions. While I gave it a try every year or so, with partial success, I never "cracked" the code completely until this month (February 2025) when I made up my mind to sit down and figure it out. This has been a multi-week effort of near total dedication, with a number of all-night coding sessions. It became an obsession.
    Sidenote: This would have exceeded my capabilities without ChatGPT, especially the Windows automation stuff. Anyone who says LLMs are useless is wrong.

If communication on github is not your thing, join my Discord server!

About

User friendly, high performance Windows 11 Virtual Machine on ARM Linux

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •