ありがちな質問で申し訳ありません。
VagrantでSSH接続をしようとした際、下記のようなエラーが発生してしまいます。
icicle@DESKTOP-JOPM1R8 MINGW64 ~/vagrant $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... There are errors in the configuration of this machine. Please fix the following errors and try again: vm: * The following settings shouldn't exist: boot_mode icicle@DESKTOP-JOPM1R8 MINGW64 ~/vagrant $ vagrant status Current machine states: default running (virtualbox) The VM is running. To stop this VM, you can run `vagrant halt` to shut it down forcefully, or you can run `vagrant suspend` to simply suspend the virtual machine. In either case, to restart it again, simply run `vagrant up`. icicle@DESKTOP-JOPM1R8 MINGW64 ~/vagrant $ vagrant reload ==> default: Attempting graceful shutdown of VM... Connection to 127.0.0.1 closed by remote host. ==> default: Checking if box 'ubuntu/xenial64' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 3000 (guest) => 3000 (host) (adapter 1) 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: ubuntu default: SSH auth method: password default: Warning: Connection reset. Retrying... default: Warning: Connection aborted. Retrying... default: Warning: Remote connection disconnect. Retrying... default: Warning: Connection aborted. Retrying... default: Warning: Remote connection disconnect. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 5.0.40 default: VirtualBox Version: 5.2 ==> default: Mounting shared folders... default: /vagrant => C:/Users/icicle/vagrant default: /home/ubuntu/workspace => C:/Users/icicle/workspace ==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision` ==> default: flag to force provisioning. Provisioners marked to run always will still run.
どの部分の設定がおかしいのか、ご教示いただけると非常に助かります
(エラー内容も、いまいち分かっていない状態です…)。
実行環境とVagrantfile
の中身は、以下の通りです。
OS: Windows10
Vagrant: version 2.0.1
仮想マシン: VirtualBox 5.2.0
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "ubuntu/xenial64" config.vm.boot_mode = :gui config.vm.network :"forwarded_port", guest: 3000, host: 3000 config.vm.synced_folder "~/workspace", "/home/ubuntu/workspace", :create => true, mount_options: ['dmode=777','fmode=755'] config.vm.provision "shell", privileged: false, inline: <<-SHELL config.vm.box_check_update = false config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--cableconnected1", "on"] end #ape-getを更新 sudo apt-get -y upgrade sudo apt-get -y update #周辺ライブラリをインストール sudo apt-get install git curl g++ make vim nodejs libreadline-dev libssl-dev zlib1g-dev imagemagick libmagickcore-dev libmagickwand-dev -y git clone git://github.com/rbenv/rbenv.git /home/ubuntu/.rbenv #rbenvの初期化 echo 'export PATH="/home/ubuntu/.rbenv/bin:$PATH"' >> /home/ubuntu/.profile echo 'eval "$(rbenv init -)"' >> /home/ubuntu/.profile . /home/ubuntu/.profile #ruby-buildをインストール mkdir -p /home/ubuntu/.rbenv/plugins git clone git://github.com/rbenv/ruby-build.git /home/ubuntu/.rbenv/plugins/ruby-build #rubyをインストール rbenv install 2.3.0 rbenv global 2.3.0 rbenv rehash sudo apt-get install ruby-railties -y #bundleをインストール gem install bundler --no-document #postgresqlをインストール sudo apt-get install postgresql postgresql-contrib python-psycopg2 libpq-dev -y SHELL end
解決方法が分かる方がおられましたら、何卒よろしくお願いいたします。
###追記
早速のご回答本当にありがとうございます。
いろいろと情報が抜けてましたので追記します。。申し訳ありません。。
SSH接続を行っているところが記述されていませんが、vagrant up時のエラーについて知りたいという質問でしょうか?
仰る通りです。
その肝心のSSHの実行結果を記述していませんでした。。
現在、下記のようなメッセージが表示されている状態です。
icicle@DESKTOP-JOPM1R8 MINGW64 ~/vagrant $ vagrant ssh VM must be running to open SSH connection. Run `vagrant up` to start the virtual machine.
また、subchanさんの回答を参考に、Vagrantfileを修正することで、
vagrant up
コマンドから、仮想マシンがGUIで立ち上がるようになりました!
icicle@DESKTOP-JOPM1R8 MINGW64 ~/vagrant $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'ubuntu/xenial64' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 3000 (guest) => 3000 (host) (adapter 1) 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: ubuntu default: SSH auth method: password default: Warning: Connection aborted. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 5.0.40 default: VirtualBox Version: 5.2 ==> default: Mounting shared folders... default: /vagrant => C:/Users/icicle/vagrant default: /home/ubuntu/workspace => C:/Users/icicle/workspace ==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision` ==> default: flag to force provisioning. Provisioners marked to run always will still run.
ただ、仮想マシン上でも、以下のようなエラーが出ている状態です。
また、参照URLも拝見させていただきましたが、
どうやら、userとpasswordがデフォルトのVagrantになっていない状態?のようです。
曖昧な説明で大変申し訳ありませんが、エラーの解決方法が分かる方は、知恵をお貸しください。。
回答2件
あなたの回答
tips
プレビュー