• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    해결됨

vagrant up 명령시 영상과 다른 결과가 나옵니다.

20.11.25 19:47 작성 조회수 715

0

안녕하세요, 강좌를 보고 따라하고 있는데, 영상과 다른 결과가 나와서 문의 드립니다.

vagrant up 명령을 실행하면 도중에

==> ansible-node01: Available bridged network interfaces:

1) Realtek PCIe GBE Family Controller

2) Hyper-V Virtual Ethernet Adapter

라고 nic를 선택하게끔 나오는데 이 부분을 자동으로 넘어가게끔 할 수 있는 방법이 있을까요?

위의 선택지에서 1번을 선택하고 다음 단계로 넘어가면 아래와 같은 메시지를 남기면서 종료됩니다. 

The following SSH command responded with a non-zero exit status.

Vagrant assumes that this means the command failed!

umount /mnt

ansible-node01만 생성되고, 02 및 server는 vm이 생성되지 않는 상황입니다.  전체 vagrant up 실행 결과는 아래와 같습니다. 

c:\HashiCorp>vagrant up
vagrant up
Bringing machine 'ansible-node01' up with 'virtualbox' provider...
Bringing machine 'ansible-node02' up with 'virtualbox' provider...
Bringing machine 'ansible-server' up with 'virtualbox' provider...
==> ansible-node01: Importing base box 'centos/7'...
==> ansible-node01: Matching MAC address for NAT networking...
==> ansible-node01: Checking if box 'centos/7' version '2004.01' is up to date...
==> ansible-node01: Setting the name of the VM: Ansible-Node01(Udemy-Bloter)
==> ansible-node01: Clearing any previously set network interfaces...
==> ansible-node01: Available bridged network interfaces:
1) Realtek PCIe GBE Family Controller
2) Hyper-V Virtual Ethernet Adapter
==> ansible-node01: When choosing an interface, it is usually the one that is
==> ansible-node01: being used to connect to the internet.
==> ansible-node01: 
    ansible-node01: Which interface should the network bridge to? 1
==> ansible-node01: Preparing network interfaces based on configuration...
    ansible-node01: Adapter 1: nat
    ansible-node01: Adapter 2: bridged
==> ansible-node01: Forwarding ports...
    ansible-node01: 22 (guest) => 19211 (host) (adapter 1)
==> ansible-node01: Running 'pre-boot' VM customizations...
==> ansible-node01: Booting VM...
==> ansible-node01: Waiting for machine to boot. This may take a few minutes...
    ansible-node01: SSH address: 127.0.0.1:19211
    ansible-node01: SSH username: vagrant
    ansible-node01: SSH auth method: private key
    ansible-node01: 
    ansible-node01: Vagrant insecure key detected. Vagrant will automatically replace
    ansible-node01: this with a newly generated keypair for better security.
    ansible-node01: 
    ansible-node01: Inserting generated public key within guest...
    ansible-node01: Removing insecure key from the guest if it's present...
    ansible-node01: Key inserted! Disconnecting and reconnecting using new SSH key...
==> ansible-node01: Machine booted and ready!
[ansible-node01] No Virtualbox Guest Additions installation found.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
Resolving Dependencies
--> Running transaction check
---> Package centos-release.x86_64 0:7-8.2003.0.el7.centos will be updated
---> Package centos-release.x86_64 0:7-9.2009.0.el7.centos will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch         Version                     Repository  Size
================================================================================
Updating:
 centos-release       x86_64       7-9.2009.0.el7.centos       base        27 k

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 27 k
Downloading packages:
No Presto metadata available for base
Public key for centos-release-7-9.2009.0.el7.centos.x86_64.rpm is not installed
warning: /var/cache/yum/x86_64/7/base/packages/centos-release-7-9.2009.0.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-8.2003.0.el7.centos.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : centos-release-7-9.2009.0.el7.centos.x86_64                  1/2 
  Cleanup    : centos-release-7-8.2003.0.el7.centos.x86_64                  2/2 
  Verifying  : centos-release-7-9.2009.0.el7.centos.x86_64                  1/2 
  Verifying  : centos-release-7-8.2003.0.el7.centos.x86_64                  2/2 

