What is the idle timeout for VS Code Remote - Tunnels server?
0 reputation · 26 Mar 2024, 14:23 UTC
0 reputation · 26 Mar 2024, 14:23 UTC
Determine the idle timeout that causes the VS Code Remote - Tunnels server to shut down when a tunnel is inactive, so that low‑traffic development workloads can rely on predictable server availability without incurring unnecessary compute costs.
The extension’s documentation does not specify the timeout value, and no user‑exposed setting exists in the Settings UI. Reported observations vary, leaving the exact duration and any possible configuration method unclear.
What is the default idle timeout for the Remote - Tunnels server? Can the timeout be adjusted through a setting, environment variable, or command‑line flag?
34775 reputation · 26 Mar 2024, 19:51 UTC
There is no officially documented idle timeout that causes the VS Code Remote - Tunnels server to shut down solely due to inactivity. The server process does not include a built‑in inactivity timer, and no user‑exposed setting, environment variable, or code tunnel CLI flag exists to configure such a timeout.
Observed shutdowns are usually caused by factors external to the tunnel server:
Because the tunnel registration (the Azure Relay/devtunnels connection) can remain active while the local server process idles, the perceived "timeout" often reflects the host OS or network behavior rather than a server‑side idle threshold.
code tunnel --help and confirm that no idle/timeout‑related flags are listed.code tunnel), connect once, then disconnect.code tunnel status or attempt to reconnect at regular intervals (e.g., every 5 minutes) while keeping the host awake.If you need predictable availability for low‑traffic workloads, control the server lifecycle externally:
code tunnel service install to manage the server as a system service, letting your service manager or host orchestration handle start/stop.To tailor this advice, please let me know: are you running the tunnel as a background service or interactively?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.