本文介绍了“ chocolatey”未被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是尝试设置 metasploitable3 并运行:

I just tried to setup metasploitable3 and ran:

.\build.ps1 windows2008

在Windows10 powershell中。

in the windows10 powershell.

一段时间后,我出现此错误:

After a while I've got this error:

Provisioning with windows-shell...
==> virtualbox-iso: Provisioning with shell script: D:\Bibliothek\Downloads1\metasploitable3-master\metasploitable3-master\packer\templates/../../scripts/installs/install_boxstarter.bat virtualbox-iso:
==> virtualbox-iso: 'chocolatey' is not recognized as an internal or external command, virtualbox-iso: C:\Users\vagrant>chocolatey feature enable -n=allowGlobalConfirmation virtualbox-iso:
==> virtualbox-iso: operable program or batch file. virtualbox-iso: C:\Users\vagrant>choco install BoxStarter virtualbox-iso: virtualbox-iso: C:\Users\vagrant>chocolatey feature disable -n=allowGlobalConfirmation
==> virtualbox-iso: 'choco' is not recognized as an internal or external command,
==> virtualbox-iso: operable program or batch file.
==> virtualbox-iso: 'chocolatey' is not recognized as an internal or external command
==> virtualbox-iso: operable program or batch file.
==> virtualbox-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
==> virtualbox-iso: Deregistering and deleting VM...
==> virtualbox-iso: Deleting output directory... Build 'virtualbox-iso' errored: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
==> Some builds didn't complete successfully and had errors: --> virtualbox-iso: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]


推荐答案

我尝试了以下解决方案:

I tried this solution:

但继续获得相同的结果错误正在Ubuntu 19.10上构建。我正在使用:

But continue to get the same error you are getting building on Ubuntu 19.10. I am using:

$ packer build --only = virtualbox-iso packer / templates / windows_2008_r2.json

$ packer build --only=virtualbox-iso packer/templates/windows_2008_r2.json

具体来说,我更换了CA证书检查:

Specifically, I replaced the CA cert check:

:virtualbox

move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"

:: There needs to be Oracle CA (Certificate Authority) certificates installed in order
:: to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer

cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
goto :done

这篇关于“ chocolatey”未被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-31 23:10