• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    해결됨

vagrant up 실행 중 에러

22.08.18 22:01 작성 조회수 443

0

안녕하세요, 윈도우10 환경에서 2-1 서버 구축 강의를 보며 진행 중 오류가 발생해 문의 드립니다.

실행 로그는 아래와 같습니다.

$ vagrant up
Bringing machine 'cent1' up with 'virtualbox' provider...
Bringing machine 'cent2' up with 'virtualbox' provider...
Bringing machine 'cent3' up with 'virtualbox' provider...
==> cent1: Preparing master VM for linked clones...
    cent1: This is a one time operation. Once the master VM is prepared,
    cent1: it will be used as a base for linked clones, making the creation
    cent1: of new VMs take milliseconds on a modern system.
==> cent1: Importing base box 'rockylinux/8'...
==> cent1: Cloning VM...
==> cent1: Matching MAC address for NAT networking...
==> cent1: Checking if box 'rockylinux/8' version '5.0.0' is up to date...
==> cent1: Setting the name of the VM: cent1
==> cent1: Clearing any previously set network interfaces...
==> cent1: Preparing network interfaces based on configuration...
    cent1: Adapter 1: nat
    cent1: Adapter 2: hostonly
    cent1: Adapter 3: hostonly
==> cent1: Forwarding ports...
    cent1: 22 (guest) => 2222 (host) (adapter 1)
==> cent1: Running 'pre-boot' VM customizations...
==> cent1: Booting VM...
==> cent1: Waiting for machine to boot. This may take a few minutes...
    cent1: SSH address: 127.0.0.1:2222
    cent1: SSH username: vagrant
    cent1: SSH auth method: private key
    cent1:
    cent1: Vagrant insecure key detected. Vagrant will automatically replace
    cent1: this with a newly generated keypair for better security.
    cent1:
    cent1: Inserting generated public key within guest...
    cent1: Removing insecure key from the guest if it's present...
    cent1: Key inserted! Disconnecting and reconnecting using new SSH key...
==> cent1: Machine booted and ready!
[cent1] No Virtualbox Guest Additions installation found.
The guest's platform ("rocky") is currently not supported, will try generic Linux method...
Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Mounting Virtualbox Guest Additions ISO to: /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
Installing Virtualbox Guest Additions 6.1.36 - guest version is unknown
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.36 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
/opt/VBoxGuestAdditions-6.1.36/bin/VBoxClient: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
/opt/VBoxGuestAdditions-6.1.36/bin/VBoxClient: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Kernel headers not found for target kernel
4.18.0-348.20.1.el8_5.x86_64. Please install them and execute
  /sbin/rcvboxadd setup
modprobe vboxguest failed
The log file /var/log/vboxadd-setup.log may contain further information.
An error occurred during installation of VirtualBox Guest Additions 6.1.36. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Redirecting to /bin/systemctl start vboxadd.service
Job for vboxadd.service failed because the control process exited with error code.
See "systemctl status vboxadd.service" and "journalctl -xe" for details.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:
VBoxService inside the vm claims: 6.1.36
Going on, assuming VBoxService is correct...
Redirecting to /bin/systemctl start vboxadd-service.service
Job for vboxadd-service.service failed because the control process exited with error code.
See "systemctl status vboxadd-service.service" and "journalctl -xe" for details.
Unmounting Virtualbox Guest Additions ISO from: /mnt
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:
VBoxService inside the vm claims: 6.1.36
Going on, assuming VBoxService is correct...
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:
VBoxService inside the vm claims: 6.1.36
Going on, assuming VBoxService is correct...
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:
VBoxService inside the vm claims: 6.1.36
Going on, assuming VBoxService is correct...
Restarting VM to apply changes...
==> cent1: Attempting graceful shutdown of VM...
==> cent1: Booting VM...
==> cent1: Waiting for machine to boot. This may take a few minutes...
==> cent1: Machine booted and ready!
==> cent1: Checking for guest additions in VM...
    cent1: No guest additions were detected on the base box for this VM! Guest
    cent1: additions are required for forwarded ports, shared folders, host only
    cent1: networking, and more. If SSH fails on this machine, please install
    cent1: the guest additions and repackage the box to continue.
    cent1:
    cent1: This is not an error message; everything may continue to work properly,
    cent1: in which case you may ignore this message.
==> cent1: Setting hostname...
==> cent1: Configuring and enabling network interfaces...
==> cent1: Mounting shared folders...
    cent1: /vagrant => C:/playground/VWS_vagrant_script
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000,_netdev vagrant /vagrant

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

