Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8940561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:04:01+00:00 2026-06-15T11:04:01+00:00

VBoxManage.exe is an Oracle VirtualBox companion utility, which allows to control VMs via command

  • 0

VBoxManage.exe is an Oracle VirtualBox companion utility, which allows to control VMs via command line. It can do numerous operations, including start/stop and screen capturing.

I am interested, which API it uses?

How can I capture VM screen or send keyboard or mouse commands there without this heavy commandline utility? Which language is better? Is is possible to access this API with Java?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:04:02+00:00Added an answer on June 15, 2026 at 11:04 am

    One of the advantages to using an open source project is supposed to be that you can answer such questions by looking at the source.

    VBoxManage is located in the source repository under /src/VBox/Frontends/VBoxManage. The code you’re looking for is in VBoxManageControlVM.cpp under the condition if (!strcmp(a->argv[1], "screenshotpng")):

    ComPtr<IDisplay> pDisplay;
    CHECK_ERROR_BREAK(console, COMGETTER(Display)(pDisplay.asOutParam()));
    
    ULONG width, height, bpp;
    CHECK_ERROR_BREAK(pDisplay, 
            GetScreenResolution(displayIdx, &width, &height, &bpp));
    
    com::SafeArray<BYTE> saScreenshot;
    CHECK_ERROR_BREAK(pDisplay, TakeScreenShotPNGToArray(displayIdx, 
            width, height, ComSafeArrayAsOutParam(saScreenshot)));
    
    RTFILE pngFile = NIL_RTFILE;
    vrc = RTFileOpen(&pngFile, a->argv[2], RTFILE_O_OPEN_CREATE | RTFILE_O_WRITE |
        RTFILE_O_TRUNCATE | RTFILE_O_DENY_ALL);
    
    if (RT_FAILURE(vrc))
    {
        RTMsgError("Failed to create file '%s'. rc=%Rrc", a->argv[2], vrc);
        rc = E_FAIL;
        break;
    }
    vrc = RTFileWrite(pngFile, saScreenshot.raw(), saScreenshot.size(), NULL);
    if (RT_FAILURE(vrc))
    {
        RTMsgError("Failed to write screenshot to file '%s'. rc=%Rrc",
            a->argv[2], vrc);
        rc = E_FAIL;
    }
    RTFileClose(pngFile);
    

    So it’s done via a COM API, and you can look at:

    Is it possible to call a COM API from Java?

    Googling for TakeScreenShotPNGToArray finds the display interface:

    https://www.virtualbox.org/sdkref/interface_i_display.html

    From there you can find the list of all the other things like mouse and keyboard:

    https://www.virtualbox.org/sdkref/annotated.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From Terminal in Mac OS X, I want to use VBoxManage guestcontrol to control
VBoxManage can do this. But I want to do this myself in my program
Is there any way I can create a Virtual Box disk image (.vdi) that
I'm trying to change TCP/UDP of a virtual machine using VBoxManage setextradata. Whenever I
I've run out of space on a virtual machine disk which is a vmdk
I have a bunch of virtual machines that I need to update from time
Problem: vagrant up fails the first time with the error below, and vagrant up
I've tried using some of the assembly tutorials around the web, and most of
I'm pretty new to C++ and am writing a cross-platform (desktop/mobile) 2D game engine...
I am making a script that needs to loop over a list of files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.