This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"command": "uptime -s", | |
"name": "uptime_since", | |
"result": [ | |
"2018-04-16 02:40:37" | |
] | |
}, | |
{ | |
"command": "hostname", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prepare directory structure | |
mkdir -p /var/tmp/packer_windows-server-2016-eval/{scripts/win-common,http/windows-server-2016,ansible} | |
cd /var/tmp/packer_windows-server-2016-eval | |
# Download Autounattended file for Windows Server 2016 Evaluation | |
wget -c -P http/windows-server-2016 https://raw.githubusercontent.com/ruzickap/packer-templates/master/http/windows-server-2016/Autounattend.xml | |
# Create some basic Ansible playbook for Windows provisioning | |
cat > ansible/win.yml << EOF | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export VIRTIO_WIN_ISO_DIR=$(mktemp -d --suffix=_virtio-win-iso) | |
export NAME=windows-server-2016-standard-x64-eval | |
export WINDOWS_VERSION=2016 | |
export WINDOWS_TYPE=server | |
export TMPDIR="/var/tmp/" | |
cd /var/tmp/packer_windows-server-2016-eval | |
# Download and mount virtio-win to provide basic virtio Windows drivers | |
wget -c https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
mkdir test | |
cd test | |
curl https://raw.githubusercontent.com/ruzickap/packer-templates/master/http/windows-server-2016/Autounattend.xml | sed '/.*Microsoft-Windows-PnpCustomizationsWinPE.*/,/component>/d' > Autounattend.xml | |
wget -c https://raw.githubusercontent.com/ruzickap/packer-templates/master/scripts/win-common/fixnetwork.ps1 | |
test -f packer || ( wget https://releases.hashicorp.com/packer/1.2.0/packer_1.2.0_linux_amd64.zip && unzip packer_1.2.0_linux_amd64.zip && rm packer_1.2.0_linux_amd64.zip ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM If PowerShell 2 is not installed, this script will automatically download and install it. | |
REM Only works on XP SP3 with .NET 3.5. Only for dev boxes, not designed for servers. | |
REM Based on http://blog.codeassassin.com/2009/12/10/no-web-browser-need-powershell/ | |
ver | find "XP" > nul | |
if %ERRORLEVEL% neq 0 goto not_xp | |
ver | find "5.1.2600" > nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nr. + product name + .exe/.iso/dvd + file integrety check | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
1 MS-DOS 6.0 (English) EN_MSDOS60.exe 2000-10-12 877B0B8E391ED07CB83214CB09E8F3B10C4B206F | |
2 SQL Server 2008 Enterprise (x86, x64, ia64) - DVD (Chinese-Simplified) zh-hans_sql_server_2008_enterprise_x86_x64_ia64_dvd_x14-89199.iso 2008-8-13 D23B103331AB0B3CCC82769B99CA1C2F16BEBBF4 | |
3 Windows XP Professional with Service Pack 2- VL (Simplified Chinese) sc_win_xp_pro_with_sp2_vl.iso 2005-5-18 C0ADDD927B5D1F93DCE9C455FD6B26EAC7391BE9 | |
4 MS-DOS 6.22 (English) EN_MSDOS622.exe 2000-10-12 D01AA47A5D85908185F8987E972AFC66DC92A735 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init 1 | |
for i in `mount | grep sda | grep ext | cut -b 9` ; do mount -o remount,ro /dev/sda$i && zerofree -v /dev/sda$i && mount -o remount,rw /dev/sda$i ; done ; |