>> vm.interface.methods
=> ["teleporter_password", "get_guest_property_value", "pointing_hid_type=", "call_function", "get_serial_port", "teleporter_password=", "current_snapshot", "vram_size", "get_cpu_status", "methods", "send", "delete_settings", "settings_modified", "members", "access_error", "keyboard_hid_type", "vram_size=", "taint", "get_cpu_id_leaf", "instance_variable_defined?", "set_boot_order", "medium_attachments", "get_guest_property_timestamp", "keyboard_hid_type=", "state", "snapshot_count", "accelerate_3d_enabled", "query_log_filename", "singleton_methods", "instance_eval", "export", "get_medium_attachment", "session_state", "accelerate_3d_enabled=", "set_cpu_id_leaf", "hpet_enabled", "nil?", "get_boot_order", "memory_size", "set_guest_property", "read_property", "get_parallel_port", "hpet_enabled=", "current_state_modified", "protected_methods", "instance_exec", "get_snapshot", "display", "memory_size=", "accelerate_2d_video_enabled", "read_log", "tainted?", "method", "get_network_adapter", "untaint", "remove_cpu_id_leaf", "instance_of?", "os_type_id", "rtc_use_utc", "accelerate_2d_video_enabled=", "attach_device", "equal?", "name", "set_guest_propetty_value", "usb_controller", "os_type_id=", "rtc_use_utc=", "write_property", "clipboard_mode", "hash", "name=", "private_methods", "find_snapshot", "monitor_count", "clipboard_mode=", "session_type", "kind_of?", "hardware_version", "io_cache_enabled", "monitor_count=", "freeze", "remove_all_cpu_id_leafs", "detach_device", "eql?", "enumerate_guest_properties", "hardware_version=", "io_cache_enabled=", "id", "get_extra_data_keys", "guest_property_notification_patterns", "bios_settings", "public_methods", "set_current_snapshot", "implementer", "add_storage_controller", "has_function?", "session_pid", "object_id", "guest_property_notification_patterns=", "is_a?", "hardware_uuid", "io_cache_size", "get_hw_virt_ex_property", "passthrough_device", "query_saved_thumbnail_size", "audio_adapter", "tap", "hardware_uuid=", "io_cache_size=", "member", "type", "get_extra_data", "teleporter_enabled", "firmware_type", "instance_variables", "can_show_console_window", "__id__", "lib", "get_storage_controller_by_name", "has_property?", "frozen?", "last_state_change", "to_enum", "teleporter_enabled=", "io_bandwidth_max", "firmware_type=", "to_a", "set_hw_virt_ex_property", "cpu_count", "respond_to?", "mount_medium", "storage_controllers", "read_saved_thumbnail_to_array", "class", "set_extra_data", "cpu_hot_plug_enabled", "cpu_count=", "io_bandwidth_max=", "teleporter_port", "snapshot_folder", "instance_variable_get", "show_console_window", "==", "cpu_hot_plug_enabled=", "__send__", "get_storage_controller_by_instance", "===", "create_shared_folder", "state_file_path", "enum_for", "teleporter_port=", "extend", "to_s", "save_settings", "memory_balloon_size", "hot_plug_cpu", "snapshot_folder=", "get_medium", "query_saved_screenshot_png_size", "parent", "page_fusion_enabled", "memory_balloon_size=", "clone", "get_cpu_property", "teleporter_address", "=~", "instance_variable_set", "get_guest_property", "vrdp_server", "page_fusion_enabled=", "remove_storage_controller", "remove_shared_folder", "log_folder", "teleporter_address=", "discard_settings", "shared_folders", "hot_unplug_cpu", "description", "inspect", "get_medium_attachments_of_controller", "read_saved_png_screenshot_to_array", "settings_file_path", "accessible", "pointing_hid_type", "dup", "set_cpu_property", "description="]


patricks-iMac:virtualbox-0.7.5 patrick$ vi lib/virtualbox/com/ffi/interfaces.rb
   create_interface(:Keyboard, :NSISupports)



