Skip to content

feat: enable support for memory ballooning feature provided by dockurr/windows image - #776

Open
lukakama wants to merge 1 commit into
winboat-org:mainfrom
lukakama:feat/memory-ballooning
Open

feat: enable support for memory ballooning feature provided by dockurr/windows image#776
lukakama wants to merge 1 commit into
winboat-org:mainfrom
lukakama:feat/memory-ballooning

Conversation

@lukakama

@lukakama lukakama commented May 10, 2026

Copy link
Copy Markdown

Summary

Adds support for dynamic memory ballooning in Windows VMs, allowing the host system to reclaim unused memory when host is under memory pressure. This feature integrates with the new dockurr/windows image's built-in ballooning feature released on 5.15 (https://github.com/dockur/windows/releases/tag/v5.15).

Fix: #522

Main changes:

  • New experimental feature configuration to enable or disable dynamic memory (ballooning)
  • Setup of the Windows ballooning service for already installed Windows containers; newly installed Windows containers get the service installed from dockurr/windows unattended installation
  • Report of current effective VM available and used memory with balloon-corrected used memory
  • Use of QEMU QMP commands correlation ID, due to possible concurrent commands execution, with timeout support

Changes

Guest Server

  • Added /balloon/status endpoint to check balloon service status
  • Added /balloon/install endpoint to install the balloon service

QMP Manager

  • Added query-balloon command support
  • Refactored QMP connection handling with EventEmitter pattern
  • Implemented proper message buffering and command correlation with IDs
  • Added configurable timeouts for commands
  • Improved error handling and connection lifecycle management

Winboat Core

  • Integrated balloon status checking via QMP query-balloon command
  • Auto-installs missing balloon service when experimental features are enabled
  • Used dedicated memory stats object to reflect available, used and percentages memory stats accounting for ballooning

UI Updates

  • Config View

    • Added "Dynamic memory" toggle (visible when experimental features enabled)
    • Persists BALLOONING=Y environment variable in docker-compose when "Dynamic memory" is enabled
    • Disables ballooning when experimental features are turned off
  • Home View

    • Updated RAM display to show ballooned vs total memory
    • Shows adjusted RAM percentage based on actual available memory
    • Conditionally displays balloon info when memory is reclaimed

Feedback and suggestions for improvement are welcome, particularly for ballooned memory stats reporting.

Adds experimental support for memory ballooning feature provided by
dockurr/windows image, with support for stats and upgrade of existing
containers created with previous dockurr/windows versions.
@lukakama

Copy link
Copy Markdown
Author

The ballooning feature has just been released on dockur/windows v5.15 (https://github.com/dockur/windows/releases/tag/v5.15).

@TibixDev

Copy link
Copy Markdown
Collaborator

Hello, sorry for the late response on your PR. It's been some months since the ballooning feature has released in dockur/windows, and if @kroese and you deem it stable, perhaps it doesn't need to be an experimental feature with a toggle, can be enabled by default implicitly, and that way we avoid having to write tons of extra code.

The migration path would be needed, however I do not plan 1.0 at this moment to be backwards compatible, if that changes I can refer to the current state of the PR, but otherwise all of that can be dropped too at this moment.

Waiting on your feedback :)

@kroese

kroese commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@TibixDev The problem is that it requires a driver to be installed in the Windows guest. Only recent releases of the image now include this driver in the unattended setup, but for a lot of people (who have older installations) the ballooning will not work unless they manually install this VirtIO driver themselves.

So maybe your Guest Agent / API program, can check after boot if the "Ballooning Service" is installed, and if not, automatically install that service. Or otherwise detect the WinBoat version that was used for the install (or the creation date of the files), and just disable the feature for older installs.

EDIT: I now see that this pull request already fixes this problem, never mind.

But it is a really advanced/complicated feature, that many people will not fully understand (including me). And that was not tested a lot. So I would hide it under an Advanced/Experimental option for now, otherwise it will raise a lot of questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Dynamically resize RAM

3 participants