Start VM

Starting the VM uses a large amount of arguments for machine configurations like memory, devices, etc. Also, the initial command signifies the type of CPU you're planning to use for the VM.

Keep in mind that the guest (VM's internal) operating system must be able to support machine swapping (example, Debian, Ubuntu, and other Linux distributions). Otherwise, you will get into constant crashing or unbootable outcome.

Formulate Arguments

QEMU uses a list of arguments to create the VM instance. Hence, you'll need to plan ahead beforehand. These are the list of arguments critical enough to operate a normal VM. Otherwise, you can formulate your own based on the specifications: https://qemu.weilnetz.de/doc/qemu-doc.html.


Memory

-m [size=]megs[,slots=n,maxmem=size]

The default memory size is 128 MiB. You'll need to specify yours to meet the guest VM's demand. Optionally, you can state "slots" and "max memory size" to emulate hot-pluggable memory unit to increase the memory ad-hoc, on-the-fly. Here's an example:

  1. -m 1G1 Gigabytes available, 1 slot, maximum memory of 1 Gigabytes
  2. -m 4096M — 4 Gibibytes available, 1 slot, maximum memory of 4 Gibibytes
  3. -m 1G,slots=3,maxmem=4G1 Gigabytes available, 3 slots available, maximum memory of 4 Gigabytes

NOTE:

  • Gibibytes = 1024 Megabytes; Gigabytes = 1000 Megabytes
  • Hot-plug slots are for simulating server based RAM modules, which are hot-plug capable.



Boot Order

-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]

Specify the boot sequences in BIOS. It is processor specific so you'll need to consult the detailed specification from KVM and QEMU. By default for x86 processors, it is the IDE hard disk. If you have CD installer (ISO), you probably want to boot into that CD first. The order symbols are as follows:

  • a, b - floppy 1 and floppy 2
  • c - first hard disk
  • d - first CD-ROM
  • n-p - (Ethernet-boot (or PXEBoot) from network adapter 1-4

You can also configure it to display the BIOS menu, display splash screen for sp_time duration in milliseconds, timeout etc.

For splash screen, the file must be either jpeg or bmp format, at SVGA compatible size: 320x240, 640x480, 800x640.

Here is an example directly from specification:

# try to boot from network first, then from hard disk
qemu-system-i386 -boot order=nc
# boot from CD-ROM first, switch back to default order after reboot
qemu-system-i386 -boot once=d
# boot with a splash picture for 5 seconds.
qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000


<to be continued>

Create Launch Script / XML

<to be continued>

Run

<to be continued>

That's all about starting the VM using the command line.