viewtopic.php?f=34&t=65910
Host Machine : Windows 8
Guest : Slitaz 4.0
VirtualBox : 4.3.24
VirtualBox Java API : 4.3
Adapter in VM : Host Only Adapter
I have created a Java program using API and I can basically connect, clone and start a VM in VirtualBox. But what I was not able to do is get the IP address of machine. (Why I need IP is because I want to SSH into that machine, using JSCH java library and execute some processes)
This is what I tried so far,
1. Based on the link, I tried
Code: Select all
machine.getGuestPropertyValue("/VirtualBox/GuestInfo/Net/<nicid>/V4/IP") - returns empty result
machine.getGuestPropertyValue("/VirtualBox/GuestInfo/Net/Count") - returns empty result
machine.getGuestPropertyValue("/VirtualBox/GuestInfo/Net/<nicid>/MAC") - return empty result
machine.getGuestPropertyValue("/VirtualBox/GuestInfo/OS/Release") - this gives me release version of linux - which is ok
Code: Select all
org.virtualbox_4_3.Holder<List<String>> tempList = new Holder<List<String>>();
org.virtualbox_4_3.Holder<List<String>> tempList1 = new Holder<List<String>>();
Holder<List<Long>> tempList2 = new Holder<List<Long>>();
org.virtualbox_4_3.Holder<List<String>> tempList3 = new Holder<List<String>>();
machine.enumerateGuestProperties("",tempList, tempList1,tempList2,tempList3);
[/VirtualBox/GuestInfo/OS/Product, /VirtualBox/HostInfo/GUI/LanguageID, /VirtualBox/HostInfo/VBoxVerExt, /VirtualBox/GuestAdd/Vbgl/Video/SavedMode, /VirtualBox/GuestInfo/OS/Version, /VirtualBox/GuestAdd/VersionExt, /VirtualBox/GuestAdd/Revision, /VirtualBox/HostGuest/SysprepExec, /VirtualBox/GuestAdd/Vbgl/Video/0, /VirtualBox/HostGuest/SysprepArgs, /VirtualBox/GuestAdd/Version, /VirtualBox/HostInfo/VBoxRev, /VirtualBox/HostInfo/VBoxVer, /VirtualBox/GuestInfo/OS/Release, /VirtualBox/GuestAdd/HostVerLastChecked]
3. That is the reason, I think this works
Code: Select all
machine.getGuestPropertyValue("/VirtualBox/GuestInfo/OS/Release") - this gives me release version of linux - which is ok
Code: Select all
machine.getGuestPropertyValue("/VirtualBox/GuestInfo/Net/<nicid>/V4/IP")
Can somebody please help me out here or guide in appropriate direction.