The latest release of kvm-84 adds a new virtio console infrastructure to qemu. This is basically a new hypervisor console output in addition to the serial and parallel port consoles. You can toggle the display of these character based consoles by typing ctrl-alt-n where n is the number assigned to the console. Currently only a single virtual console is supported for the virtio-console device but the infrastructure allow for assignment of hardware based consoles in future. The command syntax is already in place for using hardware based consoles in future and is as follows.
qemu-system-x86_64 -hda Linux.img -m 300 -virtioconsole devicearg
where devicearg represents your hardware based device. Currently qemu only allows for a single virtual console so this command will not work in its current implementation.
By default, your virtio-console display is found after your serial and parallel outputs as just another virtual console. You don't need to use any additional options when starting up your guest to verify this as your guest is assigned a virtual console by default. From within your kvm guest window, type ctrl-alt 5 and you will see an output similar to the following.

Note that by default ctrl-alt-2 shows your monitor, ctrl-alt-3 displays your serial console and ctrl-alt-4 displays your parallel port console.
Comments
But can it be used?
Thursday, October 29, 2009 - 18:07 Guido (not verified)Hi,
I've been a bit puzzled by this: I can connect to the console, but don't seem to be able to use it. Is there a way to actually get a console output for it? (like a login screen) Is there a device I have to set my getty inside the guest, or something else I have to do?
Thanks,
Guido
Re: can it be used
Thursday, October 29, 2009 - 21:46 Haydn SolomonGuido,
Right now there's no real use for it. It's just infrastructure setup for future use.
i am using QEMU PC emulator
Thursday, March 4, 2010 - 14:16 scar (not verified)i am using QEMU PC emulator version 0.9.1 (kvm-84) under ubuntu, with this command to boot up a WinXP guest: /usr/bin/kvm -S -M pc -m 512 -smp 1 -name winxp -uuid ab79113e-5981-010c-07cc-0e91020f2981 -monitor pty -pidfile /var/run/libvirt/qemu//winxp.pid -localtime -no-acpi -boot c -drive file=/dev/mapper/ubuntu-winxp,if=ide,index=0,boot=on -drive file=/home/scar/EN Win_XP_Pro/EN_WinXP_Pro.iso,if=ide,media=cdrom,index=2 -net nic,macaddr=54:52:00:14:bb:fc,vlan=0 -net tap,fd=17,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:0 -k en-us
i am getting an unknown pci device in the device manager, and i have tracked it down to a virtio console device, per this screen shot:

how to resolve it? i use virt-manager and virsh to manage the VM.
also, perhaps related, when i use alt-^2 to switch to the monitor i get nothing but "virtio console0" on the first line and a solid cursor on the second line, unable to enter any commands.
thanks
Re: i am using QEMU PC emulator
Thursday, March 4, 2010 - 17:29 Haydn Solomonscar,
There's nothing you can do about the virtio console as it's turned on by default with kvm-84. IIRC they switched this off by default in the following versions. Virt-manager doesn't give you access to the monitor.
Now the console half-works
Wednesday, March 31, 2010 - 12:19 Guido (not verified)With newer qemu-kvm if you boot a machine and bind a getty to "hvc0" now you can have a login prompt on the virtio console.
I still haven't found a way to make the kernel use the console, though. None of no console parameter, console=hvc0 or console=hvc0,38400 work.
Guido
Post new comment