Today is a nice milestone. For the first time my server is "in the cloud", and yet I have full control over the kernel it is running.

While it should be possible to do this with Xen, I never found a host who would. So for the three years since I got rid of colocated physical hardware, I was constantly nagging my Xen hosters to update their kernels, often to fix security issues. And I sometimes struggled with things like udev that needed a newer kernel. Most importantly it just didn't feel right for "my" server to not run my kernel. Even though in this modern day, "my" server is just a fever dream of bigger computer. I'm infected with the Sovereign Computing meme.

KVM probably makes this easier than does Xen. What Steve has set up at kvm-hosting.org is a great example and template for providing a small group with great hosting at a very fair price, with full control, and an excellent interface.

It's the little things, like being able to view the my neighboring guests' virtial machines in top, that I really like.

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 2841 joey      20   0 1637m 1.0g 3152 S    7 13.2  48:27.20 kvm                
 6606 steve     20   0 1365m 1.0g 3540 S    2 13.2   9:29.52 kvm                
 2888 cernio    20   0 1269m 284m 3152 R    1  3.6   4:08.57 kvm   
 2800 ore2      20   0  754m 521m 3152 S    0  6.6   4:35.68 kvm     

This all feels sorta science fictional when I step back and look at it.


notes for kernel setup on kvm-hosting.org

I want to be able to install regular Debian kernel packages. In these packages, the virtio drivers are modules, and need to be manually added to an initrd. So first edit /etc/initramfs-tools/modules and add the below to it, then run update-initramfs -k all -u to rebuild the initrd. BTW, some of these modules may not really be necessary.

virtio_blk
virtio_console
virtio_pci
virtio_net
virtio_balloon
virtio-rng

Then edit /etc/kernel-img.conf to configure the kernels to add a symlink to the latest version in /boot. This way, kvm-shell can be configured to boot the latest kernel automatically.

do_symlinks = yes
link_in_boot = yes

And here is a hook that rsyncs /boot, sending kernels and initrds to kvm-hosting, so its interface will let me boot them. This was put in /etc/initramfs-tools/hooks/kvmhostingrsync and made executable.

#!/bin/sh
# Use --copy-links so the symlinks to the current
# kernel and initrd are selectable in kvm-shell.
# 
# Use --delete because I like living dangerously. :)
rsync --copy-links --delete -vazr /boot/ kernels.kvm-hosting.net::joey-kernels/