Websocket Communication

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?

  • Flask app to forward websock communication from VM to browser window
    • noVNC
      • Get basic forwarding of websock communication working with noVNC
      • Opening multiple browser windows must work
    • serial console
      • Get basic forwarding of websock communication working with xtermjs
      • Opening multiple browser window must work
    • Add very basic test:test authentication
      • Protect endpoint

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
  • projects/osmiumvm/challenges/websocket-communication.txt
  • Last modified: 2020-08-12 03:49
  • by nkukard