programing

Vagrant는 VirtualBox 공유 폴더를 마운트 할 수 없습니다.

nasanasas 2020. 11. 13. 08:23
반응형

Vagrant는 VirtualBox 공유 폴더를 마운트 할 수 없습니다.


현재 설정 : 버추얼 5.1.20방랑 1.9.3

이전 작업 설정 : 버추얼 5.1.18방랑 1.9.3

최신 버전의 Virtualbox를 설치하고 VM을 시작하려고했습니다. 폴더 마운트가 작동을 멈췄습니다. 동일한 폴더 마운트가 Virtualbox 5.1.18 에서 잘 작동합니다 . 다음과 같은 오류 메시지가 나타납니다.

Vagrant는 VirtualBox 공유 폴더를 마운트 할 수 없습니다. 이는 일반적으로 파일 시스템 "vboxsf"를 사용할 수 없기 때문입니다. 이 파일 시스템은 VirtualBox Guest Additions 및 커널 모듈을 통해 사용할 수 있습니다. 이러한 게스트 추가가 게스트에 제대로 설치되었는지 확인하십시오. 이것은 Vagrant의 버그가 아니며 일반적으로 결함이있는 Vagrant 상자로 인해 발생합니다. 컨텍스트의 경우 시도한 명령은 다음과 같습니다.

 mount -t vboxsf -o uid=1000,gid=1000 keys /keys 

명령의 오류 출력은 다음과 같습니다.

mount: wrong fs type, bad option, bad superblock on keys,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try dmesg | tail or so.

수동으로 vagrant-vbguest플러그인 (을 통해 vagrant plugin install vagrant-vbguest) 설치를 시도했지만 아무것도 수정하지 않았습니다. 5.1.18로 다시 다운 그레이드하면 문제가 해결되지만 앞으로 나아가는 것이 이상적이지 않습니다.

Virtualbox 5.1.20Vagrant 1.9.3에서 폴더 마운트를 어떻게 할 수 있습니까?


최신 정보

VirtualBox 5.1.22에서 수정되었습니다.