#http://www.virtualbox.org/sdkref/_virtual_box_8idl-source.html
#http://www.virtualbox.org/sdkref/interface_i_keyboard.html


vi lib/virtualbox/com/interface/3.2.x/keyboard.rb

module VirtualBox
  module COM
    module Interface
      module Version_3_2_X
        class Keyboard < AbstractInterface
          IID = "2D1A531B-4C6E-49CC-8AF6-5C857B78B5D7"

          function :put_cad, nil, []
          function :put_scancode, nil, [T_INT64]
          function :put_scancodes, nil, [ [:scancode,T_INT64], T_UINT64 ]

          #function :detach_usb_device, :USBDevice, [WSTRING]
          #function :find_usb_device_by_address, :USBDevice, [WSTRING]
          #function :find_usb_device_by_id, :USBDevice, [WSTRING]
          #function :create_shared_folder, nil, [WSTRING, WSTRING, T_BOOL]
          #function :remove_shared_folder, nil, [WSTRING]
          #function :take_snapshot, :Progress, [WSTRING, WSTRING]
          #function :delete_snapshot, :Progress, [WSTRING]
          #function :restore_snapshot, :Progress, [:Snapshot]
          #function :teleport, :Progress, [WSTRING, T_UINT32, WSTRING, T_UINT32]
          #function :register_callback, nil, [:ConsoleCallback]
          #function :unregister_callback, nil, [:ConsoleCallback]
        end
      end
    end
  end
end




>> session=VirtualBox::Lib.lib.session
=> #<VirtualBox::COM::Interface::Version_3_2_X::Session>
>> session.state
get_state
[#<FFI::MemoryPointer address=0x101712bf0 size=8>]
FFI call: get_state [] [#<FFI::MemoryPointer address=0x101712bf0 size=8>]0
=> :closed


vm.interface.parent.open_remote_session(session,"c5429061-8f1c-4a9d-aea6-0d2d6a4a4ebc","gui","")


VirtualBox::Exceptions::FFIException: Error in API call to open_session: 2147942487
	from /Users/patrick/veewee/gems/gems/virtualbox-0.7.5/lib/virtualbox/com/implementer/ffi.rb:99:in `call_and_check'
	from /Users/patrick/veewee/gems/gems/virtualbox-0.7.5/lib/virtualbox/com/implementer/ffi.rb:72:in `call_vtbl_function'
	from /Users/patrick/veewee/gems/gems/virtualbox-0.7.5/lib/virtualbox/com/implementer/ffi.rb:51:in `call_function'
	from /Users/patrick/veewee/gems/gems/virtualbox-0.7.5/lib/virtualbox/com/abstract_interface.rb:135:in `call_function'
	from /Users/patrick/veewee/gems/gems/virtualbox-0.7.5/lib/virtualbox/com/abstract_interface.rb:51:in `open_session'
	from (irb):33



BUG
https://github.com/mitchellh/virtualbox/issuesearch?state=closed&q=session#issue/25



***open_remote_session****
open_remote_session
open_remote_session
[#<VirtualBox::COM::FFI::Version_3_2_X::Session::VtblParent:0x1015ab4a8>,
 #<FFI::Pointer address=0x102b1e9e0>,
 #<FFI::Pointer address=0x102b44f20>,
 #<FFI::Pointer address=0x102b1fb20>,
 #<FFI::MemoryPointer address=0x102b18720 size=8>]
FFI call: open_remote_session [#<VirtualBox::COM::Interface::Version_3_2_X::Session>, "c5429061-8f1c-4a9d-aea6-0d2d6a4a4ebc", "gui", ""] [#<VirtualBox::COM::FFI::Version_3_2_X::Session::VtblParent:0x1015ab4a8>, #<FFI::Pointer address=0x102b1e9e0>, #<FFI::Pointer address=0x102b44f20>, #<FFI::Pointer address=0x102b1fb20>, #<FFI::MemoryPointer address=0x102b18720 size=8>]0

