가상 머신 구성하기

2021. 9. 1. 14:53공부/블록체인

반응형

1. VirtualBox 설치

VirtualBox는 가상화(Virtualization: 컴퓨터 리소스의 추상화를 일컫는 광범위한 용어)를 위한 소프트웨어로 다양한 운영체제에서 사용할 수 있다.

VirtualBox의 경우 가상화의 여러 종류 중 하드웨어 가상화로 분류되는데, Host OS위에 Guest OS를 만들어 사용함으로써 독립적인 환경을 구성할 수 있다는 장점이 있다.

https://www.virtualbox.org 

 

Oracle VM VirtualBox

Welcome to VirtualBox.org! News Flash Important May 17th, 2021We're hiring! Looking for a new challenge? We're hiring a VirtualBox senior developer in 3D area (Europe/Russia/India). New July 28th, 2021VirtualBox 6.1.26 released! Oracle today released a 6.1

www.virtualbox.org

  • os 버전에 맞게 다운로드
  • Custom setup 기본값 그대로 설치
  • 설치 완료 단계에서 Start Oracle VM VirtualBox after installation 체크 후 VirtualBox 실행 화면 및 버전 확인

2. Vagrant 설치

Vagrant는 가상 머신 프로비저닝(Provisioning) 도구이다. 간단한 스크립트를 작성하여 VirtualBox 등 다양한 가상 머신을 쉽게 생성, 수정, 삭제, 관리할 수 있다. 가상 머신 소프트웨어를 사용해 다양한 스펙의 가상 머신을 다수 운용하고자 할 때 많은 작업이 필요하게 되는데, 이런 경우 Vagrant를 사용해 설정 파일 하나로 모든 가상 머신을 통합 관리할 수 있어 편리하다.

https://www.vagrantup.com 

 

Vagrant by HashiCorp

Vagrant enables users to create and configure lightweight, reproducible, and portable development environments.

www.vagrantup.com

  • os 버전에 맞게 다운로드
  • 설치 완료 후 요구에 따라 필요시 os 재부팅
#설치 여부 및 버전 확인
> vagrant version

#호스트와 가상 머신 간 파일 전송 플러그인 설치
> vagrant plugin install vagrant-scp

#원하는 작업 디렉토리에서 Vagrant 초기화
#설정 파일 생성됨.
> vagrant init

#생성된 Vagrantfile 내용 수정 (필요에 따라 임의로 수정해 사용 가능)

# -- mode: ruby --
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.

VAGRANT_API_VERSION = "2"

vms = {
  'eth0' => '10',
  'eth1' => '11'
}

Vagrant.configure(VAGRANT_API_VERSION) do |config|
   config.vm.box = "ubuntu/bionic64"
   vms.each do |key, value|
      config.vm.define "#{key}" do |node|
         node.vm.network "private_network", ip: "192.168.50.#{value}"
         if "#{key}" == "eth0"
            node.vm.network "forwarded_port", guest: 8545, host: 8545
         end
         node.vm.hostname = "#{key}"
         node.vm.provider "virtualbox" do |nodev|
         nodev.memory = 2048
         end
      end
   end
end

#가상 머신 구동 명령어 실행
> vagrant up

# 가상 머신 구동 상태 확인
> vagrant status

# 가상 머신 접속
> vagrant ssh eth0

 

반응형

'공부 > 블록체인' 카테고리의 다른 글

프라이빗 이더리움 네트워크 구축 및 마이닝  (0) 2021.09.01
이더리움 노드 구성  (0) 2021.09.01
이더리움이란  (0) 2021.08.25
블록체인이란  (0) 2021.08.25
스마트 컨트랙트란  (0) 2021.08.25