I am trying to establish a communication channel between the host and one of its guest virtual machine using kvm as a hypervisor. For this, I am using virtio-serial.
To create the virtual machine, I issued the following command:
qemu-system-x86_64 \
-m 2048 -name ubuntu \
-hda ubuntu_image \
-device virtio-serial \
-chardev socket,path=/tmp/foo,server,nowait,id=foo \
-device virtconsole,name=jobsfoo,chardev=foo,name=org.ubuntu.foo \
And then for communicating, on the guest, I use:
socat /dev/hvc0 -
And on the host:
socat /tmp/foo -
I come to understand that /tmp/foo
is a socket and /dev/hvc0
a character device.
Why is there an symmetric interface for communication: a socket on the host and a character device on the guest?