vimwiki/tech/qemu.wiki
2021-10-10 23:22:53 -04:00

50 lines
1.1 KiB
Plaintext

= QEMU =
QEMU is a lightweight cli virtual machine program
== Making a virtual disk ==
To run a vm you need a virtual hard drive. To make one,
{{{
qemu-img create -f file_format <image_name> image_size
}}}
File format can be raw, qcow2, etc
size is notated with G for gigabytes, ie 5G is 5 gigabytes
== Making a virtual machine ==
We need a virtual disk and an iso file to run. To do this
{{{
qemu-system-x86_64 -cdrom iso_image -cpu host -enable-kvm -m RAM_size -smp
number_of_core -drive file=disk_image.iso,format=qcow2
}}}
-cdrom is for iso_image
-cpu host is to emulate the host processor
-enable-kvm uses the kernel virtual machine
-m is for memory, ie 2048
-smp is for the number of cores, ie 4
To run off of an already installed hard drive without an iso, run
{{{
qemu-system-x86_64 -cpu host -enable-kvm -m 2048 -smp 2 -drive
file=/path/to/vdisk.qcow2,format=qcow2
}}}
== Emulating different systems ==
If we want to emulate i386, replace 'qemu-system-x86_64' with
'qemu-system-i386'. This works with most other architectures, assuming you have
them installed.
[[index]]