| 1 |
|
|---|
| 2 |
|
|---|
| 3 | while(true) {
|
|---|
| 4 | //Open VBOXWEB Session
|
|---|
| 5 | var machine:IMachine = vbox.createMachine("",machineName,null,osType,"")
|
|---|
| 6 | var session:ISession = mgr.getSessionObject
|
|---|
| 7 | vbox.registerMachine(machine)
|
|---|
| 8 | val progress:IProgress = machine.launchVMProcess(session,"gui", "DISPLAY=:0")
|
|---|
| 9 | progress.waitForCompletion(-1)
|
|---|
| 10 | mgr.closeMachineSession(session)
|
|---|
| 11 | //Close VBOXWEB session
|
|---|
| 12 |
|
|---|
| 13 | //Open VBOXWEB Session
|
|---|
| 14 | machine = vbox.findMachine(machineName)
|
|---|
| 15 | var progress:IProgress = session.getConsole.powerDown // Locks up here after anywhere between 5 and a few hundred iterations. Very inconsistent
|
|---|
| 16 | progress.waitForCompletion(-1)
|
|---|
| 17 | machine.unregister(org.virtualbox_4_2.CleanupMode.DetachAllReturnHardDisksOnly)
|
|---|
| 18 | //Close VBOXWEB session
|
|---|
| 19 | }
|
|---|