Skip to content

Add Start and Reboot actions for stopped boxes - #205

Open
kacperpaczos wants to merge 7 commits into
Dvlv:masterfrom
kacperpaczos:feat/start-reboot-container
Open

Add Start and Reboot actions for stopped boxes#205
kacperpaczos wants to merge 7 commits into
Dvlv:masterfrom
kacperpaczos:feat/start-reboot-container

Conversation

@kacperpaczos

@kacperpaczos kacperpaczos commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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 enter quietly 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.

stopped box on the left: Start live, the in-box rows and Reboot greyed out; running box on the right: the reverse, with Stop live

Two choices worth a reviewer's eye. Start asks the runtime directly (podman start / docker start) rather than entering the box, because distrobox start doesn't exist and entering spawns a shell that would have to be thrown away. And the reboot uses the distrobox stop subcommand rather than the split distrobox-stop binary, since v2 no longer installs the split form — the subcommand works on both, and matches what stop_box already does.

Testing

The exact command sequence was run against a real box: distrobox stop <box> --yes followed by podman start <box> returns it to Up, 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 stub distrobox list emitting one stopped and one running box.

BoxBuddy Contributor and others added 2 commits August 22, 2026 20:17
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
kacperpaczos force-pushed the feat/start-reboot-container branch from 88c1563 to 98c6d0c Compare August 22, 2026 18:32
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.
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.

A stopped box gives you no way to start it again

1 participant