feat: QEMU SPICE display and audio support#4479
feat: QEMU SPICE display and audio support#4479stuffbucket wants to merge 1 commit intolima-vm:masterfrom
Conversation
- Add SPICEOptions to YAML schema (GL, streamingVideo, agent, audio) - Detect SPICE audio configuration and route through spice audiodev - Query SPICE port via QMP for display connection - Add SPICE password change support via QMP - Add unit tests for SPICE audio detection Signed-off-by: stuffbucket <231133237+stuffbucket@users.noreply.github.com>
d90ead1 to
9337bf6
Compare
|
There is a trailing new line on the ubuntu-desktop-spice.yaml template. I can resubmit the PR if you'd like. I tried to catch all the linting in the branch but this one got through. I don't want to trigger CI runners for a blank line at the end of the file unless that's what is desired (assuming the PR gets accepted). |
There was a problem hiding this comment.
Seems too many templates; they could be consolidated with params?
Lines 96 to 97 in cb0e125
There was a problem hiding this comment.
I think we should only add the minimal template, the rest (ubuntu desktop) are better off downstream?
There was a problem hiding this comment.
That's fine with me. I can put them on my github page if folks are ok with that. I'm not sure what the convention is.
There was a problem hiding this comment.
ubuntu-desktop
This seems xubuntu, not ubuntu
There was a problem hiding this comment.
True. I wasn't sure if the naming convention should reflect Ubuntu or Xubuntu. I can change or reduce the number of templates and host them elsewhere. These were only intended as examples.
| loadDotSSHPubKeys: true | ||
|
|
||
| firmware: | ||
| legacyBIOS: false |
There was a problem hiding this comment.
Default configurations do not need to be copied
|
|
||
| ssh: | ||
| localPort: 0 | ||
| loadDotSSHPubKeys: true |
| mounts: | ||
| - location: "~" | ||
| - location: "/tmp/lima" | ||
| writable: true |
|
|
||
| cpus: 4 | ||
| memory: "8GiB" | ||
| disk: "50GiB" |
There was a problem hiding this comment.
Why not use the default values?
They are automatically adjusted depending on the amount of the host resources.
There was a problem hiding this comment.
I specified resources in the template so that it was clearer what a well performing VM with a full desktop would probably need. I've run the debian-trixie-plasma template on 2 vCPUS with less RAM. These could be removed or turned into a comment that points to the distro's resource suggestions.
| This will take several minutes and the VM will reboot automatically. | ||
|
|
||
| After the VM reboots, connect to the SPICE display: | ||
| remote-viewer spice://127.0.0.1:5930 |
There was a problem hiding this comment.
There was a problem hiding this comment.
As far as I can tell, the code is reusing the VNC password for the SPICE password.
We might want to make the messages and filenames more generic, some day?
There was a problem hiding this comment.
I didn't put any specific work into the VNC/SPICE password split. Is there something here that I need to fix?
| macOS: brew install virt-viewer | ||
| Linux: sudo apt-get install virt-viewer | ||
|
|
||
| The desktop will auto-login as user: lima |
There was a problem hiding this comment.
Why is the user name changed?
There was a problem hiding this comment.
That is a great question. I need to go take a look at that again.
|
I'm getting an error from the message: template: format:21:19: executing "format" at <.Video.Display>: can't evaluate field Video in type store.FormatData] |
|
Will need some better checking and reporting, right now the driver will crash with only a debug message. "qemu[stderr]: qemu-system-x86_64: -audiodev spice,id=default: Parameter 'driver' does not accept value 'spice'" |
|
@stuffbucket the DCO will require you to use your real name for signing the commits:
|
|
what's the minimal qemu version for this feature? and what are supported host operating systems? |
I was using QEMU 10.1.2 for testing (the latest version that homebrew would install at the time). Nothing special that I know of. I'm on Apple Silicon. |
|
I was focused on the other PR for VZ GUI, I'll start working on these comments now. Thanks for being patient. |
Adds SPICE protocol support for QEMU VMs. SPICE provides remote display with audio streaming, clipboard sharing, and optional OpenGL acceleration.
Changes:
Templates: