a stray sheep

お仕事周りの雑記帳

Vagrant で CentOS7.8 ゲストを使えるようにする

やりたいこと

手元のVagrant環境で、CentOS7.8の環境を用意する。だけ。

操作メモ

vagrant initとup

> vagrant init bento/centos-7.8

> vagrant up
・・・中略・・・
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の共有フォルダをマウントできなかった。vboxsfが利用できないせいらしい。 Guest Additionsがゲストで適切にインストールされているか確認せよ、とのこと。

vbguestを確認

>vagrant vbguest --status
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:
VBoxService inside the vm claims: 6.1.16
Going on, assuming VBoxService is correct...
[default] GuestAdditions seems to be installed (6.1.16) correctly, but not running.

ホスト上のVirtualBox は、何もない? VM内のVBoxService は、6.1.16 ホストにGuest Additionsを入れないといけないのかな?

Guest Additionsをインストールしてみる

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

インストールできた。

upとssh接続

> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/centos-7.8' version '202010.22.0' is up to date...

> vagrant ssh
Last login: Mon Feb  8 13:52:12 2021 from 10.0.2.2

This system is built by the Bento project by Chef Software
More information can be found at https://github.com/chef/bento

できた、のかな?