gpt4 book ai didi

ssh - vagrant windows box 的 "config.ssh.shell"值是否正确?

转载 作者:行者123 更新时间:2023-12-01 19:41:10 25 4
gpt4 key购买 nike

我正在从主机上启动带有 Windows 7 的 vagrant box,该主机也是带有“vagrant up”命令的 Windows 7。

Vagrantfile 的内容:

Vagrant.configure(2) do |config|
config.vm.box = "win7_base_test"
config.vm.network "forwarded_port", guest: 88, host: 3088
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
config.ssh.port = "3088"
config.ssh.host = "127.0.0.1"
config.ssh.shell = "cmd"
end

结果我得到了以下列表,最后有一个错误:

vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 88 => 3088 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:3088
default: SSH username: vagrant
default: SSH auth method: password
default: Warning: Connection timeout. Retrying...
The configured shell (config.ssh.shell) is invalid and unable
to properly execute commands. The most common cause for this is
using a shell that is unavailable on the system. Please verify
you're using the full path to the shell and that the shell is
executable by the SSH user.

注意:我可以通过同时执行“vagrant ssh”来连接到 vagrant box,并在那里发出 shell 命令。

因此我有一个问题:我是否为“config.ssh.shell”参数使用正确的值(“cmd”)?那里可能存在什么值?

谢谢!

最佳答案

一种选择是使用 WinRM 而不是 SSH:将 config.vm.communicator 设置为“winrm”。

关于ssh - vagrant windows box 的 "config.ssh.shell"值是否正确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31586621/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com