( https://www.virtualbox.org/ticket/16670 )

원래 답변

제 경우에는 VM 내부의 심볼릭 링크가 잘못되었습니다. VM에 로그인합니다.

$ vagrant ssh

그때:

$ ls -lh /sbin/mount.vboxsf 
lrwxrwxrwx 1 root root 49 Apr 19 14:05 /sbin/mount.vboxsf -> /opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf

이 링크는 끊어졌습니다. /opt/VBoxGuestAdditions-5.1.20/ 내부를 살펴보면 하위 폴더 "other"가 존재하지 않는 것을 알 수 있습니다. 이 줄은 다음을 수정합니다.

$ sudo ln -sf /opt/VBoxGuestAdditions-*/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf

이제 VM에서 로그 아웃합니다.

$ exit

그리고 그것이 당신을 위해 작동하는지 확인하십시오.

$ vagrant reload

하지만 내 상자 안에 /sbin/mount.vboxsf가 없기 때문에 링크를 수정할 수 없습니다!

/sbin/mount.vboxsf 링크가 처음에 존재하지 않으면 VBoxGuestAdditions를 설치할 수 없습니다. VirtualBox를 업데이트 한 후 일치하는 VirtualBox Extension Pack을 다운로드하지 않은 경우 발생할 수 있습니다 (v5.2.18 이상은 Virtualbox 업데이트 중에 자동으로 다운로드해야 함). 지금 할 수 있습니다.

  • 실행중인 모든 VM을 중지합니다.
  • VirtualBox 프로그램을 엽니 다.
  • VirtualBox Extension Pack의 다운로드를 시작하고 설치합니다.
  • VirtualBox Extension Pack을 다운로드할지 묻는 메시지가 표시되지 않으면-> 파일-> 업데이트 확인을 열고 다운로드 대화 상자를 트리거합니다.

VirtualBox Extension에 대한 업데이트가없는 경우 설치 프로그램에 메시지가 표시되고 vagrant 플러그인 vbguest가 응답을 프롬프트 할 수 없기 때문에 VBoxGuestAdditions를 설치할 수 없습니다 ( vbguest v0.15.0에서 "수정"됨 ). "vagrant up"의 출력에서 ​​확인할 수 있습니다. 다음과 비슷한 줄이 있어야합니다.

Do you wish to continue? [yes or no]

이 경우 설치 프로그램을 수동으로 실행할 수 있습니다. 이렇게하려면 상자를 시작하십시오.

$ vagrant up

그런 다음 vbguest를 트리거하여 설치를 다시 시도하지만 나중에 VBoxGuestAdditions ISO를 마운트 된 상태로 둡니다.

$ vagrant vbguest --do install --no-cleanup

상자에 로그인하십시오.

$ vagrant ssh

설치 프로그램을 수동으로 실행했습니다.

$ sudo /mnt/VBoxLinuxAdditions.run

마지막 희망 : DIY!

위의 방법이 모두 작동하지 않으면 게스트 추가를 수동으로 설치하십시오.

cd /opt
sudo wget -c http://download.virtualbox.org/virtualbox/5.1.28/VBoxGuestAdditions_5.1.28.iso -O VBoxGuestAdditions_5.1.28.iso
sudo mount VBoxGuestAdditions_5.1.28.iso -o loop /mnt
sudo sh /mnt/VBoxLinuxAdditions.run

vbguest 플러그인 설치는 VirtualBox 5.2.6 및 Vagrant 2.0.1에서 제 경우에 작동했습니다.

vagrant plugin install vagrant-vbguest


이것은 나를 위해 일했습니다 ... 다음을 실행하십시오.

vagrant plugin repair

그때

vagrant plugin expunge --reinstall

그때

vagrant reload

homestead.yaml에서 "nfs"유형을 제거하면 문제가 해결되었습니다. Win 10, Vagrant 1.9.7, laravel 5.4, homestead.


저에게 문제는 다음과 같은 조건에서 수정되었습니다.

환경:

  • VirtualBox 버전 6.0.4r128413
  • Vagrant 버전 2.2.3

단계 :

터미널 또는 명령 줄 ( cd) 에서 프로젝트 디렉터리로 이동 하고 다음 명령을 실행합니다.

  1. vagrant plugin install vagrant-vbguest Vagrant VB 게스트 플러그인을 설치하려면

  2. vagrant up

vboxsf사용할 수 없다는 오류가 발생하는 경우 . 그렇다면 VirtualBox Guest Additions가 제대로 설치되지 않았을 수 있습니다. 아래 명령으로 문제를 해결할 수 있기를 바랍니다.

vagrant ssh
sudo yum -y install kernel-devel
sudo yum update -y
exit
vagrant halt
vagrant up --provision

For me the following commands followed by a reboot of the guest system helped:

cd /opt/VBoxGuestAdditions-*/init  
sudo ./vboxadd setup

I found the solution here. Referring to this post you need to stop vboxadd before triggering the commands (I didn't do so since I don't know what vboxadd is).


For those who land here with almost the same problem as me, below is the solution

TLDR

  • VirtualBox guest fail because of system is currently not set up to build kernel modules
  • Solution is uninstall kernel-headers.x86_64 0:3.10.0-862.9.1.el7
  • Then install kernel-devel-3.10.0-327.el7.x86_64

Solution

  1. vagrant ssh

  2. sudo rpm -e kernel-devel-3.10.0-862.9.1.el7.x86_64

  3. sudo wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/7.0/x86_64/updates/security/kernel-devel-3.10.0-327.el7.x86_64.rpm //download the file

  4. sudo rpm -Uvh kernel-devel-3.10.0-327.el7.x86_64.rpm //use the file downloaded on step 3

  5. exit

  6. vagrant reload

Details: Problem

  1. Do vagrant up but fail with similar error except

The error output from the command was:

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

  1. Do further reading of the logs and I notice below key words

Installing Virtualbox Guest Additions 5.2.16 - guest version is 5.1.10

An error occurred during installation of VirtualBox Guest Additions

This system is currently not set up to build kernel modules.

Please install the Linux kernel "header" files matching the current kernel

packages containing the headers are probably: kernel-devel kernel-devel-3.10.0-327.el7.x86_64

  1. Read logs further

Package kernel-headers.x86_64 0:3.10.0-862.9.1.el7 will be installed

No package kernel-devel-3.10.0-327.el7.x86_64 available.

  1. My guest is I need kernel-devel-3.10.0-327.el7.x86_64 to works

Details: My environment

  • bento/centos-7.2
  • vagrant version: 2.0.4
  • virtual box version: 5.2.16

Sources

참고URL : https://stackoverflow.com/questions/43492322/vagrant-was-unable-to-mount-virtualbox-shared-folders

반응형