어떻게 하면 수정하여 환경 구축할 수 있을지 알고 싶습니다.

감사합니다.

답변 2

·

답변을 작성해보세요.

0

unchaptered님의 프로필

unchaptered

2023.08.14

vagrant CLI에서 authentication 부분 스크립트가 버그가 있는 것 같아요.

vagrant login 기능이 deprecated되고 vagrant login --token TOKEN 혹은 vagrant cloud auth login 사용해서 Vagrant Cloud랑 연동을 하더라도 해당 버그는 동일합니다.

다운로드 횟수가 많은 다른 Vagrant Box들과도 연결이 되지 않습니다. Vagrant에 문의 남기는 것이 최선일 것 같아요

vagrant쪽에서 문제를 수정한 것 같습니다.
https://github.com/hashicorp/vagrant/issues/12392 여기에서 처리를 한 것 같고환경변수를 다음과 같이 설정하면 동작한다고 합니다.

VAGRANT_SERVER_URL=https://app.vagrantup.com

bash에서 환경변수를 설정하는 방법은 다음과 같습니다.

export VAGRANT_SERVER_URL=https://app.vagrantup.com

지속적으로 등록해 두고 싶은 경우에는 vagrant를 실행하는 사용자 홈디렉터리의 .bashrc 파일에 환경변수를 설정하는 명령어를 적어주세요.

## vi문서편집기로 홈디렉터리의 .bashrc파일을 열고
vi ~/.bashrc

## 환경변수를 선언하는 명령어를 기록
export VAGRANT_SERVER_URL=https://app.vagrantup.com

## :wq 로 저장하고 vi를 빠져나온다. 

## 환경변수를 현세션에 적용
source ~/.bashrc

## 적용을 확인
echo "${VAGRANT_SERVER_URL}"

이 방법으로 해결이 안 될 경우 vagrant를 제작한 하시코프의 업데이트를 기다려야 할 것 같습니다

0

문제가 된 에러 내용은 The guest's platform ("rocky") is currently not supported, will try generic Linux method... 이 부분인 것 같고, 내용은 vagrant cloud의 rockey리눅스 공식 리포지터리에서 rockylinux이미지를 가져와야 하는데 가져오지 못해서 생긴 문제 같습니다.

링크를 눌러 다운로드가 되는 것을 확인했으니 다시한번 확인을 부탁드려요.

예전에도 다운로드가 안된다는 문의가 있었는데 vagrant cloud쪽에서 링크가 깨진 문제였기 때문에 그쪽에서 해결을 할 때까지 기다릴 수 밖에 없었습니다.

참고로 rockylinux 8을 다운로드 할 수 있는 링크는 이 곳입니다.

https://app.vagrantup.com/rockylinux/boxes/8

그리고 혹시 모르니 프로그램의 버전 정보도 확인해주세요.

프로그램의 버전 정보는 다음과 같습니다.

VirtualBOX 6.1.32

Vagrant 2.2.19

다시한번 vagrant up 해도 같은 에러가 발생할 경우 다음 단계로 진행해주세요.

  • 프로그램 버전이 맞지 않다면 virtualbox와 vagrant을 삭제 후 버전에 맞춰서 설치
  • VWS_vagrant_script 디렉토리를 삭제하고 다시 소스를 클론한 후에 실행

혹시 이 방법으로도 해결이 안되셨다면 에러로그와 함께 다시 질문 남겨주세요. 

오리너구리님의 프로필

오리너구리

2023.02.17

ㅜㅜ 선생님 저 온갖 에러 해결하고 여기까지 왔는데 이건 도대체 어떻게 해야하나요 ㅜㅜㅜㅜㅜㅜ 이젠 오기로라도 vagrant 쓰고싶어요

하륜님 안녕하세요.

실습 환경을 만드는 것이 쉘 스크립트와 다르기도하고 더 많은 분야를 알아야 하기 때문에 어려운 것이 사실입니다.

최대한 간단하게 환경을 구축할 수 있도록 스크립트를 제공한 것이었는데 오픈소스(vagrant, virtualbox)와 OS의 버전이 올라가면서 다양한 에러가 나오는 문제가 주기적으로 발생할 수 밖에 없는 상황입니다.

그래서 vagrant로 실습환경을 구축하지 않아도 되도록 준비를 했으니 아래 링크(새소식)을 참고해서 환경을 만들어보세요.

https://www.inflearn.com/news/674204

응원합니다! ^^