設定中の自宅環境メモ

ググれば沢山出てくる内容ですが、 自分で行ったことを忘れてしまうので、 備忘録として残しておきます。 (次回書くときは、ちゃんとしたエントリーにせねば…)

  • スペック
  • 今回の前提環境
  • 思い立った経緯
  • 作業

スペック

OS: Windows 10 Home (x64) プロセッサ: Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz 3.30GHz メモリ: 8GB

今回の前提環境

WSL(Debian)インストール済み ターミナルはcmder(WSL)

思い立った経緯

rails tutorialやphpを動かしたい ↓ そろそろ自宅PCに開発環境が欲しいなー ↓ WSLでDebianをインストールしてあるが、 WSLではなく、完全なLinux上(CentOS上)で作業をしたい ↓ メモリ足りてないけど仮想環境を立ち上げてみるかー

作業

本当はちゃんと選定しないといけないんだけど、 環境にこだわって、整えたら満足しちゃう可能性があるので、 深く考えずにスコスコとインストールしていきます。

普段ソフトウェアの管理をChocolateyで行ってるので、 ChocolateyからVirtualBoxVagrantをインストール。

$ choco install virtualbox 
$ choco install vagrant

インストールが終わったら、バージョン確認

$ vagrant.exe -v

Vagrant 2.1.2

無事インストールが終わったみたいなので、 DドライブにCentOSインストール用のフォルダを作ってそこでインストール作業を行う。

$ cd /mnt/d
$ mkdir -p vagrant/centos7
$ vagrant.exe init centos/7
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
$ ls
Vagrantfile  vagrant
$ vagrant.exe up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos/7' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox

 :
 :
 :

==> default: Rsyncing folder: /cygdrive/d/ => /vagrant
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /cygdrive/d/
Guest path: /vagrant
Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--chmod=ugo=rwX" "--no-perms" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2222 -o LogLevel=FATAL   -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i 'D:/.vagrant/machines/default/virtualbox/private_key'" "--exclude" ".vagrant/" "/cygdrive/d/" "vagrant@127.0.0.1:/vagrant"

rsync あたりでエラー出てる。

$ sudo apt install rsync

もう一度 vagrant up を実行

$ vagrant.exe up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'centos/7' is up to date...

……ヨシ!

$ vagrant.exe status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
$

起動してるので問題なさそう。

$ vagrant.exe ssh
exit
^C
$

あれ、やっぱりうまくいかない…… VMを切って、中断。

眠いので、次回に続く。