问题
I have setup my Pi for SSH remote host development using NetBeans.
I can confirm: in
/etc/ssh/sshd_config X11Forwarding yes
X11DisplayOffset 10...
In addition, xauth is installed on the remote Pi.
I have installed XQuartz on my client mac. Upon ssh -X pi@IPaddress, xquartz opens and if i echo $DISPLAY on the remote Pi i get localhost:12.0 ... the number changes with each terminal.
Currently, if have incorrectly set the project environment in netbeans with:
DISPLAY=localhost:11.0 (this is wrong because the number changes with each ssh connection to the remote Pi).
So when i try to run the program, NetBeans will hang and i cant debug either.
My question is, how do i set the DISPLAY Environment correctly for NetBeans so that each time it makes an SSH connection to the remote Pi and requests X11 forwarding, it will have the correct $DISPLAY?
If I run the program from an SSH -X terminal session to my Pi the program executes.
Thanks in advance.
来源:https://stackoverflow.com/questions/46043094/netbeans-how-to-set-display-environment-for-remote-ssh-server-pi