GithubHelp home page GithubHelp logo

rapid7 / metasploitable3 Goto Github PK

View Code? Open in Web Editor NEW
4.6K 310.0 1.1K 248.17 MB

Metasploitable3 is a VM that is built from the ground up with a large amount of security vulnerabilities.

License: Other

Batchfile 0.52% PowerShell 0.62% Ruby 22.61% HTML 75.57% Shell 0.54% Inno Setup 0.03% PHP 0.09% Crystal 0.03% Dockerfile 0.01% Classic ASP 0.01%

metasploitable3's Introduction

Metasploitable3

Metasploitable3 is a VM that is built from the ground up with a large amount of security vulnerabilities. It is intended to be used as a target for testing exploits with metasploit.

Metasploitable3 is released under a BSD-style license. See COPYING for more details.

Quick-start

To use the prebuilt images provided at https://app.vagrantup.com/rapid7/ create a new local metasploitable workspace:

Linux users:

mkdir metasploitable3-workspace
cd metasploitable3-workspace
curl -O https://raw.githubusercontent.com/rapid7/metasploitable3/master/Vagrantfile && vagrant up

Windows users:

mkdir metasploitable3-workspace
cd metasploitable3-workspace
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/rapid7/metasploitable3/master/Vagrantfile" -OutFile "Vagrantfile"
vagrant up

Or clone this repository and build your own box.

Building Metasploitable 3

System Requirements:

  • OS capable of running all of the required applications listed below
  • VT-x/AMD-V Supported Processor recommended
  • 65 GB Available space on drive
  • 4.5 GB RAM

Requirements:

To build automatically:

    • On Linux/OSX run ./build.sh windows2008 to build the Windows box or ./build.sh ubuntu1404 to build the Linux box. If /tmp is small, use TMPDIR=/var/tmp ./build.sh ... to store temporary packer disk images under /var/tmp.
    • On Windows, open powershell terminal and run .\build.ps1 windows2008 to build the Windows box or .\build.ps1 ubuntu1404 to build the Linux box. If no option is passed to the script i.e. .\build.ps1, then both the boxes are built.
  1. If both the boxes were successfully built, run vagrant up to start both. To start any one VM, you can use:
    • vagrant up ub1404 : to start the Linux box
    • vagrant up win2k8 : to start the Windows box
  2. When this process completes, you should be able to open the VM within VirtualBox and login. The default credentials are U: vagrant and P: vagrant.

To build manually:

  1. Clone this repo and navigate to the main directory.
  2. Build the base VM image by running packer build --only=<provider> ./packer/templates/windows_2008_r2.json where <provider> is your preferred virtualization platform. Currently virtualbox-iso, qemu, and vmware-iso providers are supported. This will take a while the first time you run it since it has to download the OS installation ISO.
  3. After the base Vagrant box is created you need to add it to your Vagrant environment. This can be done with the command vagrant box add packer/builds/windows_2008_r2_*_0.1.0.box --name=rapid7/metasploitable3-win2k8.
  4. Use vagrant plugin install vagrant-reload to install the reload vagrant provisioner if you haven't already.
  5. To start the VM, run the command vagrant up win2k8. This will start up the VM and run all of the installation and configuration scripts necessary to set everything up. This takes about 10 minutes.
  6. Once this process completes, you can open up the VM within VirtualBox and login. The default credentials are:
    • Username: vagrant
    • Password: vagrant

ub1404 Development and Modification

Using Vagrant and a lightweight Ubuntu 14.04 vagrant cloud box image, you can quickly set up and customize ub1404 Metasploitable3 for development or customization. To do so, install Vagrant and a hypervisor such as VirtualBox, VMWare, or libvirt.

Install the relevant provider plugin:

# virtualbox
vagrant plugin install vagrant-vbguest

# libvirt
vagrant plugin install vagrant-libvirt

Then, navigate to the chef/dev/ub1404 directory in this repository. Examine the Vagrantfile there. Select a base box that supports your provider.

Metasploitable ub1404 uses the vagrant chef-solo provisioner. Configure the chef_solo block in the Vagrantfile with the metasploitable chef recipes that you desire -- you can browse them in the chef/cookbooks/metasploitable folder. Or, add or edit your own cookbook and/or recipes there.

From the chef/dev/ub1404 directory, you can run vagrant up to get a development virtual ub1404 instance. After the initial up build and provision, when you edit the chef runlist or when you edit a chef recipe, run vagrant rsync && vagrant provision from the same directory. For faster development, you can comment-out recipes that you do not need to rerun -- but even if they are all enabled, vagrant re-provisioning should not take longer than one or two minutes. Chef aims to be idempotent, so you can rerun this command often.

Consider taking a snapshot (e.g., vagrant snapshot save fresh) before modifying recipes, so that you can always return to an initial state (vagrant restore fresh). If you want a totally fresh snapshot, you can do the initialization with vagrant up --no-provision, then take a snapshot, followed by vagrant provision.

Vulnerabilities

More Information

The wiki has a lot more detail and serves as the main source of documentation. Please check it out.

Acknowledgements

The Windows portion of this project was based off of GitHub user joefitzgerald's packer-windows project. The Packer templates, original Vagrantfile, and installation answer files were used as the base template and built upon for the needs of this project.

metasploitable3's People

Contributors

busterb avatar ch0mler avatar chan9390 avatar clong avatar commiebstrd avatar deargle avatar djschaap avatar elreydetoda avatar erran avatar fullstackinfo avatar jbarnett-r7 avatar jmartin-tech avatar jorgitux avatar justin- avatar kairat-beep avatar mattreduce avatar melkir avatar mkienow-r7 avatar ncharron avatar nkakouros avatar patersiul avatar pbarry-r7 avatar peterezzo avatar shahzebfarruk avatar simonirwin-r7 avatar sliim avatar tijldeneut avatar usmcfiredog avatar wchen-r7 avatar whaber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metasploitable3's Issues

Provisioning in vagrant versus packer?

Is there any particular rationale for doing most of the provisioning in the Vagrantfile instead of packer? I would have thought it made more sense to stick it all in packer so that vagrant can bring up a fully built box that is ready to go

Packer and Vagrant for AWS

Issue Description

Versions of the build files so that it can be built on AWS. AWS does have a Win 2008 R2 AMI available.

Fails to install when running Vagrant WinRM error

Run a couple of times elevated Powershell Any Ideas please

==> default: C:\Windows\system32>rd /s /q C:\axis2
==> default: Running provisioner: shell...
default: Running: inline PowerShell script
==> default: Running provisioner: shell...
default: Running: scripts/installs/install_backdoors.bat as c:\tmp\vagrant-shell.bat
==> default: C:\Windows\system32>copy C:\vagrant\resources\backdoors\caidao.asp "C:\inetpub\wwwroot"
==> default:
==> default: 1 file(s) copied.
==> default:
==> default: C:\Windows\system32>copy C:\vagrant\resources\backdoors\mma.php "C:\wamp\www"
==> default: 1 file(s) copied.
==> default:
==> default: C:\Windows\system32>copy C:\vagrant\resources\backdoors\meterpreter.php "C:\wamp\www"
==> default:
==> default: The system cannot find the file specified.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

c:\tmp\vagrant-shell.bat

Stdout from the command:

Stderr from the command:

VBoxManage: command not found

Hello my problem not working script or any program help please.

Host System

  • OS: Windows 10 Build 1607
  • Packer Version: packer_0.12.1_windows_amd64
  • Vagrant Version: vagrant_1.9.1
  • VirtualBox Version: Version 5.1.10 r112026 (Qt5.6.2)

Command Output

$ ./build_win2008.sh
./build_win2008.sh: line 50: VBoxManage: command not found
A compatible version of VirtualBox was not found. Please download and install it from https://www.virtualbox.org/

Vagrant Up Errors - Provisioning

Provisioning appears to fail on chocolatey install.

Host System

  • OS: Win8.1
  • Packer Version: 0.12
  • Vagrant Version: 1.8.7
  • VirtualBox Version: 5.1.8

PS C:\Users\dio\metasploitable3> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'metasploitable3'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: metasploitable3_default_1485558032186_28682
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 3389 (guest) => 3389 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
default: 5985 (guest) => 55985 (host) (adapter 1)
default: 5986 (guest) => 55986 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:55985
default: WinRM username: vagrant
default: WinRM execution_time_limit: PT2H
default: WinRM transport: negotiate
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/dio/metasploitable3
==> default: Running provisioner: shell...
default: Running: scripts/installs/chocolatey.cmd as c:\tmp\vagrant-shell.cmd
==> default: The argument 'C:\vagrant\scripts\installs\install_chocolatey.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.
==> default: Running provisioner: reload...
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 3389 (guest) => 3389 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
default: 5985 (guest) => 55985 (host) (adapter 1)
default: 5986 (guest) => 55986 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:55985
default: WinRM username: vagrant
default: WinRM execution_time_limit: PT2H
default: WinRM transport: negotiate
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/dio/metasploitable3
==> default: Machine already provisioned. Run vagrant provision or use the --provision
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Running provisioner: shell...
default: Running: scripts/installs/install_boxstarter.bat as c:\tmp\vagrant-shell.bat
==> default: C:\Windows\system32>chocolatey feature enable -n=allowGlobalConfirmation
==> default: 'chocolatey' is not recognized as an internal or external command,
==> default: operable program or batch file.
==> default:
==> default: C:\Windows\system32>choco install BoxStarter
==> default: 'choco' is not recognized as an internal or external command,
==> default: operable program or batch file.
==> default:
==> default: C:\Windows\system32>chocolatey feature disable -n=allowGlobalConfirmation
==> default: 'chocolatey' is not recognized as an internal or external command,
==> default: operable program or batch file.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

c:\tmp\vagrant-shell.bat

Stdout from the command:

Stderr from the command:

PS C:\Users\dio\metasploitable3>

Docker

Hey rapid7, what about publishing a Dockerfile so we can use docker?

VirtualBox Version typo?

