Repository navigation
st: forward SSH and serve GDB on free host ports - #87
Merged
Merged
Conversation
The slirp SSH forward was hard-coded to host port 2222. With a guest already running in another tree, QEMU could not set up the forwarding rule and exited before the guest started, so two trees could not run side by side although the image guard allows it. The GDB port was offset by the count of running emulators, which collides as soon as an earlier instance exits or an unrelated QEMU runs. Both ports are now the first free one from 2222 and 1234, and IB_SSH_PORT / IB_GDB_PORT choose them explicitly. The SSH port is printed next to the GDB port.
daniel-rossier
force-pushed
the
fix/st-ssh-port
branch
from
December 2, 2026 07:53
46d0e4f to
f4c3f26
Compare
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.
The slirp forward
hostfwd=tcp::2222-:22was a literal, so a second tree's QEMU exited withCould not set up host forwarding rulewhile another guest held 2222. The GDB port was offset by a count of running emulators, which collides once an earlier instance exits. Both ports are now the first free host port from 2222 / 1234 (probed on 127.0.0.1),IB_SSH_PORT/IB_GDB_PORToverride them, and the SSH port is printed. Checked with a stubqemu-system-aarch64that binds the ports it is given, in two trees: with tree A holding 2222/1234, tree B got 2223/1235 and bound them;IB_SSH_PORT=2400was honoured.bash -nclean; shellcheck 0.11 (-S warning) reports the same 18 lines as before, none new.