##環境
ホスト
- Windows10 Home 64bit
- メモリ 8GB
- CPU i5-7400 3.0GHz
- OracleVisualBox 5.2
- vagrant 2.0.1
- セキュリティーソフト:Windows Defender
ゲスト
- CentOS6.4 x86_64
##導入経緯
もともと開発環境としてノートPCをメインで使用していたのですが、かなり不調で業務に支障をきたしていたため、PCを新調しました。この端末に、仮想環境の構築をするに至りました。
##症状
txt
1C:\vagrant\centos64>vagrant up 2Bringing machine 'default' up with 'virtualbox' provider... 3==> default: Clearing any previously set forwarded ports... 4==> default: Clearing any previously set network interfaces... 5==> default: Preparing network interfaces based on configuration... 6 default: Adapter 1: nat 7==> default: Forwarding ports... 8 default: 22 (guest) => 2222 (host) (adapter 1) 9==> default: Booting VM... 10==> default: Waiting for machine to boot. This may take a few minutes... 11 default: SSH address: 127.0.0.1:2222 12 default: SSH username: vagrant 13 default: SSH auth method: private key 14Timed out while waiting for the machine to boot. This means that 15Vagrant was unable to communicate with the guest machine within 16the configured ("config.vm.boot_timeout" value) time period. 17 18If you look above, you should be able to see the error(s) that 19Vagrant had when attempting to connect to the machine. These errors 20are usually good hints as to what may be wrong. 21 22If you're using a custom box, make sure that networking is properly 23working and you're able to connect to the machine. It is a common 24problem that networking isn't setup properly in these boxes. 25Verify that authentication configurations are also setup properly, 26as well. 27 28If the box appears to be booting properly, you may want to increase 29the timeout ("config.vm.boot_timeout") value.
と、まぁ認証しなくてタイムアウトでエラーになります。
結果は同じだろうと思いつつも、違うVagrantboxを追加しましたが同様の症状となりました。
##試したこと
→ そもSSH接続できないんだから、書き換えられなくない・・・?と途中で気づいて中断
→ ゲストに./sshディレクトリがなかった・・・。homename直下にpublic_keyがあったので、そこを上書きしてみましたが、効果なし
→ 下記をvagrantfileに追記しても効果なし
config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--cableconnected1", "on"] end
→ VMでマシンをクリックするとこのエラーが表示されたため、VMとVagrantを再インストールしたけど効果なし。
- ポート指定しよう!
→ デフォルトで設定されている 22 ⇒ 2222 を適当なポート番号に書き換えたけど効果なし
- Virtualization Intel VT-x/AMD-Vが無効になってる?
→ Enabled 有効でした。
- ホストのファイアーウォールを無効にする
→ 効果なし
##Vagrantfile
Box名が違いますが、このファイルで試行錯誤してました。
txt
1# -*- mode: ruby -*- 2# vi: set ft=ruby : 3 4# All Vagrant configuration is done below. The "2" in Vagrant.configure 5# configures the configuration version (we support older styles for 6# backwards compatibility). Please don't change it unless you know what 7# you're doing. 8Vagrant.configure("2") do |config| 9 # The most common configuration options are documented and commented below. 10 # For a complete reference, please see the online documentation at 11 # https://docs.vagrantup.com. 12 13 # Every Vagrant development environment requires a box. You can search for 14 # boxes at https://vagrantcloud.com/search. 15 config.vm.box = "CentOS60-Re" 16 17 # Disable automatic box update checking. If you disable this, then 18 # boxes will only be checked for updates when the user runs 19 # `vagrant box outdated`. This is not recommended. 20 config.vm.box_check_update = false 21 22 # Create a forwarded port mapping which allows access to a specific port 23 # within the machine from a port on the host machine. In the example below, 24 # accessing "localhost:8080" will access port 80 on the guest machine. 25 # NOTE: This will enable public access to the opened port 26 config.vm.network "forwarded_port", guest: 80, host: 8888 27 config.vm.network "forwarded_port", guest: 22, host: 2223 28 config.vm.network "forwarded_port", guest: 3306, host: 3306 29 30 # Create a forwarded port mapping which allows access to a specific port 31 # within the machine from a port on the host machine and only allow access 32 # via 127.0.0.1 to disable public access 33 # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" 34 35 # Create a private network, which allows host-only access to the machine 36 # using a specific IP. 37 # config.vm.network "private_network", ip: "192.168.33.10" 38 39 # Create a public network, which generally matched to bridged network. 40 # Bridged networks make the machine appear as another physical device on 41 # your network. 42 # config.vm.network "public_network" 43 44 # Share an additional folder to the guest VM. The first argument is 45 # the path on the host to the actual folder. The second argument is 46 # the path on the guest to mount the folder. And the optional third 47 # argument is a set of non-required options. 48 # config.vm.synced_folder "../data", "/vagrant_data" 49 50 # Provider-specific configuration so you can fine-tune various 51 # backing providers for Vagrant. These expose provider-specific options. 52 # Example for VirtualBox: 53 # 54 config.vm.provider "virtualbox" do |vb| 55 # # Display the VirtualBox GUI when booting the machine 56 vb.gui = false 57 # 58 # # Customize the amount of memory on the VM: 59 vb.memory = "1024" 60 vb.customize ["modifyvm", :id, "--cableconnected1", "on"] 61 end 62 # 63 # View the documentation for the provider you are using for more 64 # information on available options. 65 66 # Enable provisioning with a shell script. Additional provisioners such as 67 # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the 68 # documentation for more information about their specific syntax and use. 69 # config.vm.provision "shell", inline: <<-SHELL 70 # apt-get update 71 # apt-get install -y apache2 72 # SHELL 73end 74
まだ、これ試してないのでは?や、そもここが間違ってるよ等ありましたら、ご教授お願いいたします・・・。
現在は、これで手を止めるわけにもいかないので、Xamppで開発をしてます。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/11/08 04:17
2017/11/08 06:53
2017/11/08 07:07