ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [우분투 설치] ubuntu 18.04 LTS 설치하기(vagrant, virtualbox)
    개발/docker 2019. 7. 5. 23:25
    반응형

    vagrant ubuntu 설정할 폴더를 하나 만든다음. 

    아래 명령어를 실행하면 Vagrantfile 이 생성된다.

     

    > vagrant init ubuntu/bionic64
    ==> vagrant: A new version of Vagrant is available: 2.2.5 (installed version: 2.2.4)!
    ==> vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html

    A `Vagrantfile` has been placed in this directory. You are now
    ready to `vagrant up` your first virtual environment! Please read
    the comments in the Vagrantfile as well as documentation on
    `vagrantup.com` for more information on using Vagrant.

     

     

     

     

    해당 폴더에 Vagrantfile 파일이 만들어진걸 확인하고, 아래 명령어를 바로 수행한다.

     

    > vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Box 'ubuntu/bionic64' could not be found. Attempting to find and install...
        default: Box Provider: virtualbox
        default: Box Version: >= 0
    ==> default: Loading metadata for box 'ubuntu/bionic64'
        default: URL: https://vagrantcloud.com/ubuntu/bionic64
    ==> default: Adding box 'ubuntu/bionic64' (v20190704.0.0) for provider: virtualbox
        default: Downloading: https://vagrantcloud.com/ubuntu/boxes/bionic64/versions/20190704.0.0/providers/virtualbox.box
        default: Download redirected to host: cloud-images.ubuntu.com
    ==> default: Successfully added box 'ubuntu/bionic64' (v20190704.0.0) for 'virtualbox'!
    ==> default: Importing base box 'ubuntu/bionic64'...
    ==> default: Matching MAC address for NAT networking...
    ==> default: Checking if box 'ubuntu/bionic64' version '20190704.0.0' is up to date...
    ==> default: Setting the name of the VM: ubuntu_default_1562335455498_2245
    ==> default: Clearing any previously set network interfaces...
    ==> default: Preparing network interfaces based on configuration...
        default: Adapter 1: nat
    ==> default: Forwarding ports...
        default: 22 (guest) => 2222 (host) (adapter 1)
    ==> default: Running 'pre-boot' VM customizations...
    ==> 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 reset. Retrying...
        default: Warning: Remote connection disconnect. Retrying...
        default:
        default: Vagrant insecure key detected. Vagrant will automatically replace
        default: this with a newly generated keypair for better security.
        default:
        default: Inserting generated public key within guest...
        default: Removing insecure key from the guest if it's present...
        default: Key inserted! Disconnecting and reconnecting using new SSH key...
    ==> default: Machine booted and ready!
    ==> default: Checking for guest additions in VM...
        default: The guest additions on this VM do not match the installed version of
        default: VirtualBox! In most cases this is fine, but in rare cases it can
        default: prevent things such as shared folders from working properly. If you see
        default: shared folder errors, please make sure the guest additions within the
        default: virtual machine match the version of VirtualBox you have installed on
        default: your host and reload your VM.
        default:
        default: Guest Additions Version: 5.2.18
        default: VirtualBox Version: 6.0
    ==> default: Configuring proxy for Apt...
    ==> default: Configuring proxy environment variables...
    ==> default: Configuring proxy for Git...
    ==> default: Mounting shared folders...
        default: /vagrant => ....(중략)...../ubuntu

     

     

     

    5분도 안되서 끝났다. vagrant ssh 로 접속하여 마음껏 ubuntu 공부를.. -_-; 

     

     

    이 아래 부터는 삭제나 초기화 로직이므로, 필요하신분만 따라하시길.

     

    개발하고 설치하고, 각종 연습을 하다가, 다시 초기 인스톨 되었던 시기로 돌아가고 싶으면, 

    과감히 vagrant destroy 명령어를 실행한다. 

     

    그리고 나서 vagrant up 을 실행하면, 

    box 를 지운건 아니라서 최초의 vagrant up 을 했을 때만큼, 시간이 걸리진 않는다.

    깨끗한 초기의 설치버전을 다시 만나게되니 조심..

     

     

     

    설치한 box 를 아예 삭제하고 싶다면, 

    > vagrant box list   로 box 이름을 확인후

     

     

    box 삭제 명령을 실행한다.

     

    > vagrant box remove --all ubuntu/bionic64

     

     

    다시 list 를 조회해보니 목록에서 삭제된걸 확인할 수 있다.

    반응형

    댓글

Designed by Tistory.