Search code examples
javac++virtualboxscreen-capture

How do I capture Oracle Virtual Box machine’s screen programmatically?


VBoxManage can do this. But I want to do this myself in my program (to write a robot).


Solution

  • UPDATE: I've answered your other question:

    What API does VBoxManage.exe use?

    It's a fair amount of overhead to bind to that API if all you want is a screen capture. For that operation, it sounds like you have the tool you need in your hand...VBoxManage is already cross-platform and already built. Look into some form of for whatever language(s)/platform(s) you're actually using.

    However, if you really want to be doing lots of automation and need more functionality (moving the mouse around, drawing on the guest screen)...that's what the API is for. Though if you don't write it in C++ you're probably setting yourself up for a nuisance.

    If I were going down that road, I'd probably follow the VirtualBox build instructions and get VBoxManage to build. Then I'd duplicate the VBoxManage build environment to make MyVBoxManage (or whatever), and tweak it a little at a time.