ssh X11 forwarding fails when VPN connected.
I have machine A running Debian Stretch and the PIA client. From machine B (also Debian Stretch), I can ssh (without X11) to A whether the VPN is connected or not. If I ssh to A when the VPN is connected using "ssh -X" or "ssh -Y", it connects with the message "X11 forwarding request failed on channel 0" and I can't run any X clients. If the VPN is disconnected it works.
Comments
1. the same IP address as when the VPN is down (but useable only from your LAN)
plus
2. the IP address of the PIA server
which of the two network interfaces is ssh using to reach machine A?
It should work fine given that everything is tunnelled through the SSH tunnel, but for this to work SSH has to bind a port on the remote machine (so apps can connect to it). If the remote machine has a firewall rule to prevent connections to whatever address SSH bound to there, the X11 forward will fail. Depending on the network situation, SSH may also not source the traffic from the correct address on your local machine.
When you enable the VPN on the remote machine, PIA by default has IPv6 leak protection enabled which disabled IPv6 completely on the machine. However, sshd was started with IPv6 support, so when you do the X11 forward request, it attempts to bind both on IPv4 and IPv6 localhost and fails to bind on the IPv6 one.
Disabling IPv6 leak protection in the app works around it, but to properly fix it you can also set
In your /etc/ssh/sshd_config so it uses IPv4 only.