CentOSで、 vagrant up
しようとすると、
[root@{server name}] myProject]# vagrant up
All Plugin Dependencies already installed
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos/7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/7' version '1811.02' is up to date...
==> default: Setting the name of the VM: myVM
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (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:2222
default: SSH username: vagrant
default: SSH auth method: private key
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.
のようになり、default: SSH auth method: private key
のところでタイムアウト
してしまいます。
何度かvagrant destroy
してみても変化なく、myVM.vbox
を編集してcable="true"
を追記してもうまくいきませんでした。 自分のmac上では、VirtualBox, Vagrant共にサーバ上と同じバージョンの組み合わせでうまく動きました。
どうすれば無事sshできるのでしょうか。これが解決しないと先に進めず、大変困っています。
どなたかご教示いただけませんでしょうか。
このディレクトリでは
[root@{server_name} myProject]# ls
LICENSE README.md Vagrantfile docker-compose.yml dockers public_key
[root@{server_name} myProject]# cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# vagrant plugins
if ARGV[0] == 'up'
plugins_dependencies = %w( vagrant-vbguest vagrant-docker-compose )
plugin_status = false
plugins_dependencies.each do |plugin_name|
unless Vagrant.has_plugin? plugin_name
puts "#{plugin_name} is required."
system("vagrant plugin install #{plugin_name}")
plugin_status = true
end
end
#Restart Vagrant if any new plugin installed
if plugin_status === true
exec "vagrant #{ARGV.join' '}"
else
puts "All Plugin Dependencies already installed"
end
end
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end
config.vm.boot_timeout = 600
config.ssh.insert_key = false
config.vm.provider "virtualbox" do |v|
v.name = "myVM"
end
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__exclude: [ '.git*', 'node_modules*', '.log' ]
config.vm.provision :docker
config.vm.provision :docker_compose, yml: ["/vagrant/docker-compose.yml"], rebuild: true, project_name: "manjiii_nnm_project", run: "always"
end
[root@{server_name} myProject]#vagrant -v
Vagrant 2.2.3
[root@{server_name} myProject]#
のような環境です。VirtualBoxは5.2が入っています。