@Override
public Node load(final String id) throws Exception {
if (id.equals("host")) {
final Node hostNode = Node.builder().id("host").name("host installing virtualbox").hostname("localhost")
.osFamily(OsFamily.LINUX.toString()).osDescription(System.getProperty("os.name"))
.osVersion(System.getProperty("os.version")).group("ssh").username(System.getProperty("user.name"))
.credentialUrl(privateKeyFile()).build();
return hostNode;
}
final IMachine machine = manager.getVBox().findMachine(id);
final String ipAddress = iMachineToIpAddress.apply(machine);
final String osTypeId = machine.getOSTypeId();
final IGuestOSType guestOSType = manager.getVBox().getGuestOSType(osTypeId);
final Node node = Node.builder().id(machine.getId()).name(machine.getName())
.description(machine.getDescription()).loginPort(22).group(System.getProperty(VIRTUALBOX_MACHINE_GROUP))
.username(System.getProperty(VIRTUALBOX_MACHINE_USERNAME))
.credential(System.getProperty(VIRTUALBOX_MACHINE_CREDENTIAL))
.sudoPassword(System.getProperty(VIRTUALBOX_MACHINE_CREDENTIAL))
.locationId(System.getProperty(VIRTUALBOX_MACHINE_LOCATION)).os64Bit(guestOSType.getIs64Bit())