sethmlarson / virtualbox-python

Complete implementation of VirtualBox's COM API with a Pythonic interface.
https://pypi.org/project/virtualbox
Apache License 2.0
354 stars 75 forks source link

Finding a VM's VDRE Configuration #135

Closed eohrnberger closed 4 years ago

eohrnberger commented 4 years ago

Hi, I've got pyvbox and vboxapi installed and working, finding the collection of VMs (vobx.machines) and the collection of hard disks (vbox.hard_disks).

My question is how do I access the VDRE parameters of a vbox.machines instance? I'm specifically looking for the port number.

Thanks in advance.

sethmlarson commented 4 years ago

I believe you can do machine.vrde_server_info.port.

eohrnberger commented 4 years ago

Hi, Thanks for responding. I've looked into this further:

machine.vrde_server has the following properties: allow_multi_connection auth_library auth_timeout auth_type enabled reuse_single_connection vrde_ext_pack vrde_properties

machine.vrde_server.vrde_properties has strings in a list: 00: 'TCP/Ports' 01: 'TCP/Address' 02: 'VideoChannel/Enabled' 03: "VideoChannel/Quality' 04: VideoChanel/DownscaleProtection' 05:'Client/DisableDisplay' 06:'Client/DisableInput' 07:'Client/DisableAudio' 08:'Client/DisableUSB' 09:'Client/DisableClipboard' 10:'Client/DisableUpstreamAudio' 11:'Client/DisableRDPDR' 12:'H3Redirect/Enabled' 13:'Security'Method' 14:'Security/ServerCirtificate' 15:'Security/ServerPrivateKey' 16:'Security/CACertificates' 17:'Audio/RateCorrectionMode' 18:'Audio/LogPath'

Where would the values for these configuration parameters be found in the interface?

sethmlarson commented 4 years ago

Try machine.vrde_server.get_vrde_property("TCP/Ports"). You should be able to put any of those keys into that getter.

eohrnberger commented 4 years ago

Oh hot dam! Thanks! (I have to admit, I'm just starting out with python) :)

sethmlarson commented 4 years ago

No problem! This library, although it says it's 'Pythonic' on the tin, it's not actually very 'Pythonic' in many ways. This is because it follows the VirtualBox API strictly for almost all functionality, like the piece you're using. :)

Hope you get some good use out of the library and good luck with learning Python!