Profile picture

[Linux] Vagrant 가상머신 구축 중 modifyvm Error 발생

JaehyoJJAng2023년 05월 20일

modifyvm 에러

"컨테이너 인프라 환경 구축을 위한 쿠버네티스/도커" 책의 초반 파트인 쿠버네티스 실습 환경 파트에서 쿠버네티스 인프라 환경을 IaC 도구인 Vagrant를 사용하여 구성 하려던 중에 modifyvm 문제가 발생하였다.


아래는 당시 발생했던 에러 로그이다.

==> m-k8s: Running 'pre-boot' VM customizations...
A customization command failed:

["modifyvm", :id, "--groups", "/k8s-SM(github_SysNet4Admin)"]

The following error was experienced:

#<Vagrant::Errors::VBoxManageError: There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "3831abfc-acd6-4105-8d6a-b2eec322d108", "--groups", "/k8s-SM(github_SysNet4Admin)"]

Stderr: VBoxManage.exe: error: Could not rename the directory 'C:\Users\home\VirtualBox VMs\New Group\m-k8s(github_SysNet4Admin)' to 'C:\Users\home\VirtualBox VMs\k8s-SM(github_SysNet4Admin)\m-k8s(github_SysNet4Admin)' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "SaveSettings()" at line 4095 of file VBoxManageModifyVM.cpp
>

Please fix this customization and try again.

책이 나온지 좀 되었다보니 질문을 해도 답변을 받기 어려울 거라 생각해 구글링을 해보았다.

image
보니까 저 때 당시에도 이런 에러가 발생했었나 보다.
도움이 안되는 답변이 달렸기에 답글은 생략하겠다


해결 방법

여러 글들을 보다가 아래의 글 처럼 나와 동일한 에러를 겪는 분을 볼 수 있었다.
Vagrant로 가상머신 구성중 생긴 문제들

이 분 글 중에 modifyvm 부분의 에러가 나와 동일했고 그 분이 하셨던 방법처럼 똑같이 따라해봤지만 여전히 동일한 에러를 내뱉었다.


그래서 다시 한 번 에러 로그를 흝던 중에 이상한 점을 발견했다.

Stderr: VBoxManage.exe: error: Could not rename the directory 'C:\Users\home\VirtualBox VMs\New Group\m-k8s(github_SysNet4Admin)' to 'C:\Users\home\VirtualBox VMs\k8s-SM(github_SysNet4Admin)\m-k8s(github_SysNet4Admin)' to save the settings file (VERR_ALREADY_EXISTS)
...

C:\Users\home\VirtualBox VMs\k8s-SM(github_SysNet4Admin)\m-k8s(github_SysNet4Admin)이 부분이다. 도저히 해결책이 떠오르지 않아 최후의 수단으로 해당 경로에 있는 파일들을 전부 지웠더니 문제가 해결되었다.


Loading script...