Hello Ben, Marta, Marek, and the Qubes Team,
My name is Sahil Kumar (GitHub: Sahilll10), and I am a Computer Science student. I am writing to express my interest in the System Health Monitor project for GSoC 2026 and to seek early feedback on my approach before drafting my formal proposal.
Over the past few weeks, I have been actively contributing to Qubes OS and familiarizing myself with its architecture:
qubes-core-admin-client#450 — merged by @marmarek
Fixed failing tests introduced by commit 84edd42 by identifying missing per-VM registration in MockQube._add_to_vm_list. Used git bisect to isolate the issue and resolved all failures with a minimal fix.
qubes-desktop-linux-manager#300 — under review
Implemented automatic file manager launch in DispVM on block device attach using qubes.StartApp + qubes-open-file-manager. Added a comprehensive test suite using MockQubesComplete.
qubes-desktop-linux-manager#303 — under review
Fixed a UI issue where a hyperlink inside a GtkRadioButton was not clickable. Verified via OpenQA and local GTK mock testing.
Through this work, I have gained hands-on experience with PyGTK widgets, qrexec services, the Qubes Admin API, and MockQubesComplete-based testing.
Initial Understanding & Direction
From my exploration, system health signals in Qubes OS appear to be fragmented and not centrally surfaced. Issues such as VM crashes, resource pressure (memory/storage), and insecure USB configurations are either logged internally or exposed indirectly across different components.
My current approach is to:
Aggregate health signals from existing sources (e.g., update widget, qubesadmin API)
Design a centralized background service to monitor system state
Build a PyGTK tray widget that provides a concise overview and proactive notifications
Ensure unit test coverage using MockQubesComplete
Add integration tests and documentation
To ensure I am aligning with the intended design direction:
Should the monitor primarily poll qubesadmin API properties from dom0, or is it preferred to leverage the event system (qubesadmin.events) for a more event-driven design?
For detecting insecure USB configurations, is checking the presence of sys-usb and verifying whether any USB controller is assigned directly to dom0 via qubesadmin sufficient, or is there a more authoritative or recommended approach?
I want to make sure I align early with the expected design direction before formalizing my proposal.
Thank you for your time and guidance.
Best regards,
Sahil Kumar
GitHub: https://github.com/Sahilll10
Email: sahilkum...@gmail.com
Hi Marek, Ben, Marta and the Qubes Team.
Thank you for the detailed feedback. I have done the research to align with each point you raised before finalizing my approach.
1) On the widget consolidation point:
Understood — no new tray icon. I traced the existing disk space widget (`qui/tray/disk_space.py`) thoroughly. The `DiskSpace` class already uses `Gtk.Application` + `Gtk.StatusIcon` and monitors pool and VM volume usage.
My plan is to extend this class directly into a `SystemHealthMonitor`, adding new health checks alongside the existing disk checks — same icon infrastructure, broader scope.
2) On events vs polling:
I traced how `qui/devices/device_widget.py` uses `qubesadmin.events.EventsDispatcher` and confirmed the exact events available in `qubesadmin/events/__init__.py`:
- `domain-shutdown`, `domain-start-failed`, `domain-start` — already exist, usable directly
- `device-assign:pci`, `device-unassign:pci` — already exist, used in device_widget.py
- `property-set:*`, `feature-set:*` — already exist
The current `disk_space.py` uses only `GObject.timeout_add_seconds` — no event integration. My plan is to replace this with `EventsDispatcher` and retain one 120-second ping solely to verify the qubesd connection is alive, as you suggested.
3) On USB detection:
Rather than checking by VM name, I traced the authoritative approach via `qubesadmin/device_protocol.py` — USB controllers have PCI interface code `p0c03**` (confirmed at line 690: `PCI_USB = ("p0c03**",)`). The correct check is:
```
for dev in qapp.domains["dom0"].devices["pci"].get_assigned_devices():
if any(str(iface).startswith("p0c03") for iface in dev.interfaces):
# USB controller directly in dom0 = insecure
```
This fires on startup and on `device-assign:pci` / `device-unassign:pci` events. Multiple USB qubes are handled correctly — the warning triggers only if a USB controller is in dom0, not based on how many USB qubes exist.
Additionally, I will check that relevant system qubes (sys-net, sys-firewall, USB qubes) are actually running — not just that USB controllers are correctly assigned. A properly configured sys-usb that has crashed is equally a security concern. This will use the domain-shutdown and domain-start-failed events combined with vm.features.get('servicevm', None) to identify and monitor all system qubes, not just USB ones.
4) On memory monitoring:
I confirmed `vm.get_mem()` calls `admin.vm.CurrentState` which returns `mem` in real time — no new upstream event is needed.
My plan is to re-check memory on each `domain-start` event and compare against `vm.maxmem`, following the `WARN_LEVEL` / `URGENT_WARN_LEVEL` threshold pattern already in disk_space.py.As a stretch goal, I would propose a `domain-memory-warning` event upstream in qubes-core-admin to make this fully reactive.
Proposed Deliverables:
1. Refactor `disk_space.py` to use `EventsDispatcher` + qubesd liveness ping
2. System VM crash detection — `domain-shutdown` + `domain-start-failed` handlers, identified via `servicevm` feature
3. Memory pressure monitoring — `vm.get_mem()` triggered on `domain-start`, per-VM thresholds
4. USB security check — PCI interface `p0c03**` detection in dom0, multi-USB-qube aware
5. Per-VM opt-out feature flag (`health-monitor-not-notify`), following the existing `disk-space-not-notify` + `NeverNotifyItem` pattern
6. Unit tests using `MockQubesComplete` for all new checks
7. Documentation
Question: For the widget consolidation — is `disk_space.py` (`DiskSpace` / `Gtk.StatusIcon`) the right entry point to extend, or do you and Marta have a different widget in mind as the consolidation target? I want to make sure I am building on the right foundation before formalizing the proposal, since this decision affects the architecture throughout.
Thank you
Gmail: sahilkum...@gmail.com
Hi Marek, Ben , Marta and Qubes Team
Thank you for the corrections. Researched all points carefully:
1) On the Stats channel for disk space:
Confirmed. qui/tray/domains.py already uses a second EventsDispatcher(qapp, api_method="admin.vm.Stats") which emits vm-stats events with memory_kb and cpu_usage kwargs. I will use this same pattern — add a stats_dispatcher alongside the main dispatcher in the refactored widget, and hook disk space refresh to vm-stats events rather than a fixed timer.
2) On the USB check:
You are right — my check was backwards. The correct approach
This fires on startup and on device-assign:pci / device-unassign:pci events.
Multiple USB qubes handled correctly — only warns if a USB controller has no non-dom0 assignment.
3) On memory monitoring:
I searched the entire codebase thoroughly — pref_mem and get_pref_mem do not exist anywhere in qubesadmin. The memory_kb field in vm-stats is currently assigned memory, not preferred memory. Without pref_mem being exposed via the Admin API, meaningful pressure detection is not possible from the client side.
Would it be in scope for this GSoC project to propose exposing pref_mem via a new field in admin.vm.Stats or a new Admin API call in qubes-core-admin?
Or would you prefer I scope memory monitoring out of core deliverables and list it as a stretch goal pending that upstream work?
Sir should I now prepare the first draft of the proposal for GSOC 2026?
Thank you again.
Hi,
First things first: you sound a bit like you're writing with an LLM. I would point to the https://doc.qubes-os.org/en/latest/introduction/contributing.html#using-ai-in-contributions , if you are using an LLM to contribute in ANY way, this MUST be disclosed. (Using an LLM to sound better also counts).
> Question: For the widget consolidation — is `disk_space.py` (`DiskSpace` /
> `Gtk.StatusIcon`) the right entry point to extend, or do you and Marta have
> a different widget in mind as the consolidation target? I want to make sure
> I am building on the right foundation before formalizing the proposal,
> since this decision affects the architecture throughout.
Marta, what do you think?
Why disk space in particular? It can work, not a bad idea, but I think this should be explained. I don't think it's that deep of a decision, though, because the widgets are pretty interchangeable in many ways (and there's too many of them :D). Ideal approach would take into account that Wayland has bad support for tray icons and offer a way to interact with whatever is the result that does not come from a tray icon, but this might be too complicated?
Best,
Marta
> threshold pattern already in disk_space.py.As <http://disk_space.py.As> a stretch goal, I would
Hi Marta,
Yes, I have used AI assistant to help me compose mailing list replies, and how to phrase things . I should have disclosed this from the start and I did not — that was wrong and I apologize. Going forward I will disclose this on every contribution where I have used an LLM.
My contributions to QubesOS , running the commands, iterations, fixing the actual bugs are all done by myself and I am confident to explain each and every commit I made.
On the widget question: I looked at all three tray widgets — disk_space.py, domains.py, and updates.py. All three use Gtk.StatusIcon with the same Gtk.Application base pattern, and all three already import gtk3_xwayland_menu_dismisser which forces GDK_BACKEND=x11 for XWayland compatibility. So the Wayland limitation is shared across all of them equally.
Marek specifically suggested disk_space.py because it already monitors system state — that is the main reason I chose it. If there is a preferred widget from your side, I am happy to work with that instead. For Wayland-native support without tray icons, I could explore Gio.Notification for alerts as a complementary path, though I agree that may be bit complicated.
Thank you.
Best regards, Sahil Kumar
GitHub: https://github.com/Sahilll10
Hi,
Ok, as long as we understand each other. Otherwise, yeah, disk_space can work.
Best,
Marta
To unsubscribe from this group and stop receiving emails from it, send an email to qubes-devel...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/qubes-devel/c40e0880-55ad-4b4a-bc2c-9266d5c6ed8en%40googlegroups.com.
Hi Marek, Marta , Ben and Qubes Team
As the deadline for project proposal for GSOC approaches , here are a few questions related to my proposal on System Health Monitor project :
Q1 (memory -blocking): Should exposing pref_mem via a new field in admin.vm.Stats or a new Admin API call be part of this GSoC project's scope? Or should memory monitoring be listed as a stretch goal ?
Q2 (updates integration): The updates widget already handles pending updates via EventsDispatcher. Should the health monitor show update status as well, or only cover :VM crashes, USB security, disk space, memory?
Q3 (service architecture): All existing widgets are started via autostart .desktop files and share qubes-widget@.service. Should the health monitor follow this same pattern, or is a separate background service expected as there is systemd mentioned in the project description?
Q4 (new events): For system VM crash detection: domain-shutdown and domain-start-failed already exist. Are there any other events I should propose adding upstream in qubes-core-admin as part of this project like for example a `domain-memory-warning event`?
I would be very grateful for your suggestions and guidance.
Disclosure: There was no AI agent used in framing these questions.
Best regards
Hi Marek, Marta, Ben and the Qubes Team,
Thank you for detailed review and the guidance throughout this discussion.
https://docs.google.com/document/d/1wClotc_ct9y2h0F92BqaMKSusm91oVZMFICS39b5yew/edit?usp=sharing I have now prepared the first draft of my GSoC proposal for the System Health Monitor project and would really appreciate your feedback .
I also wanted to confirm whether it is appropriate to include the following as stretch goals:
Please let me know if these align well with the project expectations or if you would recommend adjusting their scope.
Disclaimer: I have used AI agent to frame my thoughts and understanding in the proposal. Thank you.
Best regards,
Sahil Kumar
Hi Marek, Marta ,Ben and the Qubes Team
I have updated the final draft to reflect your technical corrections:
Memory Metric Update: Replaced avail_memory_kb with used_memory_kb across the API design and UI components, updating the xenstore extraction logic to calculate MemTotal - MemAvailable.
Log File Standardization: Changed the system VM crash log location to /var/log/qubes/qui.system-health.log to better align with the existing Qubes OS component logging hierarchy.
I would be very grateful for your review on this draft proposal.