From the Canyon Edge -- :-Dustin

Thursday, June 25, 2009

KVM's inside of Byobu

Here's a neat trick that I find phenomenally useful...

I like to run KVM virtual machines inside of Byobu, using KVM's -curses option. From QEMU's manpage:

Normally, QEMU uses SDL to display the VGA output. With this option, QEMU can display the VGA output when in text mode using a curses/ncurses interface. Nothing is displayed in graphical mode.

So this only works with non-graphical virtual machines, such as the Ubuntu Server. But hey, that's what I'm working on every day. Here's a quick demo screen cast.



Commands used in this video:

  1. start byobu

  2. run kvm -curses karmic-server.img to launch one virtual machine

  3. hit F8 to rename this window karmic

  4. hit F2 to open a new window

  5. start a second virtual machine, and rename that window

  6. hit F3 or F4 to move back and forth between windows

  7. hit F6 to detach

  8. and byobu -x to re-attach


The detach/reattach is really cool, as these virtual machines will continue running in the background. Many people use this sort of method to background an irc client such as irssi, which allows it to serve as a persistently connected proxy.

Of course, virsh and virt-manager are the preferred methods to manage virtual machines in Ubuntu, but I find this useful for my development purposes.


Cheers,
:-Dustin