Tdd Apps

# Ubuntu installation on KVM

Mar 30, 2017 1 minute read

Ubuntu is a very popular Linux distribution [citation_needed] and KVM its default virtualization infrastructure. Unfortunately, creating Ubuntu virtual machines for KVM is not a simple process. I built a tool to automate parts of this process and here’s how to use it.

Prerequitistes

Installation

git clone --depth 1 https://github.com/camilin87/kvm-automation.git && cd kvm-automation

Create the virtual machine

This command creates an Ubuntu virtual machine named vm1 in the ~/vms folder. The new machine will have two CPUs, four GB of RAM, seven GB of hard drive, and will use the bridge network adapter br0

ruby vm_task.rb UbuntuVmCreationTask                     \
    --path ~/vms/ --name vm1                             \
    --cpu 2 --ram 4096 --hdd 7 --br br0                  \
    --os-variant "ubuntu16.04"                           \
    --img ~/vm-templates/ubuntu-16.04.2-server-amd64.iso \
    --vnc-port "5921"

Complete the installation

Fire off your favorite VNC client and connect to your KVM host on port 5921

Ubuntu Installation

kvm-automation caveats

Never miss a post. Subscribe to our newsletter