Skip to content

Instantly share code, notes, and snippets.

{"set_internal_metadata":{"operator-script":"# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n#\n# Copyright (c) 2018, Joyent, Inc.\n#\n# Set Window's cleanmgr to (nearly) max, and run it. This cleans up most\n# temporary (files, cache) and unneeded data (outdated installation data).\n#\n# In order for this script to work, a Windows image needs to have mdata-get.exe,\n# mdata-put.exe and prepare_image_runner.ps1 installed in C:\\smartdc\\bin, and\n# prepare_image_runner.ps1 should be run by Windows on every boot. Upon boot,\n# prepare_image_runner.ps1 will then check if \"sdc:operator-script\" metadata\n# (seen as internal_metadata.\"operator-script\" in \"vmadm get\" output) is present\n# over COM2, and run it. If it's not present, booting continues as normal.\n#\n# Apparently, the only way to get cleanmgr to run without displaying a final\n# information dia
#/bin/sh
rm -f winsetup.iso
find winsetup/ -name .DS_Store -delete
hdiutil makehybrid -o winsetup.iso winsetup/ -iso -joliet
@marsell
marsell / gist:cd55815242f99955a8b4537d7e76f4eb
Created August 3, 2018 15:21
Basic Windows 2012r2 image creation with EMS' SAC on SmartOS
1.
Get Windows 2012r2 eval ISO from here: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2012
Get virtio driver ISO from here: https://download.joyent.com/pub/vmtools/me-ws2012std-20130712.iso
For convenience, rename the ridiculously long Windows ISO to "win2012r2eval.iso"
2.
Example kvm.json is:
{
"brand": "kvm",
"vcpus": 2,