I ran into this because I went to a hotel that had DHCP renew every 300 seconds, trying to download something inside the VM was getting clobbered...
If you check your syslog or kern.log and see the following entries; then I might have the solution for you:
kernel: [235397.022939] userif-3: sent link down event.
kernel: [235397.022943] userif-3: sent link up event.
Then the issue is one that when your DHCP renews it calls into the kernel with the new information; unfortunately this causes VMWare Workstation & Player (might effect other VMWare products?) to reset its network stack, even though nothing changed...
The solution after a lot of time googling different terms and trying to figure out what exactly was going on. I finally found it here (by Jan Just Keijer): https://www.nikhef.nl/~janjust/vmnet/ it was for an much older version of VMWare Player; but the solution still applies to VMWare workstation 15...
To make sure the information doesn't just disappear in the future (and so I can easily find it myself) I'm going to quote the relevant code and/or modifications I did..
Extract the /usr/lib/vmware/modules/source/vmnet-only.tar
tar file, you need to modify the userif.c
file. Search it for VNetUserIfSetUplinkState
function and right after the variable declaration add if (!linkUp) return 0;
// Around line 966 VNetUserIfSetUplinkState(VNetPort *port, uint8 linkUp) { VNetUserIF *userIf; VNetJack *hubJack; VNet_LinkStateEvent event; int retval; /* ADD: never send link down events */ if (!linkUp) return 0; /* END Added code */ ... rest of code ...
This will eliminate the linkdown events; which disconnect the internet from the VMWare network driver...
After you do that; recreate the vmnet-only.tar and replace the original. Then you can run: /usr/bin/vmware-modconfig --console --install-all
And then either
systemctl restart vmware
or
service vmware restart
If you still see " sent link down event." in your logs; then the patch wasn't applied properly.
Thank you very much for this! That was driving me crazy.
Jan Just Keijser has removed their vmnet page recently. Thanks for the archive. Here's another archive:
https://web.archive.org/web/20210301012537/https://www.nikhef.nl/~janjust/vmnet/
This issue is frustrating and has existed for years. Still present in VMware Player 16.