SSHをさまようには、-o KexAlgorithmsを追加してください。

SSHをさまようには、-o KexAlgorithmsを追加してください。

私は次を使いたいです:https://app.vagrantup.com/FritsHoogland/boxes/centos39-oracle817

基本vagrant upコマンドが失敗します。

$ vagrant init FritsHoogland/centos39-oracle817
$ vagrant up
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "0e84ac28-6e1d-432a-b417-cc99c71562b7", "--type", "headless"]

Stderr: VBoxManage: error: Implementation of the USB 2.0 controller not found!
VBoxManage: error: Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings.
VBoxManage: error: Note! This error could also mean that an incompatible version of the 'Oracle VM VirtualBox Extension Pack' is installed (VERR_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

USBエラーを無視するようにVagrantfileを編集しました。

  config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--usb", "on"]
    vb.customize ["modifyvm", :id, "--usbehci", "off"]
  end

これにより VM が起動しますが、VM の初期 SSH は失敗します。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'FritsHoogland/centos39-oracle817'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'FritsHoogland/centos39-oracle817' version '0.0.2' is up to date...
==> default: Setting the name of the VM: c_default_1689909952468_41
==> default: Fixed port collision for 22 => 2222. Now on port 2206.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2206 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2206
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

Vagrantが実行されているようです。

/usr/bin/ssh -vv -p 2206 -o LogLevel=FATAL -o Compression=yes -o DSAAuthentication=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o KexAlgorithms=+diffie-hellman-group1-sha1 -o UserKnownHostsFile=/dev/null -i /home/tange/.vagrant.d/insecure_private_key [email protected]

これは失敗しました。

-o KexAlgorithms=+diffie-hellman-group1-sha1機能しているように見える機能を追加するにはどうすればよいですか?

/usr/bin/ssh -vv -p 2206 -o LogLevel=FATAL -o Compression=yes -o DSAAuthentication=yes -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o KexAlgorithms=+diffie-hellman-group1-sha1 -o UserKnownHostsFile=/dev/null -i /home/tange/.vagrant.d/insecure_private_key [email protected]

これで仮想マシンにログインします。

~/.ssh/configにこれを追加してみました。

Host *
  KexAlgorithms +diffie-hellman-group1-sha1

しかしvagrant up、最初はこの部分を見落としたようです。

Vagrantfileに以下を追加しました。

config.ssh.extra_args = ["-o" "KexAlgorithms=+diffie-hellman-group1-sha1"]

使用されているようですが、vagrant ssh使用されていませんvagrant up。つまり、vagrant up停止しますが、vagrant sshシステム起動後は機能します。

私が設定できるVagrantfileセクションがありますか?それともそれを使用する-o KexAlgorithms +diffie-hellman-group1-sha1別の方法がありますか?vagrant up

ベストアンサー1

おすすめ記事