Skip Navigation

Testing qemu-system-x86_64 on Windows

After installing QEMU, you can test to see that the x86_64 system emulator is working properly.

Page Contents

Video Demonstration


Watch at Internet Archive

Preparing the Virtual Machine

These steps only need to be completed once when the virtual machine is first created. When restarting the VM at a later time, simply double-click the batch file.

  1. Download the latest Alpine Linux “Virtual” ISO file for the x86_64 architecture.
  2. Create a dedicated folder on your host system to contain this virtual machine.
  3. Move the downloaded ISO file from the first step into the newly created folder.
  4. Open the command interpreter or PowerShell, and use the cd command to navigate to the folder you created.
  5. Create the disk image by running the following command:
qemu-img create -f qcow2 alpine.qcow2 40G
  1. Proceed to create a batch file (in the same folder) to run QEMU. An example is shown in the next section.
  2. You should be able to run the virtual machine by double-clicking the batch file in Explorer.

Batch File

This batch file example isn’t exactly what I demonstrated in the video, but it should work with Alpine Linux 3.16.2. If Alpine Linux makes a new release, you will need to adjust the release version of the ISO file accordingly. Save the batch file in the same folder as your ISO file and disk image from the previous step.

:: Alpine Linux (x86_64)

qemu-system-x86_64 ^
    -name "Alpine Linux x86_64" ^
    -machine type=pc-q35-6.0 ^
    -accel tcg ^
    -cpu qemu64 ^
    -smp 2 ^
    -m 2048 ^
    -rtc base=utc ^
    -drive file="alpine.qcow2",if=virtio,format=qcow2 ^
    -boot order=cd,menu=on ^
    -display gtk ^
    -device virtio-vga ^
    -nic user,id=NAT,model=virtio-net-pci,mac=02:00:00:00:00:01 ^
    -device qemu-xhci ^
    -device usb-tablet ^
    -cdrom "alpine-virt-3.16.2-x86_64.iso"

echo QEMU has finished
pause

Once the batch file is created and has the proper extension, double-clicking it should run Alpine Linux in QEMU.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.