Vagrant

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기

Vagrant는 간소화된 가상머신(VM, Virtual Machine) 관리 서비스 이다.

  • 라이선스 : Mit License
  • 플랫폼 : Ruby

Vagrant 설치

CentOS6에 Vagrant 설치

#--- https://releases.hashicorp.com/vagrant/
#--- yum -y install vagrant
rpm -ivh https://releases.hashicorp.com/vagrant/2.1.4/vagrant_2.1.4_x86_64.rpm

Vagrant 개요

Vagrant 용어

  • Box : 기본 설정을 가진 VM Template Image


VM 생성

vagrant box add <name> <image>

-   ~/.vagrant.d/box/

mkdir project

cd project

vagrant init <name>

vagrant up

vagrant ssh

Box 생성

Virtualbox에서 CentOS 7.0을 설치 합니다.

vagrant 사용자를 생성 합니다.

    groupadd wheel
    useradd  -d /home/vagrant -m -g wheel vagrant 

visudo 명령을 사용하여 sudo 권한을 설정 합니다.

    ### vagrant ALL=(ALL) NOPASSWD:ALL
    %wheel  ALL=(ALL)  ALL
    %wheel  ALL=(ALL)  NOPASSWD: ALL

vagrant 사용자의 ssh key 설정을 합니다.

 cd /home/vagrant  
 mkdir -p .ssh
  ### wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys
  curl -kL https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub > .ssh/authorized_keys
  chmod 0700 /home/vagrant/.ssh
  chmod 0600 /home/vagrant/.ssh/authorized_keys
  chown -R vagrant:wheel /home/vagrant/.ssh
  exit

      1. yum install openssh-server
        yum install rsync openssh-clients
        yum clean all

shotdown -h now

vagrant package --output centos70_64.box --base "CentOS 7.0"


참고 문헌

참고문헌