Add Start and Reboot actions for stopped boxes - #205
Open
kacperpaczos wants to merge 7 commits into
Open
Conversation
BoxBuddy previously only exposed Stop: a stopped container could not be brought back from the UI. This adds the two missing counterparts. start_box shells out to 'podman start NAME' via the same run_command helper that stop_box uses. distrobox start would also work, but it shells out to podman/docker itself; calling podman directly skips a layer of subprocess when the user just wants to wake a container up. The start button takes the place of stop in the titlebar trailing slot whenever the box is not running. reboot_box runs 'distrobox-stop NAME -Y; podman start NAME' in a terminal so the user sees both halves of the cycle. We pipe through bash -c the same way upgrade_box does, so the host's preferred terminal emulator is honoured and the user can interrupt. A new 'Reboot Box' row in the actions list invokes it. Always present, regardless of box state - rebooting a stopped box is equivalent to starting it, which is harmless. Both actions re-render the box list after the call so the new state (running/exited) shows up immediately in the notebook tab.
…yntax start_box called podman by name, which breaks on docker-only hosts even though get_container_runtime exists for exactly this. reboot_box had the same hardcoded podman, and also spelled the stop as distrobox-stop - the split-binary form that distrobox v2 no longer installs; the stop subcommand works on both, and is what stop_box already uses. The Start button also asked for media-playback-start, which only exists in themes that kept the legacy names - Adwaita has dropped it, so the button was a broken-image placeholder on stock GNOME. The symbolic variant is bundled inside GTK itself and cannot go missing.
kacperpaczos
force-pushed
the
feat/start-reboot-container
branch
from
August 22, 2026 18:32
88c1563 to
98c6d0c
Compare
A stopped box has nothing to reboot - it is brought up with the Start button instead - so showing Reboot next to it is misleading. Add the Reboot row only when the box is running, matching how Start and Stop already appear by state.
distrobox stop --yes and the runtime's start are both non-interactive, so Reboot now runs them directly - the same way Stop and Start already do - and refreshes the box's tab afterwards. That removes a copy of the four-way terminal spawn that the row did not need.
… apply Controls that come and go with the box's state make the page jump and hide what the box can do. Start and Stop now both sit in the header with the inapplicable one greyed out, and Reboot Box stays in the list on a stopped box, disabled and saying "Start the box first" - the same way Delete Box explains itself while the box is running.
A one-line note under the row made it taller only while the box was stopped, so the list shifted on Start and Stop. The greyed-out row says enough on its own.
distrobox enter silently starts a stopped container, so Open Terminal, Upgrade, View Applications and the package-install row all acted as hidden Start buttons. Now that Start is an explicit header action, those rows are greyed out until the box is up - the state shown in the header and the state the rows act on can no longer disagree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #202
Adds the counterpart to the Stop button: a Start button (standard
media-playback-start-symbolic) next to it in the header that brings a stopped box back through the container runtime — the same podman/docker detection the rest of the app uses, no throwaway shell. Both buttons stay in place and the one that does not apply is greyed out, so the header keeps its shape and the state is readable at a glance. There's also a Reboot Box row in the actions list: stop and start in one go, run inline exactly like the Stop and Start buttons (both halves are non-interactive), with the box's tab refreshed afterwards — handy right after upgrading a box. On a stopped box the row stays put but is greyed out, the way Delete Box is while the box is running - it keeps its place and height in both states, so the page does not shift on Start and Stop.With Start as an explicit action, the rows that run inside the container — Open Terminal, Upgrade Box, View Applications and the Install .deb/.rpm row — stop doubling as hidden start buttons.
distrobox enterquietly boots a stopped box the moment any of them is used, so the header could say Exited while a click behaved as if the box were up. Those rows are now greyed out until the box is started, exactly like Reboot, and the page reads consistently: what the header says is the state every control acts on.Two choices worth a reviewer's eye. Start asks the runtime directly (
podman start/docker start) rather than entering the box, becausedistrobox startdoesn't exist and entering spawns a shell that would have to be thrown away. And the reboot uses thedistrobox stopsubcommand rather than the splitdistrobox-stopbinary, since v2 no longer installs the split form — the subcommand works on both, and matches whatstop_boxalready does.Testing
The exact command sequence was run against a real box:
distrobox stop <box> --yesfollowed bypodman start <box>returns it toUp, and the runtime-detected start alone does the same from a stopped state. The header and row states are screenshotted above, from a virtual display with a stubdistrobox listemitting one stopped and one running box.