I'm not familiar with the x2go-project and perl. A while-loop that looped through the displays until it had a valid display and free ports sounds good to me. Can you try to change the x2gostartagent in this way? Regards Thomas