본문 바로가기

원도우

[원도우] vagrant 설치 및 ubnutu 서버 배포

728x90

vagrant 설치 및 ubnutu 서버 배포

원도우 패키지 관리자 설치(CHOCOLATEY)

요구 사항

- Windows 7+ / Windows Server 2003+
- PowerShell v2+ (minimum is v3 for install from this website due to TLS 1.2 requirement)
- .NET Framework 4+

 

Windows PowerShell(오른쪽 마우스 클릭) > 관리자 권한으로 실행

 

chocolatey 설치

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

chocolatey 버전 확인(choco 버전)

choco --version
> choco --version
1.1.0

chocolatey 업그레이드

choco upgrade chocolatey
> choco upgrade chocolatey
Chocolatey v1.1.0
Upgrading the following packages:
chocolatey
By upgrading, you accept licenses for the packages.
chocolatey v1.1.0 is the latest version available based on your source(s).

Chocolatey upgraded 0/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

virtualbox 설치

virtualbox install

choco install virtualbox

vagrant 설치 및 ubuntu 서버 배포

vagrant install

choco install vagrant
> vagrant --version
Vagrant 2.2.19

vagrant boxes search

box 이미지 다운로드

vagrant box add ubuntu/focal64

vagrant init(Vagrantfile 생성)

vagrant init ubuntu/focal64

vagrant up(provisioning)

vagrant up

vagrant status

> vagrant status
Current machine states:

default                   running (virtualbox)

vagrant ssh(ubuntu 가상머신에 ssh로 접속)

vagrant ssh default
> vagrant ssh default
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-124-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Aug 22 11:48:51 UTC 2022

  System load:  0.08              Processes:               120
  Usage of /:   3.5% of 38.70GB   Users logged in:         0
  Memory usage: 20%               IPv4 address for enp0s3: 10.0.2.15
  Swap usage:   0%


1 update can be applied immediately.
To see these additional updates run: apt list --upgradable

New release '22.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


vagrant@ubuntu-focal:~$

vagrant halt(ubuntu 가상머신 종료)

vagrant halt default
> vagrant halt default
==> default: Attempting graceful shutdown of VM...

 vagrant destroy(ubuntu 가상머신 삭제)

 vagrant destroy default
> vagrant destroy default
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Destroying VM and associated drives...

 

참고URL

- chocolatey : https://chocolatey.org/install#individual

- vagrant : https://community.chocolatey.org/packages/vagrant

- virtualbox : https://community.chocolatey.org/packages/virtualbox

- vagrant boxes search : https://app.vagrantup.com/boxes/search

 

728x90