fix: prevent azlin gui from reusing stale local VNC tunnels#958
Merged
fix: prevent azlin gui from reusing stale local VNC tunnels#958
Conversation
Avoid reusing the fixed local port 5901 for GUI sessions. Each azlin gui run now picks its own free local forward port, waits for the SSH tunnel to bind, and launches vncviewer against that port. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use process-tree listener ownership checks for GUI VNC tunnels, add Linux /proc ownership fallback, and cover the regression with a live gadugi scenario. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
960d7bd to
acab50a
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.
Summary
azlin guiVNC forward onto its own local loopback port instead of reusing59015901and provesazlin gui devystill connects to the correct VMValidation
cargo test -q -p azlin --bin azlin test_build_vnc_tunnel_args -- --nocapturecargo test -q -p azlin --bin azlin test_build_vnc_viewer_args -- --nocapturecargo test -q -p azlin --bin azlin test_gui_routed_ssh_command_prefix_starts_with_ssh_binary -- --nocapturecargo build -q -p azlin --bin azlinLive evidence
Simardbastion tunnel still alive on local port50200,azlin gui devyopened a fresh bastion tunnel to.../virtualMachines/devyvncvieweragainst127.0.0.1:<random-port>, proving the GUI path no longer reuses a hard-coded local5901forwardMerge readiness
QA-team evidence
tests/agentic-scenarios/pr-958-gui-tunnel-isolation.yamlcd rust && AZLIN_BIN=./target/debug/azlin gadugi-test validate -f ../tests/agentic-scenarios/pr-958-gui-tunnel-isolation.yamlcd rust && AZURE_CONFIG_DIR=$HOME/azure-atevet17 AZLIN_BIN=./target/debug/azlin gadugi-test run -d ../tests/agentic-scenarios -s pr-958-gui-tunnel-isolationdevy) withAZURE_CONFIG_DIR=$HOME/azure-atevet17outputs/sessions/session_8a1d8d55-18e0-4156-854c-df49f32e3c48_2026-04-08T01-37-01-310Z.jsonDocumentation
rust/crates/azlin/src/cmd_gui.rs,rust/crates/azlin/src/bastion_tunnel.rs, andtests/agentic-scenarios/pr-958-gui-tunnel-isolation.yaml; the code changes are internal tunnel-selection/readiness plumbing, the scenario is QA-only, and the existing docs already describe GUI forwarding aslocalhost:<local_port>rather than fixed5901Quality-audit
lsofexit-code handling and tool-availability robustness gaps plus scenario portability/e2e-proof gaps; fixed by treatinglsofexit code1as empty, adding a Linux/proclistener-ownership fallback, removing/tmpassumptions, and requiring an actual TigerVNC connection lineCI
gh pr checks 958Security Scanning/OSSF Scorecard(workflow skipped by repo configuration)Scope
gh pr diff 958 --name-only->rust/crates/azlin/src/bastion_tunnel.rs,rust/crates/azlin/src/cmd_gui.rs,tests/agentic-scenarios/pr-958-gui-tunnel-isolation.yamlVerdict