QEMU-KVM Linux virtualization on the command line
I recently discovered that qemu-kvm
has a very promising -curses
option that, instead of starting an X window, will show a nice ncurses output from the guest suitable for managing a Linux guest from the command line (or, more satisfyingly, within a screen session, or even over ssh).
So I tried this out, and discovered that my Arch Linux guest goes into a "Graphics Mode" rendering this feature useless. From what I have been able to ascertain, the issue is that the guest kernel initializes a framebuffer to allow for higher than 80x60 character resolution (and pretty graphics). So I went on a hunt to find a way to prevent the guest kernel from starting the framebuffer. I have tried a variety of kernel parameters, nomodeset
, fb=false
, vga=0x0FF
, vga=ask
(and subsequently selecting a VGA
rather than a VESA
mode), to no avail: every time qemu-kvm -curses
reports being in a "Graphic Mode" on the guest (after the initial boot menus), and I am unable to interact with the guest from a command line terminal on the host.
Is there any easy way to keep the guest kernel in the same mode that it starts in (no framebuffer) without changing a kernel build parameter? If not, what kernel build options should I change to compile a kernel without framebuffer support? Is there a better way to get a VM login from a terminal on the host in pure text mode (suitable to run in a screen session on the host, for example) without resorting to running sshd on the guest?
So the underlying module that needs to be disabled is fbcon
, however Arch's kernel does not compile it as a module, so blacklisting it out. It might still be possible to identify and disable the particular driver that fbcon
launches but no such driver is listed by lsmod
, so qemu-kvm
's driver is compiled into Arch. To disable fbcon
itself, you have to use its own strange boot option syntax:
fbcon=map:99
where 99
is just some arbitrarily large number that is greater than the number of framebuffer devices on the system (usually 1-2).
See fbcon.txt for more info.
vga16fb.modeset=0
worked for me in the past (in Ubuntu). Also in Ubuntu, blacklisting all framebuffer modules (vga16fb included) worked too.