-
Notifications
You must be signed in to change notification settings - Fork 0
Qemu
- https://www.uninformativ.de/blog/postings/2025-05-25/0/POSTING-en.html
- https://news.ycombinator.com/item?id=44088806
- https://arstechnica.com/gadgets/2025/01/parallels-desktop-gains-really-slow-support-for-x86-oses-on-apple-silicon/
- https://news.ycombinator.com/item?id=42750655
- https://blogs.vmware.com/cloud-foundation/2024/11/11/vmware-fusion-and-workstation-are-now-free-for-all-users/
- https://news.ycombinator.com/item?id=42111314
- https://github.com/howinfo/howinfo/wiki/VMware
- https://fabulous.systems/posts/2023/07/installing-windows-xp-in-dosbox-x/
- https://news.ycombinator.com/item?id=42008499
Note: Qemu is available for many CPU/OS.
- Download SysInternals SDelete and run at Win11 cmd.exe as Administrator:
sdelete -z C:
. If there is more partitions, then also for those:sdelete -z D:
. This will make .qcow2 disk image smaller, because free disk space is not included. - Add external harddrive that has enough disk space.
- Start computer from Linux USB (like Linux Mint or Ubuntu)
- When Windows is
/dev/sda
(or/dev/nvme1n1
NVME disk, ormmcblk0 eMMC disk), and external disk is
/dev/sdb, at terminal change to root, unmount partitions like
/dev/sda1(or
/dev/nvme1n1p1and
/dev/nvme1n1p2NVME disk, or
mmcblk0p1and
mmcblk0p2 eMMC disk) , if they are mounted.
sudo su
df -h
umount /dev/sda1
umount /dev/sda2
- Mount
/dev/sdb1
by clicling partition at it, or at Terminal:
mount /dev/sdb1 /mnt
- Install qemu-utils and qemu-system
apt update
apt -y install qemu-utils qemu-system
- Copy Windows harddrive to
.qcow2
file to external disk. Sync command will write content of disk buffers to disk.
qemu-img convert -f raw -O qcow2 /dev/sda /mnt/win11.qcow2
sync
cd /mnt
nano start.sh
- To
start.sh
, copy paste this text.-m 4G
is amount of RAM used for Win11, adjust it to 8G if you have 16 GB RAM or more. Win11 likes to have more RAM.
qemu-system-x86_64 -hda win11.qcow2 -cdrom win11.iso -boot c \
-smp 2 -m 4G -usbdevice tablet \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- Save and Exit nano: Ctrl-o Enter Ctrl-x
- Make start.sh executeable:
chmod +x start.sh
- Try to start Win11 in Qemu. With changed hardware, there could be blue screens (reboot or safe more or restoring to original configuration could help), or problems with Windows activation (try to activate, click hardware changed recently, select from list of PCs you used recently which one to activate). If activation works, make backup of that
win11.qcow2
image, because sometimes activating Windows again does not work.
./start.sh
- After testing, unmount disks:
cd /
umount /mnt
More info at: https://github.com/howinfo/howinfo/wiki/Qemu#win11-x86_64-with-networking
softwareupdate --install-rosetta --agree-to-license
- With rosetta, it's possible to install amd64 software:
sudo apt install wine:amd64 snapd:amd64
brew install qemu
- Move .utm file to Documents and rename to Deb12.utm
- Duplicate Deb12.utm at macOS Finder, to have backup.
- At Debian, clean disk size to be able to make size smaller better with
sudo fstrim -av
(or as rootdd if=/dev/zero of=/mytempfile && rm /mytempfile
) cd Deb12.utm/Data
- Compress .img file. Change 12345.img in that command to actual filename of .img file in that directory:
qemu-img convert -f raw -O qcow2 -c 12345.img deb.qcow2
- Add more disk space:
qemu-img resize deb.qcow2 +300G
- Download most downloaded UPupBB .iso from https://sourceforge.net/projects/pb-gh-releases/files/NoblePup32_release/
- Create
start.sh
with this content and make it executeable withchmod +x start.sh
and start it with./start.sh
to start Puppy Linux to use GParted for resizing partitions:
qemu-system-i386 -m 2G -drive if=ide,index=0,media=disk,file=deb.qcow2 \
-drive if=ide,index=2,media=cdrom,file=NoblePup32-24.04-240810.iso -boot order=d \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- With Menu/System/Gparted, edit
/dev/sda
, click Fix button, right click swap partition and swapoff, delete swap partition, enlarge linux partition to have before it 0, and after it 1001 MB. Then create primary swap partition with name and label swap. Close GParted. click sda2 drive to open it. Run terminal commandblkid
and copy new UUID of swap partition with text editor (at top of screen menu icons, text editor) to /dev/sda2/etc/fstab, so that correct swap partition will be mounted. Close text editor and terminal. Right click sda2 and unmount it. Shutdown Puppy Linux. - Convert qcow2 image to raw, because UTM uses raw images:
qemu-img convert -f qcow2 -O raw deb.qcow2 deb.raw
- Replace original .img with deb.raw, use
ls
command to see correct filename, change it to this command to replace 12345.img filename:mv deb.raw 12345.img
For example, with Puppy Linux:
At terminal:
sudo lspci | more
sudo lsusb | more
And install correct network drivers, if they are not yet included.
- Install Qemu utils, that can convert qcow2, vmdk, vdi, etc
- pv shows progress of writing image
sudo apt -y install libnbd-bin pv qemu-tools qemu-utils
Change /dev/sdb to your disk you use. Unmount partitions before writing, if some is mounted, like below:
df -h
sudo umount /dev/sdb1 /dev/sdb2
As root, write image directly from qcow2 to disk /dev/sdb
. CHANGE TO CORRECT DEVICE ! This shows progress of writing with command pv.
sudo su
nbdcopy -- [ qemu-nbd -f qcow2 image.qcow2 ] - | pv > /dev/sdb
If you like to test command progress without writing to disk, you could write to /dev/null:
nbdcopy -- [ qemu-nbd -f qcow2 image.qcow2 ] - | pv > /dev/null
Then boot from that hard disk. If it's not only hard disk, use keys like Esc, F1, F2, F8, F12 to get booted from correct disk.
Usually CD or DVD is /dev/CDROM or /dev/sr0 .
sudo dd if=/dev/sr0 of=winxp.iso bs=20M conv=sync status=progress
sudo sync
sudo apt install qemu-utils
qemu-img convert -f qcow2 -O raw image.qcow2 image.raw
Usually CD or DVD drive is /dev/CDROM or /dev/sr0 .
sudo dd if=image.qcow2 of=/dev/sdb bs=20M conv=sync status=progress
Tested on Ubuntu 23.10 Asahi on M1 Air.
Other Ubuntu Asahi install info at https://github.com/AsahiLinux/docs/wiki/SW%3AAlternative-Distros
Also installs virt-manager.
Slirp included when compiling, to have user networking: https://bugs.launchpad.net/qemu/+bug/1917161
sudo apt -y install git libglib2.0-dev libfdt-dev \
libpixman-1-dev zlib1g-dev ninja-build \
git-email libaio-dev libbluetooth-dev \
libcapstone-dev libbrlapi-dev libbz2-dev \
libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev \
libibverbs-dev libjpeg8-dev libncurses5-dev \
libnuma-dev librbd-dev librdmacm-dev \
libsasl2-dev libsdl2-dev libseccomp-dev \
libsnappy-dev libssh-dev \
libvde-dev libvdeplug-dev libvte-2.91-dev \
libxen-dev liblzo2-dev valgrind xfslibs-dev \
libnfs-dev libiscsi-dev flex bison meson \
qemu-utils virt-manager
git clone --branch master --depth 1 https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update
git clone --branch master --depth 1 https://gitlab.freedesktop.org/slirp/libslirp
cd libslirp
meson build
ninja -C build install
cd ..
mkdir build
cd build
../configure --enable-slirp
make -j$(nproc)
sudo make install
At Asahi Fedora arm64 at M1 Air happens this error, when running
Amiga C compiler with qemu-user for i386,
when using https://github.com/xet7/darkesthour
$ qemu-i386 /opt/m68k-amigaos/bin/m68k-amigaos-gcc
qemu-i386: /opt/m68k-amigaos/bin/m68k-amigaos-gcc: Unable to find a guest_base
to satisfy all guest address mapping requirements
00000000-ffffffff
This is bug that happens at Fedora: https://gitlab.com/qemu-project/qemu/-/issues/2082
There is workaroud at .spec
file:
--enable-pie
It works around the issue by making the qemu binary load address random, o the issue now happens sometimes, while it looks like it is solved.
https://wiki.qemu.org/Documentation/Networking
wget reactos-32bit-bootcd-nightly.7z
7z x reactos-32bit-bootcd-nightly.7z
mv reactos*.iso ReactOS.iso
20G is max growable disk size here:
qemu-img create -f qcow2 ReactOS32.qcow2 20G
Here -m 3G
is 3 GB RAM.
Edit start32.sh
and set it executeable chmod +x start32.sh
with this content:
qemu-system-i386 -m 3G -drive if=ide,index=0,media=disk,file=ReactOS32.qcow2 \
-drive if=ide,index=2,media=cdrom,file=ReactOS32.iso -boot order=d \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
Then run ./start32.sh
20G is max growable disk size here:
qemu-img create -f qcow2 ReactOS64.qcow2 20G
Here -m 3G
is 3 GB RAM.
Edit start64.sh
and set it executeable chmod +x start64.sh
with this content:
qemu-system-x86_64 -m 3G -drive if=ide,index=0,media=disk,file=ReactOS64.qcow2 \
-drive if=ide,index=2,media=cdrom,file=ReactOS64.iso -boot order=d \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- Create growable harddisk image of 80 GB:
qemu-img create -f qcow2 winxp.qcow2 80G
- Start install from winxp.iso
Edit start.sh
and set it executeable chmod +x start.sh
, here -m 4G
is 4 GB RAM:
qemu-system-i386 -m 4G -drive if=ide,index=0,media=disk,file=winxp.qcow2 \
-drive if=ide,index=2,media=cdrom,file=winxp.iso -boot order=d \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- After install, boot without iso
qemu-system-i386 -m 4G -drive if=ide,index=0,media=disk,file=winxp.qcow2 \
-boot order=c \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- Create growable harddisk image of 80 GB:
qemu-img create -f qcow2 win10.qcow2 80G
- Start install from win10.iso
Edit start.sh
and set it executeable chmod +x start.sh
, here -m 4G
is 4 GB RAM:
qemu-system-x86_64 -m 4G -drive if=ide,index=0,media=disk,file=win10.qcow2 \
-drive if=ide,index=2,media=cdrom,file=win10.iso -boot order=d \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- After install, boot without iso
qemu-system-x86_64 -m 4G -drive if=ide,index=0,media=disk,file=win10.qcow2 \
-boot order=c \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- Create growable harddisk image of 80 GB:
qemu-img create -f qcow2 win11.qcow2 80G
- Start install from win11.iso
Edit start.sh
and set it executeable chmod +x start.sh
, here -m 4G
is 4 GB RAM, -usbdevice tablet
makes using mouse more exact:
qemu-system-x86_64 -hda win11.qcow2 -cdrom win11.iso -boot d \
-smp 2 -m 4G -usbdevice tablet \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- When installing Win11
a) Use bypass registry keys:
https://blogs.oracle.com/virtualization/post/install-microsoft-windows-11-on-virtualbox
b) Figure out UEFI and TPM and how to activate it, not tested:
- https://getlabsdone.com/how-to-install-windows-11-on-kvm/
- https://getlabsdone.com/how-to-enable-tpm-and-secure-boot-on-kvm/
- https://github.com/stefanberger/swtpm/wiki
- https://www.reddit.com/r/AsahiLinux/comments/y7hplo/virtual_machines_on_asahi_linux/
- https://that.guru/blog/uefi-secure-boot-in-libvirt/
- https://www.reddit.com/r/AsahiLinux/comments/107m4nb/windows_vm_on_asahi_qemukvm_virtmanager/
sudo apt-get install dh-autoreconf libssl-dev \
libtasn1-6-dev pkg-config libtpms-dev \
net-tools iproute2 libjson-glib-dev \
libgnutls28-dev expect gawk socat \
libseccomp-dev make -y
git clone https://github.com/stefanberger/swtpm
cd swtpm
./autogen.sh --with-openssl --prefix=/usr
make -j4
make -j4 check
sudo make install
- After install, boot without iso
qemu-system-x86_64 -hda win11.qcow2 -boot c \
-smp 2 -m 8G -usbdevice tablet \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- Create growable harddisk image of 80 GB:
qemu-img create -f qcow2 ubuntu.qcow2 80G
- Start install from ubuntu.iso
Edit start.sh
and set it executeable chmod +x start.sh
, here -m 4G
is 4 GB RAM:
qemu-system-x86_64 -m 4G -drive if=ide,index=0,media=disk,file=ubuntu.qcow2 \
-drive if=ide,index=2,media=cdrom,file=ubuntu.iso -boot order=d \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
- After install, boot without iso
qemu-system-x86_64 -m 4G -drive if=ide,index=0,media=disk,file=ubuntu.qcow2 \
-boot order=c \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
Check supported hardware https://dev.haiku-os.org/wiki/HardwareInfo
RI Beta 5 download: https://www.haiku-os.org/get-haiku/r1beta5/
Nightly download: https://download.haiku-os.org/nightly-images/
Create Haiku64.qcow2 growable hard disk image of 20 GB in size:
qemu-img create -f qcow2 Haiku64.qcow2 20G
install64.sh:
qemu-system-x86_64 -cdrom haiku64.iso -vga std \
-hda Haiku64.qcow2 -smp 2 -boot d -m 4096 \
-net nic,model=rtl8139 -net user
start64.sh:
qemu-system-x86_64 -vga std \
-hda Haiku64.qcow2 -smp 2 -boot c -m 4096 \
-net nic,model=rtl8139 -net user
Create Haiku64.qcow2 growable hard disk image of 20 GB in size:
qemu-img create -f qcow2 Haiku32.qcow2 20G
install32.sh:
qemu-system-i386 -cdrom haiku32.iso -vga std \
-hda Haiku32.qcow2 -smp 2 -boot d -m 4096 \
-net nic,model=rtl8139 -net user
start32.sh:
qemu-system-i386 -vga std \
-hda Haiku32.qcow2 -smp 2 -boot c -m 4096 \
-net nic,model=rtl8139 -net user
OS variants: virt-install --os-variant list | grep haiku
sudo virt-install -r 4000 -n haiku32 --os-variant haikunightly \
--disk /data/VMs/Haiku64.qcow2,device=disk,format=qcow2 \
-c /data/VMs/Haiku/haiku64.iso \
--vcpus=4 --vnc --noautoconsole
Download Icaros .iso from http://vmwaros.blogspot.com
At Linux Mint or Ubuntu, you can right click mount .iso image, and read manuals from AROS Live CD / Storage / Icaros Manuals
Create icaros.qcow2 growable hard disk image of 20 GB in size:
qemu-img create -f qcow2 icaros.qcow2 20G
At installer, install all files to same Workbench partition. Do not create separate Work partition.
At GRUB style menu, select Advanced/800x600 resolution or bigger.
install32.sh:
qemu-system-i386 -m 3G -drive if=ide,index=0,media=disk,file=icaros.qcow2 \
-drive if=ide,index=2,media=cdrom,file=icaros-pc-i386.iso -boot order=d \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
start32.sh:
qemu-system-i386 -m 3G -drive if=ide,index=0,media=disk,file=icaros.qcow2 \
-boot order=c \
-serial stdio -netdev user,id=n0 -device rtl8139,netdev=n0
For Internet access, click:
- AROS
- Prefs
- Network
- .device listed
- Edit
- Device dropdown menu
- From DEVS:networks, select
rtl8139.device
- Save and reboot AROS from Start menu.
- Use OWB to browse webpages at Internet. Please wait patiently when OWB starts the first time making fonts related setup, it takes a long time. After that first time, next times OWB will start instantly.
Also, see Docs, click:
- AROS
- Storage
- Icaros Manuals
https://blog.michael.kuron-germany.de/2023/06/emulating-ppc64-inside-docker/