-
Notifications
You must be signed in to change notification settings - Fork 31
/
vmware.sh
executable file
·44 lines (33 loc) · 1.42 KB
/
vmware.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
#
# This script build the VM without the GNS3 server installed
#
set -e
export PATH=$PATH:/Applications/VMware\ OVF\ Tool/
export GNS3VM_VERSION=`cat version`
echo "Build VM $GNS3VM_VERSION"
rm -Rf output-vmware-iso
packer build -only=vmware-iso gns3.json
rm -Rf output-vmware-ova
mkdir output-vmware-ova
# Packer bug on post_vmx in 0.8.x we apply a second time the settings to the OVA
# Also we force export to remove the CD ROM
ovftool \
--extraConfig:vhv.enable=true \
--extraConfig:ethernet0.connectionType=hostonly \
--extraConfig:ethernet1.present=true \
--extraConfig:ethernet1.startConnected=true \
--extraConfig:ethernet1.connectionType=nat \
--extraConfig:ethernet1.addressType=generated \
--extraConfig:ethernet1.generatedAddressOffset=10 \
--extraConfig:ethernet1.wakeOnPcktRcv=false \
--extraConfig:ethernet1.pciSlotNumber=33 \
--allowAllExtraConfig \
--noImageFiles \
--overwrite output-vmware-iso/GNS3\ VM.vmx output-vmware-ova/GNS3\ VM.ova
cd output-vmware-ova
echo "Fix OVA network"
python3 ../fix_vmware_ova_network.py "GNS3 VM.ova" "GNS3 VM FIX.ova"
mv "GNS3 VM FIX.ova" "GNS3 VM.ova"
zip -9 "../GNS3 VM VMware ${GNS3VM_VERSION}.zip" "GNS3 VM.ova"
rm -Rf output-*