公式のCreating a Base Boxを読んだ時の自分用メモなので、割と雑
ベースボックスの構成
Base box は最小限の構成にするべきで例えば
Linux のbox なら以下のものだけを含める
- Package manager
- SSH
- SSH user so Vagrant can connect
- Perhaps Chef, Puppet, etc. but not strictly required.
- プロバイダーによっては追加のソフトウェア例えばVirtualBoxならVirtual guest additions
ディスクスペース
可変で大きめのサイズ
メモリーサイズ
多くのプロバイダーではVagrantfileで変更できるのでデフォルトサイズは512MBとか小さい方が良い
オーディオやUSB コントローラ
不必要なハードウェアはオフにしておくべき。
多くの場合Vagrantfileで簡単に追加できる
デフォルトユーザーセッティング
パブリッシュするならばユーザー"vagrant"の作成、Root パスワード"vagrant"、password-less sudo、SSH-Tweaksの設定が必要。
だけど、個人的に使う分にはセキュリティリスクを上げるだけなので、これらの設定はむしろしないことが推奨。
Windows Box
vagrant がゲストOSとして公式にサポートしているWindowsOSは
- Windows 7
- Windows 8
- Windows Server 2008
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
設定
- Turn off UAC
- Disable complex passwords
- Disable "Shutdown Tracker"
- Disable "Server Manager" starting at login (for non-Core)
UACはコントロールパネルで無効にした後レジストリでもOFFにしないといけない
Windowsのバージョンが変わるとやり方も変わる可能性がある。
Windows8/8.1なら
reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /d 0 /t REG_DWORD /f /reg:64
Base WinRM Configuration
winrm quickconfig -q
winrm set winrm/config/winrs @{MaxMemoryPerShellMB="512"}
winrm set winrm/config @{MaxTimeoutms="1800000"}
winrm set winrm/config/service @{AllowUnencrypted="true"}
winrm set winrm/config/service/auth @{Basic="true"}
sc config WinRM start= auto
VirtualBox でBoxをつくる時の注意
VirtualBox Guest Additionsは必須
guest additions をインストールする前にlinux kernel headerとbasic developer tools が必要。
Ubuntuなら
sudo apt-get install linux-headers-$(uname -r) build-essential dkms