I’ve installed Nextcloud on WSL2 in Windows 10. Running on top of the Ubuntu 20.04 LTS distro with a LAMP stack (Apache, MariaDB, PHP 7.something).
Everything works just fine, in all regards, and my server passes all the checks in the “administration” settings.
But, after about a week of running just fine, network connectivity just drops to the WSL2 instance.
Requests don’t get through to the server. And, as a security certificate wasn’t renewed by Certbot one time, requests don’t appear to be getting out of WSL either.
When I’ve looked at the server itself, everything seems fine. It’s just that WSL is arbitrarily losing its network connection after a while.
If I manually reset it all - turn it all off and back on again - then it comes back up and runs just fine again… for about a week, and then it loses the connectivity again. It keeps doing this and it’s very annoying, as Nextcloud itself is working brilliantly.
It’s like Windows is putting WSL to sleep, or paging it out, or forcibly cutting the network connection, or something.
But it runs just fine for about a week, then it stops responding. Indeed, I’ve got a cronjob running for Certbot - to renew the SSL certificate - and that also failed to run (not sure if this is because the server also couldn’t connect outwards either, or “cron” didn’t run because WSL is paged out or ?!?).
Has anyone had issues like this trying to run Nextcloud on WSL2 with Windows 10? And how the hell do you fix it?
I think the problem is more to do with WSL2 and how it handles networking - as Ubuntu and Nextcloud and certbot all run just fine, without issue, for many days until the connection loss happens. If I restart it all, then it comes back up just fine and, again, runs for many days without issue, until it happens again.
A server that keeps losing its Internet connection is a bit useless, and I’ve set this up for someone else - hence the need to run it on Windows, due to other Windows software being needed - so I can’t easily just keep manually resetting it every time.