8

I've got a vagrant VM which is running tomcat and I wanted to connect VisualVM to monitor the performance of the VM during some tests.

I followed this guide to setup this configuration which recommended creating a setenv.sh script and placing it within /usr/share/tomcat7/bin. I found that setenv wasn't being run, so I placed the following in /etc/tomcat/tomcat.conf instead:

JAVA_OPTS="-Dcom.sun.management.jmxremote=true - Dcom.sun.management.jmxremote.port=9901 -Dcom.sun.management.jmxremote.ssl=false

m.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.rmi.port=9909"

I believe that the config is working as when running the following, I can see the ports active:

[vagrant@localhost ~]$ netstat -lntu | grep 99
tcp6       0      0 :::9901                 :::*                    LISTEN
tcp6       0      0 :::9909                 :::*                    LISTEN

Here is my config from the vagrant file:

  # Ports enabled for VisualVM to work. 
  config.vm.network "forwarded_port", guest: 9901, host: 9905
  config.vm.network "forwarded_port", guest: 9909, host: 9907

However after entering the following config, or close variations of (have tried 127.0.0.1 & enabling "do not require SSL" all I get is " ".

I have also tried ports 9901, 9905, 9909.

VisualVM Config

Any thoughts on how to solve this?

jwv
  • 475
  • 4
  • 21
  • 1
    Do you check this solution: http://stackoverflow.com/a/834660/4165731 ? – lukaslew Aug 07 '15 at 19:56
  • Yeah I did, it unfortunately since the vagrant setup has a NAT network and therefore no IP I can use. I tried switching it to a bridged adapter but I couldn't get this setup to work at all. – jwv Aug 10 '15 at 15:26
  • By any chance have you configured a private address for that VBox? – David B Nov 26 '15 at 07:09
  • This was a while ago now but I was using vagrant and tried to configure a private address and it refused to accept it. – jwv Nov 26 '15 at 08:59

0 Answers0