vagrant 를 사용하다 보면 GuestAdditions 의 버전이 다른 경우가 있다.

vagrant up 시에 다음과 같은 메시지가 뜬다.

Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   4.3.10
VBoxService inside the vm claims: 4.3.14
Going on, assuming VBoxService is correct...
GuestAdditions 4.3.14 running --- OK.

host 와 가상머신내의 버전이 다르다.


~/VirtualBox VMs/chef-solo_default_1406182370453_27414 => 다음 위치에서

 vi OOO.vbox 를 열어본다. (진한부분은 box 별로 다를 것이다.)

          <GuestProperty name="/VirtualBox/GuestAdd/Version" value="4.3.14" timestamp="1397926654949278000" flags=""/>
          <GuestProperty name="/VirtualBox/GuestAdd/VersionExt" value="4.3.14" timestamp="1397926654951054000" flags=""/>

위와 같은 항목이 나오는데, 버전부분을 새버전으로 바꿔준다.

vagrant reload 를 해서 다시 실행시켜 본다.


# 몇가지 guest 체크 명령

# vagrant vbguest --status
GuestAdditions 4.3.14 running --- OK.


- 현재 버전 보기.

# VBoxManage guestproperty get aadfe9f8-a351-42b0-832a-af8d7dcbe6be /VirtualBox/GuestAdd/Version
Value: 4.3.14

진한 부분은 /VirtualBox VMs/ 의 해당가상머신의 UUID (OOO.vbox 파일 위쪽에 있음)


- 현재 머신 설정으로 저장하기

# VBoxManage guestproperty set aadfe9f8-a351-42b0-832a-af8d7dcbe6be /VirtualBox/GuestAdd/Version

# VBoxManage guestproperty set aadfe9f8-a351-42b0-832a-af8d7dcbe6be /VirtualBox/GuestAdd/Revisioin

get 을 set 으로 바꿔주면  OOO.vbox 의 내용을 현재 설정으로 바꿔준다.



참고1) 아래 위치는  기본 box 이미지에서 수정할때 사용한다.

~/.vagrant.d/boxes/chef-VAGRANTSLASH-ubuntu-14.04-i386/1.0.0/virtualbox => 다음과 같은 위치에

 vi box.ovf 를 열어보면 위 와 비슷하다. 버전 부분 변경.


참고2) 버전이 다르면 vagrant 가 자동으로 업데이트 해준다. => 크게 의미 없는 듯 함(사용하는게 좋을 듯)

이때 버전업을 하기 싫다면 다음 옵션을 Vagrantfile 에 추가한다.

  config.vbguest.auto_update = false




반응형

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

,

vagrant up 시에 다음과 같은 vboxsf 관련 에러를 보게되면,

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 reload 를 한번 해준다.



반응형

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

,

vagrant 의 기본 메모리가 부족해서 늘려보고자 한다.

설정은 다음과 같다. Vagrantfile 에 추가해준다.

  config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--memory", "1024"]
  end

적당한 메모리 값을 넣어준다.

위와 같이 하면 정상정으로 진행될 것이다.



=> 아래 에러는 아마도 cpu 를 2 로 늘렸을때 났던 에러인 듯 하다. 빼고 해도 동일 에러가 나는 이유는 무엇일까?
설정값이 남아있었던 것일까? vagrant destroy 후에 다시 해보니 정상이다.

관련 설정을 한후 vagrant up 을 해보면 다음과 같은 에러가 난다.

# vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'chef/ubuntu-14.04-i386' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2201.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2201 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.


/VirtualBox VMs/chef-solo_default_1406169045971_64274/Logs 에서 VBox.log 를 열어서 보면

00:00:00.070719
00:00:00.070719 ********************* End of CFGM dump **********************
00:00:00.070730 VM: fHMEnabled=true  (configured) fRecompileUser=false fRecompileSupervisor=false
00:00:00.070732 VM: fRawRing1Enabled=false CSAM=true  PATM=true
00:00:00.070842 VMSetError: /home/vbox/vbox-4.3.14/src/VBox/VMM/VMMR3/HM.cpp(532) int HMR3Init(PVM); rc=VERR_VMX_MSR_VMXON_DISABLED
00:00:00.070854 VMSetError: VT-x is disabled in the BIOS.
00:00:00.196099 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={8ab7c520-2442-4b66-8d74-4ff1e195d2b6} aComponent={Console} aText={VT-x is disabled in the BIOS. (VERR_VMX_MSR_VMXON_DISABLED)}, preserve=false
00:00:00.248130 Power up failed (vrc=VERR_VMX_MSR_VMXON_DISABLED, rc=NS_ERROR_FAILURE (0X80004005))

