From Cnwiki

Jump to: navigation, search

Beorn is a virtualisation server, providing virtual machines for research and student projects. The server was purchased in December 2015 and has been named after Beorn, the character of The Hobbit.

This page contains static information, i.e. guides and hardware documentation. For more dynamic content, i.e. currently deployed virtual machines and their network address allocations, please see Ressource assignment and deployed VMs on Beorn.

The Beorn server has the public IP address:, which is resolved by the name


Hardware Characteristics

The server has the following characteristics:

• DELL PowerEdge R430

• Processor: Intel Xeon E5-2630 v3, 8 cores 16 threads @ 2.40GHz

• RAM: 2x16GB, 2133MHz

• Storage: 2x400GB SSD, hardware RAID1

• Network Adapter: 2x1GBit Ethernet

The server is placed in the server room inside the laboratory (Edison 331) mounted on the middle rack, and has three years of basic warranty provided by DELL, running from ~December 2015.

Server installation guide

This installation guide follows the guide on Radagast. If you encounter problems, or would like more information regarding the software components installed, try looking at that page first.

1: Install Ubuntu

Install Ubuntu 14.04 LTS from USB drive (use standard lab admin account as user).
Create your own superuser (

2: Install SSH

Install SSH:

  $sudo apt-get install openssh-server

Save public key on server: Sec. 6 in
Remember to turn off password authentication: Sec. 9 in

3: Install virtualization components

Install components:

  $sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

Add user to libvirtd group:

  ~$ sudo adduser <username> libvirtd

4: Setup bridge (cannot be done via SSH)

Shutdown network connection, take a backup of the interfaces file and enter the interfaces file:

  ~$ sudo ifdown em1
  ~$ sudo cp /etc/network/interfaces /etc/network/interfaces.factory-defaults
  ~$ sudo chmod a-w /etc/network/interfaces
  ~$ sudo editor /etc/network/interfaces

Change the file to:

  # This file describes the network interfaces available on your system
  # and how to activate them. For more information, see interfaces(5).
  # The loopback network interface
  auto lo
  iface lo inet loopback
  # # The primary network interface
  # auto em1
  # iface em1 inet dhcp
  # Bridged network interface
  auto br0
  iface br0 inet dhcp
       bridge_ports em1
       bridge_stp off

Bring up the new bridge:

  ~$ sudo ifup br0

5: Create the build-command script

Create and enter the script file:

  $sudo nano /var/lib/libvirt/images/

Change the file to:

  vmbuilder kvm ubuntu \
         --hostname <insert> \
         --user <insert> \
         --pass <insert> \
         --libvirt qemu:///system \
         --addpkg openssh-server \
         --addpkg linux-image-generic \
         --destdir=./image \
         --flavour virtual \
         --bridge br0 \
         --mac 02:00:02:06:00:<insert last two digits> \
         --suite trusty \
         --cpus 1 \
         --mem 1024 \
         --swapsize=1024 \
         --rootsize 10000

6: Having problems with "Errors were encountered while processing: sudo"?

Only follow this step if the build-command script fails due to "Errors were encountered while processing: sudo". Follow procedure from

1) Open

  $ sudo nano /usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/

2) Change 'dist-upgrade' to 'update' (it only occurs once).

  • The error occurs because vmbuilder on the virtualization server runs "sudo apt-get upgrade" on the new VM it is creating, and the "sudo" package got an upgrade (around October 2016) which makes vmbuilder fail. By changing 'dist-upgrade' to 'update', it only runs a "sudo apt-get update". This also means that when logging onto the created VM for the first time, one should run "sudo apt-get upgrade" manually to make sure the newest packages are installed.

Guide for creating virtual machines

In this guide, the user "jhj" creates a virtual machine (VM) named "VirtualMachine1" with the IP address "". The MAC address, "02:00:02:06:00:07", used in the guide is from the MAC-IP address pair for "" found in Ressource assignment and deployed VMs on Beorn.

1: Create folder

Go to the VM images folder, create a new directory for the machine (MachineName.InitialsOfCreator), copy the build-script template to the directory and enter the directory:

  $cd /var/lib/libvirt/images/
  $sudo mkdir VirtualMachine1.jhj
  $sudo cp VirtualMachine1.jhj/
  $cd VirtualMachine1.jhj

2: Edit and run the build-script

Enter the build-script:

  $sudo nano

Modify the build-script:

  vmbuilder kvm ubuntu \
         --hostname VirtualMachine1 \
         --user test \
         --pass test \
         --libvirt qemu:///system \
         --addpkg openssh-server \
         --addpkg linux-image-generic \
         --destdir=./image \
         --flavour virtual \
         --bridge br0 \
         --mac 02:00:02:06:00:07 \
         --suite trusty \
         --cpus 1 \
         --mem 1024 \
         --swapsize=1024 \
         --rootsize 10000

3: Create and start the VM

Run the script (takes a couple of minutes) to create the VM:

  $sudo sh

Start the VM:

  $virsh start VirtualMachine1

4: Access the VM

Access the VM through SSH using the IP address "". Remember that the IP address was assigned to the VM because you used the MAC address from the MAC-IP pair in Ressource assignment and deployed VMs on Beorn.

See following guide for using SSH key-authentication instead of password authentication:

(5: Add extra disk drive)

This is ONLY necessary if you desire to mount an extra disk to your VM (E.g. if you want to simulate a production environment server running with a separate disk for data storage). IMPORTANT: The extra disk might lose all data if the virtual machine is shutdown, ie. ALL data will be lost if the VM is shutdown or restarted! (This might be fixed if the disk is attached to the VM inside virsh edit VirtualMachine1).

Start by going to the directory of the VM and create an extra disk (on the virtualization server). In this example, we create a 15GB disk:

  $cd /var/lib/libvirt/images/VirtualMachine1.jhj/
  $qemu-img create -f raw VirtualMachine1-disk2.img 15G

Attach the disk to the VM:

  $virsh attach-disk VirtualMachine1 --source /var/lib/libvirt/images/VirtualMachine1.jhj/VirtualMachine1-disk2.img --target sdb --persistent

The rest of should step is done on the virtual machine, so SSH into it. Now partition the new disk (just press enter when it suggests default values):

  $sudo fdisk /dev/sdb
  $Command (m for help): n
  $Partition type:
  $   p   primary (0 primary, 0 extended, 4 free)
  $   e   extended
  $Select (default p): p
  $Partition number (1-4, default 1):
  $Using default value 1
  $First sector (2048-83886079, default 2048):
  $Using default value 2048
  $Last sector, +sectors or +size{K,M,G} (2048-83886079, default 83886079):
  $Using default value 83886079

Create a "data" directory with read/write permission, and mount the partition to it:

  $cd /
  $sudo mkdir -m 777 Data
  $sudo mount -t auto -v /dev/sdb /data

Now your partition is mounted, and you can access it through the "data" folder:

  $cd /data

Sources: Add extra disk on virtualization server, Partition a disk in Ubuntu, Mount partition in Ubuntu

Personal tools