[Vagrant & VirtualBox] MacにIEテスト環境を作る(ievms 編)
Modern.IE のセットアップが必要だったので、ievms を使ってみました。
結論的には、自分の環境と条件ではうまく動きませんでしたが、そこもログに残しておきます。
[markdown]
Virtual Box に必要なファイルをダウンロードして、必要な IE のバージョンが含まれるイメージを作ってくれるよう。
> * [xdissent/ievms · GitHub](https://github.com/xdissent/ievms)
2014 年は、IE 7 – 11 が必要そう。
最新の IE 11をインストールして、Developer Toolsの「BrowserMode」「Document Mode」で、IE7から10をまかなうつもり。
> * [MacにIEテスト環境を作る(VMware 編) | deadwood](https://www.d-wood.com/blog/2013/05/04_3501.html)
## インストール
調べてみると、ディスクスペースを結構とるみたいです。
ダウンロードにも時間がかかると思うので、バージョンを限定してみます。
“`prettyprinted
% curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | env IEVMS_VERSIONS=”11″ bash
Checking for VirtualBox
Checking for Oracle VM VirtualBox Extension Pack
Virtualbox version 4.3.8 found.
Downloading Oracle VM VirtualBox Extension Pack from http://download.virtualbox.org/virtualbox/4.3.8/Oracle_VM_VirtualBox_Extension_Pack-4.3.8.vbox-extpack to Oracle_VM_VirtualBox_Extension_Pack-4.3.8.vbox-extpack
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 –:–:– –:–:– –:–:– 0
100 9.9M 100 9.9M 0 0 2469k 0 0:00:04 0:00:04 –:–:– 4013k
Installing Oracle VM VirtualBox Extension Pack from /Users/****/.ievms/Oracle_VM_VirtualBox_Extension_Pack-4.3.8.vbox-extpack
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Successfully installed “Oracle VM VirtualBox Extension Pack”.
Downloading unar from http://theunarchiver.googlecode.com/files/unar1.5.zip to unar1.5.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4201k 100 4201k 0 0 1016k 0 0:00:04 0:00:04 –:–:– 1016k
Archive: unar1.5.zip
inflating: lsar
inflating: unar
Building IE11 VM
Checking for existing OVA at /Users/****/.ievms/IE9 – Win7.ova
Downloading OVA ZIP from http://virtualization.modern.ie/vhd/IEKitV1_Final/VirtualBox/OSX/IE9_Win7.zip to IE9_Win7.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4770M 100 4770M 0 0 3539k 0 0:23:00 0:23:00 –:–:– 3033kls
“`
なぜか IE9 – Win7 のダウンロードが始まる。
“`prettyprinted
Extracting OVA from /Users/****/.ievms/IE9_Win7.zip
IE9_Win7.zip: Zip
IE9 – Win7.ova (5079366144 B)… OK.
Successfully extracted to “./IE9 – Win7.ova”.
Checking for existing IE11 – Win7 VM
Creating IE11 – Win7 VM (disk: /Users/****/.ievms/IE11 – Win7-disk1.vmdk)
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Interpreting /Users/****/.ievms/IE9 – Win7.ova…
OK.
Disks: vmdisk1 135291469824 -1 http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized IE9 – Win7-disk1.vmdk -1 -1
Virtual system 0:
0: Suggested OS type: “Windows7”
(change with “–vsys 0 –ostype
1: VM name specified with –vmname: “IE11 – Win7”
2: Number of CPUs: 2
(change with “–vsys 0 –cpus
3: Guest memory: 1024 MB
(change with “–vsys 0 –memory
4: Sound card (appliance expects “”, can change on import)
(disable with “–vsys 0 –unit 4 –ignore”)
5: USB controller
(disable with “–vsys 0 –unit 5 –ignore”)
6: Network adapter: orig NAT, config 3, extra slot=0;type=NAT
7: CD-ROM
(disable with “–vsys 0 –unit 7 –ignore”)
8: IDE controller, type PIIX4
(disable with “–vsys 0 –unit 8 –ignore”)
9: IDE controller, type PIIX4
(disable with “–vsys 0 –unit 9 –ignore”)
10: SATA controller, type AHCI
(disable with “–vsys 0 –unit 10 –ignore”)
11: Hard disk image: source image=IE9 – Win7-disk1.vmdk, target path=/Users/****/.ievms/IE11 – Win7-disk1.vmdk, controller=10;channel=0
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Successfully imported the appliance.
Building IE11 – Win7 VM
build_ievm_ie11
Downloading ievms control ISO from https://dl.dropboxusercontent.com/u/463624/ievms-control-0.2.0.iso to /Users/****/.ievms/ievms-control-0.2.0.iso
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3504k 100 3504k 0 0 461k 0 0:00:07 0:00:07 –:–:– 740k
Attaching ievms control ISO
Starting VM IE11 – Win7
Waiting for VM “IE11 – Win7” to power on…
VM “IE11 – Win7” has been successfully started.
Waiting for IE11 – Win7 to shutdown…
Waiting for IE11 – Win7 to shutdown…
Waiting for IE11 – Win7 to shutdown…
“`
VirtualBox の再起動がうまく動かないようでスクリプトが止まっているよう。
手動で再起動やら、イジェクトやら行ってみる。
Windows のデスクトップも表示されていない状態。
“`prettyprinted
Ejecting ievms control ISO
Attaching Guest Additions
Starting VM IE11 – Win7
Waiting for VM “IE11 – Win7” to power on…
VM “IE11 – Win7” has been successfully started.
Waiting for IE11 – Win7 to shutdown…
Waiting for IE11 – Win7 to shutdown…
Waiting for IE11 – Win7 to shutdown…
Ejecting Guest Additions
Downloading IE11-Windows6.1-x86-en-us.exe from http://download.microsoft.com/download/9/2/F/92FC119C-3BCD-476C-B425-038A39625558/IE11-Windows6.1-x86-en-us.exe to IE11-Windows6.1-x86-en-us.exe
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 28.3M 100 28.3M 0 0 1753k 0 0:00:16 0:00:16 –:–:– 1852k
Starting VM IE11 – Win7
Waiting for VM “IE11 – Win7” to power on…
VM “IE11 – Win7” has been successfully started.
Waiting for IE11 – Win7 to be available for guestcontrol…
Waiting for IE11 – Win7 to be available for guestcontrol…
Waiting for IE11 – Win7 to be available for guestcontrol…
^C
“`
この後も動かないので強制終了。
VirtualBox の GUI から仮想マシンを起動してみます。
「IE11 – Win7 VM」という仮想マシンができたが、確認すると「IE9 – Win7」の構成でした。
## アンインストール
仮想マシンを停止して、ファイルをすべて削除しました。
“`prettyprinted
% rm -rf ~/VirtualBox\ VMs/IE11\ -\ Win7
% rm -rf ~/.ievms
“`
公式レポジトリをみたところ、同じような症状に関する issue がいろいろあがっていました。
## ievms を使わずにインストールする
公式をみながらインストールします。
MSサイトのダウンロードファイルのURLが変わることがあるように思うので、これくらいの手間ならば手動でもいいかな。
> * [Virtual Machine (VM), Windows Virtual PC & Browserstack | Modern.IE](http://www.modern.ie/en-us/virtualization-tools#downloads)
`Grab them all with cURL` を確認してファイルを一括ダウンロード。
“`prettyprinted
% pushd /tmp
% curl -O -L “http://www.modern.ie/vmdownload?platform=mac&virtPlatform=virtualbox&browserOS=IE11-Win7&parts=4&filename=VMBuild_20131127/VirtualBox/IE11_Win7/Mac/IE11.Win7.For.MacVirtualBox.part{1.sfx,2.rar,3.rar,4.rar}”
% chmod +x IE11.Win7.For.MacVirtualBox.part1.sfx
% ./IE11.Win7.For.MacVirtualBox.part1.sfx
% popd
“`
VirtualBox を起動し、「ファイル – 仮想アプライアンスのインポート」メニューから、.ova を登録します。
(選択時に /tmp を入力してから探せばOK)
> * [VirtualBox: VBoxManage を使って VM の登録と snapshot をとる | deadwood](https://www.d-wood.com/blog/2014/04/26_6097.html)
> * [MacにIEテスト環境を作る(VirtualBox 編) | deadwood](https://www.d-wood.com/blog/2014/01/27_5343.html)
インストール後は、日本語入力の設定が必要だったはず。
コントロールパネルから言語を追加することで入力可能となる。
* 「Setting」→「Control Panel」→「Add language」で日本語を選択。
あとは必要に応じてスナップショットをとっておきましょう。
[/markdown]