Sorry if there is a similar post of this on this forum but i couldn't find it anywhere.
I'm trying to launch an executable (.exe) on a Japanese Windows 7 guest, using Python 2.7 on the host (Windows 7).
So far, this is what i've done :
Code: Select all
mgr = vboxapi.VirtualBoxManager(None, None)
vbox = mgr.vbox
machine = vbox.findMachine("W7 32-bit JAP")
session = mgr.openMachineSession(machine)
console = session.console
try:
snapshot = machine.findSnapshot("SnapshotW7x86Jap")
progress = session.machine.restoreSnapshot(snapshot)
progress.waitForCompletion(10000)
if progress.resultCode ! =0:
raise Exception, "Couldn't restore VM snapshot"
mgr.closeMachineSession(session)
# Launching VM
session = mgr.mgr.getSessionObject(vbox)
progress = machine.launchVMProcess(session, "gui", "")
progress.waitForCompletion(10000)
if progress.resultCode != 0:
raise Exception, "Couldn't start VM"
console = session.console
while console.state != mgr.constants.MachineState_FirstOnline:
print console.state
time.sleep(3)
guestsession=console.guest.createSession("test","pass","","")
guestsession.waitFor(1,20000)
Code: Select all
path = glob.glob("K:¥****¥****¥****¥****¥*****.exe") # (Full path in the real script)
arg = []
evtc = []
flag[0] = 2
progress=guestsession.processCreate(path, arg, evtc, flag, 0)
progress.waitFor(2,20000)