Node-Virtualization / node-virtualbox

A JavaScript Library for Interacting with VirtualBox
MIT License
259 stars 68 forks source link

virtualbox.exec how works? #114

Closed cekkr closed 2 years ago

cekkr commented 2 years ago

virtualbox.exec it's a very cool feature. But I have to understand some things:

Thank you

colonelpopcorn commented 2 years ago

I'm not sure how it works under the hood, but this library uses the VBoxManage controlvm <vm> keyboardputscancode <hex> [<hex>...] command. Here's the relevant documentation page. It is not possible to read the contents of the screen, but other text based tools like SSH should do that for you. I don't think it needs guest additions to work. Does that answer your question?

cekkr commented 2 years ago

Ever on the doc it provides you several functions for guest control: https://docs.oracle.com/en/virtualization/virtualbox/6.0/user/vboxmanage-guestcontrol.html

It's very interesting but it doesn't specify how it works (and when it works). Anyway, very useful features. Thank you!

colonelpopcorn commented 2 years ago

Right, we're just using the command line options that VBoxManage exposes. If you'd like to dig deeper, VirtualBox source code can be found here, and the function that actually sends the codes to the VM can be found here