레거시/트러블슈팅
[Vagrant] There was an error while executing VBoxManage, a CLI used by Vagrantfor controlling VirtualBox. The command and stderr is shown below.
Gurumee
2022. 1. 7. 19:30
반응형
문제 상황
vagrant init centos/8
이후, vagrant up
명령어 실행하면, 다음 에러가 뜨면서 부팅되지 않음.
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos/8'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/8' version '2011.0' is up to date...
==> default: Setting the name of the VM: vagrant-tutorial_default_1641173107918_54575
==> 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: 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", "cdbd9eca-dbd7-4154-b9e2-7771d08a4c18", "--type", "headless"]
Stderr: VBoxManage: error: The virtual machine 'vagrant-tutorial_default_1641173107918_54575' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
FAIL
에러가 났을 때 환경은 다음과 같다.
- virtualbox 6.1.30
- vagrant 2.2.19
문제 원인
결론만 말하면 이러한 문제가 발생한 이유는 크게 2가지가 있다.
- vagrant가 virtualbox를 조작할 때, 확장팩에 있는 기능을 사용하는데 이 확장팩이 없어서
- virtualbox가 macos 보안에 막혀 있어서
먼저 virtualbox
확장팩이 설치되어있는지 확인해보자. (다음과 같이 있다면 다음 단계로 넘어간다.)
그 다음 virtuablox
내에서 부팅 이미지를 수동으로 실행해보자. 다음 에러가 뜬다면 보안에 막힌 것이다.
문제 해결
virtualbox 확장팩 설치
먼저 확장팩을 설치해준다. virtualbox
공식 문서로 이동한다. 그 후 "Extension Pack"의 "All supported platforms"를 클릭한다.
그럼 하단 탭에 설치 파일이 하나 뜰 것이다. 설치가 완료되면 클릭한다.
그러면 다음 창이 뜨면서 "설치"할 것인지 묻는다. "설치"를 클릭한다.
그럼 동의 팝업이 뜨는데 쭉 스크롤을 밑으로 내리면 활성화가 된다. "동의합니다"를 클릭한다.
그러면, 다음과 같이 "Extension Pack"이 설치됨을 알 수 있다.
MacOS 보안 해제
먼저 "시스템 환결성정"에 들어가서 "보안 및 개인 정보 보호"를 클릭한다.
그 후 아래 자물쇠 아이콘을 클릭한다.
비밀번호 입력 후 "세부사항..."을 클릭한다.
그 후 "Oracle America, Inc."를 클릭한다.
이후, 컴퓨터를 재부팅한다.
문제 해결 확인
이후 다시 vagrant up
을 진행하면 정상적으로 실행된다.
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'centos/8' version '2011.0' is up to date...
==> default: Resuming suspended VM...
==> 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!
참고
728x90
반응형