결론은 해당 호스트머신이 CPU 가상화 VT-x 를 지원하지 않는 것이다.

테스트한 머신이 i3 라 가상화 지원을 하지 않아서 그런듯 하다. 메모리만 늘리려 하는데도 안되는 듯 하다.

i5 이상급으로 업그레이드 하거나 다른 머신에서 테스트해야 겠다.


반응형

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

,

관리하는 서버 대수가 많아지다 보니 모니터링이 쉽지 않다.

서버 호스팅 업체를 통한 기본관리도 가능하지만, 부족한 부분이 있고, 여러 호스팅 업체를 사용하다보면 그것도 불편하다


icinga 로 모니터링 서버를 구축해본다.

웹 모니터링 화면을 접속하면 이런식으로 나온다.

관련글 : https://www.digitalocean.com/community/tutorials/how-to-use-icinga-to-monitor-your-servers-and-services-on-ubuntu-14-04

설정은 위 링크를 참조하기로 하고 특이사항 들을 추가한다.


관련 패키지를 설치하면 몇가지 설정단계를 거친다.

1) 처음에는 mysql root 계정 암호를 넣을 것이다. 적당한 암호를 넣는다.


2) 메일 설정 부분

메일 설정을 해준다. 메일로 알람을 받을 때 쓰는 듯 하다.


3) 관리자 화면에 쓸 icingaadmin 계정 설정

관리용 웹화면의 암호를 입력한다.

다음처럼 추가 패키지들이 설치된다.


다음은 그냥 No 로 넘어가고,


4) icinga-idoutils 관련 설정

icinga-idoutils 의 설정 : 모니터링 데이터에 쓰이는 듯 하다.

여기에서는 mysql 을 쓸 것이다.


초기데이터 설정을 위해 관리자 암호를 물어본다(처음에 설정한 값)


icinga-idoutils 가 쓸 mysql 계정암호를 넣는다.

여기까지 기본설정 완료. 추가로 패키지들이 마저 설치된다.



5) 모니터링 관리자 화면 접속.

난 설정을 포트포워딩 해서 http://localhost:8800/icinga/ 으로 접속했다.

아이디는 icingaadmin 이고, 암호는 설정시 입력한 값을 넣는다.




참고로 난 vagrant 로 가상머신을 만들고, icinga 를 세팅했다.
vagrant 로 세팅후 box 의 80포트를 포트포워딩 하고, 부팅시 자동실행하도록 설정했다.

1) 포트포워딩(Vagrantfile)

config.vm.network :forwarded_port, host: 8080, guest: 80

2) 부팅시 자동실행(vagrant box) : http://blog.1day1.org/543




반응형

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

,

vagrant up 을 하게 되면 virtualbox 가 시작되면서 가상머신이 부팅하게 된다.

기본 설정은 private network 로 되는 듯 하다.


브리지 모드로 하려면

Vagrantfile 에 다음 항목을 넣어준다.

방법1)
config.vm.network "public_network"

방법2)
config.vm.network "public_network", bridge: "eth0"

설정값이 vagrant 버전에 따라 차이가 있는 듯 하다.

config.vm.network :public_network, bridge: "eth0"

위와 같이 옵션을 넣어줘도 되는 듯 하다. ( 구분은 " => 로 하는게 더 쉬워보인다)


비슷하게 포트 포워딩을 하려면 이런식.

config.vm.network :forwarded_port, host: 8080, guest: 80



# vagrant -v
Vagrant 1.6.3

그냥 config.vm.network "public_network" 부분까지만 넣어주면, 네트웍인터페이스(랜카드) 가 여러개이면 선택하는 화면이 나온다.

# vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Available bridged network interfaces:
1) eth0
2) wlan0
3) docker0
    default: What interface should the network bridge to?

=> 매번 선택 해줘야 한다. bridge 옵션으로 network interface 를 정해주면 선택하지 않고 바로 가동할 수 있다.




하위 버전은 아래 명령중 하나로 작동할 듯 함.(아래 설정중 알아서 설정)

config.vm.network :bridged, :bridge => "eth0"

config.vm.network :public_network, :public_network => "wlan0"




반응형

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

,