sandia-minimega / minimega

minimega
GNU General Public License v3.0
148 stars 67 forks source link

Add copy/paste support #1520

Closed jacdavi closed 7 months ago

jacdavi commented 9 months ago

Adds two levels of copy/paste support:

  1. Primitive Paste - enabled by default for all VMs. On a ClientCutText VNC request, types out the contents of the paste buffer
  2. Bidirectional Copy/Paste - can be set by the bidirectionalCopyPaste vm config. When enabled, copy/paste does not type directly, but interacts with the host and VM clipboards directly. Note that this setting requires QEMU 6.1+ compiled with the vdagent and for spice-vdagent to be installed on the VM.

Additionally adds a new vnc type command which will type the provided ascii string into the specified vm. All shifted characters on a US keyboard are handled correctly. e.g., vnc type my-vm "this is a long string I want in the VM!!". Under the hood, this is what the primitive paste is utilizing.

jacdavi commented 7 months ago

LGTM, Is there anyway to make this backwards compatible? IE detect version of QEMU disable copy paste for older qemu

Does it work to check at vm start and just disable the bidirectional copy/paste with a warning if an old QEMU is used? The way it is now, it's backwards compatible by default, but setting vm config bidrectional-copy-paste true requires QEMU 6.1+.

Could additionally check for the spice-vdagent to be in QEMU since that's also a requirement