Going back to the original email from 2018:
It might be neat to attach ISOs to KVM guests via websockets. Basically
the browser would be the NBD "server" and an NBD client would run on the
hypervisor, then use `virsh change-media vm1 hdc --insert /dev/nbd0` could
use an ISO from my desk to boot from.
Here's an HTML5 open file example:
https://stackoverflow.com/questions/3582671/how-to-open-a-local-disk-file-with-javascript
and the NBD protocol looks simple enough to implement in javascript:
https://stackoverflow.com/questions/17295140/where-is-the-network-block-device-format-describled
So I think what you mean here is that in a browser you'd open a local
(eg) ISO, and then that ISO could be shared with a remote VM. The
browser runs a Javascript NBD server. The remote VM is qemu. Between
the two is a WebSocket.
I've seen this being done with an HP blade server of some kind and
IIRC the client side used a Java applet. No idea what the protocol
was but likely something proprietary. It was nevertheless a useful
feature, eg to boot the server from an install CD that you have
locally.
I guess the problem is two-fold:
(1) You need to write an NBD server in Javascript. Not especially
difficult, particularly if you avoid any complicated features, and I
guess you only need read support.
...
When qemu is running headless using a VNC or Spice display we can access
the display of https+websockets using things like noVNC---which is out of
scope to this converstation---but I'm just saying that such an existing
web front-end for the display could be extended to have an "Insert CDROM"
button and use the javascript file IO for the user to reference a local
file and pass it to qemu over nbd, perhaps via nbdkit.
I'm not sure how nbdkit would be involved, unless it was compiled
to WASM or something like that.
But the plan above sounds feasible, albeit a chunk of work.
Rich.