LoginSignup
6
4

More than 5 years have passed since last update.

Windows10(64bit)にVagrant+VirtualBoxで開発環境作る1

Last updated at Posted at 2018-06-03

概要

個人で開発する用の環境を作るのでそのメモ

普通のWeb用環境を想定

(あとQiitaの練習)

追記

その2も書きました

ゴール

とりあえず以下のような環境を作りたい

  • Windows 10 64bit
  • Vagrant
  • VirtualBox
  • Git for Windows
  • CentOS
  • Nginx
  • PHP
  • MySQL
  • Redis

Vagrant, VirtualBox, Git for Windowsインストール

それぞれ公式からDLしてインストール

- Vagrant (2.1.1)
- VirtualBox (5.2.12)
- Git for Windows (2.17.1)

※ 括弧内は執筆時のバージョン

インストールはウィザードに従って行うので割愛

また、コマンドプロンプト使えないので代用でGit for WindowsにくっついてくるGit Bashを使う

$ vagrant --version
Vagrant 2.1.1
$ /c/Program\ Files/Oracle/VirtualBox/VBoxManage.exe --version
5.2.12r122591
$ git --version
git version 2.17.1.windows.2

ここまででこんな感じ

CentOSのイメージを使ってVM構築

  1. 適当な作業ディレクトリを作る(~/work/sampleとか)
  2. その中にvagrantディレクトリを作る
  3. vagrant initでVagrantfileを作る
$ mkdir -p ~/work/sample
$ cd ~/work/sample
$ mkdir vagrant
$ cd vagrant
$ vagrant init centos/7
$ vagrant up

これでCentOS 7の公式イメージでVMが作れる

※ Vagrantfileを色々いじるのはまた今度

しばらく待って、終わったらひとまず空っぽのVM完成

$ vagrant ssh
[vagrant@localhost ~]$ pwd
/home/vagrant
[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

この先

VM上で設定いじったり色々インストールしたりしていく

最後に

頑張って継続していく

6
4
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
6
4