I use vscode.dev to develop a small app. To do this I have installed nodejs and the code tunnel app on my droplet. Everything works fine, I can edit, compile, and debug my app from vscode.dev.
My problem is that after some time vscode.dev loses connection to my droplet. I have discovered that I get the connection to work again, by opening a console to my droplet from the digital ocean site.
I wonder how I can stop my droplet from disconnecting vscode.dev? So that I don’t have to keep the console open all the time…
thanks, sam
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
It looks like I found a solution.
sudo loginctl enable-linger $USER
Hey!
The most common cause for this issue is SSH timing out due to inactivity. There was a similar discussion reported here and the user was able to get it working by increasing that in their SSH config:
https://www.digitalocean.com/community/questions/how-to-increase-ssh-connection-timeout
You can try to configure your Droplet’s SSH server.
sudo nano /etc/ssh/sshd_config
ClientAliveInterval 120
ClientAliveCountMax 720
sudo systemctl restart sshd
Let me know how it goes!
- Bobby
Heya, @samdejonghhepworth
The issue you’re facing is likely related to your droplet terminating idle connections or entering a low-activity state.
You can try using a keep-alive option when starting Code Tunnel:
code-tunnel --keep-alive
If this option doesn’t exist for your version, check the Code Tunnel documentation for updated flags.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.