You can fix this by executing this before your command: export DISPLAY=:0.0
export DISPLAY=:0.0
It sets an environment variable tells your SSH session that you want to target the X server on the host.