If you want to install a virtual machine in a x86_64 device by QEMU, you can following the steps.
- At least 2 core CPU
- At least 4 GB RAM
- At least 50 GB disk space
- CPU virtualization enabled
- QEMU installed
This example shows installing Debian 7.5.0 based on QEMU on Ubuntu 22.04, Other versions may have some differences, please refer to the user documentation for different operating systems.
-
Create a virtual disk:
qemu-img create -f qcow2 -o cluster_size=128K virt_disk.qcow2 20G
-
Copy an EFI.fd file to your path:
sudo cp /usr/share/ovmf/OVMF.fd EFI.fd
-
Set up launch script parameter:
sudo vim launch.sh
-
Check the file structure:
debian ├── debian-7.5.0-amd64-netinst.iso ├── EFI.fd ├── lingmo-debian-vm.qcow2 └── start.sh
-
Launch the VM:
sudo sh launch.sh