私はUbuntu 14.04でVirtualBox 5.0.16を実行しています。私はWindows7の32ビット版の仮想マシンを持っています。私がしたいのは、ゲストでプログラムを実行することです。まず私は、この目的のためにPythonスクリプトを使用してみました:VirtualBoxのゲストOSでプログラムを実行
vbox = virtualbox.VirtualBox()
session = virtualbox.Session()
vm = vbox.find_machine('Windows7')
vm.launch_vm_process(session, 'gui', '').wait_for_completion()
session = vm.create_session()
time.sleep(35)
gs = session.console.guest.create_session('win7', '')
process, stdout, stderr = gs.execute('C:\\Windows\\System32\\cmd.exe', ['/C', 'tasklist'])
print stdout
マシンはうまく起動しますが、何かが次のエラーを発生させますので、私は、任意のプログラムを実行することはできません。
Traceback (most recent call last): File "runonguest.py", line 39, in gs = session.console.guest.create_session('win7', '') File "/usr/local/lib/python2.7/dist-packages/virtualbox/library_ext/guest.py", line 24, in create_session raise SystemError("GuestSession failed to start") SystemError: GuestSession failed to start
私は、コマンドラインを使用してみました後ゲストでプログラムを実行するだから私は、仮想マシンを実行すると、以下のコマンドを実行しようとしています
VBoxManage guestcontrol "Windows7" --username win7 run --exe C:\Windows\System32\cmd.exe --wait-stdout -- "C:\Windows\System32\cmd.exe" "/C" "tasklist"
をしかし、それは私に次のエラーをもたらします:
私は可能な解決策を探していたVBoxManage: error: VERR_ACCOUNT_RESTRICTED VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component GuestSessionWrap, interface IGuestSession, callee nsISupports VBoxManage: error: Context: "WaitForArray(ComSafeArrayAsInParam(aSessionWaitFlags), 30 * 1000, &enmWaitResult)" at line 938 of file VBoxManageGuestCtrl.cpp
が、VirtualBoxの古いバージョンのためにそれらのほとんどコマンドを実行した場合、はまったく存在しません。 誰かが可能な解決策を知っているといいですね。おかげさまで
ありがとうございます。私はその方向で考えることさえしなかった。今はうまくいく。 – aGGeRReS
私はこの時点で私はこの問題を抱えていませんでした:) – EugenG