VMs using KVM from Ubuntu command line. Portable hypervisor / homelab. RDP to Debian desktop.



VMs using KVM from Ubuntu command line. Portable hypervisor / homelab. RDP to Debian desktop.

VMs using KVM from Ubuntu command line. Portable hypervisor / homelab. RDP to Debian desktop.

00:00 Purpose of video
01:41 Installing Ubuntu Server as host
02:09 What is HWE kernel?
03:28 Responses to the installer
06:36 Install KVM core packages
06:59 Getting the Ubuntu Cloud Image
08:34 Creating cloud-init configuration
09:51 user-data
10:34 meta-data
11:30 Host reboot
12:12 virt-install ubuntu
13:12 br0 from netplan
15:28 First console to ubuntu guest
16:21 Test port 22 on guest
16:57 Test port 8000 on guest
17:57 Install Debian desktop by ISO
20:15 tasksel
22:14 ssh access to Debian
23:06 RDP from Windows
24:36 The problem with /tmp
25:06 Persisting cloud-init disks
27:19 Console to new guest
28:09 Reboot hypervisor host

I have amassed enough actual hardware devices to consider getting rid of multiple power and ethernet cables with a ProxMox-type server.

I’m too used to carting a laptop across the country on trains to go the dedicated ProxMox route. I’ve been using mostly VirtualBox until now. It’s feature rich but low performance.

I’m fond of KVM and discovered cloud images in 2019, which allowed me to skip lengthy installations without having a Vagrant dependency.

Here I set up a fresh, minimal KVM server installation. Desktop works too, I tried. I refer to this as my “homelab”, but that is just my new jargon for something I’ve been working on for years without having a word for it. I install a couple of VMs. First a pre-prepared Ubuntu cloud image. Second I install Debian desktop from ISO.

I haven’t published the tutorial to accompany this yet. Do check silverbullets.co.uk for this, and similar articles. Give it another hundred more posts and I’ll maybe be ready for OpenStack.

Now the code for an Ubuntu cloud image that I promised:

openssl passwd -6 -salt saltEntropy2000 password

ssh-keygen -t ed25519 -C “Demo default key”

#cloud-config
users:
– default
– name: user1000
sudo: ALL=(ALL) NOPASSWD:ALL
lock_passwd: false
passwd: “$6$saltEntropy2000$ixYDbpakZhqyNDrGRBrUuZomw3IEsd0P6ku1WwIa4g7Nq8ZnqdCXV7WWLg8M7tCcjEtwc/eRYCjwM.FxDGibM0”
shell: /bin/bash
groups: users, admin
ssh-authorized-keys:
– ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINN4MoYckzjbwwI8Hpf4QPsbB9jb9sorxq1W/QIlOyAv Demo key with default name

instance-id: ubuguest
local-hostname: ubuguest

qemu-img create -b /tmp/ubuntu-22.04-server-cloudimg-amd64.img -f qcow2 -F qcow2 /tmp/ubuguest.qcow2 12G

vim /etc/netplan/00-installer-config.yaml

network:
version: 2
ethernets:
eno1:
dhcp4: no
bridges:
br0:
dhcp4: yes
interfaces:
– eno1

virt-install
–virt-type kvm
–name ubuguest
–ram 2048 –vcpus=1
–os-variant ubuntu22.04
–disk path=/tmp/ubuguest.qcow2,format=qcow2
–disk /tmp/ubuguest-cidata.iso,device=cdrom
–import
-w bridge=br0,model=virtio
–noautoconsole