Commit db508f0a authored by Joe Fitzgerald's avatar Joe Fitzgerald

Windows Server 2008 R2 Standard

parent e33a1263
/iso/
\ No newline at end of file
This diff is collapsed.
REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be
REM create the cygwin directory
cmd /c mkdir %SystemDrive%\cygwin
cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal http://www.cygwin.com/setup.exe %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 http://cygwin.mirrors.pair.com
%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
# http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
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
#!/bin/sh
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 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
chown -R vagrant /home/vagrant/.ssh
cd ..
# Install rpm,apt-get like code for cygwin
# http://superuser.com/questions/40545/upgrading-and-installing-packages-through-the-cygwin-command-line
wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
chmod +x apt-cyg
mv apt-cyg /usr/local/bin/
cat <<'EOF' > /bin/sudo
#!/usr/bin/bash
exec "$@"
EOF
chmod 755 /bin/sudo
# 7zip will allow us to extract a file from an ISO
wget http://downloads.sourceforge.net/sevenzip/7z920-x64.msi
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
wget http://softwareupdate.vmware.com/cds/vmw-desktop/ws/9.0.2/1031769/windows/packages/tools-windows-9.2.3.exe.tar
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
/home/vagrant/vmware/tools-windows-9.2.3.exe
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"
config.vm.box = "windows2008r2"
config.vm.provider :virtualbox do |v, override|
end
config.vm.provider :vmware_fusion do |v, override|
v.gui = true
v.vmx["ethernet0.virtualDev"] = "vmxnet3"
end
config.vm.provider :vmware_workstation do |v, override|
v.vmx["ethernet0.virtualDev"] = "vmxnet3"
v.gui = true
end
end
\ 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": [
"Autounattend.xml",
"install-cygwin-sshd.bat",
"setup.exe"
],
"vmx_data": {
"RemoteDisplay.vnc.enabled": "false",
"RemoteDisplay.vnc.port": "5900"
}
}
],
"provisioners": [
{
"type": "shell",
"script": "postinstall.sh"
}
],
"post-processors": [
{
"type": "vagrant",
"keep_input_artifact": false,
"output": "windows2008r2_{{.Provider}}_trial_201307232050.box",
"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