CentOSのインストール

VirtualBox+Vagrant環境上にCentOS7.1をインストールします。


CentOS7.1のインストール

http://www.vagrantbox.es/ にアクセスしてBoxファイルのURLをコピーする。

  • コマンドプロンプトから以下のコマンドを入力して仮想環境用のディレクトリを作る。
  1. C:\>mkdir Vagrant\CentOS7.1
  2. C:\>cd Vagrant\CentOS7.1
  3.  

  • Boxファイルをダウンロードする。
  1. C:\Vagrant\CentOS7.1>vagrant box add CentOS7.1 https://github.com/holms/vagrant-centos7-box/releases/download/7.1.1503.001/CentOS-7.1.1503-x86_64-netboot.box
  2. ==> box: Adding box 'CentOS7.1' (v0) for provider:
  3. box: Downloading: https://github.com/holms/vagrant-centos7-box/releases/download/7.1.1503.001/CentOS-7.1.1503-x86_64-netboot.box
  4. ==> box: Box download is resuming from prior download progress
  5. box: Progress: 100% (Rate: 3126k/s, Estimated time remaining: --:--:--)
  6. ==> box: Successfully added box 'CentOS7.1' (v0) for 'virtualbox'!
  7.  

  • Boxが追加されていることを確認する。
  1. C:\Vagrant\CentOS7.1>vagrant box list
  2. CentOS7.1 (virtualbox, 0)
  3.  

  • 仮想環境の初期化をする。
  1. C:\Vagrant\CentOS7.1>vagrant init CentOS7.1
  2. A `Vagrantfile` has been placed in this directory. You are now
  3. ready to `vagrant up` your first virtual environment! Please read
  4. the comments in the Vagrantfile as well as documentation on
  5. `vagrantup.com` for more information on using Vagrant.
  6.  

  • 仮想環境を起動する。
  1. C:\Vagrant\CentOS7.1>vagrant up
  2. Bringing machine 'default' up with 'virtualbox' provider...
  3. ==> default: Importing base box 'CentOS7.1'...
  4. ==> default: Matching MAC address for NAT networking...
  5. ==> default: Setting the name of the VM: CentOS71_default_1431791415011_58624
  6. ==> default: Clearing any previously set forwarded ports...
  7. ==> default: Clearing any previously set network interfaces...
  8. ==> default: Preparing network interfaces based on configuration...
  9. default: Adapter 1: nat
  10. ==> default: Forwarding ports...
  11. default: 22 => 2222 (adapter 1)
  12. ==> default: Booting VM...
  13. ==> default: Waiting for machine to boot. This may take a few minutes...
  14. default: SSH address: 127.0.0.1:2222
  15. default: SSH username: vagrant
  16. default: SSH auth method: private key
  17. default: Warning: Connection timeout. Retrying...
  18. default: Warning: Connection timeout. Retrying...
  19. default: Warning: Connection timeout. Retrying...
  20. default:
  21. default: Vagrant insecure key detected. Vagrant will automatically replace
  22. default: this with a newly generated keypair for better security.
  23. default:
  24. default: Inserting generated public key within guest...
  25. default: Removing insecure key from the guest if its present...
  26. default: Key inserted! Disconnecting and reconnecting using new SSH key...
  27. ==> default: Machine booted and ready!
  28. ==> default: Checking for guest additions in VM...
  29. ==> default: Mounting shared folders...
  30. default: /vagrant => C:/Vagrant/CentOS7.1
  31.  

SSHクライアントからの接続確認

PuTTYから仮想環境に接続する。PuTTYからの接続情報は 03.PuTTYのインストール で設定したとおり。

  • 接続情報は以下のとおり。
項目
ホスト名(IPアドレス) 127.0.0.1
ポート番号 2222
ユーザー vagrant
パスワード vagrant

  • PuTTYを起動し、事前に設定した VirtualBox(Vagrant) をダブルクリックすると接続を開始する。

  • 初回接続時など、サーバーの鍵がPuTTYにキャッシュされていない旨の警告がでるので、[はい(Y)]をクリックしてPuTTYにキャッシュする。

  • パスワードを入力してログインする。
  1. Using username "vagrant".
  2. vagrant@127.0.0.1's password:
  3. Last login: Sat May 16 15:53:52 2015 from 10.0.2.2
  4. Welcome to your Vagrant-built virtual machine.
  5. [vagrant@localhost ~]$


次のページ > 05.CentOSのアップデート

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2015年05月17日 15:14