2023-08-12 Meeting

Carl gave a quick intro to virtualization.

The qemu set of programs allow a virtual machine to be created using almost any type of virtual hardware.  So it is easy to create anything from a virtual i386 with a meg of ram and two floppies to a multicore xx86_64 with 8 gigs of ram, a SCSI dvd drive, a terabyte harddrive,  High Def Audio, Ultra HD graphics, and direct access to PCI devices.

Virtualization using libvirt (aka kvm) can also emulate an amazing array of hardware.  It has a very small overhead allowing it to approach or even surpass bare metal performance.  Also libvirt has a variety of options for remote access, both for the console and the manager.

The first live demo showed how to easily boot from a USB drive.

  1. Using the output of lsblk, determine which device is the USB drive.
    Typically this would be /dev/sda or /dev/sdb.
  2. Create an alias to be saved in the .bash_profile or similar location:alias usbboot=”sudo qemu-system-x86_64 -machine accel=kvm -m 2048 -smp 4 -drive format=raw,media=disk,file=/dev/sda &”
  3. Source the file:
    .  ~/.bash_profile
  4. Plug in the USB drive and run usbboot.

Running usbboot is all that’s needed in the future to verify that a device can boot or to run a private instance of your OS which does not exchange data with its host.

The second live demo created a very capable virtual machine running SystemRescue.

  1. Copy the ISO file for SystemRescue to /var/tmp or another suitable location.
  2. Create an alias to be saved in the .bash_profile or similar location:
    alias sysres=”qemu-system-x86_64 -machine accel=kvm -cdrom /var/tmp/systemrescue-10.01-amd64.iso -m 4096 -audiodev pa,id=hda -device intel-hda -device hda-duplex,audiodev=hda -smp 4 -boot d
  3. Source the file:
    . ~/.bash_profile
  4. Run sysres to ensure everything works.

This alias can be very useful when updating or troubleshooting another virtual machine.  For example, it can be used to add files from a network location to a FreeDOS harddrive image:
sysres -drive file=/var/tmp/freedos.img,format=raw

The third live demo involved installing android on a libvirt/kvm virtual machine using the gui manager.

  1. Copy the ISO file to /var/tmp or another suitable location.
  2. Launch the gui app to manage virtual machines:
    virt-manager
  3. Create a new virtual machine, using local install media.
  4. Browse to the location and select the ISO file.
  5. For the operating system, start to type android, then select a version.
  6. Use the default settings, if appropriate.
  7. Ensure that a valid network is selected, and finish.

After a minute or two, android will greet you with “Hi there” and allow you to start the setup.  You will now be able to run pretty much any android app on your Linux desktop!

The followup discussion.

We did talk about some of the other virtualization platforms.  Most notably Richard said that when some programmers provide archives of DOS games, they include dosbox which is then configured for the particular game.  This simplifies the installation and automatically creates a proper virtual environment.

Thanks to Rich for setting up audio in the meeting room at the library.