Commit db508f0a authored by Joe Fitzgerald's avatar Joe Fitzgerald

Windows Server 2008 R2 Standard

parent e33a1263
\ No newline at end of file
This diff is collapsed.
REM create the cygwin directory
cmd /c mkdir %SystemDrive%\cygwin
cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal %SystemDrive%\cygwin\cygwin-setup.exe
REM goto a temp directory
cd %SystemDrive%\windows\temp
REM run the installation
cmd /c %SystemDrive%\cygwin\cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s
%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
REM /bin/ash is the right shell for this command
cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall
cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group
cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd
%SystemDrive%\cygwin\bin\sleep 1
%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /bin/ssh-host-config -y -c "ntsecbinmode tty" -w "abc&&123!!" '
%SystemDrive%\cygwin\bin\sleep 2
cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes
cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
%SystemDrive%\cygwin\bin\sleep 2
net start sshd
# Fix corrupt recycle bin
cmd /c rd /s /q c:\$Recycle.bin
copy a:\sudo %SystemDrive%\cygwin\usr\local\bin
cmd /c %SystemDrive%\cygwin\bin\chmod 755 %SystemDrive%\cygwin\usr\local\bin\sudo
\ No newline at end of file
set -x
# Create the home directory
mkdir -p /home/vagrant
chown vagrant /home/vagrant
cd /home/vagrant
# Install ssh certificates
mkdir /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
cd /home/vagrant/.ssh
wget --no-check-certificate '' -O authorized_keys
chown -R vagrant /home/vagrant/.ssh
cd ..
# Install rpm,apt-get like code for cygwin
chmod +x apt-cyg
mv apt-cyg /usr/local/bin/
cat <<'EOF' > /bin/sudo
exec "$@"
chmod 755 /bin/sudo
# 7zip will allow us to extract a file from an ISO
msiexec /qb /i 7z920-x64.msi
# Download VMware Tools For Windows
mkdir /home/vagrant/vmware
chown -R vagrant /home/vagrant/vmware
cd /home/vagrant/vmware
tar -xvf /home/vagrant/vmware/tools-windows-9.2.3.exe.tar
rm /home/vagrant/vmware/tools-windows-9.2.3.exe.tar
chown -R vagrant /home/vagrant/vmware
# Install the VMware Tools
rm /home/vagrant/vmware/tools-windows-9.2.3.exe
/cygdrive/c/Program\ Files/7-Zip/7z.exe x C:\\Program\ Files\ \(x86\)\\VMware\\tools-windows\\windows.iso
chown -R vagrant /home/vagrant/vmware
cmd.exe /c "C:\\cygwin\\home\\vagrant\\vmware\\setup.exe /S /v\"/qn REBOOT=R\""
sleep 1
\ No newline at end of file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "vagrant-windows" = "windows2008r2"
config.vm.provider :virtualbox do |v, override|
config.vm.provider :vmware_fusion do |v, override|
v.gui = true
v.vmx["ethernet0.virtualDev"] = "vmxnet3"
config.vm.provider :vmware_workstation do |v, override|
v.vmx["ethernet0.virtualDev"] = "vmxnet3"
v.gui = true
\ No newline at end of file
"builders": [
"type": "vmware",
"iso_url": "./iso/windows.iso",
"iso_checksum_type": "md5",
"iso_checksum": "8dcde01d0da526100869e2457aafb7ca",
"boot_wait": "5m",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Vagrant Shutdown\"",
"guest_os_type": "windows7srv-64",
"disk_size": 61440,
"vnc_port_min": 5900,
"vnc_port_max": 5980,
"floppy_files": [
"vmx_data": {
"RemoteDisplay.vnc.enabled": "false",
"RemoteDisplay.vnc.port": "5900"
"provisioners": [
"type": "shell",
"script": ""
"post-processors": [
"type": "vagrant",
"keep_input_artifact": false,
"output": "windows2008r2_{{.Provider}}",
"vagrantfile_template": "vagrantfile.template"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment