Skip to content

Problems about a Specific QMP Scripting Use Case #6462

Description

@iblowmymind

BEFORE SUBMITTING YOUR ISSUE, PLEASE LOOK AT THE PINNED ISSUES AND USE THE SEARCH FUNCTION TO MAKE SURE IT IS NOT ALREADY REPORTED. ALWAYS COMMENT ON AN EXISTING ISSUE INSTEAD OF MAKING A NEW ONE.

Describe the issue
Hello,
I'm trying to run a program called GlobalView for X on a Solaris 2.6 Sparcstation-5 virtual machine on UTM. This specific program requires the use of the Sun keyboard's "function cluster" (the set of keys on the very left of a Sun Type 5 keyboard, Props and Copy for example) for some of its functionality. Now, I'm not in the posession of a Sun keyboard myself, bu I can invoke these keys by using the QEMU compat monitor and the "sendkey" command. However, this requires effort every time I want to press one of these keys. So, I thought I would try to make a soft keyboard panel using macOS's Accessibility Keyboard and its Panel Editor functionality, which I then added custom keys to and bound an AppleScript to each one. These keys (using the Help key as an example) invoke this shell command (through AppleScript "do shell script"):

cat <(echo "{ \"execute\": \"qmp_capabilities\" }"; echo ""; echo "{\"execute\": \"send-key\", \"arguments\": { 'keys': [{ \"type\": \"qcode\", \"data\": \"help\" }] }}") | nc localhost 5902

This is what the panel looks like:
Screenshot of the key panel

I also added this argument to UTM manually: -qmp tcp::5902,server,nowait (I'm pretty sure UTM already defines its own QMP interface, but I think I can add multiple?)
Basically, I'm using QMP scripting to send a send-key command that contains the key I want with netcat through a TCP socket.

Now, I've tested this on the latest stock QEMU (9.x) and it works just fine (I can send QMP commands alright), however on UTM after nc recieves the server handshake messages and sends the first character of the response, the remote side immediately closes the connection. The odd thing is, running nc or telnet interactively works just fine. However, I can't seem to do this headless no matter what! I've tried using ncat and socat, both the regular monitor (defined both from UTM and as a custom QEMU argument) and the QMP, and the outcome is the same: Nc recieves the server handshake stuff, but QEMU immediately closes the connection without waiting for nc's full response (my command). There's nothing related to my QMP port being opened in the logs.

Would anyone be able to assist me? I'd prefer to use the UTM interface for managing my VM.
Thanks!

Configuration

  • UTM Version: 4.5.3
  • macOS Version: 14.5
  • Mac Chip (Intel, M1, ...): M3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions