参考記事
ほぼ以下の内容と一緒です
Mac × VagrantでWindows7 × IE11の環境をつくる!
手順
vagrant, VirtualBox をインストール
$ brew cask install vagrant
$ brew cask install virtualbox
# virtualbox のインストールに失敗する場合は不要なリポジトリを untap する
# ref: https://github.com/Homebrew/homebrew-cask/issues/66037
#
#$ brew untap caskroom/cask caskroom/versions
対象の box イメージをダウンロード、unzip
以下の例では Win7 IE11 をダウンロードしています。
# Vagrant - Win7 IE11
$ curl -OL https://az792536.vo.msecnd.net/vms/VMBuild_20190311/Vagrant/MSEdge/MSEdge.Win10.Vagrant.zip
$ unzip IE11.Win7.Vagrant.zip
直リンクで取れなかったら以下から vagrant → 任意の OS、ブラウザを選んでダウンロードする
作業ディレクトリ作成、VagrantFile を準備
$ mkdir win7_ie11; cd $_
$ vagrant init
$ cat > Vagrantfile
以下の内容をコピーペーストして Ctrl + D
Vagrantfile
Vagrant.configure("2") do |config|
# vagrant box addで追加したbox名を指定
config.vm.box = "win7_ie11"
# GUIの使用とメモリの設定
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "2048"
end
# ゲストOSを指定
config.vm.guest = "windows"
# SSHの設定
config.ssh.username = "IEUser"
config.ssh.password = "Passw0rd!"
config.ssh.insert_key = false
config.ssh.shell = 'sh -l'
end
ssh のID/パスワードが変わっていたら View installation instructions で確認して正しいものを入力する
起動
$ vagrant up
補足
- 共有フォルダはデフォルトで
host:<作業ディレクトリ>
→guest:C:\vagrant\
に設定される。
変更したい場合はconfig.vm.synced_folder
を設定する