Vagrant 공유 폴더 문제(mount.vboxsf 관련) - vagrant-vbguest 플러그인

DevOps|2017. 5. 29. 19:43

Vagrant를 이용해 apache brooklyn을 학습하던 중에 갑자기 brooklyn 서버가 동작을 안하는 문제가 생겼습니다. 최초로 VM을 생성했을 때는 마운트에 문제가 없었는데 재부팅을 하면 문제가 생깁니다.

이런저런 방법으로 추적해 봤더니 결국 Vagrant 혹은 VirtualBox에서 발생한 오류 때문이더군요.

brooklyn 서버의 /vagrant로 마운트되는 VirtualBox 공유 폴더가 마운트 안되는 문제인데, 아래와 같은 오류 메시지가 출력됩니다.

==> brooklyn: Mounting shared folders...
    brooklyn: /vagrant => G:/workspace/apache-brooklyn-0.11.0-vagrant
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 vagrant /vagrant

The error output from the command was:

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

구글링을 해보니, VirtualBox Guest Additions 설치에 문제가 있어서 그런 것 같습니다. 여러 가지 시도를 해봤는데 결국 vagrant-vbguest 플러그인을 설치해서 해결했습니다.

vagrant-vbguest 플러그인은 guest machine과 VirtualBox host의 Guest Additions 버전이 다를 경우에 알맞은 버전을 설치해 주는 플러그인입니다.


   vagrant-vbguest 플러그인 설치

아래의 명령으로 설치합니다.

$ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.14.2)'!

이미 생성한 box에 적용하려면 아래의 명령으로 수동으로 설치할 수 있습니다.

$ vagrant vbguest

Guest Additions가 설치된 후 vagrant reload 명령으로 vagrant machine 재시작하니까 공유 폴더가 제대로 마운트되는 것을 실행 로그에서 확인할 수 있었습니다.

지금까지 Vagrant를 사용하면서 Guest Additions 설치에 대해서 고민한 적이 없었는데, 관련 문제를 vagrant-vbguest를 통해 해결하면서 수행 로그를 보니, 꽤 수고스러운 작업을 대신 해 주는 고마운 플러그인이네요. 어쩌면 필수 플러그인이 아닐까 싶습니다.


EOF


댓글()