get an Ubuntu 16.04 LTS. iso

Kubernetes is developed on 16.04, and has the version of docker supported for kubernetes in its apt repositories.

Download Page

boot and install Ubuntu in the virtual machine host that you choose, in this we will be using qemu

create a raw image

qemu-img create -f raw k8s-ubuntu.img 4g

run the virtualized system using the ubuntu image that we just downloaded.

# qemu-system-x86_64 options disk_image
qemu-system-x86_64 -m 2G -enable-kvm -cdrom ubuntu-16.04.5-server-amd64.iso -boot order=d -drive file=k8s-ubuntu.img,format=raw
*Note:* By default only 128 MB of memory is assigned to the machine. The amount of memory can be adjusted with the -m switch, for example -m 512M or -m 2G.

output should look like this

WARNING: Image format was not specified for 'ubuntu-16.04.6-server-amd64.iso' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
VNC server running on ::1:5900

install ubuntu on the virtual machine

connect to the vnc server on localhost:5900, This guide will be using tiger-vnc

you can follow the default installation steps but make sure that you choose openssh during your installation of ubuntu

Running the virtualized system

start the virtual machine

start the virtualized system that we just created, For example, binding port 10022 on the host with port 22 (SSH) on the guest, start QEMU with a command like:

qemu-system-x86_64 -m 2G -enable-kvm k8s-ubuntu.img -net nic -net user,hostfwd=tcp::10022-:22

connect via ssh

ssh localhost -p10022

❎ TODO configure the system

use the initial page for configuration

Copying an image to a physical device

sudo dd if=k8s-ubuntu.img of=/dev/sdd bs=4M status=progress && sync