LoginSignup
4
6

More than 5 years have passed since last update.

Vagrant boxの日本語化(CentOS7)

Posted at

概要

Vagrant boxの日本語化 にCentOS 6でのvagrant box日本語化手順があるが、CentOS 7ではロケールやタイムゾーンの設定方法が異なるため、以下に記載する。

前提

  • 実行環境
    • OS X El Capitan
    • Vagrant-1.8.1
    • VirtualBox-5.0.20
  • ベースとなるboxはAtlasのCentOS/7を使用

手順

vagrant box 追加・起動・ログイン

$ mkdir centos7_jp && cd centos7_jp
$ vagrant init centos/7
$ vagrant up
$ vagrant ssh

日本語化

$ sudo localectl set-locale LANG=ja_JP.UTF-8
$ sudo timedatectl set-timezone Asia/Tokyo
$ sudo yum install man-pages-ja -y

不要なファイルを削除して最適化

$ sudo rm -fr /var/log/*
$ sudo rm -fr /tmp/*
$ sudo yum clean all
$ sudo dd if=/dev/zero of=zero bs=4k
$ sudo rm zero
$ history -c
$ sudo shutdown -h now

再パッケージ

$ vagrant package
$ vagrant box add centos7_jp package.box
4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6