User Tools

Site Tools


KVM virtualized RD's for Boxes with hardware virtualization


We are using a KVM based setup for research devices and have installed Zotac ZBoxes which have quite some performance but are not as ruggedized as Alix Boards. The good thing about these boxes is that they have hardware virtualization support so they enable us to combine the research device with the connecting community device into one piece of hardware. The setup got tested on Zotac ZBox ID-81E, ID-82 and Zotac ZBox nano ID61.

For our new reasearch devices we want to switch to a newGigabyte GA-J1800N-D2H based system with the Intel Celeron J1800 processor. CPU performance should be sligtly lower than a Zotec Box with Intel i3, but it still support VT-x and is much cheaper.


BIOS update

Make sure you have installed the latest BIOS. general BIOS Update Instructions.

To enable booting without attached display / monitor make sure to set correct Gigabyte Mainboard Bios Settings.


Installing the Base System

  • Boot the Debian installer using netboot or any other method you prefer. You can also install the base system using debootstrap.
  • When installing Debian wheezy use the following settings:
    • 2 primary partitions
      1. 512MB EFI BOOT
      2. rest of disk, Physical Volume for LVM
    • Create a volume group named vm containing 2 Logical Volumes
      1. root 2 GB, ext4, / as mountpoint, name root, mount options noatime
      2. rd 50 GB (no mountpoint, no filesystem - we will configure this later)
    • deselect everything at the tasksel screen (we only want debian base)
    • install grub at MBR
    • reboot
  • edit /etc/default/grub
    • change GRUB_TIMEOUT to 2 seconds
  • $ update-grub
  • configure networking to your needs
  • edit /etc/apt/sources.list
  • your sources.list should now look like this example sources.list
  • $ wget -O - | apt-key add -
  • $ aptitude update
  • $ aptitude install sudo screen openssh-server dstat htop less psmisc tcpdump nmap lsof mtr-tiny debian-goodies olsrd olsrd-plugins ntp qemu-kvm libvirt-bin vim zsh acpid isc-dhcp-server
  • for older hardware (e.g. the Zotac ZBox)
    • $ aptitude install firmware-linux
  • for the new Celeron based Hardware
    • $ aptitude install -t wheezy-backports linux-image-amd64 firmware-linux firmware-realtek
  • $ adduser <username> sudo (username which got created by the installer)
  • edit /etc/ssh/sshd_config
    • set PermitRootLogin to no
  • $ /etc/init.d/ssh restart
  • you can now use ssh to connect to the box as normal user
  • edit /etc/inittab
    • comment lines for getty for tty3-tty6, add –noclear to tty1
    • 1:2345:respawn:/sbin/getty –noclear 38400 tty1
  • $ sudo init q
  • edit /etc/default/libvirt-guests
  • sudo vi /etc/dpkg/dpkg.cfg
    • add these lines at the end of file.
  • $ reboot

Updating the debian system

This makes sure the update doesn't hang while restarting important services like olsrd

  • sudo aptitude update
  • sudo DEBIAN_FRONTEND=noninteractive aptitude dist-upgrade

Configuring Networking

Configuring KVM and Installing the Confine Image

  • $ sudo mkdir /home/confine
  • $ cd /home/confine
  • create file rd.xml with following content rd.xml
  • create an firmware image for the node
  • wget --user <your controller user> --ask-password --auth-no-challenge --no-check-certificate "<link to the created firmware iamge>"''
  • zcat confine-firmware-*.img.gz | sudo dd of=/dev/vm/rd bs=4096 conv=fsync
  • you may delete the firmware file now if you wish
  • $ sudo virsh
    • virsh # define rd.xml
    • virsh # autostart rd
    • virsh # start rd –console
  • you should now be connected to the serial console and see the research device booting
    • the firmware will reboot several times, be patient until the process has finished
    • your device should now be listed as online in the controller, if so, continiue
    • $ opkg update
    • $ opkg install kmod-acpi-button
    • $ opkg install acpid
  • your confine research device is now up and running and can be configured
    • disconnect from virtual console with CTRL+]
    • quit virsh with quit
    • you can reconnect to the console with
      • $ sudo virsh console rd
    • you can shutdown the vm with
      • $ sudo virsh shutdown rd
    • and restart it with
      • $ sudo virsh start rd
    • also a reboot inside the VM works as expected
    • if you want to switch off the VM from within use the command poweroff
    • halt will shutdown the virtual machine but not exit KVM, if your VM hangs at system halted you can use the following to exit KVM
      • $ sudo virsh destroy rd

USB devices inside KVM

Updating the RD

testbeds/austria/kvm.txt · Last modified: 2014/06/25 15:41 by otti