Skip to content

Give Workspace sessions their address back after a restart - #108

Open
tigerblue77 wants to merge 2 commits into
linuxserver:masterfrom
tigerblue77:claude/loving-hopper-f527pj
Open

tigerblue77 wants to merge 2 commits into
linuxserver:masterfrom
tigerblue77:claude/loving-hopper-f527pj

Conversation

@tigerblue77

Copy link
Copy Markdown

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

On shutdown, svc-kasm/finish records the address of each running or paused Workspace session container in /opt/kasm_sessions.state. On start, after svc-kasm/run has stopped leftover containers, it reconnects each recorded container to its networks with docker 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 use instead 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-ls150 with this root/ 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:

  • without this PR: B runs at .10, its route points at .11, where nothing answers;
  • with it: both containers are pinned (IPAMConfig), B runs at .11 and KasmVNC answers on its route.

Source / References:

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
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RmwHZxdRuWgp9chBZTZTMn
@tigerblue77

Copy link
Copy Markdown
Author

Hi @thespad & @thelamer, can you have a look please ? 😉🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[BUG] Resumed Workspace sessions can get another address after a container restart, and Kasm keeps routing to the old one

3 participants