したいこと
・仮想環境の構築イメージをなんとなく掴んでおきたい。
・今後のために、手軽にローカル開発環境を構築できるようになりたい。
・(もし、vagrantの仕様?バグ?で、毎度SSHの鍵登録・修正等が必要なら、
VirtualBox+Vagrant で作るのを諦めて、Docker等を使う予定です。
が、悔しいので、ある程度、原因を突き止めておきたい。)
実行環境
ともに最新バージョンのインストーラーを使いました。
Windows7 Ultimate 64bit
VirtualBox-6.0.8-130520-Win
vagrant_2.2.4_x86_64
VM起動手順と、タイムアウトになる様子
cd C:\Users\<username> mkdir vagrant cd vagrant mkdir ubuntu16 cd ubuntu16 vagrant init bento/ubuntu-16.04 # Vagrantfileをテキストエディタで編集 config.vm.network "private_network", ip: "192.168.2.1" # 追記 vagrant up PS C:\Users\<username>\vagrant\ubuntu16> vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'bento/ubuntu-16.04' could not be found. Attempting default: Box Provider: virtualbox default: Box Version: >= 0 ==> default: Loading metadata for box 'bento/ubuntu-16.04' default: URL: https://vagrantcloud.com/bento/ubuntu-16.04 ==> default: Adding box 'bento/ubuntu-16.04' (v201812.27.0) for prov default: Downloading: https://vagrantcloud.com/bento/boxes/ubunt x default: Download redirected to host: vagrantcloud-files-product default: Progress: 100% (Rate: 1498k/s, Estimated time remaining ==> default: Successfully added box 'bento/ubuntu-16.04' (v201812.27 ==> default: You assigned a static IP ending in ".1" to this machine ==> default: This is very often used by the router and can cause the ==> default: network to not work properly. If the network doesn't wo ==> default: properly, try changing this IP. ==> default: Importing base box 'bento/ubuntu-16.04'... ==> default: Matching MAC address for NAT networking... ==> default: You assigned a static IP ending in ".1" to this machine ==> default: This is very often used by the router and can cause the ==> default: network to not work properly. If the network doesn't wo ==> default: properly, try changing this IP. ==> default: Checking if box 'bento/ubuntu-16.04' version '201812.27 ==> default: Setting the name of the VM: ubuntu16_default_1558153258 ==> 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: Booting VM... ==> default: Waiting for machine to boot. This may take a few minute 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.
VM自体は起動していて、VirtualBoxでGUI経由で見ると、
ログインプロンプトが立ち上がっていて、ログインもできました。
ここを参考に4つほど試しました。
1. 切り分けのため、GUIで起動
・VMが起動しているか
・BIOS設定で仮想化機能が有効になってないメッセージが出ないか
を確認
config.vm.provider "virtualbox" do |vb| vb.gui = true end
2. ケーブル接続が外れているのを修正
・VirtualBoxの設定でケーブル接続されていなかったとき?
そもそもVirtualBoxで見たとき、「ケーブル接続」にチェック入っていました。
config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--cableconnected1", "on"] end
3. VirtualBox, Vagrant バージョンを落とす
VirtualBox DLページ
Vagrant DLページ
・VirtualBox-5.1.38-122592-Win
・vagrant_1.9.6_x86_64
で試すも再発。。
4. boxを消して、他の新しいboxで試す
・bento/centos-6.8
・bento/centos-7.2
・bento/ubuntu-16.04
再発。。。
# 確認 vagrant box list vagrant global-status # 削除 vagrant box remove bento/centos-6.8 vagrant destroy <対象のVMid> cd .. Remove-Item -Recurse -Force .\centos-6.8
他の確認項目や試すべきことなどあれば教えてください。
よろしくお願いします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/06/01 15:10