So I can get X11 forwarding working in WSL2 following e.g., How to set up working X11 forwarding on WSL2. Then I had issues getting networking to function after connecting to a Cisco AnyConnect server, but I solved that using, e.g., WSL 2 Cisco AnyConnect Networking Workaround. This included manually setting up /etc/resolv.conf to include the DNS nameservers I need, although the DISPLAY variable for X11 should then be set via this answer to the X11 question.
But as soon as I connect to AnyConnect, I can no longer forward X11 apps, which even includes vim unless I add the -X
argument (seemed odd, but what do I know). The apps don't show an error in display setting, they just don't show up. The same commands work fine as soon as I disconnect from the VPN. This happens regardless of the networking settings that need to happen, so I think it's only related to the AnyConnect itself, but perhaps there are additional Powershell commands I need to run so the display works? Any ideas?