QEmu
on Windows 10
Introduction
I prepared this article to share my experience QEmu hardware emulator on Windows 10 OS using AMD CPU Hardware. Working with QEmu on windows was gaining experience with QEmu system and working with OS-level low-level primitives. QEmu provides various features to experiment OS features. One of the examples of a use case for low-level primitives is booting OS kernels (even your own kernel). With QEmu you can access the serial ports, parallel ports, and hardware console to control the Hardware state and execute the code in various different CPU architectures.
Hardware :
32 GB RAM
AMD 8 CPU / 16 Cores
+100 GB Disk Space
OS:
Windows 10 Host OS
Debian 11 Gust OS
Software:
Qemu v7.0.0
Clink
Windows Terminal
Scoop.sh - Package Manager
Others:
Download Debian 11 x86-64bit ISO image from the official Debian website.
Experiment Initial Setup
I assume you installed the Scoop package manager from https://scoop.sh website. Run the "cmd" command to prepare the environment
Install windows terminal
C:\>scoop install windows-terminal
Install qemu
C:\>scoop install qemu
Install clink (optional)
C:\>scoop install clink
Setup/Install clink (optional)
C:\>clink autorun install
Close "cmd" and open "wt" (windows terminal) and you should see clink is injected itself automatically to cmd command in windows terminal. Clink is a very nice utility tool that will help us use the TAB auto-completion like bash in Windows OS.
Run the following command to prepare raw image to install Debian 11
C:\Qemu-Work>qemu-img create -f raw img1.raw 10G
Execute QEmu to install Debian 11 into the image file we just created
C:\Qemu-Work>qemu-system-x86_64w.exe -cdrom C:\ISOs\debian-11.3.0-amd64-netinst.iso -boot d -hda img1.raw -m 4096 -smp 6
Select Text install option from the boot screen and follow the screen by screen guidance to install the Debian as a normal installation for bare metal system.
Prepare Snapshot drive from the base installation
C:\Qemu-Work>qemu-img create -o backing_file=img1.raw,backing_fmt=raw -f qcow2 img1.cow
Run the new installation
C:\Qemu-Work>qemu-system-x86_64w.exe img1.cow -m 4096 -smp 6