When I try to connect to remote server (jboss) that is on my local machine all works perfectly, but if I try to connect to remote machine (to jboss again) eclipse starts connecting and after some time tells me
Failed to connect to remote VM. Connection timed out.
Timeout occurred while waiting for packet 1479.
but connection stays alive, and I have to kill it manually to reconnect again and get the connection time out error
How can I set timeout for remote debug, or may be there are other workarounds for such kind of problem?
You can increase a value of debugging timeout in Eclipse.
Go to Window/Preferences. In the Java/Debug you'll see Debugger Timeout parameter.