Vagrant 仮想マシン作成

Vagrant でVirtualBox のOS入りVMを容易に作成できる。

mkdir centos
cd centos

vagrant init を実行。vagrant init bento/centos-7.5

vagrant up を実行。vagrant up

C:\centos>vagrant init bento/centos-7.5
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
`` for more information on using Vagrant.

C:\centos>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/centos-7.5' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'bento/centos-7.5'
     default: URL:
==> default: Adding box 'bento/centos-7.5' (v201808.24.0) for provider: virtualbox
    default: Downloading:
    default: Download redirected to host:
==> default: Successfully added box 'bento/centos-7.5' (v201808.24.0) for 'virtualbox'!
==> default: Importing base box 'bento/centos-7.5'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/centos-7.5' is up to date...
==> default: Setting the name of the VM: centos_default_1544939936610_38872
==> default: Vagrant has detected a configuration issue which exposes a
==> default: vulnerability with the installed version of VirtualBox. The
==> default: current guest is configured to use an E1000 NIC type for a
==> default: network adapter which is vulnerable in this version of VirtualBox.
==> default: Ensure the guest is trusted to use this configuration or update
==> default: the NIC type using one of the methods below:
==> default:
==> default:
==> default:
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address:
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection reset. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's 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:/centos

インストールされたのは,CentOS Linux release 7.5.1804 (Core)
メモリ 1GB,ディスクは可変で実サイズ1.28GB,最大64GB
ログインは,vagrant / vagrant。
sudo –s でroot昇格できる。
ssh 接続は,上記のユーザ,パスワードで接続できる。また公開鍵認証でssh接続も可能で,その場合以下の秘密鍵を使用する。


box はこちらで探し,選択後Newボタンを押すと vagrant init の引数が確認できる。

nice!(1)  コメント(0) 

nice! 1

コメント 0



Facebook コメント