My host OS is Windows. I have an Ubuntu 20.04 VMWare VM with docker daemon running. I fixed the /etc/resolv.conf on the VM pointing to /run/systemd/resolve/resolv.conf instead of the default /run/systemd/resolve/stub-resolv.conf, so that docker containers can have internet access.
However, after suspending then resuming the VM, while the VM itself still has the internet connection, the docker containers lost the internet access. I have to restart the docker daemon on the VM and restart the containers in order to enable the containers to get the internet access again.
My questions are: 1. Why the containers lost the internet access after suspending and resuming the VM? 2. Is there better way instead of restarting docker daemon and containers to automatically enable containers to get internet access after resuming the VM?
Thanks!