'vagrant cloud'에 해당하는 글 1건

vagrant cloud 를 사용하려고 한다.( 기존 http://www.vagrantbox.es 를 사용하고 있었다.)

vagrantbox 에는 그리 많지 않아서 vagrant cloud (https://vagrantcloud.com) 를 사용하려 한다.


vagrant cloud 를 사용하려면 1.5 버전 이상에서 사용가능한 듯 하다.

우분투 14.04 기본패키지는 1.4.3 버전이다.( 다음처럼 에러가 난다.)

$ 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 box 'hfm4/centos7' could not be found.



# 최신 버전으로 업그레이드 한다.

우분투 패키지를 다운받아서 설치했다.( http://www.vagrantup.com/downloads.html )

deb 파일이라 다운로드 하면 자동으로 우분투소프트웨어센터로 설치된다.

업그레이드 하면 된다.

버전을 확인해본다.

$ vagrant -v
Vagrant 1.6.3


vagrant cloud 에서 이미지를 찾아서 설치/가동 해본다.

가입은 쉽다. 가입후 에 Discover 메뉴에서 찾고자 하는 box 를 검색해본다.(가입안해도 될려나?)
그냥 box init 용도로만 사용하려면 가입은 안해도 되나보다.


원하는 box 를 찾았으면 vagrant init  명령을 내린다.

vagrant init hfm4/centos7

위 명령을 하면 Vagrantfile 이 생긴다.
이 파일을 기준으로 vagrant up 시 이미지등을 생성하고, 자동실행하게 된다.


# vagrant up

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hfm4/centos7' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'hfm4/centos7'
    default: URL: https://vagrantcloud.com/hfm4/centos7
==> default: Adding box 'hfm4/centos7' (v1.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/hfm4/centos7/version/1/provider/virtualbox.box
    default: Progress: 10% (Rate: 1239k/s, Estimated time remaining: 0:09:02)

위와 같이 진행이 된다.


위와 같이 진행하다가 다음과 같은 에러가 나온다.

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant


다음처럼 guest plugin 을 설치한다.

$ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.10.0)'!

정상적으로 되면

vagrant ssh

로 접속해본다. vagrant 속에서 다음 명령을 해준다.

sudo ln -s /opt/VBoxGuestAdditions-4.3.12/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

4.3.12 => 버전은 차이가 있을 것이다.

뭔가 계속 에러가 난다. box 패키징이 잘 못된것인가?


다른 박스로 해봤다.( https://vagrantcloud.com/chef/centos-6.5 )

다른 박스로 해보니 정상적이다.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'chef/centos-6.5' 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: 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: Machine booted and ready!
GuestAdditions 4.3.12 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /user/develop/vagrant/chef-centos-6.5
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.


vagrant cloud 쪽의 box 들이 모두 검증된 것은 아닌것 같다.
각자 취사 선택해서 사용해야 겠다.




반응형

WRITTEN BY
1day1
하루하루 즐거운일 하나씩, 행복한일 하나씩 만들어 가요.

,