Skip to content

feat: Add support for running qemu-guest-agent in machine#175

Draft
ninja-quokka wants to merge 1 commit intocontainers:mainfrom
ninja-quokka:add_qemuga
Draft

feat: Add support for running qemu-guest-agent in machine#175
ninja-quokka wants to merge 1 commit intocontainers:mainfrom
ninja-quokka:add_qemuga

Conversation

@ninja-quokka
Copy link
Copy Markdown
Contributor

Added support for running qemu-guest-agent in machine

Signed-off-by: Lewis Roy <lewis@redhat.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Aug 25, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ninja-quokka
Once this PR has been reviewed and has the lgtm label, please assign ashley-cui for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Comment on lines +49 to +51
RUN --mount=type=bind,source=/qemuga-vsock.te,target=/run/qemuga-vsock.te,z <<EOF
/usr/bin/checkmodule -M -m -o /run/qemuga-vsock.mod /run/qemuga-vsock.te
/usr/bin/semodule_package -o /run/qemuga-vsock.pp -m /run/qemuga-vsock.mod
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather do this in a build step so we don't need to install the checkpolicy package.
I could include the compiled qemuga-vsock.pp, it can be read with tools like sedismod but I think as a rule it's better to not include compiled files.

Copy link
Copy Markdown
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the goal here? qemu is only used for linux so how will that help on other providers?

Copy link
Copy Markdown
Member

@vyasgun vyasgun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the access to push to this branch so I have made some suggestions.

@@ -0,0 +1,11 @@
Description=QEMU Guest Agent
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Description=QEMU Guest Agent
[Unit]
Description=QEMU Guest Agent
ConditionVirtualization=apple


[Service]
UMask=0077
ExecStart=/usr/bin/qemu-ga --method=vsock-listen --path=3:1025 # Todo: The 3 may need to be dynamic
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ExecStart=/usr/bin/qemu-ga --method=vsock-listen --path=3:1025 # Todo: The 3 may need to be dynamic
ExecStart=/usr/bin/qemu-ga --method=vsock-listen --path=3:1234

@Honny1
Copy link
Copy Markdown
Member

Honny1 commented Apr 23, 2026

Hi @ninja-quokka, can you please rebase and address comments? If you don't have time, I will take over next week.

Honny1 added a commit to Honny1/podman-machine-os that referenced this pull request May 6, 2026
Install qemu-guest-agent and configure it to listen on vsock port 1234
(matching the constant in containers/podman). The service is gated by a
DMI sys_vendor check (ExecCondition) so it only runs on Podman machine
providers that expose the vsock channel: vfkit (Apple Inc.), libkrun
(Libkrun), and qemu (QEMU). A custom SELinux module allows
virt_qemu_ga_t to use vsock sockets.

Related PR: containers/podman#28527
Replace: containers#175

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Honny1 added a commit to Honny1/podman-machine-os that referenced this pull request May 6, 2026
Install qemu-guest-agent and configure it to listen on vsock port 1234
(matching the constant in containers/podman). The service is gated by a
DMI sys_vendor check (ExecCondition) so it only runs on Podman machine
providers that expose the vsock channel: vfkit (Apple Inc.), libkrun
(Libkrun), and qemu (QEMU). A custom SELinux module allows
virt_qemu_ga_t to use vsock sockets.

Related PR: containers/podman#28527
Replace: containers#175

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Honny1 added a commit to Honny1/podman-machine-os that referenced this pull request May 6, 2026
Install qemu-guest-agent and configure it to listen on vsock port 1234
(matching the constant in containers/podman). The service is gated by a
DMI sys_vendor check (ExecCondition) so it only runs on Podman machine
providers that expose the vsock channel: vfkit (Apple Inc.), libkrun
(Libkrun), and qemu (QEMU). A custom SELinux module allows
virt_qemu_ga_t to use vsock sockets.

Related PR: containers/podman#28527
Replace: containers#175

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Honny1 added a commit to Honny1/podman-machine-os that referenced this pull request May 6, 2026
Install qemu-guest-agent and configure it to listen on vsock port 1234
(matching the constant in containers/podman). The service is gated by a
DMI sys_vendor check (ExecCondition) so it only runs on Podman machine
providers that expose the vsock channel: vfkit (Apple Inc.), libkrun
(Libkrun), and qemu (QEMU). A custom SELinux module allows
virt_qemu_ga_t to use vsock sockets.

Related PR: containers/podman#28527
Replace: containers#175

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Honny1 added a commit to Honny1/podman-machine-os that referenced this pull request May 6, 2026
Install qemu-guest-agent and configure it to listen on vsock port 1234
(matching the constant in containers/podman). The service is gated by a
DMI sys_vendor check (ExecCondition) so it only runs on Podman machine
providers that expose the vsock channel: vfkit (Apple Inc.), libkrun
(Libkrun), and qemu (QEMU). A custom SELinux module allows
virt_qemu_ga_t to use vsock sockets.

Related PR: containers/podman#28527
Replace: containers#175

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants