加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

为vagrant windows box更正“config.ssh.shell”值?

发布时间:2020-12-14 02:47:07 所属栏目:Windows 来源:网络整理
导读:我正在使用 Windows 7从主机启动流浪盒,这也是带有“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
我正在使用 Windows 7从主机启动流浪盒,这也是带有“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”.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读