2

私は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の古いバージョンのためにそれらのほとんどコマンドを実行した場合、はまったく存在しません。 誰かが可能な解決策を知っているといいですね。おかげさまで

答えて

4

アクセス[スタートメニュー]と[検索プログラムおよびファイル]には、実行を入力します。 内部[実行ライン] gpedit.mscと入力してください。 Windowsの設定 - >セキュリティ設定 - >ローカルポリシー - >セキュリティオプション - > [アカウント:コンソールログオン時に空白パスワードのローカルアカウントの使用を制限する]に設定し、を無効にします。に設定します。 VMの再起動後、解決する必要があります。

+0

ありがとうございます。私はその方向で考えることさえしなかった。今はうまくいく。 – aGGeRReS

+0

私はこの時点で私はこの問題を抱えていませんでした:) – EugenG

0

これまでのところ、私はVirtualBoxのゲストOSでプログラムを起動することができました。 ユーザーアカウントにパスワードがない場合、VBox APIがセッションを起動しないという事実に基づいた解決策です。だから私はゲストのWindows7でパスワード付きの新しいユーザーアカウントを作成しました。 Python用

はただ書く:コンソール用の

In [15]: gs = session.console.guest.create_session('user', 'user') 

    In [16]: process, stdout, stderr = gs.execute('C:\\Windows\\System32\\cmd.exe', ['/C', 'tasklist']) 

    In [17]: print stdout 

    Image Name      PID Session Name  Session# Mem Usage 
    ========================= ======== ================ =========== ============ 
    System Idle Process    0 Services     0   12 K 
    System       4 Services     0  528 K 
    smss.exe      264 Services     0  688 K 
    csrss.exe      340 Services     0  2,824 K 
    wininit.exe     388 Services     0  3,128 K 
    csrss.exe      400       1  3,572 K 
    winlogon.exe     440       1  5,556 K 
..... 

を書くだけで:

VBoxManage guestcontrol "Windows7" --verbose --username user --password user run --exe "C:\\ 
Windows\\System32\\cmd.exe" -- cmd.exe /c tasklist 

Image Name      PID Session Name  Session# Mem Usage 
========================= ======== ================ =========== ============ 
System Idle Process    0 Services     0   12 K 
System       4 Services     0  532 K 
smss.exe      264 Services     0  688 K 
csrss.exe      340 Services     0  2,848 K 
wininit.exe     388 Services     0  3,128 K 
csrss.exe      400       1  3,572 K 
winlogon.exe     440       1  5,556 K 
...... 

起動の詳細:

のpython 2.7.6
pyvbox 1.0.0
ホストOSを - Ubuntu 14.04
ゲストOS - Windows7 x32

のVirtualBox 5.0.16

UPD:真の解決策は、Windowsのセキュリティポリシーにあったiugeneの答えによります。

Access [Start menu] and in [search program and files] type Run. Inside [Run line] type gpedit.msc. There, go to Windows Settings -> Security Settings -> Local Policies -> Security Options -> [Accounts: Limit local account use of blank passwords to console logon only] and set it to Disabled. After a VM restart, should be solved.

関連する問題