The version check for VirtualBox in the build_win2008.sh script is set to "5.1.9", which isn't available via their repo for Ubuntu 15.04 LTS, the latest version available is 5.1.8. It's not available on the Downloads page of their site either. I saw the issue from yesterday regarding the version check looking for 5.1.6, so I was just wondering if someone might have made a typo in correcting the code.

If this is intentional, I guess my next question would be: How do I get VirtualBox 5.1.9?

Thanks in advance.

Problem with powershell

Issue Description

I can't execute the powershell

Host System

  • OS: Windows 10 Home. Version 1607
  • Packer Version: Packer v0.12.2
  • Vagrant Version: Vagrant 1.9.1
  • VirtualBox Version: Versiรณn 5.1.14 r112924 (Qt5.6.2)

Command Output

C:\Users\Agora\Desktop\metasploitable3-master\metasploitable3-master>powershell -executionpolicy bypass -File build_win2008.ps1
No se puede llamar a un mรฉtodo en una expresiรณn con valor NULL.
En C:\Users\Agora\Desktop\metasploitable3-master\metasploitable3-master\build_win2008.ps1: 17 Carรกcter: 5

  • $actualVersion = $actualVersion.split(".")
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : InvokeMethodOnNull

vagrant up: Exception calling "GetRequestStream" with "0" argument(s)

Issue Description

After running vagrant up for several minutes, it dies with an error from a powershell script
Exception calling "GetRequestStream" with "0" argument(s)

Host System

  • OS: Microsoft Windows [Version 10.0.14393]
  • Packer Version: 0.12.0
  • Vagrant Version: 1.8.7
  • VirtualBox Version: 5.1.6r110634

Command Output

==> default: C:\Windows\system32>powershell -Command "$req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/'); $req.method = 'PUT'; $req.GetResponse()"
==> default: Exception calling "GetResponse" with "0" argument(s): "Unable to connect to the
==> default: remote server"
==> default: At line:1 char:124
==> default: + $req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploita
==> default:
==> default: ble3/'); $req.method = 'PUT'; $req.GetResponse <<<< ()
==> default:
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
==> default: C:\Windows\system32>powershell -Command "$body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date": "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Ne
t.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.method = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream = $req.GetRequestStream(); $stream.Write($body, 0, $bo
dy.Length); $stream.close(); $req.GetResponse()"
==> default: Exception calling "GetRequestStream" with "0" argument(s): "Unable to connect t
==> default:
==> default: o the remote server"
==> default: At line:1 char:338
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream <<<< (); $stream.Write($body, 0, $body.Length); $stream
==> default: .close(); $req.GetResponse()
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
==> default: You cannot call a method on a null-valued expression.
==> default: At line:1 char:355
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write <<<< ($body, 0, $body.Length); $stream
==> default: .close(); $req.GetResponse()
==> default: + CategoryInfo : InvalidOperation: (Write:String) [], RuntimeExce
==> default: ption
==> default: + FullyQualifiedErrorId : InvokeMethodOnNull
==> default:
==> default: You cannot call a method on a null-valued expression.
==> default: At line:1 char:394
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close
==> default: <<<< (); $req.GetResponse()
==> default: + CategoryInfo : InvalidOperation: (close:String) [], RuntimeExce
==> default: ption
==> default: + FullyQualifiedErrorId : InvokeMethodOnNull
==> default:
==> default:
==> default: Exception calling "GetResponse" with "0" argument(s): "Unable to connect to the
==> default: remote server"
==> default: At line:1 char:414
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close
==> default: (); $req.GetResponse <<<< ()
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

c:\tmp\vagrant-shell.bat

Stdout from the command:

Stderr from the command:

BoxStarter not installed. The package was not found with the source(s) listed.

Hi,

I get an error when the provisioning process starts...

==> default: C:\Windows\system32>choco install BoxStarter
==> default: Chocolatey v0.10.3
==> default: Installing the following packages:
==> default:
==> default: BoxStarter
==> default: By installing you accept licenses for the packages.
==> default: BoxStarter not installed. The package was not found with the source(s) listed.
==> default:
==> default: If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
==> default: Version: ""
==> default: Source(s): "https://chocolatey.org/api/v2/"
==> default:
==> default: Chocolatey installed 0/1 packages. 1 packages failed.
==> default: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
==> default:
==> default: Failures
==> default: - BoxStarter - BoxStarter not installed. The package was not found with the source(s) listed.
==> default: If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.

I checked the connectivity on the VM, but everything is fine. Any ideas ?

System: OS X 10.11.6
VBox 5.1.8
Vagrant 1.8.6

Update 1

According to this issue: chocolatey/choco#1029, NAT seems to be the problem. I managed to manually install BoxStarter by changing my network adapter from NAT to Bridged, but of course it breaks Vagrant's port forward.

SSH hang on build.sh script

Issue Description

SSH Timing Out

Host System

MacOS Sierra 10.12.2 (16C67)
Version 5.1.10 r112026
Packer 0.12.1
Vagrant 1.9.1

Command Output

Using ./build provided script.

aegis58:metasploitable3 jamesrudisill$ ./build_win2008.sh
Compatible version of VirtualBox found.
Compatible version of packer was found.
Correct version of vagrant was found.
Compatible version of vagrant-reload plugin was found.
All requirements found. Proceeding...
Building the Vagrant box...
virtualbox-iso output will be in this color.

==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: http://download.microsoft.com/download/7/5/E/75EC4E54-5B02-42D6-8879-D8D3A25FBEF7/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
==> virtualbox-iso: Creating floppy disk...
virtualbox-iso: Copying files flatly from floppy_files
virtualbox-iso: Copying file: ./answer_files/2008_r2/Autounattend.xml
virtualbox-iso: Copying file: ./scripts/configs/microsoft-updates.bat
virtualbox-iso: Copying file: ./scripts/configs/win-updates.ps1
virtualbox-iso: Copying file: ./scripts/installs/openssh.ps1
virtualbox-iso: Copying file: ./resources/certs/oracle-cert.cer
virtualbox-iso: Copying file: ./resources/certs/gdig2.crt
virtualbox-iso: Copying file: ./resources/certs/comodorsadomainvalidationsecureserverca.crt
virtualbox-iso: Copying file: ./resources/certs/comodorsacertificationauthority.crt
virtualbox-iso: Copying file: ./resources/certs/addtrust_external_ca.cer
virtualbox-iso: Copying file: ./resources/certs/baltimore_ca.cer
virtualbox-iso: Copying file: ./resources/certs/digicert.cer
virtualbox-iso: Copying file: ./resources/certs/equifax.cer
virtualbox-iso: Copying file: ./resources/certs/globalsign.cer
virtualbox-iso: Copying file: ./resources/certs/gte_cybertrust.cer
virtualbox-iso: Copying file: ./resources/certs/microsoft_root_2011.cer
virtualbox-iso: Copying file: ./resources/certs/thawte_primary_root.cer
virtualbox-iso: Copying file: ./resources/certs/utn-userfirst.cer
virtualbox-iso: Done copying files from floppy_files
virtualbox-iso: Collecting paths from floppy_dirs
virtualbox-iso: Resulting paths from floppy_dirs : []
virtualbox-iso: Done copying paths from floppy_dirs
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Attaching floppy disk...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 2883)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1481930552 --memory 4096
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1481930552 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
virtualbox-iso: The VM will be run headless, without a GUI. If you want to
virtualbox-iso: view the screen of the VM, connect via VRDP without a password to
virtualbox-iso: 127.0.0.1:5992
==> virtualbox-iso: Waiting 2m0s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for SSH to become available...

iso error after "virtualbox-iso: Waiting for SSH to become available..."

i run build_win2008.ps1,it is ok until the command line give "virtualbox-iso: Waiting for SSH to become available...". but after that,the virsualbox give a system error like some file is lost.
i tried three times,it was always the same error.
so , i think the ISO file maybe bad.

then i download a new ISO from MSDN,but a new error come,it give me a error "something in file c:\panther\unattend.xml is not exist".

PS: anybody has a ISO file else can be used here?

build_win2008.ps1 Failing version check

Issue Description

The CompareVesrion function fails for me at the exact match check.
This is similar to issue #48 which was closed. However the updated version of the script does not work for me. It could be something weird on my system, not sure.

I did make a small change to the script and got it to work, see below:

