[CentOS-virt] Setting up serial ports on kvm guests

Tue Jan 31 21:15:17 UTC 2012
Nenad Opsenica <nenad at panline.net>

Hi James,

You should try to make a PCI pass-through for your multiport serial card 
in virt-manager.
Although I haven't tried this kind of configuration, I think that this 
should be the right way to make such setup.
You'll need driver for this PCI card within your guest OS.

On 01/31/2012 08:01 PM, James B. Byrne wrote:
> CentOS-6.2
>
> We have a dedicated CentOS-5.7 host used for fax reception
> and transmission that we wish to move to a CentOS-6.2
> virtual guest instance. The CentOS-6.2 virtual host has a
> 4-port serial card installed.
>
> lspci -v tshows this this:
>
> 03:00.0 Serial controller: Oxford Semiconductor Ltd
> OX16PCI954 (Quad 16950 UART) function 0 (Uart) (prog-if 06
> [16950])
>          Subsystem: Oxford Semiconductor Ltd Device 0000
>          Flags: medium devsel, IRQ 17
>          I/O ports at d040 [size=32]
>          Memory at d0702000 (32-bit, non-prefetchable)
> [size=4K]
>          I/O ports at d020 [size=32]
>          Memory at d0701000 (32-bit, non-prefetchable)
> [size=4K]
>          Capabilities: [40] Power Management version 2
>          Kernel driver in use: serial
>
>
> setserial -g /dev/ttyS* shows this:
>
> /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
> /dev/ttyS1, UART: 16950/954, Port: 0xd040, IRQ: 17
> /dev/ttyS2, UART: 16950/954, Port: 0xd048, IRQ: 17
> /dev/ttyS3, UART: 16950/954, Port: 0xd050, IRQ: 17
>
>
> But, in virt-manage, when I try to add a serial device  to
> the guest as the physical character device /dev/ttyS1 I
> get this error and the device is not added.
>
> XML error: unknown device type
>
> Traceback (most recent call last):
>    File
> "/usr/share/virt-manager/virtManager/addhardware.py",
> line 1026, in add_device
>      self.vm.attach_device(self._dev)
>    File "/usr/share/virt-manager/virtManager/domain.py",
> line 698, in attach_device
>      self._backend.attachDevice(devxml)
>    File "/usr/lib64/python2.6/site-packages/libvirt.py",
> line 400, in attachDevice
>      if ret == -1: raise libvirtError
> ('virDomainAttachDevice() failed', dom=self)
> libvirtError: XML error: unknown device type
>
> We wish to have at least two, preferably three, andf
> ideally all four, serial ports enabled on the virtual
> guest. Does anyone know how this is accomplished?