If you unable to connect IDE to xdebug, probably there is a firewall between your IDE and xdebug. You can either set up a tunnel or disable your firewall. Here is how you can disable firewall in ubuntu:
sudo ufw disable
Reference:
http://derickrethans.nl/debugging-with-xdebug-and-firewalls.html