Login
Immutable PageDiscussionInfoAttachments
ytoku/daily-record/2015-10-05

MMA

最新カーネルのUbuntu環境をVagrant上に作る

Ubuntu用の最新カーネルはKernel-ppaで提供されている. 今回はv4.3-rc4-unstableから

をダウンロードしてインストールした. インストールを自動化するスクリプトもあるらしいがまだ試していない.

Linux 4.3ではvirtualbox-guest-dkmsのビルドに失敗し,

ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-guest-dkms.0.crash'
Error! Bad return status for module build on kernel: 4.3.0-040300rc4-generic (x86_64)
Consult /var/lib/dkms/virtualbox-guest/4.3.26/build/make.log for more information.

   CC [M]  /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.o
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c: In function ‘sf_follow_link’:
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c:43:5: error: implicit declaration of function ‘nd_set_link’ [-Werror=implicit-function-declaration]
      nd_set_link(nd, error ? ERR_PTR(error) : path);
      ^
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c: In function ‘sf_put_link’:
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c:49:5: error: implicit declaration of function ‘nd_get_link’ [-Werror=implicit-function-declaration]
      char *page = nd_get_link(nd);
      ^
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c:49:18: warning: initialization makes pointer from integer without a cast
      char *page = nd_get_link(nd);
                   ^
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c: At top level:
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c:57:5: warning: initialization from incompatible pointer type
      .follow_link    = sf_follow_link,
      ^
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c:57:5: warning: (near initialization for ‘sf_lnk_iops.follow_link’)
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c:59:1: warning: initialization from incompatible pointer type
  };
  ^
 /var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.c:59:1: warning: (near initialization for ‘sf_lnk_iops.put_link’)
 cc1: some warnings being treated as errors
 scripts/Makefile.build:258: recipe for target '/var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.o' failed
 make[2]: *** [/var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf/lnkops.o] Error 1
 scripts/Makefile.build:403: recipe for target '/var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf' failed
 make[1]: *** [/var/lib/dkms/virtualbox-guest/4.3.26/build/vboxsf] Error 2
 Makefile:1378: recipe for target '_module_/var/lib/dkms/virtualbox-guest/4.3.26/build' failed
 make: *** [_module_/var/lib/dkms/virtualbox-guest/4.3.26/build] Error 2
 make: Leaving directory '/usr/src/linux-headers-4.3.0-040300rc4-generic'

vagrant up時に/vagrantのマウントができなくなってしまった.

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

stdin: is not a tty
/sbin/mount.vboxsf: mounting failed with the error: No such device

ホスト側ではVirtualBox 5.0.6を使用していたので,ゲストにも最新のGuest Additionをインストールしたところビルドに成功した.

VagrantのゲストのGuest Additionを更新するには, vagrant-vbguestというプラグインを用いた.

vagrant plugin install vagrant-vbguest

このプラグインをインストールしておくと,vagrant up時にホストと同じバージョンのGuest Additionが自動でインストールされる.

参考文献

ytoku/daily-record/2015-10-05 (last edited 2015-10-05 21:30:17 by ytoku)