Updated:
  centos-release.x86_64 0:7-9.2009.0.el7.centos                                 

Complete!
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
No package kernel-devel-3.10.0-1127.el7.x86_64 available.
Error: Nothing to do
Unmounting Virtualbox Guest Additions ISO from: /mnt
umount: /mnt: not mounted
==> ansible-node01: Checking for guest additions in VM...
    ansible-node01: No guest additions were detected on the base box for this VM! Guest
    ansible-node01: additions are required for forwarded ports, shared folders, host only
    ansible-node01: networking, and more. If SSH fails on this machine, please install
    ansible-node01: the guest additions and repackage the box to continue.
    ansible-node01: 
    ansible-node01: This is not an error message; everything may continue to work properly,
    ansible-node01: in which case you may ignore this message.
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

umount /mnt

Stdout from the command:



Stderr from the command:

umount: /mnt: not mounted

c:\HashiCorp>

답변 3

·

답변을 작성해보세요.

1

Paul Go님의 프로필

Paul Go

2022.01.03

여기에도 좋은 정보가 있습니다. installer_hooks, installer_options를 사용하는 방법이네요.

 

https://github.com/dotless-de/vagrant-vbguest/discussions/401

1

안녕하세요 드림팩토리 이승환님 :), 

1. interface 선택 부분

아래와 같은 선택이 뜨는건 실제로 인터페이스가 2개 있어서 그런건데, Hyper-V를 쓰고 계시는 랩탑이거나 디폴트로 설정되어 있거나 예전에 쓰셨거나 한거 같습니다. Hyper-V는 virtualbox와 충돌 날수 있으니 꺼주시기 바랍니다. 서비스를 끄면 아마도 인터페이스가 사라질꺼 같은데, 안 사라지면 인터페이스를 삭제하시면 지워집니다. (안 쓰고 있는 경우) 

```

1) Realtek PCIe GBE Family Controller

2) Hyper-V Virtual Ethernet Adapter

라고 nic를 선택하게끔 나오는데 이 부분을 자동으로 넘어가게끔 할 수 있는 방법이 있을까요?

```

2. 에러 부분 

(소스 코드를 그대로 사용했다는 가정하에서) 이건 /mnt 이슈나 그런게 아니라 2개 중에 하나인데..

1) 디렉터리 마운트 

코드 상에서 호스트 시스템과 가상 시스템이 공유하는 디렉터리를 생성하는 구문이 있는데, 그걸 disable 시킵니다.

근데 그걸 그대로 사용하려면 (기본 설정) guest exptension (확장팩)이 필요합니다. 그래서 disable로 처리한건데...

아마 그 구문이 적용이 안되었거나, 의미 없다고 생각해서 빼셨거나 한거라... 쓰시려고 한다면 확장팩을 설치하시면 해결이 되긴 됩니다. 

2) 시스템 성능

시스템에 따라서 성능에 따라서 그때 그때 호스트와 게스트가 통신하다가 통신 응답이 에러가 나는 경우가 있습니다. 보통 authorized key 생성할때 생기는데...아마 그 시기가 아닌걸 봐서 1)인거 같이 보이네요 

위의 내용을 보시고 일단 지우고 다시 생성해 본 이후에 말씀해 주시겠어요?

조훈 드림. 

0

네엡 해결되셨다니 다행이네요. 

근데 메일로는 왔는데 시스템 상으로는 해결된 내용이 보이진 않네요..뭐가 문제지;;

참고 

===

알려주신대로 1번은  hyper-v virtual ethernet adapter를 "사용하지 않음"으로 변경했더니 해결되었습니다. 2번의 경우 동일한 이슈가 있던 포스트를 보고 vagrant-vbguest 버전을 0.28->0.21로 다운그레이드해서 해결했습니다.