Skip to content

Instantly share code, notes, and snippets.

@tejasraman
Last active February 17, 2025 15:27
Show Gist options
  • Save tejasraman/beb15feae2bbfef950d4709df2bddd66 to your computer and use it in GitHub Desktop.
Save tejasraman/beb15feae2bbfef950d4709df2bddd66 to your computer and use it in GitHub Desktop.
Install ChromeOS in QEMU (Windows)

Installing ChromeOS Flex (hardware accelerated) on QEMU for Windows

A word of warning. This will be slow and buggy. Do not attempt to use this as a daily driver.

Requirements:

  • Windows 10 or 11 (x64)

Download Files:

  • Download QEMU
  • Download ChromeOS Flex (remember to download the file; do NOT use Chromebook Recovery Utility)
  • Download Windows Terminal (if on Windows 10, included on 11)

Steps:

  • Enable Windows Hypervisor Platform from Control Panel and reboot

  • Install QEMU. Make sure "Tools" is enabled.

  • Open the Start menu and search for "Edit environment variables for your account". Click "Path", "Edit", "New" and then type C:\Program Files\qemu

  • Log out and log back in (to load the PATH variable)

  • Create a directory on yout system to store all your files. Move the downloaded Flex zip to this folder and unzip it. You will see a .bin file. Enable showing file extensions in your Explorer for this part

  • Right-click inside the folder and click "Open in Terminal". You will see a PowerShell window.

  • Type qemu-img create -f vdi flex.vdi xG (x represents number of GB)

  • Rename the .bin to cros.raw (Ctrl+A to select file extension)

  • Type 'C:\Program Files\qemu\qemu-system-x86_64.exe' -vga virtio -m 8G -drive file=flex.vdi,format=vdi,index=1 -accel whpx,kernel-irqchip=on -drive file=cros.raw,format=raw,index=0 -device qemu-xhci -device usb-kbd -smp x (where x is a number of cores (if you have a 4c/8t use 4)

  • Click "Install" and install to the vdi

  • Next boot, type 'C:\Program Files\qemu\qemu-system-x86_64.exe' -vga virtio -m 8G -drive file=flex.vdi,format=vdi,index=0 -accel whpx,kernel-irqchip=on -device qemu-xhci -device usb-kbd -smp x to boot into the VDI.

  • Profit (or not; this will be laggy. Flags: disabling 2d canvas accel will help a LOT and using the "new" blur engine in high res does too.)

(If you have an Intel CPU, you can use HAX accel which will be faster (replace whpx with hax after installing intel Android tools)

@tejasraman
Copy link
Author

why? is it not supported anymore?

Yeah but it still works well...

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

any idea why it would be unsupported in newer versions?

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

if i install it it will overwrite the modern version right

@tejasraman
Copy link
Author

any idea why it would be unsupported in newer versions?

It isn't supported on some Intel CPUs (because intel decided not to support haxm anymore). Your 13700F will work with it

@tejasraman
Copy link
Author

if i install it it will overwrite the modern version right

yes

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

oh

@tejasraman
Copy link
Author

if i install it it will overwrite the modern version right

yes

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

I downgraded but it's still giving C:\Program Files\qemu\qemu-system-x86_64.exe: -accel haxm: invalid accelerator haxm

@tejasraman
Copy link
Author

When you run 'C:\Program Files\qemu\qemu-system-x86_64.exe' --version what do you see?

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

image

@tejasraman
Copy link
Author

my fault, the accelerator should be set to hax (-accel hax) as that is haxm in this case

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

image

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

do i need to setup enviroment variables or something?

@tejasraman
Copy link
Author

You shouldn't need to - did you install haxm and reboot?

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

Yeah i rebooted idk why its not working

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

PS C:\flexfilesinc> & 'C:\Program Files\qemu\qemu-system-x86_64.exe' -vga virtio -m 8G -drive file=flex.vdi,format=vdi,index=0 -accel hax -device qemu-xhci,id=usb-bus -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 -smp 4
Failed to open the HAX device!
Open HAX device failed
Failed to get Hax capability:6u
No accelerator found.
C:\Program Files\qemu\qemu-system-x86_64.exe: -accel hax: failed to initialize hax: Invalid argument
PS C:\flexfilesinc>

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

do i need to disable hyper v?

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

pretty sure it is disabled

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

wait how do i enable it

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

image

@tejasraman
Copy link
Author

That's already correct
I'm legitimately confused about why it isn't working

@tejasraman
Copy link
Author

If you want whpx to work the windows hypervisor platform has to be enabled

@tejasraman
Copy link
Author

I'm not at home right now but when I get an opportunity I'll try haxm out

@FoxYolk
Copy link

FoxYolk commented Dec 26, 2024

oh ok thanks

@tejasraman
Copy link
Author

-accel whpx

what happened?

@FoxYolk
Copy link

FoxYolk commented Feb 17, 2025

did not work 😭

@JE6XKC
Copy link

JE6XKC commented Feb 17, 2025

qemu-system-x86_64.exe -display sdl,show-cursor=on,gl=on -device virtio-vga-gl,xres=1366,yres=768 -m 4G -drive file=flex.vdi,format=vdi,index=0 -accel whpx,kernel-irqchip=on -device qemu-xhci -device usb-tablet -smp 4 -audiodev sdl,id=audio0 -device intel-hda -device hda-output,audiodev=audio0 -cpu host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment