KVM Serial console and VNC console

· by Tim Hughes · Read in about 1 min · (105 words)

Configuration for libvirt to get serial and graphics working at the same time:

virt-install \
 --name centos6_golden \
 --ram 2048 \
 --arch x86_64 \
 --vcpus 4 \
 --disk path=/var/lib/libvirt/images/centos6_golden.disk,format=qcow2,sparse=true,size=24,bus=virtio \
 --location http://repos.example.com/repos/centos/6.4/os/x86_64/ \
 --hvm \
 --accelerate \
 --nographics \
 --os-type linux \
 --os-variant virtio26 \
 --extra-args 'acpi=force noipv6 console=tty0 console=ttyS0,115200 ks=http://repos.example.com/kickstarts/el6.ks ksdevice=52:54:00:A8:7A:0A ip= gateway= netmask= dns= ' \
 --network bridge:br250 \
 --mac 52:54:00:A8:7A:0A

Serial console in GRUB:

serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1 terminal --timeout=15 serial console

Change the kernel command line to attach ttys in the right spots. Remove rhgb and quiet and add the following to the kernel command line:

acpi=force console=tty0 console=ttyS0,115200n8