NetBeans, how to set DISPLAY environment for remote SSH server (Pi)

帅比萌擦擦* 提交于 2020-01-25 21:10:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!