If you want to use VisualVM to connect to your remotely hosted Minecraft server you need to run your server with the following parameters. Note that the parameters must come before your normal startup parameters.

-Dcom.sun.management.jmxremote <- Enable Java Management Extensions Remote Access
-Djava.net.preferIPv4Stack=true <- Binds IPv4 instead of IPv6
-Dcom.sun.management.jmxremote.port=25000 <- Specify the port to listen on
-Dcom.sun.management.jmxremote.authenticate=false <- Disable authentication
-Dcom.sun.management.jmxremote.ssl=false <- Disable SSL
-Djava.rmi.server.hostname=0.0.0.0 <- Specify the IP to bind to

Notes:
~ You can enable login authentication if you want, but we don't go over that.
~ The port must be different from your Minecraft server port. If you are using this on an ExtraVM Minecraft server, we allocate 4 ports immediately after your server port to use for plugins or external apps, so if your server port is 25680, you can use 25681 for this purpose.
~ You must set your IP, if you use ExtraVM Minecraft servers, the IP must be set to 0.0.0.0 for it to work as our servers run inside containers that can only bind to 0.0.0.0.

Full startup example:
java -Dcom.sun.management.jmxremote -Djava.net.preferIPv4Stack=true -Dcom.sun.management.jmxremote.port=25861 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=0.0.0.0 -Xmx4G -Xmx4G -jar paper-1.20.1.jar

If you are using an ExtraVM Minecraft server there is no way to specify a custom parameter, in this case you can create your own bash file to run instead. For example, create a file on your server named "run.sh" then paste the above command in it (editing the values required) but add " #!/bin/bash " to the first line of the file immediately above the java command. Once your server has the run.sh file in the main server folder, go into our MC control panel and type in "run.sh" into the JAR File field then save and restart your server.

Once your server is running open VisualVM on your PC.

https://visualvm.github.io/download.html

Add a Remote Host and enter your server IP...



Then right click the host and click Add JMX Connection...



Once it opens to add the connection type the JMX port that you specified above in the startup command and tick the box to not require SSL...



Once you click OK it should automatically connect if there are no issues.

Was this answer helpful? 0 Users Found This Useful (0 Votes)