macOS Monterey에서 vagrant up 실패

  • TCP/IP를 사용한 책이 Vagrant/Virtualbox에서 환경 구축을 했기 때문에 MacOS Monteerey에서 진행되었고 실패로 인해 비망록
  • 을 남겼다.

    이벤트


    컨디션

  • Vagrant와 Virtualbox는 모두 홈brew를 통해 설치되어 있음
  • $ sw_vers
    ProductName:	macOS
    ProductVersion:	12.0.1
    BuildVersion:	21A559
    
    $ vagrant -v
    Vagrant 2.2.18
    
    $ brew -v
    Homebrew 3.3.2-33-gcb32066
    Homebrew/homebrew-core (git revision 1e9d510578e; last commit 2021-11-03)
    Homebrew/homebrew-cask (git revision d5198633bb; last commit 2021-11-03)
    

    잘못된 내용


  • 생성Vagrantfile 상태에서 실행vagrant up하면 다음과 같은 오류가 발생하여 가상 머신이 부팅되지 않습니다
  • $ vagrant init ubuntu/focal64
    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.
    
    $ ls
    Vagrantfile
    
    $ vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Checking if box 'ubuntu/focal64' version '20211026.0.0' 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 (guest) => 2222 (host) (adapter 1)
    ==> default: Running 'pre-boot' VM customizations...
    ==> default: Booting VM...
    There was an error while executing `VBoxManage`, a CLI used by Vagrant
    for controlling VirtualBox. The command and stderr is shown below.
    
    Command: ["startvm", "3e336932-d167-496b-83ed-537b6fa52468", "--type", "headless"]
    
    Stderr: VBoxManage: error: The virtual machine 'ubuntu2004_default_1635924448821_54833' has terminated unexpectedly during startup because of signal 10
    VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
    

    시도해 본 일

  • 검색한 결과, 비교적 가까운 예로'Oracle 소프트웨어 실행 허가 필요'가 있었지만, 이것은 Homebrew 설치를 사용할 때 삭제된 것이기 때문에 이번 사건의 원인이 아니다
  • https://qiita.com/akane_kato/items/c103332729e3d0ac39e6

    해결책


    비디오 편집

  • 부팅용Vagrantfile의 설정 블록config.vm.provider에서 vb.gui를 진짜
  • 로 설정
    # `config.vm.provider` のブロックと`vb.gui=true`のコメントアウトを外す
    $ vim Vagrantfile
    config.vm.provider "virtualbox" do |vb|
        # Display the VirtualBox GUI when booting the machine
        vb.gui = true
    
        # Customize the amount of memory on the VM:
        # vb.memory = "1024"
    end
    

    결실


    GUI
  • 가 시작되어 안전하게 GUI 명령 수행

  • $ vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Checking if box 'ubuntu/focal64' version '20211026.0.0' 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 (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:
        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: Mounting shared folders...
        default: /vagrant => ...
    
    $ vagrant status
    Current machine states:
    
    default                   running (virtualbox)
    
    The VM is running. To stop this VM, you can run `vagrant halt` to
    shut it down forcefully, or you can run `vagrant suspend` to simply
    suspend the virtual machine. In either case, to restart it again,
    simply run `vagrant up`.
    

    까닭

  • Vagrant에 유사한 issue
  • 가 있음
  • headless 모드에 문제가 있는 것 같아서 GUI에서 이 문제를 피하는 방법이 시작되는 것 같다
  • https://github.com/hashicorp/vagrant/issues/12557

    참고 자료


    https://apple.stackexchange.com/questions/429609/running-vagrant-via-vagrant-up-on-macos-monterey-12-0-1-fails

    좋은 웹페이지 즐겨찾기