はじめに
昨日の記事「Packerを使ってCentOS 7の仮想マシンイメージを作成する」では、Packerを使ってVagrant用のBoxを作成し、Vagrantで起動できることを確認しました。
しかし、Boxをguiモードで起動した際に、CentOSのブートメニューの後にtsc: Fast TSC calibration failedが表示されている事に気づいたため、今回は、このメッセージを消す方法について解説します。
2014年07月30日 20時21分
昨日の記事「Packerを使ってCentOS 7の仮想マシンイメージを作成する」では、Packerを使ってVagrant用のBoxを作成し、Vagrantで起動できることを確認しました。
しかし、Boxをguiモードで起動した際に、CentOSのブートメニューの後にtsc: Fast TSC calibration failedが表示されている事に気づいたため、今回は、このメッセージを消す方法について解説します。
作業の前提条件は、下記のとおりです。
| ソフトウエア | バージョン |
|---|---|
| OS | Windows 7 Ultimate 32bit |
| Cygwin | Setup Version 2.831 |
| VirtualBox | 4.3.12 r93733 |
| Vagrant | 1.6.3 |
VirtulBoxを起動し、Vagrantが追加した仮想マシンを起動しても確認できますが、ここでは、Vagrantfileを編集してBoxをguiモードで起動します。
Vagrantfileに、VirtualBoxをGUIモードで起動するように設定します。
$ cd /tmp/centos-vm $ vi Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos7"
config.vm.box_url = "box/virtualbox/centos70-nocm.box"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
end
Boxを起動します。
$ vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> 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: Forwarding ports...
default: 22 => 2222 (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: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
GuestAdditions 4.3.12 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.
しばらくするとVirtualBoxのGUIが表示されます。


上の画像でメッセージが確認できます。
起動時のメッセージが確認できましたので、消去してみます。
同様の現象は、StackOverflowでも確認されていて、いろいろと対処方法が議論されていますが、決め手となった対処方法を説明します。
Boxに接続した後、 GRUB_CMDLINE_LINUXにパラメタを追加します。
$ sudo cp -p /etc/default/grub /etc/default/grub.orig $ sudo vi /etc/default/grub
GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=jp106 rd.lvm.lv=centos/root crashkernel=auto rhgb quiet clocksource=tsc" GRUB_DISABLE_RECOVERY="true" GRUB_CMDLINE_LINUX="clocksource=tsc"
$ diff /etc/default/grub /etc/default/grub.orig
6c6 < GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=jp106 rd.lvm.lv=centos/root crashkernel=auto rhgb quiet clocksource=tsc" --- > GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=jp106 rd.lvm.lv=centos/root crashkernel=auto rhgb quiet" 8d7 < GRUB_CMDLINE_LINUX="clocksource=tsc"
grub.cfgを再生成します。
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.4.4.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.4.4.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-f2f9f27f76d84f539b589cdee5d8bb64 Found initrd image: /boot/initramfs-0-rescue-f2f9f27f76d84f539b589cdee5d8bb64.img done
Boxを再起動します。表示されているVirtualBoxのGUI上で、メッセージが消えていれば成功です。
$ sudo reboot

