Help us understand the problem. What is going on with this article?

CentOS7.2のvagrant boxを作る

More than 3 years have passed since last update.

vagrantのboxに変更を加えて別のboxとして追加したい

CentOS7.2のboxがUPされていなかった。(2016/6/19時点)
http://www.vagrantbox.es

ここではCentOS7.1のboxを使ってCentOS7.2のboxを作成してvagrant boxとして追加したい。

現在あるboxを確認。(CentOS7.1のboxは既に追加されている前提)

$ vagrant box list
cent7      (virtualbox, 0)

cent7のboxで起動したホストにsshしてOSバージョンを確認。
$ vagrant ssh
Last login: Sun Jun 19 00:23:23 2016 from 192.168.33.1
[vagrant@localhost ~]$ cat /etc/redhat-release 
CentOS Linux release 7.1.1503 (Core) 

CentOS7.2にupdateする。
[vagrant@localhost ~]$ yum update -y
[vagrant@localhost ~]$ cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core)

変更を加えたホストからexitしてからhaltする。
$ vagrant halt

vagrant packageしてからカレントディレクトリにpackage.boxがあることを確認する。
$ vagrant package
==> default: Clearing any previously set forwarded ports...
==> default: Exporting VM...
==> default: Compressing package to: /Users/hoge/vagrant/cent72/package.box
$ ls
Vagrantfile package.box

保存されたpackage.boxをcent72としてbox名を付ける。
$ vagrant box add cent72 package.box 
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'cent72' (v0) for provider: 
    box: Unpacking necessary files from: file:///Users/hoge/vagrant/cent72/package.box
==> box: Successfully added box 'cent72' (v0) for 'virtualbox'!

cent72のboxが追加された。
$ vagrant box list
cent7      (virtualbox, 0)
cent72     (virtualbox, 0)

以上

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away