JetKVM
Add a JetKVM like any other KVM: type its address and qKVM recognises it. Leave the password empty if the JetKVM has none; the user name is ignored. A JetKVM has no "send me a picture" request: its screen exists only as WebRTC video, so qKVM connects the way the JetKVM's own page does. What that takes (the aiortc package and the video decoder it brings) is installed with qKVM. It is most of what an install takes on disk (75 to 120 MB of it, depending on the system), and is loaded only once there is a JetKVM on the wall. How a JetKVM is reached is its owner's choice, made at the device's own page (Settings, Access), and qKVM goes along with it:
- HTTPS or plain HTTP. Out of its box a JetKVM serves plain HTTP. With its HTTPS mode on it serves HTTPS beside that, with a certificate of its own making or one you give it. qKVM asks both ways and uses HTTPS wherever the JetKVM offers it, also where
http://was typed in front of the address; its certificate is remembered on first contact, as a Comet's is. An address typed withhttps://is never answered the plain way: where only plain HTTP answers, that is said, and the address is yours to type withhttp://. A JetKVM added over plain HTTP says so in the list of what was added. - When that is changed later, the tile follows. A JetKVM on the wall over plain HTTP is asked every ten minutes whether it offers HTTPS by now, and moved there when it does, where what answers there is that JetKVM: a certificate no other tile has, and the number it gives for itself the tile's (anything else there, a gateway's port that leads to another device say, is not followed, and the log says so). It is asked as well before qKVM signs in to it, and before a password you type for it is sent or a saved one is used in an edit, so that none goes out unencrypted where HTTPS is on offer. Each move is in the activity log. The other way round nothing moves by itself: a JetKVM that stops answering over HTTPS for two minutes and answers over plain HTTP keeps its address, with a password or without, and its tile says so. Over plain HTTP nothing is checked any more, and the certificate remembered for it is let go of by a person only: to allow it, change its address to
http://(and type its password again, if it has one). - With a password or without. Type the password when adding it, or leave it empty for one that has none. A password switched on at the device later shows on its tile as Login failed, with Update login to type it in. A JetKVM fresh from its box, where nobody has chosen yet how it is signed in to, lets nobody in and is said to be that.
- The JetKVM it was added for, and no other. qKVM remembers the number a JetKVM gives for itself when it is added, and asks it again before every video connection, over which every key, text and press goes: another JetKVM that took its address (a new lease) is sent none of them, and its tile says so. One without a password says its number to anybody, and is asked before anything goes. One with a password says it only to whoever is signed in, so over plain HTTP its password goes, unencrypted, before it can be told apart from another JetKVM with the same password. That is why HTTPS is the better choice: there the certificate remembered for it is checked before the password goes.
- Loopback-only mode (Settings, Advanced on the device) shuts everything but the device itself out, qKVM included.
- Virtual media, for an admin: an image of its own storage in its drive, as a CD-ROM drive or a disk, and images uploaded there through qKVM (see Virtual media).
Three things are different from a Comet, and they come from the device:
- One viewer at a time. A JetKVM shows its picture to a single connection. While it is on the wall, qKVM is that viewer. When someone opens the JetKVM's own console, the tile says In use elsewhere and qKVM stays away, so it never throws that person out. Show here on the tile takes the picture back (and disconnects them).
- Signing in signs others out. A JetKVM with a password has one session for everybody: when qKVM logs in, a browser logged in to that JetKVM has to log in again, and the other way round. qKVM logs in once and keeps its session for as long as it can.
- It must be reachable directly, on the LAN or over a VPN such as Tailscale. JetKVM Cloud only works from a browser signed in with Google, so qKVM cannot go through it. Its picture comes over a connection to the very address qKVM reaches it at: of the network addresses a JetKVM offers for its video, qKVM tries only that one (whatever answers at a JetKVM's address could otherwise have qKVM send its checks to any host it named). A JetKVM reached through a reverse proxy, a forwarded port, an SSH tunnel, a route through NAT or a 4via6 route offers addresses of its own, none of them the one qKVM reaches it at, and gives no picture there: its tile says that no video connection came about.
The picture is decoded on the computer running qKVM, and a JetKVM sends video at the rate of the screen it watches. Measured with a 1920×1200 screen at 60 frames a second, one JetKVM takes about 15 % of one core of a desktop processor for as long as qKVM is connected to it: while somebody has the wall open, and five minutes after the last viewer has gone. Then qKVM disconnects and it takes nothing. A JetKVM nobody has watched for a minute or more sends its first picture some five seconds after qKVM connects to it (a real one did every time; after a long rest it once took longer than fifteen): its tile says Waiting for the first picture meanwhile. Held for those five minutes, the picture is there at once when somebody looks again; the JetKVM's own page takes the viewer as at any other time, and the JetKVM works harder meanwhile (a real one: 8 % of its processor, where it used under 1 % with nobody connected). When its computer's screen comes back on a connection qKVM holds (the computer woke, or its screen did), the JetKVM says so at once and sends the first picture of it a moment later (a real one: within a second or two). Until that picture comes, the one from before is not handed out as the screen: the tile waits for it, and a live view that opens or asks for a picture meanwhile gets none (one that is open keeps what it shows). That moment is no sign of a JetKVM that stopped sending video, however old the picture from before: the first picture is waited for twenty seconds, where a JetKVM that stops sending pictures of a screen it shows is given five. Where none comes by then, it is taken for one that stopped, as after those five: called offline for the moment it takes to connect again, and a live view that held its keyboard and mouse takes them again (a real one once sent no picture on the connection it held while its computer was woken, and a new connection had it at once). Where qKVM falls behind decoding its video (a busy computer), it goes on from the next key frame, which it asks the JetKVM for; a JetKVM that sends none when asked has its connection made anew after five seconds without a picture, and each time in a row after twice as long as the time before, forty seconds at the most.
Keys, typed text, keep-awake, Wake-on-LAN, the ATX power extension and reboot are in the action menu. Text is typed in the keyboard layout the JetKVM says its computer uses (set on its own page): for each of the nineteen layouts it offers, with the keys of the layout Windows has under that name, from tables made of Unicode CLDR's keyboard data (qkvm/layouts.py); a character that takes a dead key is typed as that key and the next (on a German keyboard, an e with a circumflex is the circumflex key, then e). A character the layout has no key for (a Latin letter on a Russian keyboard), or any character where the JetKVM names a layout qKVM has no table for, is refused before anything is typed, with its place in the text and the layout named (not the character itself: the words are kept in the activity log, where a typed text never goes). A JetKVM whose layout was never chosen gets US keys, as its own page types them. Caps Lock is not looked at: where it is on, letters come out the other way round. A layout of another system (Linux, macOS) may have a few symbols elsewhere. The live view's keys are not touched by this: they are places on the keyboard, and the computer makes of them what its layout has there, as of a keyboard plugged into it. On a real JetKVM with a Windows PC behind it, keys, Ctrl+Alt+Del, Type text (every character of a US keyboard, 48 a second), the saved actions and keep-awake were seen to arrive on the PC, and so were the live view's keys, pointer, buttons and wheel; the restart works. The ATX extension's short press woke a real one's PC from its sleep, and its power and disk lights were read (see Limits); its long press, reset and Wake-on-LAN have so far only been tried on a stand-in.
How keys and the mouse go. A JetKVM has a binary channel for them (hidrpc), which its own page uses, and so does qKVM: each key, move and click goes at once, without waiting for the one before, and the JetKVM does the keyboard's in the order they were sent and the mouse's in the order they were sent. (A key and a mouse report that reach it at the same moment may be done in either order, as from its own page; a person's Ctrl and click are far enough apart. The wheel, which that channel has not got, goes over the other one, and may land a moment before or after a press of a button made at the same time.) A key held in the live view is kept alive as its own page keeps it: the JetKVM lets go of a key 100 ms after it was pressed or last kept alive. Its page sends a keep-alive every 50 ms, qKVM every 30 (one that comes early counts in full, so a wall that is busy for a moment has more time to spare). So when qKVM vanishes (stopped hard, or the network between them cut) a key it held is let go of within a tenth of a second (a real one: 0.1 s after the last keep-alive, where it took some six seconds before); Ctrl, Shift, Alt and Win the JetKVM never lets go of that way, and those wait until it notices that the connection is gone, some seconds later. A keep-alive that comes more than about a tenth of a second late lets go of the key for good: over a link that stalls that long, the computer stops repeating a key that is still held. An action types one key a round trip, each once the JetKVM has said that it has it, so one key is on its way at the most (on a local network 48 keys a second, where the other way gave 33). A JetKVM that does not answer qKVM's question on that channel within two seconds of its opening (a firmware older than the channel) is spoken to as below; keys and actions then wait those two seconds once a connection. One whose answer comes later (a wall busy for seconds, or a JetKVM still setting the channel up) is asked again once a second for ten seconds, as its own page asks, and gets its keys and mouse over that channel from the first moment nothing of qKVM's is down on it or on its way to it, and no action types.
Over that other way, JSON-RPC, a JetKVM does each request in a task of its own, so two that arrive together are done in either order. qKVM sends it keys and the mouse one at a time, each once the JetKVM has answered the one before; sent without waiting, a real one typed the alphabet out of order and kept a key and a mouse button down. On a local network an answer takes a few milliseconds. Over a slow link (a VPN, Wi-Fi) keys wait their turn: at a tenth of a second there and back, some five keys a second go through, and fast typing falls behind. Moves of the mouse and turns of the wheel that wait add up, so the pointer keeps up (a turn of the wheel may then land a little before or after where the pointer went meanwhile); a press or a release of a button stays where it was made. A JetKVM that leaves one of them unanswered for five seconds, or falls far behind, has its connection ended (it lets go of every key then, and what waited to go is lost) and made anew; its tile stays online, and whoever held its keyboard and mouse is told at their next key. On either way, an action that types waits for keys of the live view still on their way, and is refused (busy) where they take longer than that; where the JetKVM does not say that it has a key the action pressed, the key is let go of and the connection is ended as well.
Letting go. A JetKVM lets go of the keyboard when the connection that pressed it ends and when its own page takes the viewer; never of a mouse button: a real one kept the left button down across both, for whoever came next. So qKVM lets go of what it has down before it ends a connection itself (the tile edited or removed, the wall locking itself or stopping, nobody watching), and a connection after one that ended with something of qKVM's down, or maybe down, begins with "nothing down" (the keyboard, and the mouse's buttons where the pointer was last put). To the computer a JetKVM's mouse is two, one put at places and one moved by steps (the live view's locked pointer), each with buttons of its own: a drag begun with one and ended with the other is let go of on both. Where the JetKVM closes only the channel keys and the mouse go over, the buttons and the keyboard are let go of over the other. An action that types stops where its connection is ending: it lets go of its key at once, nothing of it goes after that, and it says after how many keys it stopped; a key held in the live view is no longer kept alive then, so the JetKVM lets go of it within a tenth of a second. Whoever holds the keyboard and mouse in the live view loses them, and is told so, as soon as somebody opens the JetKVM's own page, and nothing more goes to it, also not the rest of a text being typed, but one thing: a letting go. A JetKVM goes on doing what the old connection sends for about a second after the hand-over, and closes it then; a key pressed in that second stays down for whoever has taken the viewer (a real one repeated it until the page's own connection ended), and a letting go sent in that second lets go of it (seen on the real one too). Over hidrpc, where qKVM cannot tell whether its last key was done before the hand-over or after, it sends one letting go of the keyboard where the last it said had a key down, and of the mouse's buttons where they were down, at once, behind everything of its own (the JetKVM does them in order), and nothing else; its keep-alives stop. Over JSON-RPC, a key or a mouse button qKVM pressed that the JetKVM did after it had handed its viewer over (its answer comes after the JetKVM said so) is let go of by one more report as that answer comes, and one it never answered is let go of the same way once no answer has come in time, while the connection is still open, and again, in turn, should its answer come after all; a mouse button held as the page took over is let go of once no mouse report of qKVM's is in the JetKVM's hands; qKVM waits up to two seconds for such answers before it closes its connection, also when the tile is edited or removed or qKVM stops in those seconds. A power button is not pressed where the page took over meanwhile (the action says so, also where it was cut off while qKVM still asked whether the power board is on), and one that was on its way is said to be "may have been done", as it is whichever way qKVM's connection to the JetKVM ended while the press was on its way (the tile edited or removed, the wall locking itself, the connection given up or closed). A press the JetKVM does only after qKVM's connection to it has closed is the one thing nobody lets go of then (see Limits).