How to Virtualize Chrome OS Flex on a VM (QEMU/KVM)
Chrome OS Chrome OS Flex Guide Installation QEMU WalkthroughHi all, welcome to my blog, MusaBase! In this comprehensive walkthrough, I'll guide you through virtualization of Chrome OS Flex on QEMU (Quick Emulator) in Linux. I am using Arch Linux btw, but you can achieve the same on almost every Linux distribution's.
It might be challenging, but i assure you that if you follow each step in this walkthrough, you'll have a fully functional virtual machine with Chrome OS Flex installed and running by the end.
In this tutorial, we'll learn steps like creating a virtual machine, attaching virtual disk to our VM, running and installing Chrome OS Flex on the VM.
Limitations and Caveats
Chrome OS Flex is designed to be installed directly onto physical hardware specifically, PCs and Macs, to revitalize older devices. Although it can be run in virtual machines, this is not its intended use case, and Google does not officially provide full support for it in a virtual enviornmnet. Furthermore, there are additional limitations with this setup: for example, you cannot run a Linux development enviornmnet within it because doing so require nested virtualization, and successful operation is not guaranteed.
Prerequisites for Running Chrome OS Flex on a Virtual Machine
Running Chrome OS Flex on a virtual machine is straightforward, though the process differs from installing it on physical hardware. Instead of booting from a USB drive, you'll need to create a virtual drvie (for installing Chrome OS Flex) and configure your VM to boot from the Chrome OS Flex recovery image. This approach allows you to test and get familiar with Chrome OS Flex in a safe virtual enviornmnet before considering any physical deployment.
Before proceeding, ensure your PC meets the following hardware requirments:
- Processor: Intel or AMD x86-64-bit compatible.
- Ram: 8GB or 16GB.
- Hard-Drive: Allocate at least 16GB for Chrome OS Flex, plus additional space based on your needs.
- Operating System: Any Linux distribution to run your virtualization software.
- 🖥️ Virtual Machine Tool: QEMU.
Step 1. Installing QEMU and Core Virtualization Packages
For detailed, distribution-specific instructions on installing QEMU and its virtualization dependencies, please see our How to Install QEMU on Linux guide. Once QEMU is set up, return here to continue configuring and running Chrome OS Flex in your virtual machine environment.
Step 2. Acquire Chrome OS Flex Image
Now that you've set up your virtual emulator, it's time to download the Chrome OS Flex image for QEMU. Note that Chrome OS Flex is not distributed as a conventional .ISO file. Instead, Google provides a recovery image in .bin format, compressed within a .zip file.
To download ChromeOS Flex:- Option 1:
- Option 2:
Visit Google's Official Chrome OS Flex Page. Fill out the form and follow Google's guide to obtain the Chrome OS Flex image.
Click the direct download link:
https://dl.google.com/chromeos-flex/images/latest.bin.zip
The above link will start downloading the Chrome OS Flex image.
This link is safe and comes directly from Google's official website for Chrome OS Flex.
After the downlaod completes you'll have a .zip file, typically named something like:
"chromeos_16002.51.0_reven_recovery_stable-channel_mp-v6.bin.zip"
Extract the Image:
Since the download file is a .zip archive containing a .bin file, you need to extract it. You can use a graphical file extraction tool like Ark, a utility that supports multiple formats(tar, gzip, bzip2, rar, and zip).
- Installation (Example for Arch-Base distros):
sudo pacman -S ark
Replace "pacman" with your package manager.
Once Ark is installed, extract the .bin file from the .zip archive. For clarity when selecting the image in QEMU, rename the extracted .bin file to a simple, memorable name (e.g., chromeosflex).
Step 3. Installing Chrome OS Flex On a Virtual Machine
Now that your QEMU virtual emulator is set up, configured, and you've downloaded and extracted the Chrome OS Flex image, it's time to install Chrome OS Flex on your virtual machine. First, create a virtual storage device where the OS will be installed.
3.1. Creating a Virtual Storage Drive
- Open your terminal.
- (Optional) If you want the virtual drive created in a specific directory, navigate there using the cd command. By default, the drive will be created in your home directory.
- I'm going to create my virtual drive in .qcow2 format.
- To create the virtual drive, type:
qemu-img create -f qcow2 chromeosflex.qcow2 16G
Note: Make sure that your chromeosflex.bin file and chromeos.qcow2 (virtual drive) are in the same directory. Like this:
3.2. Booting into Chrome OS Flex Image
Next, attach your drives to VM.
- The first drive will be attached is chromeosflex.bin file (the installer, functioning like a bootable USB).
- The second drive is the virtual storage drive (chromeosflex.qcow2) where the OS will be installed.
Note: Confirm you're in the same directory as both files, use cd if necessary.
- To launch QEMU with chromeosflex.bin and chromeosflex.qcow2, type:
qemu-system-x86_64 -drive format=raw,file=chromeosflex.bin -drive format=qcow2,file=chromeosflex.qcow2 -m 8G -smp 2 -enable-kvm -display "gtk,gl=on,show-cursor=on" -device virtio-vga-gl -usb -device usb-tablet
Once QEMU starts, the Chrome OS Flex installer will load after about 1-2 minutes. You can also use Chrome OS Flex in guest mode by clicking the Browse as Guest button. However, note that guest mode won't save changes between sessions.
3.3. Installing Chrome OS Flex
To install the OS:- When the installer loads, click the Install Chrome OS Flex button (or follow the on-screen prompts to choose between trying and installing the OS). The installer will warn you that the installation will erase data on the hard-drive. Since this is a virtual drive, click Install to proceed.
- After installation, the emulator will shut down.
3.4. Booting into Freshly Installed Chrome OS Flex
- Now that Chrome OS Flex is successfully installed in the virutal machine, it's time to boot into the freshly installed operating system from the virtual drive.
- To do this, simply modify the preivous QEMU run command by removing the installer drive option -drive format=raw,file=chromeosflex.bin.
- Use the following command to boot directly from the virtual storage drive:
qemu-system-x86_64 -drive format=qcow2,file=chromeosflex.qcow2 -m 8G -smp 2 -enable-kvm -display "gtk,gl=on,show-cursor=on" -device virtio-vga-gl -usb -device usb-tablet
- Press Enter.
And here you go! now you have Chrome OS Flex running in your virtual machine. With save state support, every time you shut down QEMU and restart Chrome OS Flex, it picks up right where you left off. Enjoy exploring your new virtual machine environment.
🎉 Congratulations, your Chrome OS Flex setup is complete!
If this guide helped you, subscribe for more step-by-step tutorials.
1O1 out, I`ll see you in the next one!