Preparation of QEMU Disk Image

A disk image is a computer file that encapsulates the full contents and organizational structure of a storage device. The concept has been extended to include any such file, regardless of whether it originates from an actual physical medium or is created virtually (Disk image - Wikipedia, 2026).

QEMU supports a wide range of disk image formats, including growable images (which expand as non‑empty sectors are written), as well as compressed and encrypted images (Disk Images — QEMU documentation, 2026).

In laboratory exercises, the qcow2 format will be used as QEMU’s second‑generation Copy On Write disk image type. A qcow2 image encapsulates the complete contents and structure of a virtual disk while supporting snapshots, compression, encryption, and growable size. Compared to the raw format, qcow2 offers greater flexibility and storage efficiency, whereas raw provides only maximum performance (2.4. Storage Formats for Virtual Disks | Technical Reference | Red Hat Virtualization | 4.3 | Red Hat Documentation, 2026). Two approaches exist for preparing an operating system on a qcow2 image: (a) manual installation on the newly created image, or (b) deployment of a pre‑built cloud image.

As the operating system, it is suggested to use Debian Linux, recommended for its stability, security and freedom, although another Linux distribution may also be chosen depending on preference.

(a) Manual Installation of Operating System:

On Windows

  1. Open Administrator: Command Prompt by typing cmd in the Start menu, right‑clicking to select Run as administrator, or alternatively navigating through Windows SystemCommand Prompt.
  2. Create working folder — for example, create a directory C:\VMs with mkdir C:\VMs, then switch into it using cd C:\VMs. You may choose any convenient location instead of C:\VMs. To move between drives, use the drive letter followed by a colon (e.g. D: to switch to drive D).
  3. Create qcow2 image by running qemu-img create -f qcow2 debian.qcow2 20G, where debian.qcow2 is the image file name and 20G sets the virtual disk size (Disk Images — QEMU documentation, 2026).
  4. Download Debian ISO by clicking Download on the site and saving the file (e.g. debian-12.6.0-amd64-netinst.iso) into working folder such as C:\VMs.
  5. Start QEMU by mounting the qcow2 hard disk image and the Debian installer ISO image:

    qemu-system-x86_64.exe -m 2G -smp 2 -boot order=dc -hda debian.qcow2 -cdrom debian-12.6.0-amd64-netinst.iso

    Where:

    More details about these parameters can be found on the page Invocation — QEMU documentation.

    Internet will be available in the guest system right away and no additional configuration is required (Network emulation — QEMU documentation, 2026).

  6. Install Debian Linux according to the guide 4.2. Installing, Step by Step available at the Debian Handbook.

    Pressing Ctrl + Alt + G releases the grab.

  7. After installation, Debian should be started with the following command: qemu-system-x86_64.exe -m 2G -smp 2 -hda debian.qcow2

    In case of problems with QEMU, use the help command: qemu-system-x86_64.exe --help

On Android

  1. On internal storage or on the SD card, create a directory such as /storage/emulated/0/VMs (internal phone storage) or /storage/XXXX-XXXX/VMs (where XXXX-XXXX is the SD card identifier, e.g. /storage/1234-5678/) to store disk images and ISO files.
  2. As in Step 4 of the On Windows section, download the Debian installer ISO (e.g. debian-12.6.0-amd64-netinst.iso) and place it into working folder.
  3. Open Limbo x86 in the app drawer, then in the menu (three vertical dots) select Create Machine, enter a name for the Virtual Machine, and press Create.
  4. Configure Virtual Machine settings by set the following parameters:
  5. Press Play button and install Debian according to Step 6 of the On Windows. Control of the virtual machine can be carried out through the menu (vertical three dots).
  6. After installation, in the virtual machine settings change parameter Boot (Boot from Device: Hard Disk). The system will then boot from the first disk (Hard Disk A).

(b) Deployment of Pre‑built Cloud Image

On Windows

  1. Complete Step 1 and Step 2 of subsection On Windows in section (a) Manual Installation of Operating System.
  2. Go to the webpage Debian Official Cloud Images, scroll down, select the latest Debian build (Trixie), open the latest directory, download the file debian‑13‑nocloud‑amd64.qcow2, and place it directly into the working directory (e.g. C:\VMs).

    Verification can be performed by downloading the SHA512SUMS file in the same directory, running Get-FileHash debian-13-nocloud-amd64.qcow2 -Algorithm SHA512 in PowerShell on Windows, and comparing the output with the published checksum to confirm authenticity.

    The nocloud image is chosen because it is self‑contained, does not rely on external cloud‑init metadata, and is therefore ideal for straightforward local QEMU deployment under Windows.

  3. For increasing space on the virtual disk, execute the command from Command Prompt in the working directory
    qemu-img resize debian-13-nocloud-amd64.qcow2 +20G, where +20G means adding 20 gigabyte to the current disk size (QEMU disk image utility — QEMU documentation, 2026).

    After resizing the qcow2 image with qemu-img, extra steps are needed inside the VM. qemu-img only enlarges the virtual disk container. The partition table and filesystem inside the OS remain at their old size. Until the partition is expanded and the filesystem grown, the new space is invisible and cannot be used.

  4. Run the virtual machine by analogy with Step 7 of subsection On Windows in section (a) Manual Installation of Operating System.
  5. Enlarge partition boundaries and filesystem within the virtual machine.
  6. Shut down the machine from the command line, use: shutdown -h now

Course © 2026 by Dmitry Tsapik is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International