qemu-system-x86_64 -m 1024 -hda helper.iso -hdb $QCOW2_OUTPUT -boot d -enable-kvm
Inside helper VM:
# Partition /dev/sdb
fdisk /dev/sdb
> n (new partition)
> p (primary)
> 1
> (default start)
> (default end)
> a (make bootable)
> w (write)
Format and install bootloader:
mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /mnt
extlinux --install /mnt
# or GRUB:
grub-install --target=i386-pc --boot-directory=/mnt/boot /dev/sdb
| Tool | Purpose | Typical Source |
|------|---------|----------------|
| qemu-img | Create raw/qcow2 disk images | QEMU package (apt install qemu-utils) |
| qemu-system-x86_64 | Emulate the hardware | QEMU package |
| unzip / tar | Extract Cisco image (if compressed) | Base OS |
| fdisk / parted | Partition management (optional) | Base OS |
| extlinux or GRUB | Bootloader installation | Syslinux package |
| Linux kernel & initrd | Minimal boot environment | Custom or prebuilt | convert cisco bin to qcow2
Critical note: Cisco
.binfiles are not raw disk images. They are bootable firmware executables that run directly on Cisco hardware or under QEMU’s Cisco emulation (vIOS, vIOS-L2, CSR1000v, etc.). The conversion process embeds the.bininto a bootable disk that loads it.
If you’ve ever tried to run a Cisco IOS or IOS-XE image in a modern emulator like GNS3, EVE-NG, or directly under KVM/QEMU, you’ve likely encountered a problem: the raw .bin file isn’t directly bootable as a virtual disk. qemu-system-x86_64 -m 1024 -hda helper
In this post, I’ll walk you through why conversion is needed, the exact steps to convert a .bin to .qcow2, and how to launch your new Cisco VM.
Decide on a size (usually 8GB is safe for IOS-XE): Inside helper VM: # Partition /dev/sdb fdisk /dev/sdb
qemu-img create -f qcow2 cisco.qcow2 8G
Converting a Cisco .bin to qcow2 is a multi-step process that essentially encapsulates the Cisco binary inside a bootable virtual disk. While not as simple as a format conversion, the result enables seamless integration into modern hypervisors.
For production use, prefer official Cisco .qcow2 images or OVA packages. The method described here is ideal for lab environments, legacy images, or custom automation where only .bin files are available.