Skip to content

vivian: disable graphical window when running qemu, use telnet

clayton craft requested to merge craftyguy/valve-infra:qemu_no_win into master

Here's the reasoning why I chose to use telnet instead of dumping the console to the terminal:

  1. by dumping the console to the current terminal, it makes debugging/using the vivian script more difficult. stdout is intermixed with (or when urwid launches, it's lost in) the console output from the VM. this includes the sudo/doas prompt from cleanup when it quits

  2. console from the VM isn't resized correctly when the terminal window is resized. Martin found a workaround on the Arch wiki but it isn't straight forward (use 'resize' or use 'stty' and manually enter geometry)

  3. ya instead of telnet, I could redirect stdio to a socket that can be connected to with socat or something, but telnet makes connecting/using it super easy (even if you have to install the telnet client...)

  4. vivian currently launches an ssh session to the infra VM once it is up, which is probably the best way to interact with it over the existing terminal that you used to make vivian, it's fast, resizes the console correctly, etc. so this telnet/console stuff would only really be useful for debugging boot issues in vivian, and so you wouldn't even need to install the telnet client if you didn't need to do that.

  5. the dashboard could still use it, i.e. for DUT VMs it would just run telnet on some port for the VM instead of tailing a log file. the console output can still be sent to a log file so it's persistent. this would also allow interacting with the DUT VM via stdin, which currently isn't possible with the "dumb" tail approach. Note that this patch doesn't affect DUT VMs from the vpdu, I'm just pointing out that this technique may also be useful there!

Merge request reports

Loading