Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to set up a development box using Virtualbox / Vagrant / Puppet with the intention of eventually provisioning all my machines up to production. However this is stopping me going forward at the moment. I've installed ubuntu lucid over windows 7.

When trying to connect to xdebug by starting a debugging session in eclipse, it hangs at 57% (common in eclipse when it cannot communicate with xdebug). Here is my xdebug.ini and the settings here are appearing in phpinfo().

xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_host=192.168.56.1
xdebug.remote_port=9000

I'm now wondering if it's an issue with port forwarding? If eclipse is looking on port 9000, will it find port 9000 on a virtual machine?

Any help would be greatly appreciated!

share|improve this question

2 Answers 2

Try using xdebug.remote_connect_back instead of remote_host, assuming your vagrant machine is not accessible to the outside world.

xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000    
share|improve this answer
    
Cheers for the suggestion but no difference I'm afraid. .. –  smix96 Oct 2 '12 at 15:09

I have found this to be a problem of many network interfaces. When I set up xdebug.remote_host to the IP adress my local machine (the one running virtualbox) uses to access the internet, the debugging works just fine. This does not mean the external IP, but the one my machine has in the local LAN (from wich the internet is accessed) Setting the IP adress to the one being paired with the host only adapter (e.g. 192.168.56.1) doesn't work. However: I got the whole thing running at one time with the host only adapter. although I can - for the life of me - not figure out what it was that did the trick. only different thing was, all other connections on the machine were disabled. But I can not reproduce the state I had..

Edit: Ok, I've found out what the problem was: The problem is a Windows problem (what else?). Windows seems to handle the Network Adapters like real adapters and hence inklude them in firewall issues. You need to tell Windows, that all "VirtualBox Host-Only Ethernet Adapter" Devices are not real devices.

To do so you have to make some minor changes to the registry: Open regedit and navigate to

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}

In this key you will find all kind of adapters your system uses. Find those Keys that have a property 'DriverDesc' with the value 'VirtualBox Host-Only Ethernet Adapter' and add a new DWord property named '*NdisDeviceType' with the value 1. restart your machine and that was it.

Please note that from that point on all your VirtualBox Host-Only Ethernet Adapters will not show in Network and Sharing Center anymore!

Once this is done XDebug will even work with the xdebug.remote_connect_back = 1 parameter, which it did not do before!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.