Instalamos paquetes necesarios para crear la máquina.
$ sudo pacman -S virtualbox dkms packer vagrant
Plugin de vagrant necesario para la máquina.
$ vagrant plugin install vagrant-reload
Clonamos el repositorio de github de metasploitable 3.
$ git clone https://github.com/rapid7/metasploitable3.git
La máquina se creará manualmente por lo que navegamos hasta aquí:
$ cd (lugar donde hemos clonado el repositorio)/packer/template
Empezamos a crear la máquina
$ packer build windows_2008_r2.json
Posiblemente tengamos el siguiente error:
Error: Failed to prepare build: "qemu"
1 error occurred:
\* Deprecated configuration key: 'iso_checksum_type'. Please call packer fix against your template to update your template to be compatible with the current version of Packer. Visit https://www.packer.io/docs/commands/fix/ for moredetail.
Lo solucionamos ejecutando el siguiente comando:
$ packer fix windows_2008_r2.json > new_windows_2008_r2.json
Volvemos a ejecutar packer y esperamos a que termine (tarda un buen rato):
$ packer build windows_2008_r2.json
Una vez terminado ejecutamos el siguiente comando:
$ vagrant add box ../builds/windows_2008_r2_virtualbox_0.1.0.box
Seguramente salte un error como este:
A name is required when adding a box file directly. Please pass the --name parameter to vagrant box add. See vagrant box add -h for more help.
Ejecutamos lo siguiente:
$ vagrant add box --name windows_server ../builds/windows_2008_r2_virtualbox_0.1.0.box
Y por último:
$ vagrant up
Y con esto ya tendríamos configuradas las máquinas tanto de Windows Server como de Ubuntu Server en VirtualBox
Al momento de escribir packer fix windows_2008_r2.json > new_windows_2008_r2.json. En él siguiente paso no habría que poner $ packer build new_windows_2008_r2.json?
Buenas Macman:
Gracias por visitarnos 🙂
Sobre tu pregunta, así es tal y como sale en el tutorial. Una vez que ejecutas el packer fix, ejecutas de nuevo el packer build y esperas un ratillo.
Un saludo.