title: Adding remote VMs in Java VisualVM
body: <p>If I open <code>jvisualvm</code> and go to <code>File &gt;&gt; Add Remote Host</code> I am prompted to create a new remote server entry. I enter a host name of <code>myapp01.example.org</code>, and then I see that server show up under the <code>Remote</code> section of the <code>Applications</code> tree on the left-hand side. When I right-click that server, and click <code>Add JMX Connection</code>, I see the following dialog:</p>
  
  <p><img src="https://i.stack.imgur.com/ZFKAI.png" alt="enter image description here"></p>
  
  <p>Let's say I have a Java app (WAR deployed to Tomcat) running on <code>myapp01.example.org:8443</code>. To SSH into the server, I use username <code>skroob</code> and a password of <code>12345</code> (hey, that's the combination on my luggage!):</p>
  
  <pre><code>ssh skroob@myapp01.example.org
  skroob@myapp01.example.org's password: 12345
  </code></pre>
  
  <p>When I fill out the dialog as follows:</p>
  
  <ul>
  <li>Connection: <code>myapp01.example.org:8443</code></li>
  <li>Username: <code>skroob</code></li>
  <li>Password: <code>12345</code></li>
  </ul>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Cannot connect to skroob@myapp01.example.org:8443 using service:jmxLrmi:///jndi/rmi://myapp01.example.org:8443/jmxrmi</p>
  </blockquote>
  
  <p>I believe this may be because I'm not configuring JMX to be exposed on Tomcat itself. Or maybe I'm just entering the wrong info. Maybe both. Either way:</p>
  
  <ul>
  <li>What do I need to do to configure this with proper JMX info?</li>
  <li>What do I need to do to configure this properly for <code>jstatd</code>?</li>
  </ul>