Repository navigation
Give Workspace sessions their address back after a restart - #108
Open
tigerblue77 wants to merge 2 commits into
Open
tigerblue77 wants to merge 2 commits into
tigerblue77 wants to merge 2 commits into
Conversation
Kasm routes to a session by the address its container was created with, while Docker gives a starting container the lowest free address. Record the address of each running or paused session on shutdown and pin the container back to it on start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RmwHZxdRuWgp9chBZTZTMn
1 task done
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RmwHZxdRuWgp9chBZTZTMn
Author
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.
Description:
On shutdown,
svc-kasm/finishrecords the address of each running or paused Workspace session container in/opt/kasm_sessions.state. On start, aftersvc-kasm/runhas stopped leftover containers, it reconnects each recorded container to its networks withdocker network connect --ip <previous address>.Benefits of this PR and context:
closes #107
A session paused at shutdown now resumes at the address Kasm routes to.
The address stays pinned on the container: if a new session takes it while the container is stopped, the container fails to start with
Address already in useinstead of starting where Kasm does not route.Running sessions are still left stopped after a restart: #106.
How Has This Been Tested?
lscr.io/linuxserver/kasm:1.19.0-ls150with thisroot/copied in, Kasm 1.19.0, docker-ce 29.3.1 host. Session A running at.10, session B paused at.11,docker restart kasm, then B resumed:.10, its route points at.11, where nothing answers;IPAMConfig), B runs at.11and KasmVNC answers on its route.Source / References:
docker network connect --ip: https://docs.docker.com/reference/cli/docker/network/connect/