CentOSのインストール
VirtualBox+Vagrant環境上にCentOS7.1をインストールします。
CentOS7.1のインストール
- コマンドプロンプトから以下のコマンドを入力して仮想環境用のディレクトリを作る。
C
:\
>mkdir Vagrant\CentOS7
.1
C:\>cd Vagrant\CentOS7.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
==> box: Adding box 'CentOS7.1' (v0) for provider:
box: Downloading: https://github.com/holms/vagrant-centos7-box/releases/download/7.1.1503.001/CentOS-7.1.1503-x86_64-netboot.box
==> box: Box download is resuming from prior download progress
box
: Progress
: 100% (Rate
: 3126k
/s
, Estimated
time remaining
: --:--:--)==> box: Successfully added box 'CentOS7.1' (v0) for 'virtualbox'!
C
:\Vagrant\CentOS7
.1
>vagrant box
listCentOS7.1 (virtualbox, 0)
C:\Vagrant\CentOS7.1>vagrant init CentOS7.1
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first
virtual environment
! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
C:\Vagrant\CentOS7.1>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'CentOS7.1'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: CentOS71_default_1431791415011_58624
==> 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: 22 => 2222 (adapter 1)
==> 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 default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default:
default: Vagrant insecure
key detected
. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated
public key within guest
... default: Removing insecure
key from the guest
if its present
... default: Key inserted
! Disconnecting and reconnecting using
new SSH
key... ==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => C:/Vagrant/CentOS7.1
SSHクライアントからの接続確認
項目 |
値 |
ホスト名(IPアドレス) |
127.0.0.1 |
ポート番号 |
2222 |
ユーザー |
vagrant |
パスワード |
vagrant |
- PuTTYを起動し、事前に設定した VirtualBox(Vagrant) をダブルクリックすると接続を開始する。
- 初回接続時など、サーバーの鍵がPuTTYにキャッシュされていない旨の警告がでるので、[はい(Y)]をクリックしてPuTTYにキャッシュする。
Using username "vagrant".
vagrant@127.0.0.1's password:
Last login: Sat May 16 15:53:52 2015 from 10.0.2.2
Welcome to your Vagrant-built virtual machine.
[vagrant@localhost ~]$
最終更新:2015年05月17日 15:14