diff --git a/.gitignore b/.gitignore index f6fd517..ba0bcbd 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,7 @@ bin/*.vshost.exe scripts/vmgen.json.lock scripts/vmgen.json scripts/floppy/build.cfg -scripts/vmgen.log +scripts/*.log scripts/vmgen.cfg scripts/parallels-command.txt *.user \ No newline at end of file diff --git a/README.md b/README.md index 889926d..d0b2a15 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,6 @@ Some of these steps will not make sense for you so feel free to hack around and There are some known issues with the scripts so make sure to check the issues section. -Currently this process only works on Windows 8.1 machines. - ## Software Requirements * Windows 10 - version 1709 * [Packer 1.1.2 For Windows and Mac](https://packer.io/downloads.html) @@ -48,7 +46,7 @@ The Hyper-V ISO builder in Packer 1.1.2 works well on Windows 10 version 1709. #### VirtualBox support -We automatically install the Guest Extensions, but to do that silently the installation needs to add the Oracle certificate to the list of trusted certs in the guest OS. Right now we suggest that you follow the process described in [this guide](http://www.catonrug.net/2013/03/virtualbox-silent-install-store-oracle-certificate.html). You will have to place that `.cer` file in `scripts\floppy\guesttools\oracle-cert.cer`. In the near future we plan to update the process to follow the guidance of the [official manual](https://www.virtualbox.org/manual/ch04.html#additions-windows) in the section **4.2.1.3. Unattended Installation**. +We automatically install the Guest Extensions, but to do that silently the installation needs to add the Oracle certificate to the list of trusted certs in the guest OS. Right now we suggest that you follow the process described in [this guide](https://web.archive.org/web/20170226085950/http://www.catonrug.net/2013/03/virtualbox-silent-install-store-oracle-certificate.html). You will have to place that `.cer` file in `scripts\floppy\guesttools\oracle-cert.cer`. In the near future we plan to update the process to follow the guidance of the [official manual](https://www.virtualbox.org/manual/ch04.html#additions-windows) in the section **4.2.1.3. Unattended Installation**. ### Set PowerShell Execution Policy Set the execution policy by typing this into your powershell window: diff --git a/scripts/answer_files/10/autounattend.xml b/scripts/answer_files/10/autounattend.xml index f64f234..ffea3c4 100644 --- a/scripts/answer_files/10/autounattend.xml +++ b/scripts/answer_files/10/autounattend.xml @@ -45,8 +45,8 @@ false - /IMAGE/NAME - Windows 10 Enterprise Evaluation + /IMAGE/INDEX + 1 diff --git a/scripts/floppy/openssh/openssh.ps1 b/scripts/floppy/openssh/openssh.ps1 index 80ad6a3..419eceb 100644 --- a/scripts/floppy/openssh/openssh.ps1 +++ b/scripts/floppy/openssh/openssh.ps1 @@ -134,7 +134,7 @@ function DownloadSSH () { } function OpenSSH () { - #Start-Service "OpenSSHd" + Start-Service "OpenSSHd" # If ($software -eq "HyperV" -or $software -eq "VPC") { # Stop-Computer -Force diff --git a/scripts/floppy/openssh/win10/openssh.ps1 b/scripts/floppy/openssh/win10/openssh.ps1 new file mode 100644 index 0000000..329bcec --- /dev/null +++ b/scripts/floppy/openssh/win10/openssh.ps1 @@ -0,0 +1,33 @@ +# -------------------------------------------------------------- +# +# dev.microsoftedge.com -VMs +# Copyright(c) Microsoft Corporation. All rights reserved. +# +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files(the ""Software""), +# to deal in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies +# of the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions : +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS +# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# -------------------------------------------------------------- + +param ( + [switch]$AutoStart = $false, + [switch]$Finish = $false +) + +Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 +Start-Service sshd diff --git a/scripts/floppy/updates/win-updates.ps1 b/scripts/floppy/updates/win-updates.ps1 index b812f6f..3b0a0b7 100644 --- a/scripts/floppy/updates/win-updates.ps1 +++ b/scripts/floppy/updates/win-updates.ps1 @@ -190,8 +190,8 @@ function Install-WindowsUpdates() { Title = $UpdatesToInstall.Item($i).Title Result = $InstallationResult.GetUpdateResult($i).ResultCode } - LogWrite "Item: " $UpdatesToInstall.Item($i).Title - LogWrite "Result: " $InstallationResult.GetUpdateResult($i).ResultCode; + LogWrite "Item: " + $UpdatesToInstall.Item($i).Title + LogWrite "Result: " + $InstallationResult.GetUpdateResult($i).ResultCode } Check-ContinueRestartOrEnd diff --git a/scripts/template-parts/floppy_files_common.json b/scripts/template-parts/floppy_files_common.json index db5fd6e..4024a39 100644 --- a/scripts/template-parts/floppy_files_common.json +++ b/scripts/template-parts/floppy_files_common.json @@ -5,12 +5,12 @@ "floppy_files": [ "floppy/common/setautologon.ps1", "floppy/build.cfg", - "floppy/openssh/openssh.ps1", "floppy/updates/win-updates.ps1", "floppy/common/post-win-updates.ps1", "floppy/common/finish-actions.ps1", "floppy/updates/microsoft-updates.bat", "floppy/common/preprovisioner.ps1", + "floppy/common/preprovisioner.cmd", "floppy/bginfo/Bginfo.exe", "floppy/bginfo/install.vbs", "floppy/bginfo/background.jpg", @@ -24,12 +24,12 @@ "floppy_files": [ "floppy/common/setautologon.ps1", "floppy/build.cfg", - "floppy/openssh/openssh.ps1", "floppy/updates/win-updates.ps1", "floppy/common/post-win-updates.ps1", "floppy/common/finish-actions.ps1", "floppy/updates/microsoft-updates.bat", "floppy/common/preprovisioner.ps1", + "floppy/common/preprovisioner.cmd", "floppy/bginfo/Bginfo.exe", "floppy/bginfo/install.vbs", "floppy/bginfo/background.jpg", @@ -43,12 +43,12 @@ "floppy_files": [ "floppy/common/setautologon.ps1", "floppy/build.cfg", - "floppy/openssh/openssh.ps1", "floppy/updates/win-updates.ps1", "floppy/common/post-win-updates.ps1", "floppy/common/finish-actions.ps1", "floppy/updates/microsoft-updates.bat", "floppy/common/preprovisioner.ps1", + "floppy/common/preprovisioner.cmd", "floppy/bginfo/Bginfo.exe", "floppy/bginfo/install.vbs", "floppy/bginfo/background.jpg", @@ -62,12 +62,12 @@ "floppy_files": [ "floppy/common/setautologon.ps1", "floppy/build.cfg", - "floppy/openssh/openssh.ps1", "floppy/updates/win-updates.ps1", "floppy/common/post-win-updates.ps1", "floppy/common/finish-actions.ps1", "floppy/updates/microsoft-updates.bat", "floppy/common/preprovisioner.ps1", + "floppy/common/preprovisioner.cmd", "floppy/bginfo/Bginfo.exe", "floppy/bginfo/install.vbs", "floppy/bginfo/background.jpg", diff --git a/scripts/template-parts/floppy_files_win10.json b/scripts/template-parts/floppy_files_win10.json index b228fb8..a14f0ac 100644 --- a/scripts/template-parts/floppy_files_win10.json +++ b/scripts/template-parts/floppy_files_win10.json @@ -3,41 +3,37 @@ { "type": "hyperv-iso", "floppy_files": [ - "floppy/common/setautologon.ps1", - "answer_files/10/autounattend.xml", - "floppy/common/preprovisioner.cmd", - "floppy/bginfo/win10/bgconfig.bgi", - "floppy/eula/win10/eula.txt" + "./answer_files/10/autounattend.xml", + "./floppy/eula/win10/eula.txt", + "./floppy/bginfo/win10/bgconfig.bgi", + "./floppy/openssh/win10/openssh.ps1" ] }, { "type": "virtualbox-iso", "floppy_files": [ - "floppy/common/setautologon.ps1", - "answer_files/10/autounattend.xml", - "floppy/common/preprovisioner.cmd", - "floppy/bginfo/win10/bgconfig.bgi", - "floppy/eula/win10/eula.txt" + "./answer_files/10/autounattend.xml", + "./floppy/eula/win10/eula.txt", + "./floppy/bginfo/win10/bgconfig.bgi", + "./floppy/openssh/win10/openssh.ps1" ] }, { "type": "vmware-iso", "floppy_files": [ - "floppy/common/setautologon.ps1", - "answer_files/10/autounattend.xml", - "floppy/common/preprovisioner.cmd", - "floppy/bginfo/win10/bgconfig.bgi", - "floppy/eula/win10/eula.txt" + "./answer_files/10/autounattend.xml", + "./floppy/eula/win10/eula.txt", + "./floppy/bginfo/win10/bgconfig.bgi", + "./floppy/openssh/win10/openssh.ps1" ] }, { "type": "parallels-iso", "floppy_files": [ - "floppy/common/setautologon.ps1", - "answer_files/10/autounattend.xml", - "floppy/common/preprovisioner.cmd", - "floppy/bginfo/win10/bgconfig.bgi", - "floppy/eula/win10/eula.txt" + "./answer_files/10/autounattend.xml", + "./floppy/eula/win10/eula.txt", + "./floppy/bginfo/win10/bgconfig.bgi", + "./floppy/openssh/win10/openssh.ps1" ] } ] diff --git a/scripts/template-parts/floppy_files_win7.json b/scripts/template-parts/floppy_files_win7.json index c73c987..0becf1c 100644 --- a/scripts/template-parts/floppy_files_win7.json +++ b/scripts/template-parts/floppy_files_win7.json @@ -6,6 +6,7 @@ "answer_files/7/autounattend.xml", "floppy/common/preprovisioner.cmd", "floppy/bginfo/bgconfig.bgi", + "floppy/openssh/openssh.ps1", "floppy/eula/win7/eula.txt" ] }, @@ -15,6 +16,7 @@ "answer_files/7/autounattend.xml", "floppy/common/preprovisioner.cmd", "floppy/bginfo/bgconfig.bgi", + "floppy/openssh/openssh.ps1", "floppy/eula/win7/eula.txt" ] }, @@ -24,6 +26,7 @@ "answer_files/7/autounattend.xml", "floppy/common/preprovisioner.cmd", "floppy/bginfo/bgconfig.bgi", + "floppy/openssh/openssh.ps1", "floppy/eula/win7/eula.txt" ] }, @@ -33,6 +36,7 @@ "answer_files/7/autounattend.xml", "floppy/common/preprovisioner.cmd", "floppy/bginfo/bgconfig.bgi", + "floppy/openssh/openssh.ps1", "floppy/eula/win7/eula.txt" ] } diff --git a/scripts/template-parts/floppy_files_win81.json b/scripts/template-parts/floppy_files_win81.json index 85c6bfb..0a6b243 100644 --- a/scripts/template-parts/floppy_files_win81.json +++ b/scripts/template-parts/floppy_files_win81.json @@ -6,6 +6,7 @@ "answer_files/81/autounattend.xml", "floppy/common/preprovisioner.cmd", "floppy/bginfo/bgconfig.bgi", + "floppy/openssh/openssh.ps1", "floppy/eula/win81/eula.txt" ] }, @@ -15,6 +16,7 @@ "answer_files/81/autounattend.xml", "floppy/common/preprovisioner.cmd", "floppy/bginfo/bgconfig.bgi", + "floppy/openssh/openssh.ps1", "floppy/eula/win81/eula.txt" ] }, @@ -24,6 +26,7 @@ "answer_files/81/autounattend.xml", "floppy/common/preprovisioner.cmd", "floppy/bginfo/bgconfig.bgi", + "floppy/openssh/openssh.ps1", "floppy/eula/win81/eula.txt" ] }, @@ -33,6 +36,7 @@ "answer_files/81/autounattend.xml", "floppy/common/preprovisioner.cmd", "floppy/bginfo/bgconfig.bgi", + "floppy/openssh/openssh.ps1", "floppy/eula/win81/eula.txt" ] } diff --git a/scripts/template-parts/provisioner_common.json b/scripts/template-parts/provisioner_common.json index f2205e7..ecfa952 100644 --- a/scripts/template-parts/provisioner_common.json +++ b/scripts/template-parts/provisioner_common.json @@ -1,9 +1,7 @@ { "provisioners": [ { - "type": "shell", - "remote_path": "/tmp/script.bat", - "execute_command": "{{.Vars}} cmd /c C:/Windows/Temp/script.bat", + "type": "windows-shell", "scripts": [ "./provisioners/vm-guest-tools.bat", "./provisioners/compact.bat", diff --git a/scripts/template-parts/urls_win10x64.json b/scripts/template-parts/urls_win10x64.json index a984f75..bfb812c 100644 --- a/scripts/template-parts/urls_win10x64.json +++ b/scripts/template-parts/urls_win10x64.json @@ -1,7 +1,7 @@ { "variables": { - "iso_url": "iso/15063.0.170317-1834.RS2_RELEASE_CLIENTENTERPRISEEVAL_OEMRET_X64FRE_EN-US.iso", - "iso_checksum": "cf812813211add8fe7c53b07b7caff8c", - "iso_checksum_type": "md5" + "iso_url": "iso/17763.107.101029-1455.rs5_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", + "iso_checksum": "164f022a22d2305e6fbd82f6e35d530b6bbadca8", + "iso_checksum_type": "sha1" } } diff --git a/scripts/template-parts/win10x64.json b/scripts/template-parts/win10x64.json index fc011e3..02256ef 100644 --- a/scripts/template-parts/win10x64.json +++ b/scripts/template-parts/win10x64.json @@ -16,7 +16,7 @@ "ssh_timeout": "16h", "ram_size": 2048, "disk_size": 40960, - "switch_name": "", + "switch_name": "Default Switch", "shutdown_command": "{{ user `shutdown_command`}}", "output_directory" : "..\\vms\\output\\MSEdge-Win10-HyperV" },