Table of Contents

Websocket Communication

Goals

We want our virtualization platform to use noVNC web-based consoles and have support for serial communication.

We'll be doing this using Qemu VNC UNIX websockets. It may be easier to try with a normal IP-based socket first, then convert your code to use UNIX sockets.

There is probably two ways this can be implemented, 1) we use websockets in qemu and proxy it to the client; and 2) we use raw communication between our app and qemu, and proxy that over websockets to the client.

I'd prefer we handle all communication in the same flask app than use a proxy process that requires an additional port to be opened. This way authentication would be easier and contained in the same app?

POC Process

Testing

Basic noVNC testing with an IP-based socket…

qemu-system-x86_64 -m 512 --enable-kvm -vnc :0,websocket
python -m http.server
http://localhost:8000/vnc.html

We however need the above to work with UNIX sockets…

qemu-system-x86_64 -m 512 --enable-kvm -vnc /tmp/test.sock,websocket

For serial…

-chardev socket,id=serial0,path=/tmp/ws-serial.sock,server,nowait,websocket -serial chardev:serial0