function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False) {
    If ($exactMatch -eq $True) {
    	Write-Host "Exact Match"
        If ($actualVersion -eq $expectedVersion) {
            return $True
        } else {
            return $False
        }
    }
... snip ...

I simply changed If ($ExactMatch) { to If ($ExactMatch -eq $True) { which fixed the error I was having.

Again, this may just be some quirk on my system in particular, I'm not sure.

Host System

  • OS: Windows 7
  • Packer Version: 0.12.1
  • Vagrant Version: 1.9.1
  • VirtualBox Version: 5.1.12r112440

VMware support

Hi,
Can I assume that I can build the VM in VirtualBox, export it, and then import it into VMware?

Linux version?

I'd be happy to create a Linux version. Any preferences to distro? Ubuntu 16.04 is probably a good starting point, but i'd be interested to know if there are any other preferences

jenkins.exe is not recognized as an internal or external command,

"C:\Program Files\jenkins\jenkins.exe"' is not recognized as an internal or external command,
==> default: operable program or batch file.
==> default:
==> default: C:\Windows\system32>sc config jenkins start= auto
==> default: [SC] OpenService FAILED 1060:
==> default:
==> default: The specified service does not exist as an installed service.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

c:\tmp\vagrant-shell.bat

Stdout from the command:

Stderr from the command:

VirtualBox version check of the build_win2008.sh script fails on Debian (with solution)

Issue

On a Kali distro (reminder: that's Debian based) with VirtualBox v5.1.6 installed. When trying to build using the ./build_win2008.sh script, I get the following error message:

A compatible version of VirtualBox was not found. Currently only 5.1.6 is supported. Please download and install it from https://www.virtualbox.org/wiki/Download_Old_Builds_5_1.

Diagnosis

The script compares the minimal version of VirtualBox with the one installed on the system using VBoxManage -v. The output is piped to cut(1) to get a standard version number so the minimal (hardcoded) version and the installed version can be compared:

if compare_versions $(VBoxManage -v | cut -d'r' -f1) $min_virtualbox_ver true; then
    echo "Compatible version of VirtualBox found."
else
    echo "A compatible version of VirtualBox was not found. Currently only 5.1.6 is supported. Please download and install it from https://www.virtualbox.org/wiki/Download_Old_Builds_5_1."
    exit 1

While this may work on some systems, it does not work on Debian-based system because the version returned by VBoxManage follows this format: 3.2.1_Debianr123456. For example on my system:

VBoxManage -v
5.1.6_Debianr110634

Quick & dirty workarounds

Comment the part of the script that checks the VirtualBox version (or just the related exit 1 that is executed when the check fails).

Solution suggestions

Removing the release number **and** the _Debian string from VBoxManage -v output when checking the versions:

  • Sed(1): VBoxManage -v | sed -e 's/r.*//g' -e 's/_.*//g'
  • Cut(1): VBoxManage -v | cut -d 'r' -d '_' -f1
  • Awk(1)/Mawk(1): VBoxManage -v | awk -F[r_] '{print $1}'
  • Or even better, using a PCRE RegExp with Grep(1): VBoxManage -v | grep -Po '^\d.\d.\d'.

Also, the link in the error message when vagrant is not installed or when the version is not compatible is not correct:

A compatible version of vagrant was not found. Please download and install it from https://www.virtualbox.org/wiki/Downloads.

It should be:

A compatible version of vagrant was not found. Please download and install it from https://www.vagrantup.com/downloads.html.

Besides that, everything is working as expected. Thanks for the great work!

Windows license notice?

Since Windows Server is used I assume I must provide a legitimate license myself for it? While an evaluation copy may be usable that is only for a certain number of days.

Microsoft could also pull the ISO you download years down the road.

You may want to include in the README a disclaimer that the user is responsible for obtaining and following the Microsoft license terms.

Ruby errors while installing

This is where the errors start:

==> default: Running provisioner: shell...
default: Running: inline PowerShell script
==> default: Running provisioner: shell...
default: Running: scripts/installs/install_rails_server.bat as c:\tmp\vagrant-shell.bat
==> default: C:\Windows\system32>copy /Y C:\Vagrant\resources\rails_server\gemrc C:\Users\vagrant.gemrc
==> default:
==> default: 1 file(s) copied.
==> default:
==> default: C:\Windows\system32>cmd /C "C:\tools\ruby23\bin\gem.cmd install rails -v '4.1.1' --no-ri --no-rdoc"
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: C:\Windows\system32>cmd /C "C:\tools\ruby23\bin\gem.cmd install rake -v '11.3.0' --no-ri --no-rdoc" ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default:
==> default:
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install coffee-script-source -v '1.10.0' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install execjs -v '2.7.0' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default:
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install hike -v '1.2.3' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install multi_json -v '1.12.1' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install tilt -v '1.4.1' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install sass -v '3.2.19' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default:
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install sqlite3 -v '1.3.11' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install turbolinks-source -v '5.0.0' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default:
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install rdoc -f -v '4.2.2' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install coffee-script -v '2.4.1' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install uglifier -v '3.0.2' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install sprockets -v '2.12.4' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: undefined method unpack' for nil:NilClass
==> default:
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install turbolinks -v '5.0.1' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install sdoc -v '0.4.2' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install tzinfo-data -v '1.2016.7' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install jbuilder -v '2.6.0' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: undefined method unpack' for nil:NilClass
==> default:
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install coffee-rails -v '4.0.1' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install jquery-rails -v '3.1.4' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default:
==> default:
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install sass-rails -v '4.0.5' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install debug_inspector -v '0.0.2' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: undefined method unpack' for nil:NilClass
==> default:
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install binding_of_caller -v '0.7.2' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method unpack' for nil:NilClass ==> default: ==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install web-console -v '2.1.2' --no-ri --no-rdoc ==> default: ERROR: While executing gem ... (NoMethodError) ==> default: ==> default: undefined method unpack' for nil:NilClass
==> default: C:\Windows\system32>cmd /C C:\tools\ruby23\bin\gem.cmd install minitest -v '5.9.1' --no-ri --no-rdoc
==> default: ERROR: While executing gem ... (NoMethodError)
==> default:
==> default: undefined method `unpack' for nil:NilClass
==> default:
==> default: C:\Windows\system32>copy /Y C:\Vagrant\Resources\rails_server\sqlite3-1.3.11-x64-mingw32.gemspec C:\tools\ruby23\lib\ruby\gems\2.3.0\specifications
==> default: 1 file(s) copied.
==> default:
==> default:
==> default: C:\Windows\system32>C:\tools\ruby23\bin\rails.bat 4.1.1 new "C:\Program Files\Rails_Server"
==> default: 'C:\tools\ruby23\bin\rails.bat' is not recognized as an internal or external command,
==> default: operable program or batch file.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

Still digging in to this, but if anyone has any hints, please let me know.

vagrant up failing

Issue Description:
Executing vagrant up fails with the following error, the error starts at #Install Chocolatey

Host System:
OS: Windows 10 x64
Vagrant: 1.9.1
Packer: 0.12.1
VirtualBox: 5.1.12 r112440

Command Output:

PS C:\Users\XXXXXX\metasploitable3_git> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'metasploitable3'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: metasploitable3_git_default_1482476193913_36700
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 3389 (guest) => 3389 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
default: 5985 (guest) => 55985 (host) (adapter 1)
default: 5986 (guest) => 55986 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:55985
default: WinRM username: vagrant
default: WinRM execution_time_limit: PT2H
default: WinRM transport: negotiate
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/XXXXXX/metasploitable3_git
==> default: Running provisioner: shell...
default: Running: scripts/installs/chocolatey.cmd as c:\tmp\vagrant-shell.cmd
==> default: The argument 'C:\vagrant\scripts\installs\install_chocolatey.ps1' to the -File parameter does not exist. Pr
ovide the path to an existing '.ps1' file as an argument to the -File parameter.
==> default: Running provisioner: reload...
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 3389 (guest) => 3389 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
default: 5985 (guest) => 55985 (host) (adapter 1)
default: 5986 (guest) => 55986 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:55985
default: WinRM username: vagrant
default: WinRM execution_time_limit: PT2H
default: WinRM transport: negotiate
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/XXXXXX/metasploitable3_git
==> default: Machine already provisioned. Run vagrant provision or use the --provision
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Running provisioner: shell...
default: Running: scripts/installs/install_boxstarter.bat as c:\tmp\vagrant-shell.bat
==> default: C:\Windows\system32>chocolatey feature enable -n=allowGlobalConfirmation
==> default: 'chocolatey' is not recognized as an internal or external command,
==> default: operable program or batch file.
==> default:
==> default: C:\Windows\system32>choco install BoxStarter
==> default: 'choco' is not recognized as an internal or external command,
==> default: operable program or batch file.
==> default:
==> default: C:\Windows\system32>chocolatey feature disable -n=allowGlobalConfirmation
==> default: 'chocolatey' is not recognized as an internal or external command,
==> default: operable program or batch file.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

c:\tmp\vagrant-shell.bat

Stdout from the command:

Stderr from the command:

PS C:\Users\XXXXXX\metasploitable3_git>

vagrant up ? problem

Issue Description

Firstly build the packer. \ Windows_2008_r2.json
Vagrant box add after. \ Windows_2008_r2_virtualbox.box --name = metasploitable3
Finally, I run the vagrant up commands, but how do I resolve the vagrant up error?

Host System

OS: Windows 10 Build 1607
Packer Version: packer_0.12.1_windows_amd64
Vagrant Version: vagrant_1.9.1
VirtualBox Version: Version 5.1.10 r112026 (Qt5.6.2)

Command Output

PS D:\metasploitable3> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:

  • The 'reload' provisioner could not be found.
  • The 'reload' provisioner could not be found.

An error occurred while downloading the remote file.

I get to the same point with the auto build or manual build:
โžœ git-metasploitable3 git:(master) ./build_win2008.sh
Compatible version of VirtualBox found.
Compatible version of packer was found.
Correct version of vagrant was found.
A compatible version of vagrant-reload plugin was not found.
Attempting to install...
Installing the 'vagrant-reload' plugin. This can take a few minutes...
Installed the plugin 'vagrant-reload (0.0.1)'!
Successfully installed the vagrant-reload plugin.
All requirements found. Proceeding...
Building the Vagrant box...
virtualbox-iso output will be in this color.

==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: http://download.microsoft.com/download/7/5/E/75EC4E54-5B02-42D6-8879-D8D3A25FBEF7/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
virtualbox-iso: Download progress: 1%
virtualbox-iso: Download progress: 3%

virtualbox-iso: Download progress: 100%
==> virtualbox-iso: Creating floppy disk...
virtualbox-iso: Copying files flatly from floppy_files
virtualbox-iso: Copying file: ./answer_files/2008_r2/Autounattend.xml
virtualbox-iso: Copying file: ./scripts/configs/microsoft-updates.bat
virtualbox-iso: Copying file: ./scripts/configs/win-updates.ps1
virtualbox-iso: Copying file: ./scripts/installs/openssh.ps1
virtualbox-iso: Copying file: ./resources/certs/oracle-cert.cer
virtualbox-iso: Copying file: ./resources/certs/gdig2.crt
virtualbox-iso: Copying file: ./resources/certs/comodorsadomainvalidationsecureserverca.crt
virtualbox-iso: Copying file: ./resources/certs/comodorsacertificationauthority.crt
virtualbox-iso: Copying file: ./resources/certs/addtrust_external_ca.cer
virtualbox-iso: Copying file: ./resources/certs/baltimore_ca.cer
virtualbox-iso: Copying file: ./resources/certs/digicert.cer
virtualbox-iso: Copying file: ./resources/certs/equifax.cer
virtualbox-iso: Copying file: ./resources/certs/globalsign.cer
virtualbox-iso: Copying file: ./resources/certs/gte_cybertrust.cer
virtualbox-iso: Copying file: ./resources/certs/microsoft_root_2011.cer
virtualbox-iso: Copying file: ./resources/certs/thawte_primary_root.cer
virtualbox-iso: Copying file: ./resources/certs/utn-userfirst.cer
virtualbox-iso: Done copying files from floppy_files
virtualbox-iso: Collecting paths from floppy_dirs
virtualbox-iso: Resulting paths from floppy_dirs : []
virtualbox-iso: Done copying paths from floppy_dirs
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Attaching floppy disk...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 2916)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1479227155 --memory 2048
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1479227155 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
virtualbox-iso: The VM will be run headless, without a GUI. If you want to
virtualbox-iso: view the screen of the VM, connect via VRDP without a password to
virtualbox-iso: 127.0.0.1:5991
==> virtualbox-iso: Waiting 2m0s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for SSH to become available...
==> virtualbox-iso: Connected to SSH!
==> virtualbox-iso: Uploading VirtualBox version info (5.1.6)
==> virtualbox-iso: Uploading VirtualBox guest additions ISO...
==> virtualbox-iso: Provisioning with shell script: ./scripts/installs/vm-guest-tools.bat
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>if not exist "C:\Windows\Temp\7z920-x64.msi" (powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" 0<NUL )
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>msiexec /qb /i C:\Windows\Temp\7z920-x64.msi
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>if "virtualbox-iso" EQU "vmware-iso" goto :vmware
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>if "virtualbox-iso" EQU "virtualbox-iso" goto :virtualbox
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "TrustedPublisher" A:\oracle-cert.cer
virtualbox-iso: TrustedPublisher
virtualbox-iso: Certificate "CN=Oracle Corporation, OU=VirtualBox, OU=Digital ID Class 3 - Microsoft Software Validation v2, O=Oracle Corporation, L=Redwood Shores, S=California, C=US" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
virtualbox-iso: 1 file(s) moved.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
virtualbox-iso:
virtualbox-iso: 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
virtualbox-iso:
virtualbox-iso: Processing archive: C:\Windows\Temp\VBoxGuestAdditions.iso
virtualbox-iso:
virtualbox-iso: Extracting 32Bit
virtualbox-iso: Extracting 32Bit\Readme.txt
virtualbox-iso: Extracting 64Bit
virtualbox-iso: Extracting 64Bit\Readme.txt
virtualbox-iso: Extracting AUTORUN.INF
virtualbox-iso: Extracting OS2
virtualbox-iso: Extracting OS2\VBoxControl.exe
virtualbox-iso: Extracting OS2\VBoxGuest.sys
virtualbox-iso: Extracting OS2\VBoxReplaceDll.exe
virtualbox-iso: Extracting OS2\VBoxService.exe
virtualbox-iso: Extracting OS2\gengradd.dll
virtualbox-iso: Extracting OS2\libc06.dll
virtualbox-iso: Extracting OS2\libc061.dll
virtualbox-iso: Extracting OS2\libc062.dll
virtualbox-iso: Extracting OS2\libc063.dll
virtualbox-iso: Extracting OS2\libc064.dll
virtualbox-iso: Extracting OS2\libc065.dll
virtualbox-iso: Extracting OS2\libc066.dll
virtualbox-iso: Extracting OS2\readme.txt
virtualbox-iso: Extracting OS2\vboxmouse.sys
virtualbox-iso: Extracting VBoxLinuxAdditions.run
virtualbox-iso: Extracting VBoxSolarisAdditions.pkg
virtualbox-iso: Extracting VBoxWindowsAdditions-amd64.exe
virtualbox-iso: Extracting VBoxWindowsAdditions-x86.exe
virtualbox-iso: Extracting VBoxWindowsAdditions.exe
virtualbox-iso: Extracting autorun.sh
virtualbox-iso: Extracting cert
virtualbox-iso: Extracting cert\VBoxCertUtil.exe
virtualbox-iso: Extracting cert\oracle-vbox.cer
virtualbox-iso: Extracting runasroot.sh
virtualbox-iso:
virtualbox-iso: Everything is Ok
virtualbox-iso:
virtualbox-iso: Folders: 4
virtualbox-iso: Files: 26
virtualbox-iso: Size: 58848147
virtualbox-iso: Compressed: 59258880
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>goto :done
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>msiexec /qb /x C:\Windows\Temp\7z920-x64.msi
==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/vagrant-ssh.bat
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>if exist a:\vagrant.pub (copy a:\vagrant.pub C:\Users\vagrant.ssh\authorized_keys ) else (powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant.ssh\authorized_keys')" 0<NUL )
==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/disable-auto-logon.bat
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /d 0 /f
virtualbox-iso: The operation completed successfully.
==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/enable-rdp.bat
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389
virtualbox-iso: Ok.
virtualbox-iso:
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
virtualbox-iso: The operation completed successfully.
==> virtualbox-iso: Provisioning with shell script: ./scripts/configs/update_root_certs.bat
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\addtrust_external_ca.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "CN=AddTrust External CA Root, OU=AddTrust External TTP Network, O=AddTrust AB, C=SE" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\baltimore_ca.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "CN=Baltimore CyberTrust Root, OU=CyberTrust, O=Baltimore, C=IE" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\digicert.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "CN=DigiCert Assured ID Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\equifax.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "OU=Equifax Secure Certificate Authority, O=Equifax, C=US" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\globalsign.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "CN=GlobalSign Root CA, OU=Root CA, O=GlobalSign nv-sa, C=BE" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\gte_cybertrust.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "CN=GTE CyberTrust Global Root, OU="GTE CyberTrust Solutions, Inc.", O=GTE Corporation, C=US" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\microsoft_root_2011.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "CN=Microsoft Root Certificate Authority 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\thawte_primary_root.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "CN=thawte Primary Root CA - G3, OU="(c) 2008 thawte, Inc. - For authorized use only", OU=Certification Services Division, O="thawte, Inc.", C=US" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>cmd /c certutil -addstore -f "Root" A:\utn-userfirst.cer
virtualbox-iso: Root
virtualbox-iso: Signature matches Public Key
virtualbox-iso: Certificate "CN=UTN-USERFirst-Object, OU=http://www.usertrust.com, O=The USERTRUST Network, L=Salt Lake City, S=UT, C=US" added to store.
virtualbox-iso: CertUtil: -addstore command completed successfully.
==> virtualbox-iso: Gracefully halting virtual machine...
virtualbox-iso: Removing floppy drive...
==> virtualbox-iso: Preparing to export machine...
virtualbox-iso: Deleting forwarded port mapping for the communicator (SSH, WinRM, etc) (host port 2916)
==> virtualbox-iso: Exporting virtual machine...
virtualbox-iso: Executing: export packer-virtualbox-iso-1479227155 --output output-virtualbox-iso/packer-virtualbox-iso-1479227155.ovf
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Running post-processor: vagrant
==> virtualbox-iso (vagrant): Creating Vagrant box for 'virtualbox' provider
virtualbox-iso (vagrant): Copying from artifact: output-virtualbox-iso/packer-virtualbox-iso-1479227155-disk1.vmdk
virtualbox-iso (vagrant): Copying from artifact: output-virtualbox-iso/packer-virtualbox-iso-1479227155.ovf
virtualbox-iso (vagrant): Renaming the OVF to box.ovf...
virtualbox-iso (vagrant): Using custom Vagrantfile: vagrantfile-windows_2008_r2.template
virtualbox-iso (vagrant): Compressing: Vagrantfile
virtualbox-iso (vagrant): Compressing: box.ovf
virtualbox-iso (vagrant): Compressing: metadata.json
virtualbox-iso (vagrant): Compressing: packer-virtualbox-iso-1479227155-disk1.vmdk
Build 'virtualbox-iso' finished.

==> Builds finished. The artifacts of successful builds are:
--> virtualbox-iso: 'virtualbox' provider box: windows_2008_r2_virtualbox.box
Box successfully built by Packer.
Attempting to add the box to Vagrant...
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'metasploitable3' (v0) for provider:
box: Unpacking necessary files from: file:///Users/Bryan/git-metasploitable3/windows_2008_r2_virtualbox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.


Same error occurs building manually...

Vagrant-reload : Unable to resolve dependency

Issue Description

Error during the vagrant plugin installation

Host System

  • OS: Ubuntu 16.04.1 LTS
  • Packer Version: 0.12.0
  • Vagrant Version: Vagrant 1.9.0
  • VirtualBox Version: 5.1.10

Command Output

I have installed Vagrant, Packer and VirtualBox on Ubuntu and tried to run the bash script. I get the output as:

user@desktop:~/metasploitable3$ bash build_win2008.sh 
Compatible version of VirtualBox found.
Compatible version of packer was found.
Correct version of vagrant was found.
A compatible version of vagrant-reload plugin was not found.
Attempting to install...
Installing the 'vagrant-reload' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

Unable to resolve dependency: user requested 'vagrant-reload (> 0)'
There was an error installing the vagrant-reload plugin. Please see the above output for more information.

Failure at vagrant up - ElasticSearch/WinRM

Issue Description

Failure occurred after executing vagrant up

Host System

  • OS: Linux kali 4.7.0-kali1-amd64 #1 SMP Debian 4.7.8-1kali1 (2016-10-24) x86_64 GNU/Linux
  • Packer Version: 0.12.0
  • Vagrant Version: 1.9.1
  • VirtualBox Version: 5.1.10

Command Output

==> default: The service 'elasticsearch-service-x64' has been installed.
==> default:
==> default: C:\Windows\system32>sc config "elasticsearch-service-x64" start= auto
==> default:
==> default: [SC] ChangeServiceConfig SUCCESS
==> default: C:\Windows\system32>cmd /c ""C:\Program Files\elasticsearch-1.1.1\bin\service.bat" start"
==> default: The service 'elasticsearch-service-x64' has been started
==> default:
==> default: C:\Windows\system32>powershell -Command "Start-Sleep -s 5"
==> default: C:\Windows\system32>powershell -Command "$req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/'); $req.method = 'PUT'; $req.GetResponse()"
==> default: Exception calling "GetResponse" with "0" argument(s): "Unable to connect to the
==> default:
==> default: remote server"
==> default: At line:1 char:124
==> default: + $req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploita
==> default: ble3/'); $req.method = 'PUT'; $req.GetResponse <<<< ()
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
==> default: C:\Windows\system32>powershell -Command "$body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date": "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.method = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close(); $req.GetResponse()"
==> default: Exception calling "GetRequestStream" with "0" argument(s): "Unable to connect t
==> default:
==> default: o the remote server"
==> default: At line:1 char:338
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default:
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream <<<< (); $stream.Write($body, 0, $body.Length); $stream
==> default:
==> default: .close(); $req.GetResponse()
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
==> default: You cannot call a method on a null-valued expression.
==> default: At line:1 char:355
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default:
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write <<<< ($body, 0, $body.Length); $stream
==> default: .close(); $req.GetResponse()
==> default:
==> default: + CategoryInfo : InvalidOperation: (Write:String) [], RuntimeExce
==> default: ption
==> default: + FullyQualifiedErrorId : InvokeMethodOnNull
==> default:
==> default: You cannot call a method on a null-valued expression.
==> default: At line:1 char:394
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default:
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close
==> default: <<<< (); $req.GetResponse()
==> default: + CategoryInfo : InvalidOperation: (close:String) [], RuntimeExce
==> default: ption
==> default:
==> default: + FullyQualifiedErrorId : InvokeMethodOnNull
==> default:
==> default: Exception calling "GetResponse" with "0" argument(s): "Unable to connect to the
==> default: remote server"
==> default: At line:1 char:414
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close
==> default: (); $req.GetResponse <<<< ()
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

c:\tmp\vagrant-shell.bat

Stdout from the command:

Stderr from the command:

Error Message

Following the execution of vagrant up which seems to complete with no errors, i receive the following error messages when attempting to start the VM in Virtual Box:

Failed to open a session for the virtual machine metasploitable3_default_1480289896790_89030.

Callee RC: E_FAIL (0x80004005)

Failed to open a session for the virtual machine metasploitable3_default_1480289896790_89030.

The VM session was aborted.

Result Code: E_FAIL (0x80004005)
Component: SessionMachine
Interface: ISession {7844aa05-b02e-4cdd-a04f-ade4a762e6b7}

Any idea what could be the cause? I've installed on a Win 7 Professional OS w/16GB RAM and over 100GB of free disk space.

WinRM 2.1.1 and WinRM-fs 1.0.1

Issue Description

With these updated plugins the "vagrant up" crashes.
So I have to downgrade to WinRM 1.8.1 and WinRM-fs 0.4.3.
(vagrant plugin install winrm --plugin-version=1.8.1)
(vagrant plugin install winrm-fs)
Now it seems to be working.

Host System

  • OS: Linux kali 4.8.0-kali2-amd64
  • Packer Version: 0.12.1
  • Vagrant Version: 1.9.0
  • VirtualBox Version: 5.1.10

Command Output

==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:55985
default: WinRM username: vagrant
default: WinRM execution_time_limit: PT2H
default: WinRM transport: negotiate
==> default: Running cleanup tasks for 'reload' provisioner...
==> default: Running cleanup tasks for 'reload' provisioner...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
/usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/communicators/winrm/shell.rb:169:in new_session': uninitialized constant WinRM::WinRMWebService (NameError) Did you mean? WinRM::WinRMWMIError from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/communicators/winrm/shell.rb:176:in session'
from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/communicators/winrm/shell.rb:65:in cmd' from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/communicators/winrm/communicator.rb:107:in block in ready?'
from /usr/lib/ruby/2.3.0/timeout.rb:91:in block in timeout' from /usr/lib/ruby/2.3.0/timeout.rb:33:in block in catch'
from /usr/lib/ruby/2.3.0/timeout.rb:33:in catch' from /usr/lib/ruby/2.3.0/timeout.rb:33:in catch'
from /usr/lib/ruby/2.3.0/timeout.rb:106:in timeout' from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/communicators/winrm/communicator.rb:106:in ready?'
from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/communicators/winrm/communicator.rb:57:in block in wait_for_ready' from /usr/lib/ruby/2.3.0/timeout.rb:91:in block in timeout'
from /usr/lib/ruby/2.3.0/timeout.rb:33:in block in catch' from /usr/lib/ruby/2.3.0/timeout.rb:33:in catch'
from /usr/lib/ruby/2.3.0/timeout.rb:33:in catch' from /usr/lib/ruby/2.3.0/timeout.rb:106:in timeout'
from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/communicators/winrm/communicator.rb:31:in wait_for_ready' from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in block in call'
from /home/kalango/.vagrant.d/gems/2.3.3/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `block in create_with_logging_context'

Unable to add box via vagrant

Issue Description

After building the ISO when I issued box add command via Vagrant by issuing the following command: vagrant box add .\windows_2008_r2_virtualbox.box --name=metasploitable3 it throws an error

Host System

  • OS: Windows 7 SP1 64 bit
  • Packer Version: v0.12.0
  • Vagrant Version: 1.9.1
  • VirtualBox Version: 5.1.10

Command Output

2016-12-10 18_29_27-windows powershell

Use Ansible, Puppet etc. for provisioning

Given that two objectives of this project are:

  1. support multiple operating systems
  2. support multiple levels of difficulty

it may be beneficial to consider the use of a more robust provisioning system such as Puppet or Ansible.

I'm going to start looking at Linux support (#37) and would like to consider whether to:

  1. just use shell scripts for provisioning
  2. use puppet
  3. use ansible

The current Windows setup is not idempotent and repeated provisioning will result in errors.

Puppet and ansible have their pros and cons.

Puppet - cross platform, no additional requirements on the host but the configuration language is more complex
Ansible - very simple YAML configuration, no software required on the guest, but additional dependencies required on the host environment

Both would allow a lot of flexibility in terms of conditional installation or starting of services.

A good example of how ansible can be used is in the Streisand project.

Before I start with Linux support (#37), it would be great to hear if anyone has a strong opinion either way. Personally, I think Ansible is probably best as long as nobody cares about the extra dependency on the host.

Build Script build_win2008.ps1: Version comparison not working

In Powershell (on W8.1), the build script fails when comparing the versions of e.g. VirtualBox in the CompareVersions function.

When $exactMatch is set to $True, the check $actualVersion -eq $expectedVersion fails because the strings are split and the resulting lists can't be compared with -eq.

This can be fixed by moving the splitting of $actualVersion and $expectedVersion after the first If-block.

function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False) {
	If ($exactMatch) {
		If ($actualVersion -eq $expectedVersion) {
			return $True
		} else {
			return $False
		}
	}

	$actualVersion = $actualVersion.split(".")
	$expectedVersion = $expectedVersion.split(".")

	for($i=0; $i -le $expectedVersion.length; $i++) {
		If([INT]$actualVersion[$i] -gt [INT]$expectedVersion[$i]) {
			return $True
		}

		If([INT]$actualVersion[$i] -lt [INT]$expectedVersion[$i]) {
			return $False
		}
	}
	return $True
}

Vagrant up Error

Issue Description

Vagrant up fails at this point after executing WinRM.
I'm already using the new version with the WinRm 1.8.1 fix.

Host System

  • OS: Win7 x64
  • Packer Version: 0.12.1
  • Vagrant Version: 1.9.0
  • VirtualBox Version: 5.1.12

Command Output

INFO warden: Calling OUT action: #<Proc:0x498e70@C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:94 (lambda)>
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::Call:0x43081c8>
 INFO warden: Calling OUT action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckVirtualbox:0x43081e0>
 INFO warden: Recovery complete.
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x45c3300>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: undefined method `split' for nil:NilClass

Please find the detailed log file here

and the Vagrant screen output here.

iso md5 error

when i run the build_win2008.ps1,it response error like this:

virtualbox-iso: Error downloading: checksums didn't match expected: 4263be2cf3c59177c45085c0a7bc6ca5
==> virtualbox-iso: ISO download failed.
Build 'virtualbox-iso' errored: ISO download failed.

then i download the iso manually and make a md5,it is not equal 4263be2cf3c59177c45085c0a7bc6ca5,so i think the content in the file windows_2008_r2.json is wrong. or the ISO file in bad?!

it continue correctly after i give a new md5.

Build Script usage of comparison function bug

Issue Description

The function in the powershell build script is called as follows (line 38):
If (CompareVersions -actualVersion $vboxVersion -expectedVersion $virtualBoxMinVersion --exactMatch $False)
which sets the value of exactMath to "--exactMatch" instead of $False.

The correct usage is:
If (CompareVersions -actualVersion $vboxVersion -expectedVersion $virtualBoxMinVersion -exactMatch $False)

Secondly, I had to manually install the guest additions for virtualbox to make the shared folder link work for the vagrant scripts.

Tomcat Server Failure with provisioning 'C:\ProgramData\chocolatey\lib\Tomcat\tools\chocolateyInstall.ps1'.

==> default: Download of apache-tomcat-8.0.33-windows-x64.zip (10.37 MB) completed.
==> default: Hashes match.
==> default: Extracting C:\Users\vagrant\AppData\Local\Temp\chocolatey\Tomcat\8.0.33\apache-tomcat-8.0.33-windows-x64.zip to C:\Program Files\Apache Software Foundation\tomcat...
==> default: C:\Program Files\Apache Software Foundation\tomcat
==> default: #< CLIXML
==> default: Host version is 2.0, PowerShell Version is '2.0' and CLR Version is '2.0.50727.5420'.Exporting function 'Format-FileSize'.Exporting function 'Get-ChecksumValid'.Exporting function 'Get-ChocolateyUnzip'.Exporting function 'Get-ChocolateyWebFile'.Exporting function 'Get-EnvironmentVariable'.Exporting function 'Get-EnvironmentVariableNames'.Exporting function 'Get-FtpFile'.Exporting function 'Get-OSArchitectureWidth'.Exporting function 'Get-ToolsLocation'.Exporting function 'Get-UACEnabled'.Exporting function 'Get-UninstallRegistryKey'.Exporting function 'Get-VirusCheckValid'.Exporting function 'Get-WebFile'.Exporting function 'Get-WebFileName'.Exporting function 'Get-WebHeaders'.Exporting function 'Install-BinFile'.Exporting function 'Install-ChocolateyDesktopLink'.Exporting function 'Install-ChocolateyEnvironmentVariable'.Exporting function 'Install-ChocolateyExplorerMenuItem'.Exporting function 'Install-ChocolateyFileAssociation'.Exporting function 'Install-ChocolateyInstallPackage'.Exporting function 'Install-ChocolateyPackage'.Exporting function 'Install-ChocolateyPath'.Exporting function 'Install-ChocolateyPinnedTaskBarItem'.Exporting function 'Install-ChocolateyPowershellCommand'.Exporting function 'Install-ChocolateyShortcut'.Exporting function 'Install-ChocolateyVsixPackage'.Exporting function 'Install-ChocolateyZipPackage'.Exporting function 'Install-Vsix'.Exporting function 'Set-EnvironmentVariable'.Exporting function 'Set-PowerShellExitCode'.Exporting function 'Start-ChocolateyProcessAsAdmin'.Exporting function 'Test-ProcessAdminRights'.Exporting function 'Uninstall-BinFile'.Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.Exporting function 'Uninstall-ChocolateyPackage'.Exporting function 'Uninstall-ChocolateyZipPackage'.Exporting function 'Update-SessionEnvironment'.Exporting function 'Write-ChocolateyFailure'.Exporting function 'Write-ChocolateySuccess'.Exporting function 'Write-FileUpdateLog'.Exporting function 'Write-FunctionCallLogMessage'.Exporting alias 'Get-ProcessorBits'.Exporting alias 'Get-OSBitness'.Exporting alias 'Get-InstallRegistryKey'.Exporting alias 'Generate-BinFile'.Exporting alias 'Add-BinFile'.Exporting alias 'Start-ChocolateyProcess'.Exporting alias 'Invoke-ChocolateyProcess'.Exporting alias 'Remove-BinFile'.Exporting alias 'refreshenv'.Importing function 'Format-FileSize'.Importing function 'Get-ChecksumValid'.Importing function 'Get-ChocolateyUnzip'.Importing function 'Get-ChocolateyWebFile'.Importing function 'Get-EnvironmentVariable'.Importing function 'Get-EnvironmentVariableNames'.Importing function 'Get-FtpFile'.Importing function 'Get-OSArchitectureWidth'.Importing function 'Get-ToolsLocation'.Importing function 'Get-UACEnabled'.Importing function 'Get-UninstallRegistryKey'.Importing function 'Get-VirusC
==> default: heckValid'.
Importing function 'Get-WebFile'.Importing function 'Get-WebFileName'.Importing function 'Get-WebHeaders'.Importing function 'Install-BinFile'.Importing function 'Install-ChocolateyDesktopLink'.Importing function 'Install-ChocolateyEnvironmentVariable'.Importing function 'Install-ChocolateyExplorerMenuItem'.Importing function 'Install-ChocolateyFileAssociation'.Importing function 'Install-ChocolateyInstallPackage'.Importing function 'Install-ChocolateyPackage'.Importing function 'Install-ChocolateyPath'.Importing function 'Install-ChocolateyPinnedTaskBarItem'.Importing function 'Install-ChocolateyPowershellCommand'.Importing function 'Install-ChocolateyShortcut'.Importing function 'Install-ChocolateyVsixPackage'.Importing function 'Install-ChocolateyZipPackage'.Importing function 'Install-Vsix'.Importing function 'Set-EnvironmentVariable'.Importing function 'Set-PowerShellExitCode'.Importing function 'Start-ChocolateyProcessAsAdmin'.Importing function 'Test-ProcessAdminRights'.Importing function 'Uninstall-BinFile'.Importing function 'Uninstall-ChocolateyEnvironmentVariable'.Importing function 'Uninstall-ChocolateyPackage'.Importing function 'Uninstall-ChocolateyZipPackage'.Importing function 'Update-SessionEnvironment'.Importing function 'Write-ChocolateyFailure'.Importing function 'Write-ChocolateySuccess'.Importing function 'Write-FileUpdateLog'.Importing function 'Write-FunctionCallLogMessage'.Importing alias 'Add-BinFile'.Importing alias 'Generate-BinFile'.Importing alias 'Get-InstallRegistryKey'.Importing alias 'Get-OSBitness'.Importing alias 'Get-ProcessorBits'.Importing alias 'Invoke-ChocolateyProcess'.Importing alias 'refreshenv'.Importing alias 'Remove-BinFile'.Importing alias 'Start-ChocolateyProcess'.
==> default: 0
==> default: ERROR: Cannot bind parameter 'FilterScript'. Cannot convert the "Name" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
==> default: Environment Vars (like PATH) have changed. Close/reopen your shell to
==> default: see the changes (or in powershell/cmd.exe just type refreshenv).
==> default: The install of tomcat was NOT successful.
==> default: Error while running 'C:\ProgramData\chocolatey\lib\Tomcat\tools\chocolateyInstall.ps1'.
==> default:
==> default: See log for details.
==> default: Chocolatey installed 1/2 packages. 1 packages failed.
==> default: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
==> default: Failures
==> default: - tomcat (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\Tomcat\tools\chocolateyInstall.ps1'.
==> default: See log for details.

Choco and Vagrant install issues

Issue Description

Tomcat install gives error and the GlassFish service does as well. I have trimmed the output to (what I believe are) the relevant areas, but I have full logs of all steps (built manually, but auto install hasn't worked previously either).

Host System

  • OS: Windows 10 x64
  • Packer Version: 0.12.0
  • Vagrant Version: 1.9.1
  • VirtualBox Version: 5.1.10 r112026 (Qt5.6.2)

Command Output

==> default: Progress: 100% - Completed download of C:\Users\vagrant\AppData\Local\Temp\chocolatey\Tomcat\8.0.33\apache-tomcat-8.0.33-windows-x64.zip (10.37 MB).
==> default: Download of apache-tomcat-8.0.33-windows-x64.zip (10.37 MB) completed.
==> default: C:\Program Files\Apache Software Foundation\tomcat
==> default: #< CLIXML
==> default: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"&gt;&lt;S S="debug">Host version is 2.0, PowerShell Version is '2.0' and CLR Version is '2.0.50727.5420'.</S><S S="verbose">Exporting function 'Format-FileSize'.</S><S S="verbose">Exporting function 'Get-ChecksumValid'.</S><S S="verbose">Exporting function 'Get-ChocolateyUnzip'.</S><S S="verbose">Exporting function 'Get-ChocolateyWebFile'.</S><S S="verbose">Exporting function 'Get-EnvironmentVariable'.</S><S S="verbose">Exporting function 'Get-EnvironmentVariableNames'.</S><S S="verbose">Exporting function 'Get-FtpFile'.</S><S S="verbose">Exporting function 'Get-OSArchitectureWidth'.</S><S S="verbose">Exporting function 'Get-ToolsLocation'.</S><S S="verbose">Exporting function 'Get-UACEnabled'.</S><S S="verbose">Exporting function 'Get-UninstallRegistryKey'.</S><S S="verbose">Exporting function 'Get-VirusCheckValid'.</S><S S="verbose">Exporting function 'Get-WebFile'.</S><S S="verbose">Exporting function 'Get-WebFileName'.</S><S S="verbose">Exporting function 'Get-WebHeaders'.</S><S S="verbose">Exporting function 'Install-BinFile'.</S><S S="verbose">Exporting function 'Install-ChocolateyDesktopLink'.</S><S S="verbose">Exporting function 'Install-ChocolateyEnvironmentVariable'.</S><S S="verbose">Exporting function 'Install-ChocolateyExplorerMenuItem'.</S><S S="verbose">Exporting function 'Install-ChocolateyFileAssociation'.</S><S S="verbose">Exporting function 'Install-ChocolateyInstallPackage'.</S><S S="verbose">Exporting function 'Install-ChocolateyPackage'.</S><S S="verbose">Exporting function 'Install-ChocolateyPath'.</S><S S="verbose">Exporting function 'Install-ChocolateyPinnedTaskBarItem'.</S><S S="verbose">Exporting function 'Install-ChocolateyPowershellCommand'.</S><S S="verbose">Exporting function 'Install-ChocolateyShortcut'.</S><S S="verbose">Exporting function 'Install-ChocolateyVsixPackage'.</S><S S="verbose">Exporting function 'Install-ChocolateyZipPackage'.</S><S S="verbose">Exporting function 'Install-Vsix'.</S><S S="verbose">Exporting function 'Set-EnvironmentVariable'.</S><S S="verbose">Exporting function 'Set-PowerShellExitCode'.</S><S S="verbose">Exporting function 'Start-ChocolateyProcessAsAdmin'.</S><S S="verbose">Exporting function 'Test-ProcessAdminRights'.</S><S S="verbose">Exporting function 'Uninstall-BinFile'.</S><S S="verbose">Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.</S><S S="verbose">Exporting function 'Uninstall-ChocolateyPackage'.</S><S S="verbose">Exporting function 'Uninstall-ChocolateyZipPackage'.</S><S S="verbose">Exporting function 'Update-SessionEnvironment'.</S><S S="verbose">Exporting function 'Write-ChocolateyFailure'.</S><S S="verbose">Exporting function 'Write-ChocolateySuccess'.</S><S S="verbose">Exporting function 'Write-FileUpdateLog'.</S><S S="verbose">Exporting function 'Write-FunctionCallLogMessage'.</S><S S="verbose">Exporting alias 'Get-ProcessorBits'.</S><S S="verbose">Exporting alias 'Get-OSBitness'.</S><S S="verbose">Exporting alias 'Get-InstallRegistryKey'.</S><S S="verbose">Exporting alias 'Generate-BinFile'.</S><S S="verbose">Exporting alias 'Add-BinFile'.</S><S S="verbose">Exporting alias 'Start-ChocolateyProcess'.</S><S S="verbose">Exporting alias 'Invoke-ChocolateyProcess'.</S><S S="verbose">Exporting alias 'Remove-BinFile'.</S><S S="verbose">Exporting alias 'refreshenv'.</S><S S="verbose">Importing function 'Format-FileSize'.</S><S S="verbose">Importing function 'Get-ChecksumValid'.</S><S S="verbose">Importing function 'Get-ChocolateyUnzip'.</S><S S="verbose">Importing function 'Get-ChocolateyWebFile'.</S><S S="verbose">Importing function 'Get-EnvironmentVariable'.</S><S S="verbose">Importing function 'Get-EnvironmentVariableNames'.</S><S S="verbose">Importing function 'Get-FtpFile'.</S><S S="verbose">Importing function 'Get-OSArchitectureWidth'.</S><S S="verbose">Importing function 'Get-ToolsLocation'.</S><S S="verbose">Importing function 'Get-UACEnabled'.</S><S S="verbose">Importing function 'Get-UninstallRegistryKey'.</S><S S="verbose">Importing function 'Get-VirusCheckValid'.</S><S S="verbose">Importing function 'Get-WebFile'.</S><S S="verbose">Importing function 'Get-WebFileName'.</S><S S="verbose">Importing function 'Get-WebHeaders'.</S><S S="verbose">Importing function 'Install-BinFile'.</S><S S="verbose">Importing function 'Install-ChocolateyDesktopLink'.</S><S S="verbose">Importing function 'Install-ChocolateyEnvironmentVariable'.</S><S S="verbose">Importing function 'Install-ChocolateyExplorerMenuItem'.</S><S S="verbose">Importing function 'Install-ChocolateyFileAssociation'.</S><S S="verbose">Importing function 'Install-ChocolateyInstallPackage'.</S><S S="verbose">Importing function 'Install-ChocolateyPackage'.</S><S S="verbose">Importing function 'Install-ChocolateyPath'.</S><S S="verbose">Importing function 'Install-ChocolateyPinnedTaskBarItem'.</S><S S="verbose">Importing function 'Install-ChocolateyPowershellCommand'.</S><S S="verbose">Importing function 'Install-ChocolateyShortcut'.</S><S S="verbose">Importing function 'Install-ChocolateyVsixPackage'.</S><S S="verbose">Importing function 'Install-ChocolateyZipPackage'.</S><S S="verbose">Importing function 'Install-Vsix'.</S><S S="verbose">Importing function 'Set-EnvironmentVariable'.</S><S S="verbose">Importing function 'Set-PowerShellExitCode'.</S><S S="verbose">Importing function 'Start-ChocolateyProcessAsAdmin'.</S><S S="verbose">Importing function 'Test-ProcessAdminRights'.</S><S S="verbose">Importing function 'Uninstall-BinFile'.</S><S S="verbose">Importing function 'Uninstall-ChocolateyEnvironmentVariable'.</S><S S="verbose">Importing function 'Uninstall-ChocolateyPackage'.</S><S S="verbose">Importing function 'Uninstall-ChocolateyZipPackage'.</S><S S="verbose">Importing function 'Update-SessionEnvironment'.</S><S S="verbose">Importing function 'Write-ChocolateyFailure'.</S><S S="verbose">Importing function 'Write-ChocolateySuccess'.</S><S S="verbose">Importing function 'Write-FileUpdateLog'.</S><S S="verbose">Importing function 'Write-FunctionCallLogMessage'.</S><S S="verbose">Importing alias 'Add-BinFile'.</S><S S="verbose">Importing alias 'Generate-BinFile'.</S><S S="verbose">Importing alias 'Get-InstallRegistryKey'.</S><S S="verbose">Importing alias 'Get-OSBitness'.</S><S S="verbose">Importing alias 'Get-ProcessorBits'.</S><S S="verbose">Importing alias 'Invoke-ChocolateyProcess'.</S><S S="verbose">Importing alias 'refreshenv'.</S><S S="verbose">Importing alias 'Remove-BinFile'.</S><S S="verbose">Importing alias 'Start-ChocolateyProcess'.</S></Objs>
==> default:
==> default: 0
==> default: ERROR: Cannot bind parameter 'FilterScript'. Cannot convert the "Name" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
==> default: Environment Vars (like PATH) have changed. Close/reopen your shell to
==> default:
==> default: see the changes (or in powershell/cmd.exe just type refreshenv).
==> default: The install of tomcat was NOT successful.
==> default: Error while running 'C:\ProgramData\chocolatey\lib\Tomcat\tools\chocolateyInstall.ps1'.
==> default: See log for details.
==> default: Chocolatey installed 1/2 packages. 1 packages failed.
==> default: See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
==> default:
==> default: Failures
==> default: - tomcat (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\Tomcat\tools\chocolateyInstall.ps1'.
==> default: See log for details.

==> default: processed file: C:\glassfish\glassfish4\pkg\lib\pkg-client.jar
==> default: Successfully processed 3439 files; Failed processing 0 files
==> default:
==> default: C:\Windows\system32>sc config domain1 obj= "NT Authority\LOCAL SERVICE"
==> default: [SC] ChangeServiceConfig SUCCESS
==> default: Running provisioner: shell...
default: Running: inline PowerShell script
==> default: Running provisioner: shell...
default: Running: scripts/installs/start_glassfish_service.bat as c:\tmp\vagrant-shell.bat
==> default: C:\Windows\system32>net start "domain1 GlassFish Server"
==> default: The service is starting or stopping. Please try again later.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

c:\tmp\vagrant-shell.bat

Stdout from the command:

Stderr from the command:

Vm not visible inside virtualbox console

Hello, I have successfully installed metasploitable 3 using vagrant & all required files using manual procedure. am using virtualbox Version 5.1.6 r110634. the vagrant status shows machine is running, but i cannot see the machine inside virtualbox console, kindly suggest me a fix. check screenshot.
capture

vagrant up fails to boot up Metasploitable3

I have Mac OS X 10.11.6 and i have followed the guide to deploy metasploitable 3. Everything seems fine, the machine starts to boot up but after a few scripts i receive this error and the machine suddenly shuts down:

==> default: C:\Windows\system32>net localgroup "Replicator" chewbacca /ADD 
==> default: The command completed successfully.
==> default: Running provisioner: shell...
    default: Running: inline PowerShell script
==> default: Running provisioner: shell...
==> default: Running cleanup tasks for 'reload' provisioner...
==> default: Running cleanup tasks for 'reload' provisioner...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
/opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:64:in `raise_if_wsman_fault': [WSMAN ERROR CODE: 2150859174]: <f:WSManFault Code='2150859174' Machine='127.0.0.1' xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault'><f:Message>The WS-Management service cannot process the request. This user is allowed a maximum number of 50 concurrent operations, which has been exceeded. Close existing operations for this user, or raise the quota for this user. </f:Message></f:WSManFault> (WinRM::WinRMWSManFault)
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:51:in `raise_if_error'
... TRIMMED ...

Full stack trace

==> default: C:\Windows\system32>net localgroup "Replicator" chewbacca /ADD 
==> default: The command completed successfully.
==> default: Running provisioner: shell...
    default: Running: inline PowerShell script
==> default: Running provisioner: shell...
==> default: Running cleanup tasks for 'reload' provisioner...
==> default: Running cleanup tasks for 'reload' provisioner...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
/opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:64:in `raise_if_wsman_fault': [WSMAN ERROR CODE: 2150859174]: <f:WSManFault Code='2150859174' Machine='127.0.0.1' xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault'><f:Message>The WS-Management service cannot process the request. This user is allowed a maximum number of 50 concurrent operations, which has been exceeded. Close existing operations for this user, or raise the quota for this user. </f:Message></f:WSManFault> (WinRM::WinRMWSManFault)
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:51:in `raise_if_error'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:35:in `parse_to_xml'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/transport.rb:200:in `send_request'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:492:in `send_message'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:393:in `run_wql'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:190:in `os_version'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:149:in `code_page'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:72:in `block in open'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:222:in `retryable'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:71:in `open'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:359:in `create_executor'
    from /opt/vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/file_manager.rb:110:in `upload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/communicators/winrm/shell.rb:76:in `upload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/communicators/winrm/communicator.rb:173:in `upload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provisioners/shell/provisioner.rb:114:in `block (2 levels) in provision_winrm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provisioners/shell/provisioner.rb:105:in `tap'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provisioners/shell/provisioner.rb:105:in `block in provision_winrm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provisioners/shell/provisioner.rb:220:in `with_script_file'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provisioners/shell/provisioner.rb:104:in `provision_winrm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/provisioners/shell/provisioner.rb:22:in `provision'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/provision.rb:133:in `run_provisioner'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:473:in `hook'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/provision.rb:121:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/provision.rb:121:in `block in call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/provision.rb:103:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/provision.rb:103:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/set_name.rb:50:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/box_check_outdated.rb:36:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/match_mac_address.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/discard_state.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/import.rb:74:in `import'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/import.rb:13:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/prepare_clone.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/customize.rb:40:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:225:in `action_raw'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:200:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:561:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:186:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:186:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
    from /opt/vagrant/embedded/gems/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `call'
    from /opt/vagrant/embedded/gems/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `block in create_with_logging_context'

checksum error during build

Get the following error when attempting to run build_win2008.sh:

root@kali:~/metasploitable3# ./build_win2008.sh
Compatible version of VirtualBox found.
./build_win2008.sh: line 52: packer-io: command not found
Compatible version of packer was found.
Correct version of vagrant was found.
Compatible version of vagrant-reload plugin was found.
All requirements found. Proceeding...
Building the Vagrant box...
virtualbox-iso output will be in this color.

==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///usr/share/virtualbox/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: http://download.microsoft.com/download/7/5/E/75EC4E54-5B02-42D6-8879-D8D3A25FBEF7/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
virtualbox-iso: Download progress: 1%
virtualbox-iso: Download progress: 3%
---------------------------SNIP----------------------------
virtualbox-iso: Download progress: 100%
virtualbox-iso: Download progress: 100%
virtualbox-iso: Error downloading: checksums didn't match expected: 4263be2cf3c59177c45085c0a7bc6ca5
==> virtualbox-iso: ISO download failed.
Build 'virtualbox-iso' errored: ISO download failed.

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: ISO download failed.

==> Builds finished but no artifacts were created.
Error building the Vagrant box using Packer. Please check the output above for any error messages.

Unable to login using the keyboard

Once I startup metasploitable3 using vagrant up, I am unable to enter the password using the keyboard. If I start up the VM from the Virtualbox interface I can enter the password. I am running Windows 10 and VB version 5.16.

waiting for ssh become available

Issue Description

Please give a thorough description of the issue you're seeing.
Also, please be sure to include any troubleshooting steps that you've already attempted.

Host System windows10

  • OS:windows2008_r2
  • Packer Version:0.12.0
  • Vagrant Version:1.9.1
  • VirtualBox Version:5.1.6

Command Output

ps packer build .\windows_2008_r2.json

Building Issues

Main two issues are in bold. Cannot make heads or tails about the error messages. I'm using Kali to build.

Compatible version of VirtualBox found.
./build_win2008.sh: line 52: packer-io: command not found
Compatible version of packer was found.
Correct version of vagrant was found.
Compatible version of vagrant-reload plugin was found.
All requirements found. Proceeding...
Building the Vagrant box...
virtualbox-iso output will be in this color.

==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///usr/share/virtualbox/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: http://download.microsoft.com/download/7/5/E/75EC4E54-5B02-42D6-8879-D8D3A25FBEF7/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
==> virtualbox-iso: Creating floppy disk...
virtualbox-iso: Copying files flatly from floppy_files
virtualbox-iso: Copying file: ./answer_files/2008_r2/Autounattend.xml
virtualbox-iso: Copying file: ./scripts/configs/microsoft-updates.bat
virtualbox-iso: Copying file: ./scripts/configs/win-updates.ps1
virtualbox-iso: Copying file: ./scripts/installs/openssh.ps1
virtualbox-iso: Copying file: ./resources/certs/oracle-cert.cer
virtualbox-iso: Copying file: ./resources/certs/gdig2.crt
virtualbox-iso: Copying file: ./resources/certs/comodorsadomainvalidationsecureserverca.crt
virtualbox-iso: Copying file: ./resources/certs/comodorsacertificationauthority.crt
virtualbox-iso: Copying file: ./resources/certs/addtrust_external_ca.cer
virtualbox-iso: Copying file: ./resources/certs/baltimore_ca.cer
virtualbox-iso: Copying file: ./resources/certs/digicert.cer
virtualbox-iso: Copying file: ./resources/certs/equifax.cer
virtualbox-iso: Copying file: ./resources/certs/globalsign.cer
virtualbox-iso: Copying file: ./resources/certs/gte_cybertrust.cer
virtualbox-iso: Copying file: ./resources/certs/microsoft_root_2011.cer
virtualbox-iso: Copying file: ./resources/certs/thawte_primary_root.cer
virtualbox-iso: Copying file: ./resources/certs/utn-userfirst.cer
virtualbox-iso: Done copying files from floppy_files
virtualbox-iso: Collecting paths from floppy_dirs
virtualbox-iso: Resulting paths from floppy_dirs : []
virtualbox-iso: Done copying paths from floppy_dirs
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Attaching floppy disk...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 4271)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1480597523 --memory 2048
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1480597523 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
virtualbox-iso: The VM will be run headless, without a GUI. If you want to
virtualbox-iso: view the screen of the VM, connect via VRDP without a password to
virtualbox-iso: 127.0.0.1:5917
==> virtualbox-iso: Error starting VM: VBoxManage error: VBoxManage: error: The virtual machine 'packer-virtualbox-iso-1480597523' has terminated unexpectedly during startup with exit code 1 (0x1)
==> virtualbox-iso: VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error starting VM: VBoxManage error: VBoxManage: error: The virtual machine 'packer-virtualbox-iso-1480597523' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error starting VM: VBoxManage error: VBoxManage: error: The virtual machine 'packer-virtualbox-iso-1480597523' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

==> Builds finished but no artifacts were created.
Error building the Vagrant box using Packer. Please check the output above for any error messages.

Build Script build_win2008.ps1 Failing on Syntax Issue

Issue Description:

Line 114 of build_win2008.ps1 executes this command:
cmd.exe /c vagrant box add windows_2008_r2_virtualbox.box --name metasploitable3

The result in my environment (Win7x64) is:

C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant: unrecognized option `--name'
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: C:/WORKSPACE/vm/metasploitable3_build/metasploitable3/Vagrantfile
Line number: 0
Message: GetoptLong::InvalidOption: unrecognized option `--name'

It appears it doesn't like the --name option, which is odd considering Vagrant's own documentation on that flag (https://www.vagrantup.com/docs/cli/box.html#_name_VALUE).

There is also the a very similar command listed on step 3 of the wiki here (includes an equals sign though): https://github.com/rapid7/metasploitable3/wiki

Issue Resolution:

The fix is to adjust the syntax of the command, not using the invalid '--name' flag:
cmd.exe /c vagrant box add metasploitable3 windows_2008_r2_virtualbox.box

Luckily this is the last step, and the build has technially already completed successfully. So you can just run that command (vagrant box add metasploitable3 windows_2008_r2_virtualbox.box) and you're all set.

I know some individuals are currently using either vagrant 1.8.1 or 1.8.6. This issue appears across both versions.

I wanted to put this here because it took me a bit of tinkering to figure out how to fix it. It wasn't until I stumbled on a tutorial on scotch.io that used the alternate syntax that I got it working.

Please validate in a clean environment. If others run into this, I'm happy to submit a PR. Tested on a clean Win7 x64. It's entirely possible I'm doing something wrong, but I can't figure out what that could be.

Cheers

vagrant stops provisioning at glassfish4

Issue Description

vagrant stops provisioning at glassfish4 (see last output). Reprovisoning results in the output below:

vagrant.exe up --provision
...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/Reinhard/Desktop/metasploitable3
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Running provisioner: shell...
    default: Running: scripts/installs/install_boxstarter.bat as c:\tmp\vagrant-shell.bat
==> default: C:\Windows\system32>net start "domain1 GlassFish Server"
==> default: The requested service has already been started.
==> default:
==> default:
==> default: More help is available by typing NET HELPMSG 2182.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

Host System

  • OS: Windows 10
  • Packer Version: 0.12.0
  • Vagrant Version: 1.9.1
  • VirtualBox Version: 5.1.10

Command Output

vagrant up
...
==> default: processed file: C:\glassfish\glassfish4\pkg\javadocs\com\sun\pkg\client\Version.html
==> default:
==> default: processed file: C:\glassfish\glassfish4\pkg\javadocs\resources\inherit.gif
==> default: processed file: C:\glassfish\glassfish4\pkg\lib\pkg-bootstrap.jar
==> default: processed file: C:\glassfish\glassfish4\pkg\lib\pkg-bootstub.bat
==> default:
==> default: processed file: C:\glassfish\glassfish4\pkg\lib\pkg-bootstub.sh
==> default: processed file: C:\glassfish\glassfish4\pkg\lib\pkg-client.jar
==> default: Successfully processed 3439 files; Failed processing 0 files
==> default: C:\Windows\system32>sc config domain1 obj= "NT Authority\LOCAL SERVICE"
==> default: [SC] ChangeServiceConfig SUCCESS
==> default: Running provisioner: shell...
    default: Running: inline PowerShell script
==> default: Running provisioner: shell...
    default: Running: scripts/installs/start_glassfish_service.bat as c:\tmp\vagrant-shell.bat
==> default: C:\Windows\system32>net start "domain1 GlassFish Server"
==> default: The service is starting or stopping.  Please try again later.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

c:\tmp\vagrant-shell.bat

Stdout from the command:



Stderr from the command:

vagrant up hangs at "configure_firewall.bat"

Hello,

Commendable work on metasploitable 3. Unfortunately I seem to be having an issue provisioning the Server 2008 virtual machine. For reasons unknown to me, "vagrant up" seems to hang at executing "configure_firewall.bat". Specifically, this line:

default: Running: scripts/configs/configure_firewall.bat as c:\tmp\vagrant-shell.bat

since vagrant runs virtualbox in headless mode, I don't have access to a console to see how and what exactly the VM appears to be choking on. Also, for some reason, vagrant rdp failed to work as well. I was however able to use vagrant SSH, and TCP Forwarding to open up an RDP connection to the VM. C:\vagrant-shell.bat DOES exist, and if I run it manually as the vagrant user, it appears to execute with no problem. I can also manually execute the next two batch files "install_elasticsearch.bat" and "install_flags.bat" from the RDP session as well. I have no idea why vagrant up hangs at configure_firewall in particular.

Issue: vagrant up never completes. hangs at "default: Running: scripts/configs/configure_firewall.bat as c:\tmp\vagrant-shell.bat"

Desired outcome: configure_firewall.bat finishes executing; vagrant up finishes executing so that I have a fully functional VM to play with

Environment:
Host OS: Windows 10 Professional x64, Anniversary Edition
Hypervisor: Virtualbox 5.0.28, with guest extensions installed
Vagrant: 1.8.1
Packer: 0.11.0

Error starting VM

I am running this on Ubuntu Mate 16.04 but get this error. I am new to this so any guidance is appreciated.

==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1479314325 --memory 2048
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1479314325 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
virtualbox-iso: The VM will be run headless, without a GUI. If you want to
virtualbox-iso: view the screen of the VM, connect via VRDP without a password to
virtualbox-iso: 127.0.0.1:5905
==> virtualbox-iso: Error starting VM: VBoxManage error: VBoxManage: error: The virtual machine 'packer-virtualbox-iso-1479314325' has terminated unexpectedly during startup with exit code 1 (0x1)
==> virtualbox-iso: VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error starting VM: VBoxManage error: VBoxManage: error: The virtual machine 'packer-virtualbox-iso-1479314325' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error starting VM: VBoxManage error: VBoxManage: error: The virtual machine 'packer-virtualbox-iso-1479314325' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

==> Builds finished but no artifacts were created.
Error building the Vagrant box using Packer. Please check the output above for any error messages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.