Skip to content

Instantly share code, notes, and snippets.

@paina
Last active August 24, 2018 07:29
Show Gist options
  • Save paina/1d812fea78ed7262aad128ee53f15cd3 to your computer and use it in GitHub Desktop.
Save paina/1d812fea78ed7262aad128ee53f15cd3 to your computer and use it in GitHub Desktop.
Fixes VITOCHA OVA Image to work with VMware Fusion
#!/bin/sh
ORIGINAL_OVA=${1:-./InternetSim.ova}
DESTDIR=${2:-.}
tar -C $DESTDIR -xvf $ORIGINAL_OVA
cp -ip $DESTDIR/InternetSim.ovf $DESTDIR/InternetSim.ovf_ORG
sed -i "" 's/ovf:capacity="19326328320"/ovf:capacity="18" ovf:capacityAllocationUnits="GigaBytes"/' $DESTDIR/InternetSim.ovf
sed -i "" 's/ovf:capacity="21474836480"/ovf:capacity="20" ovf:capacityAllocationUnits="GigaBytes"/' $DESTDIR/InternetSim.ovf
OVF_NEW_SHA1=$(shasum $DESTDIR/InternetSim.ovf | cut -d" " -f1)
sed -i "_ORG" "s/65c31205755089edaa80f7c8b929ca10b768fa89/$OVF_NEW_SHA1/" $DESTDIR/InternetSim.mf
@paina
Copy link
Author

paina commented Aug 24, 2018

  1. このスクリプトと InternetSim.ova を同じディレクトリに置く(場所を変える場合は引数で指定)
  2. スクリプトを実行
  3. ごりごり動いた後の InternetSim.ovf を VMware Fusion でインポート(.ova では ない ことに注意)

で動くと思います。ファイルのハッシュ値含め全てがハードコードなので,現在のバージョンでしか動きません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment