使用Vagrant projects for Oracle products and other examples 新创建的虚机,例如vagrant-projects/OracleLinux/8
。
用vagrant ssh可以登录:
$ vagrant ssh
==> vagrant: Getting Proxy Configuration from Host...
Welcome to Oracle Linux Server release 8.9 (GNU/Linux 5.15.0-200.131.27.el8uek.x86_64)
The Oracle Linux End-User License Agreement can be viewed here:
* /usr/share/eula/eula.en_US
For additional packages, updates, documentation and community help, see:
* https://yum.oracle.com/
[vagrant@ol8-vagrant ~]$
而vagrant putty却报错:
$ vagrant putty
==> vagrant: Getting Proxy Configuration from Host...
C:/Users/XiaoYu/.vagrant.d/gems/3.1.4/gems/vagrant-multi-putty-1.6.0/lib/vagrant-multi-putty/command.rb:114:in `read': Could not parse PKey: unsupported (OpenSSL::PKey::PKeyError)
from C:/Users/XiaoYu/.vagrant.d/gems/3.1.4/gems/vagrant-multi-putty-1.6.0/lib/vagrant-multi-putty/command.rb:114:in `block in get_putty_key_file'
from <internal:kernel>:90:in `tap'
from C:/Users/XiaoYu/.vagrant.d/gems/3.1.4/gems/vagrant-multi-putty-1.6.0/lib/vagrant-multi-putty/command.rb:112:in `get_putty_key_file'
from C:/Users/XiaoYu/.vagrant.d/gems/3.1.4/gems/vagrant-multi-putty-1.6.0/lib/vagrant-multi-putty/command.rb:94:in `putty_connect'
from C:/Users/XiaoYu/.vagrant.d/gems/3.1.4/gems/vagrant-multi-putty-1.6.0/lib/vagrant-multi-putty/command.rb:53:in `block in execute'
from C:/Program Files/Vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/plugin/v2/command.rb:249:in `block in with_target_vms'
from C:/Program Files/Vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/plugin/v2/command.rb:238:in `each'
from C:/Program Files/Vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/plugin/v2/command.rb:238:in `with_target_vms'
from C:/Users/XiaoYu/.vagrant.d/gems/3.1.4/gems/vagrant-multi-putty-1.6.0/lib/vagrant-multi-putty/command.rb:51:in `execute'
from C:/Program Files/Vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/cli.rb:67:in `execute'
from C:/Program Files/Vagrant/embedded/gems/gems/vagrant-2.4.1/lib/vagrant/environment.rb:319:in `cli'
from C:/Program Files/Vagrant/embedded/gems/gems/vagrant-2.4.1/bin/vagrant:248:in `<main>'
我们发现目录下,并没有putty格式的私钥文件:
$ ls .vagrant/machines/ol8-vagrant/virtualbox/
action_provision action_set_name box_meta creator_uid id index_uuid private_key synced_folders vagrant_cwd
使用puttygen导入私钥,并另存一份PPK形式的私钥。
文件另存为private_key.ppk:
$ ls -1 .vagrant/machines/ol8-vagrant/virtualbox/private_key*
.vagrant/machines/ol8-vagrant/virtualbox/private_key
.vagrant/machines/ol8-vagrant/virtualbox/private_key.ppk
再次vagrant putty,这会成功了: