Virtio Serial Device How To

Asked by Anton Nayshtut on 2013-04-30

How To create, test and use the Virtio Serial Device

Question information

English Edit question
netanya-obsolete Edit question
No assignee Edit question
Last query:
Last reply:

Basic info:

To add VirtIO PCI Serial device via QEMU command line:

        -device virtio-serial-pci,id=virtio_serial_pci0,addr=0x07

To add VirtIO PCI Serial device Port via QEMU command line:

        -chardev socket,id=devvc1,path=/tmp/virtio_port-vc1,server,nowait \
        -device virtconsole,chardev=devvc1,name=pvlib.0,id=vc1,bus=virtio_serial_pci0.0

Thus, to add one VirtIO PCI Serial device with one port attached:

        -device virtio-serial-pci,id=virtio_serial_pci0,addr=0x07 \
        -chardev socket,id=devvc1,path=/tmp/virtio_port-vc1,server,nowait \
        -device virtconsole,chardev=devvc1,name=pvlib.0,id=vc1,bus=virtio_serial_pci0.0

Please refer to lp:~daynix/netanya/trunk/PVTools/ that adds one VirtIO PCI Serial device with two port attached.

Once you have a port created, you should be able to see:
 - On the Host: corresponding socket file (/tmp/virtio_port-vc1)
 - On the Guest: corresponding DosDevice file (\\.\pvlib.0)

On the Host, the socket file can be accessed using socat tool (

On the Guest, the DosDevice file can be accessed by some standard console tools and techniques (like IO streams redirection, type etc.), however lots of standard applications doesn't support or partially support DosDevice files.

Can you help with this problem?

Provide an answer of your own, or ask Anton Nayshtut for more information if necessary.

To post a message you must log in.