元祖若手のプログラミング奮闘記

元祖若手の奮闘記。主にメモ

VargrantのguestOSのversionが合ってなくてエラーになってたのを直した

お世話になっているvargrant
なんかごにょごにょしたらエラーが出てしまった

$ vagrant up
(前略)
[default] GuestAdditions versions on your host (5.1.28) and guest (5.0.6) do not match.

(中略)

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:

mount: unknown filesystem type 'vboxsf'

[default] GuestAdditions versions on your host (5.1.28) and guest (5.0.6) do not match.


よはguestOSのversionを合わせればいいんだなって思い

vargrant ssh

でログイン

$ curl -0 http://download.virtualbox.org/virtualbox/5.1.28/VBoxGuestAdditions_5.1.28.iso > /tmp/vboxguest.iso
$ sudo mount -o loop /tmp/vboxguest.iso /mnt
$ yes yes | sudo /mnt/VBoxLinuxAdditions.run
$ exit

ほんで読み込み直しておしまい

myuser: centos7$ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'bento/centos-7.1' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 3000 (guest) => 3000 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
[default] GuestAdditions 5.1.28 running --- OK.

(後略)