private IMachine getVmWithGuestAdditionsInstalled() { MasterSpec masterSpecForTest = super.getMasterSpecForTest(); try { Injector injector = view.utils().injector(); return injector.getInstance(CreateAndInstallVm.class).apply(masterSpecForTest); } catch (IllegalStateException e) { // already created return manager.get().getVBox().findMachine(masterSpecForTest.getVmSpec().getVmId()); } }
private IMachine cloneFromMaster() { IMachine source = getVmWithGuestAdditionsInstalled(); CloneSpec cloneSpec = CloneSpec.builder() .vm(machineSpec.getVmSpec()) .network(machineSpec.getNetworkSpec()) .master(source) .linked(true) .build(); return new CloneAndRegisterMachineFromIMachineIfNotAlreadyExists( manager, workingDir, machineUtils) .apply(cloneSpec); }