Virtual Machines with quickemu


Quickemu

quickemu is a really nice tool that allows you to quickly create and run a virtual machine from the command line.

You can get it from here.

I will not repeat quickemu install instructions here, but I'll use this post to document what you need to do to use it, especially with a custom ISO, that is, an image file you've downloaded yourself, how to set it up and run it.

What to do

Assuming quickemu is already installed, download the ISO file of the OS you want to use. For this example, we'll create a VMs folder in the home directory:

  mkdir ~/VMs

Next, we will create a new sub-directory with the name of the OS to use and place the ISO file in that new folder.

  mkdir ~/VMs/calculate-linux

Now, in the VMs folder (parent to the distributions folder, we will create the configuration file.

  cd ~/VMs
  touch calculate-linux.conf

There are many possible parameters you can use in this file. We'll just use the bare minimum and let quickemu decide the optimum settings (including cores, ram, and disk size).

In this file we need to set three parameters: guest OS type, and disk and iso paths. Here's how it should look:

  guest_os="linux"
  disk_img="calculate-linux/disk.qcow2"
  iso="calculate-linux/cld-22.0.1-x86_64.iso"

Start the VM

Now that everything is in place, you can start the VM. from the command line:

  cd ~/VMs
  quickemu --vm calculate-linux.conf

The VM should start in a new window. You can use it in live mode and install the OS.

When in the VM, use the keys CTRL + ALT + F to switch to/from full-screen.

Depending on your system, if the guest is in a window or second monitor and your cursor gets "locked" inside, use the keys CTRL + ALT + G.

After the installation is completed, you can power-off or restart your VM.

Next time you want to start the VM, use the same command you used to start it before. There is no need to change any configuration file.

Finally, if you encounter errors in the first boot of the VM with the fresh install, try adding to your configuration file:

  boot="legacy"

More options

Here are other options (and their default values) you can use with the configuration file.

  boot="efi"
  bridge=""
  cpu_cores=""
  disk_img=""
  disk_size=""
  fixed_iso=""
  floppy=""
  guest_os="linux"
  img=""
  iso=""
  macos_release=""
  port_forwards=()
  preallocation="off"
  ram=""
  secureboot="off"
  tpm="off"
  usb_devices=()