Last active
December 18, 2018 13:17
-
-
Save rezamt/d7b933fd8a08ab68cd3d28f5f209fba2 to your computer and use it in GitHub Desktop.
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
# How | |
qemu-img create -f raw -o size=20G w2k2016dc_disk.img | |
qemu-system-x86_64 -boot d -cdrom /Users/reza/Downloads/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO -m 2048M -hda /Users/reza/projects/w2k2016dc_disk.img | |
# References | |
# https://pastebin.com/VfRRr5KV | |
# https://www.emaculation.com/doku.php/ppc-osx-on-qemu-for-osx |
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
{ | |
"_comment": "Build with `packer build windows.json`", | |
"builders": [ | |
{ | |
"type": "qemu", | |
"disk_size": "{{ user `disk_size` }}", | |
"floppy_files": "{{ user `floppy_files_list` }}", | |
"headless": "{{ user `headless` }}", | |
"http_directory": "http", | |
"iso_checksum": "{{ user `iso_checksum` }}", | |
"iso_checksum_type": "{{ user `iso_checksum_type` }}", | |
"iso_urls": [ | |
"{{ user `iso_url` }}" | |
], | |
"output_directory": "output-{{ user `vm_name` }}", | |
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"", | |
"communicator": "winrm", | |
"winrm_username": "vagrant", | |
"winrm_password": "vagrant", | |
"winrm_timeout": "10000s", | |
"accelerator": "none", | |
"qemuargs": [ | |
[ "-m", "8096M" ], | |
[ "-cpu", "Westmere" ] | |
], | |
"boot_wait": "2s", | |
"vm_name": "{{ user `vm_name` }}", | |
"qemuargs": [ | |
[ "-m", "{{ user `memory` }}" ], | |
[ "-smp", "cpus={{ user `cpus`}}"] | |
] | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "windows-shell", | |
"scripts": [ | |
"scripts/unlimited-password-expiration.bat", | |
"scripts/enable-rdp.bat", | |
"scripts/uac-disable.bat", | |
"scripts/disablewinupdate.bat", | |
"scripts/disable-hibernate.bat", | |
"scripts/firewall-open-ping.bat", | |
"scripts/firewall-open-rdp.bat" | |
] | |
}, | |
{ | |
"type": "windows-shell", | |
"inline": ["net user vagrant {{ user `password`}}"] | |
} | |
], | |
"variables": { | |
"disk_size": "65536", | |
"cpus" : "4", | |
"memory" : "8096", | |
"headless": "true", | |
"iso_checksum_type": "md5", | |
"iso_checksum": "70721288bbcdfe3239d8f8c0fae55f1f", | |
"iso_url": "/users/reza/Downloads/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO", | |
"preseed" : "windows-2016-standard/*", | |
"vagrantfile_template" : "vagrantfile-windows-2016-standard.template", | |
"version" : "1", | |
"vm_name": "windows-2016", | |
"floppy_files_list" : "floppy/drivers/virtio-win-0.1.135/viostor/2k16/amd64/*,floppy/drivers/virtio-win-0.1.135/NetKVM/2k16/amd64/*,floppy/common/*,floppy/windows-2016-standard/*" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment