Debugging via xpcom or port 5000

Discussions related to using VirtualBox on Linux hosts.
Post Reply
xabilistas@gmail.com
Posts: 4
Joined: 14. Sep 2011, 09:35
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP SP3

Debugging via xpcom or port 5000

Post by xabilistas@gmail.com »

Hello,

I am trying to develop a Java application to debug VirtualBox, using the xpcom interface. I have read the SDK reference, and I found the specifications for the IMachineDebugger interface. This interface has methods for checking and modifying register values, memory space, and even for enabling or disabling single step execution, but I cannot find any method to execute instructions in a single-step way (equivalent to the 't' command in the debugger console).

I thought about opening the v.m. in debug mode and using the telnet debugger on port 5000 (to code a gateway class to manage it from Java), but I cannot connect to that port in any way.

The version I am running is VirtualBox 4.0.8 r71778 on an Ubuntu 10.10 host system. The guest system is a Windows XP SP3 machine.

My questions are:

Is debugging on port 5000 disabled?
Is there any way to execute instructions in single step mode from Java xpcom or any other programming interface?

Thank you in advance.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Debugging via xpcom or port 5000

Post by vbox4me2 »

Did you portforward 5000 to the Guest? otherwise use Bridge mode.
xabilistas@gmail.com
Posts: 4
Joined: 14. Sep 2011, 09:35
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP SP3

Re: Debugging via xpcom or port 5000

Post by xabilistas@gmail.com »

Thanks four your advice. If I understand you, the telnet service is deployed on the guest machine, not in the host.
I have tried bridged mode, but I cannot connect to the port 5000 on the guest's IP.
I have also configured NAT mode, setting up the port forwarding
to redirect all connections to any IP in the host machine on the port 5000 to the port 5000 on the guest machine.
In this case nmap shows that the port 5000 is open, I cannot connect to the guest's port 5000: the connection is inmediatly refused.

Is it necessary to use any specific tool to connect by telnet protocol? I have tried putty and telnet (Ubuntu repository versions).
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Debugging via xpcom or port 5000

Post by vbox4me2 »

Firewall? Bridge should always work unless a firewall is blocking or the required service is not running.
xabilistas@gmail.com
Posts: 4
Joined: 14. Sep 2011, 09:35
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP SP3

Re: Debugging via xpcom or port 5000

Post by xabilistas@gmail.com »

Is is disabled, and no AV is installed. In fact I have deployed a service on port 333 in the guest machine and works perfectly.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Debugging via xpcom or port 5000

Post by vbox4me2 »

As you wrote earlier:
xabilistas@gmail.com wrote:In this case nmap shows that the port 5000 is open, I cannot connect to the guest's port 5000: the connection is inmediatly refused.
The service is not running or refusing connections from the host IP.
In Bridge mode the Guest is just another pc on the lan.
xabilistas@gmail.com
Posts: 4
Joined: 14. Sep 2011, 09:35
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP SP3

Re: Debugging via xpcom or port 5000

Post by xabilistas@gmail.com »

Anyway, is there a way to debug the guest machine through the xpcom interface? The IMachineDebugger has methods for retrieving and modifying cpu registers, virtual and physical memory, and even for switching on and off the single-step execution. The problem is that I cannot find any method or event to manage that single-step execution and debug the guest instruction by instruction... (something equivalent to the "t" command of the debugger).

Thank you very much for your help!
Post Reply