Thank you Annie, for looking at this. While this workaround works, it seems clear to me that there is something in Hyper-V that causes this. I've never seen this issue on bare metal or a similar VM running in Virtualbox.
Xterm from Linux VM disappears repeatably
Setting: Windows 20H2 with Hyper-V enabled, and Debian 10.6 VM installed. Xming Xserver running on the Windows host. In the Debian guest, fire up an xterm displaying on the Windows-based Xming Xserver. All good!
Some random amount of time later (typically a couple of hours), the xterm disappears. 'pgrep -a xterm' in the Debian guest shows that the xterm is still running.
Some time after that, the xterm exits with "xterm fatal error 110 (connection timed out) or KillClient on X server 192.168.92.8:0" Repeatably.
This first showed up with WSL (see 5339). Someone suggested the following Linux sysctl changes in the guest VM: sysctl -w net.ipv4.tcp_keepalive_intvl=60 net.ipv4.tcp_keepalive_probes=5 net.ipv4.tcp_keepalive_time=300
This fixed the issue for WSL.
Over the weekend i set up two virtually identical Debian 10.6 VMs, one with the default settings, and one with the above modified settings.
The xterm from the VM with the modified settings has kept running. The xterm from the "stock" VM died within 6 hours. I restarted it several times and it repeatably died.
To be clear, the Debian VM continues running, but xterms started from a "stock" Linux VM reliably disappear.
Not sure where the problem lies, but posting here in case anyone else runs into it, and hoping that someone on the Hyper-V team might have some insider perspective on it.