First thank you for reading this. My question is this - I'm trying to create a simple automation via the API to setup a virtual machine and create a port forwarding on port80. I've included two bits of code. One that works which is pretty much out of the example and the other which does not and ends in an " Cannot create ActiveX component. "
So either I'm creating the object incorrectly or doing something wrong elsewhere... Any help is greatly appreciated.
Code: Select all
Dim vb As VirtualBox.IVirtualBox
vb = CreateObject("VirtualBox.VirtualBox")
vb.CreateNATNetwork("newNat")
'' This code works
'Add the port forwarding -- This code below does not work :(
Dim vbE As VirtualBox.INATEngine
vbE = CreateObject("VirtualBox.INATEngine") '' This fails with '' Cannot create ActiveX component.''
'vbE.INATEngine.AddRedirect(Of String, VirtualBox.NATProtocol, String, UShort, String, UShort)
vbE.AddRedirect("webfw", VirtualBox.NATProtocol.NATProtocol_TCP, "", 80, "192.168.10.200", 80)