Dec 4 2013
Connecting to JMX from visualVM using SSH tunnel
I used the following source:
https://bowerstudios.com/node/731
I did this in windows using git bash that has ssh command. You can also do using cygwin or pure minggw.
1) Run ssh tunnel command in command prompt (I do this in git bash/MINGGW32).
ssh -D 9010 -p 22 root@IP -v
2) Run your application on server with JMX options
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar application.jar
3) Run visualVM through socks proxy to connect:
visualvm -J-Dnetbeans.system_socks_proxy=localhost:9010 -J-Djava.net.useSystemProxies=true
4) Actually add your JMX remote connection in visualVM