X11 forwarding over ssh only working with sudo

Regarding the hostname resetting, check if you have something like cloud-config installed and configured. It really messes up some stuff, you probably need to change some option like update_hostname or set_hostname.

Regarding the question, try adding the following to your sshd_config and restarting sshd.

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
AddressFamily inet