1. Getting started

Create and run your first virtual machine

Goals

  • Get familiar with the lab environment
  • Create your first VM using KubeVirt
  • Start and stop a VM using virtctl or kubectl
  • Connect to the VM’s console
  • Expose and access ports of your VM
  • Change a file inside a VM and observe the behaviour

Folder structure

This is your first lab where you will create and apply files to the Kubernetes cluster. It may make sense to structure your files according to the labs. Feel free to create a folder structure something like this:

labs
|-- lab01
|-- lab02
|-- lab03
[...]

Make sure you’re in the correct directory:

cd /home/project

Initialize the directory structure by executing the following command:

mkdir -p labs/lab{01..9}/

Finally, verify the structure:

tree labs

1.1. Create a VM

Create your first virtual machine

1.2. Start and stop a VM

Start and stop your virtual machines

1.3. Accessing the console

Opening a console on your virtual machine

1.4. Exposing VM Ports

Accessing ports of the running virtual machine

1.5. Changing files

Changing files in your running VM