xref: /kvmtool/Documentation/virtio-console.txt (revision f616b10ba905b79707a2d398090b53f897899aae)
1*f616b10bSSasha LevinGeneral
2*f616b10bSSasha Levin--------
3*f616b10bSSasha Levin
4*f616b10bSSasha Levinvirtio-console as the name implies is a console over virtio transport. Here is
5*f616b10bSSasha Levina simple head to head comparison of the virtio-console vs regular 8250 console:
6*f616b10bSSasha Levin
7*f616b10bSSasha Levin8250 serial console:
8*f616b10bSSasha Levin
9*f616b10bSSasha Levin - Requires CONFIG_SERIAL_8250=y and CONFIG_SERIAL_8250_CONSOLE=y kernel configs,
10*f616b10bSSasha Levinwhich are enabled almost everywhere.
11*f616b10bSSasha Levin - Doesn't require guest-side changes.
12*f616b10bSSasha Levin - Compatible with older guests.
13*f616b10bSSasha Levin
14*f616b10bSSasha Levinvirtio-console:
15*f616b10bSSasha Levin
16*f616b10bSSasha Levin - Requires CONFIG_VIRTIO_CONSOLE=y (along with all other virtio dependencies),
17*f616b10bSSasha Levinwhich got enabled only in recent kernels (but not all of them).
18*f616b10bSSasha Levin - Much faster.
19*f616b10bSSasha Levin - Consumes less processing resources.
20*f616b10bSSasha Levin - Requires guest-side changes.
21*f616b10bSSasha Levin
22*f616b10bSSasha LevinEnabling virtio-console
23*f616b10bSSasha Levin------------------------
24*f616b10bSSasha Levin
25*f616b10bSSasha LevinFirst, make sure guest kernel is built with CONFIG_VIRTIO_CONSOLE=y. Once this
26*f616b10bSSasha Levinis done, the following has to be done inside guest image:
27*f616b10bSSasha Levin
28*f616b10bSSasha Levin - Add the following line to /etc/inittab:
29*f616b10bSSasha Levin	'hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0'
30*f616b10bSSasha Levin - Add 'hvc0' to /etc/securetty (so you could actually log on)
31*f616b10bSSasha Levin - Start the guest with '--console virtio'
32*f616b10bSSasha Levin
33*f616b10bSSasha LevinCommon errors
34*f616b10bSSasha Levin--------------
35*f616b10bSSasha Levin
36*f616b10bSSasha LevinQ: I don't see anything on the screen!
37*f616b10bSSasha LevinA: Make sure CONFIG_VIRTIO_CONSOLE=y is enabled in the *guest* kernel, also
38*f616b10bSSasha Levinmake sure you've updated /etc/inittab
39*f616b10bSSasha Levin
40*f616b10bSSasha LevinQ: It won't accept my username/password, but I enter them correctly!
41*f616b10bSSasha LevinA: You didn't add 'hvc0' to /etc/securetty
42