Pls browse the bin folder under your JBoss distribution directory, you can see run.conf and run.bat.conf, uncomment the remote debug property, like the below
# Sample JPDA settings for remote socket debugging
#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Then start JBoss by run.sh or run.bat, also you can set remote debug profile to Eclipse or Netbeans