[kwlug-disc] Virtualization technology

William Park opengeometry at yahoo.ca
Mon Jul 28 23:36:25 EDT 2014


I use QEMU for command-line and VirtualBox for GUI, depending on my mood.

1. QEMU:
    - doesn't support UEFI, so it has to be MBR
    - command line (I like it)
    - video is a bit tricky.  You need to manually modify bootloader
      (lilo or grub) to recover the default 1280x720 or change to
      something else.  Still, Fedora can't do 1280x720.
    - it has "snapshot", but I don't use it, because all my images are
      "raw".  Advantage is I can access the image in loop device.
    - You can use block device (USB, SD, harddisk) or image file as
      "harddisk".  Eg. you can install to USB, and use it to boot as
      though you did it from regular install.

2. VirtualBox:
    - supports UEFI.  All my VirtualBox images are UEFI.
    - it's GUI, so configurations are easier.
    - video is better.  Once you install "guest addition", video modes
      are automatic.
    - One distinct advantage is directory sharing.  You can share /tmp
      between guest and host, which you can't do in QEMU.

To be strict, they both use KVM underneath, and you cannot use QEMU and
VirtualBox at the same time.  I used to use QEMU more, but now I use
VirtualBox more.  For example, in QEMU, to expose the virtual machine to
outside, you have to know what is "bridge" in the first place, and set
it up on the host.  But, in VirtualBox, it's clicking of option and
menu.
-- 
William

On Mon, Jul 28, 2014 at 05:05:01PM -0400, Khalid Baheyeldin wrote:
> Although I have used VPSs for many years, I have not hosted them
> myself. Rather I let others deal with the complexity in return for a
> fee.
> 
> But in the lab, I have been playing around with VirtualBox to create
> test VMs. Things that I can test certain things then roll back to a
> previous state.
> 
> VirtualBox works, and does the job, and is free/open source.
> 
> I used the following script to create images for Ubuntu Server LTS,
> one for 12.04 and the other for 14.04, both from the stock
> downloadable DVD media.
> 
> mkdir virtualbox/
> cd virtualbox/
> 
> #!/bin/sh
> 
> if [ $# = 2 ]; then
>   VM=$1
>   ISO=$2
> else
>   echo "Usage: `basename $0` vm_name install_iso_path"
>   exit 1
> fi
> 
> if [ ! -r $ISO ]; then
>   echo "Cannot find ISO install media!"
>   exit 2
> fi
> 
> # Create the VM
> vboxmanage createvm --name $VM --ostype Ubuntu_64 --register
> # Modify the VMs parameter
> vboxmanage modifyvm $VM --memory 512 --cpus 1 --pae off --acpi on
> --hpet on --ioapic on --hwvirtex on --hwvirtexexcl on --vtxvpid on
> --accelerate3d off --audio none --chipset ich9 --nic1 bridged
> --bridgeadapter1 eth0 --nictype1 82543GC --clipboard bidirectional
> # Create a hard disk for the VM
> vboxmanage createhd --filename ./$VM-sda.vdi --size 4096
> # Create storage for the VM
> vboxmanage storagectl $VM --name storage --add sata --controller
> IntelAHCI --sataportcount 4 --hostiocache off
> # For the hard disk image
> vboxmanage storageattach $VM --storagectl storage --port 1 --medium
> ./$VM-sda.vdi --type hdd
> #And for the DVD, so we can boot from it
> vboxmanage storageattach $VM --storagectl storage --port 2 --medium
> $ISO --type dvddrive
> # Make the VM boot from the DVD
> vboxmanage modifyvm $VM --boot1 dvd
> # Now start the VM, and install Linux on it
> vboxheadless --vnc -startvm $VM
> # Make the VM bootable from the hard disk
> vboxmanage modifyvm $VM --boot1 disk
> # Finally remove the DVD, it is not needed
> vboxmanage storageattach $VM --storagectl storage --port 2 --medium none
> # Now start the VM normally
> vboxheadless -startvm $VM &
> 
> There are other comments for snapshot management, disk cloning ...etc.
> 
> As you can see the commands tend to be too verbose.
> 
> Also, I saw even when the VMs are idle (quiescent system), the the
> number of context switches and interrupts on the host (physical) go up
> significantly (130 per second to over 2,000 per seconds). That may be
> unescapable overhead, and therefore I am asking ...
> 
> If you want to reproduce/compare this, stop all the VMs for a few
> hours, take a baseline graph using Munin or Cacti, then start the VMs,
> and leave them idle for a few hours, then stop them, and compare the
> graph before/during/after.
> 
> So, while staying within the free and open source alternatives, what
> are the options that people use? KVM? Xen? What else? With a bit of
> details on what you like and what you don't like where possible.
> -- 
> Khalid M. Baheyeldin
> 2bits.com, Inc.
> Fast Reliable Drupal
> Drupal optimization, development, customization and consulting.
> Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
> Simplicity is the ultimate sophistication. --   Leonardo da Vinci
> For every complex problem, there is an answer that is clear, simple,
> and wrong." -- H.L. Mencken
> 
> 
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org





More information about the kwlug-disc mailing list