Shell scripts cannot be debugged using a debugger, bash lacks the capabilities to provide the hooks for a debugger. (You can debug the bash executable that is, but that is not your goal) You have to insert echo statements in smart places. It also helps to run the script with
As for the remote, set up an SSH session to the remote server and run the script in that session. No need for VNC as bash scripts are usually console based if you don't call GUI programs from the script.
jlinkels