Chris's Blog

Devops Shokunin

Using JMX on Vagrant

Comments Off on Using JMX on Vagrant

Getting JMX remote from my desktop to a Vagrant machine took a few tries.

Vagrant file configuration to add more memory and forward the HTTP and JMX ports

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "ubuntu/xenial64" "forwarded_port", guest: 8080, host: 8080 "forwarded_port", guest: 9010, host: 9010
 config.vm.provider "virtualbox" do |vb|
   vb.customize ["modifyvm", :id, "--memory", "2048"]

Application Start script needs to be modified to setup remote access

 java \ \ \ \
 -Djava.rmi.server.hostname= \ \ \
 -jar "${SOURCE_DIR}/bin/myjar.jar"

Connection is now possible by running:


When Jconsole starts up Select “Insecure Connection”