diff --git a/README.md b/README.md index 58cdb9d..dfb1795 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ to the IP address you will associate to your VM Launch the generation: - $ packer build misp.json + $ packer build -only=virtualbox-iso misp.json A VirtualBox image will be generated and stored in the folder *output-virtualbox-iso*. You can directly import it in VirtualBox. diff --git a/misp.json b/misp.json index 5fe7b8d..6044ec5 100644 --- a/misp.json +++ b/misp.json @@ -2,18 +2,22 @@ "variables": { "ssh_name": "packer", "ssh_pass": "packer", - "hostname": "packer" + "hostname": "packer", + "vm_name": "MISP_demo", + "disk_size": "10000" }, "builders": [{ "type": "virtualbox-iso", "guest_os_type": "Ubuntu_64", + "format": "ova", + "vm_name": "{{user `vm_name`}}", "vboxmanage": [ ["modifyvm", "{{.Name}}", "--vram", "32"] ], - "disk_size" : 10000, + "disk_size": "{{user `disk_size`}}", "iso_url": "http://releases.ubuntu.com/17.04/ubuntu-17.04-server-amd64.iso", "iso_checksum": "ca5d9a8438e2434b9a3ac2be67b5c5fa2c1f8e3e40b954519462935195464034", @@ -41,6 +45,42 @@ "keyboard-configuration/variant=USA console-setup/ask_detect=false ", "initrd=/install/initrd.gz -- " ] + }, + { + "type": "vmware-iso", + "guest_os_type": "ubuntu-64", + "vm_name": "{{user `vm_name`}}", + + "disk_size": "{{user `disk_size`}}", + + "iso_url": "http://releases.ubuntu.com/17.04/ubuntu-17.04-server-amd64.iso", + "iso_checksum": "ca5d9a8438e2434b9a3ac2be67b5c5fa2c1f8e3e40b954519462935195464034", + "iso_checksum_type": "sha256", + + "http_directory" : "preseeds", + "http_port_min" : 9001, + "http_port_max" : 9011, + + "ssh_username": "{{user `ssh_name`}}", + "ssh_password": "{{user `ssh_pass`}}", + "ssh_wait_timeout": "20m", + "ssh_pty" : "true", + + "shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now", + + "boot_command" : [ + "", + "/install/vmlinuz noapic ", + "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", + "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", + "hostname={{user `hostname`}} ", + "fb=false debconf/frontend=noninteractive ", + "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", + "keyboard-configuration/variant=USA console-setup/ask_detect=false ", + "initrd=/install/initrd.gz -- " + ], + + "skip_compaction": false } ],