Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit fa5bb5b

Browse files
committed
Change VirtIO drivers installation, cpu+memory parameters increased
1 parent 38a21a6 commit fa5bb5b

File tree

15 files changed

+57
-60
lines changed

15 files changed

+57
-60
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,45 +254,46 @@ cd packer-templates
254254

255255
```bash
256256
curl -L -O /var/tmp/virtio-win.iso https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso
257+
xorriso -report_about WARNING -osirrox on -indev /var/tmp/virtio-win.iso -extract / /var/tmp/virtio-win
257258
export TMPDIR=/var/tmp
258259

259260
# Windows Server
260261
## Windows Server 2012
261262
export NAME="windows-server-2012_r2-standard-x64-eval"
262263
export WINDOWS_VERSION="2012"
263-
export VIRTIO_WIN_ISO="/var/tmp/virtio-win.iso"
264+
export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win"
264265
export ISO_URL="http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO"
265266
export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
266267
packer build -only="qemu" windows.json
267268

268269
## Windows Server 2019
269270
export NAME="windows-server-2019-standard-x64-eval"
270271
export WINDOWS_VERSION="2019"
271-
export VIRTIO_WIN_ISO="/var/tmp/virtio-win.iso"
272+
export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win"
272273
export ISO_URL="https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso"
273274
export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
274275
packer build -only="qemu" windows.json
275276

276277
## Windows Server 2016
277278
export NAME="windows-server-2016-standard-x64-eval"
278279
export WINDOWS_VERSION="2016"
279-
export VIRTIO_WIN_ISO="/var/tmp/virtio-win.iso"
280+
export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win"
280281
export ISO_URL="https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO"
281282
export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
282283
packer build -only="qemu" windows.json
283284

284285
# Windows 10
285286
export NAME="windows-10-enterprise-x64-eval"
286287
export WINDOWS_VERSION="10"
287-
export VIRTIO_WIN_ISO="/var/tmp/virtio-win.iso"
288+
export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win"
288289
export ISO_URL="https://software-download.microsoft.com/download/pr/19041.264.200511-0456.vb_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso"
289290
export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
290291
packer build -only="qemu" windows.json
291292

292293
# Windows 10 - customized
293294
export NAME="my_windows-10-enterprise-x64-eval"
294295
export WINDOWS_VERSION="10"
295-
export VIRTIO_WIN_ISO="/var/tmp/virtio-win.iso"
296+
export VIRTIO_WIN_ISO_DIR="/var/tmp/virtio-win"
296297
export ISO_URL="https://software-download.microsoft.com/download/pr/19041.264.200511-0456.vb_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso"
297298
export PACKER_IMAGES_OUTPUT_DIR="/var/tmp/"
298299
packer build -only="qemu" my_windows.json

ansible/site.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
roles:
55
- role: ansible-role-virtio-win
6-
virtio_win_iso_path: 'E:\\'
6+
virtio_win_iso_path: 'E:\\virtio-win\\'
77
when: ansible_system == 'Win32NT' and ansible_system_vendor == 'QEMU'
88
- role: ansible-role-my_common_defaults
99
when: packer_build_name | regex_search('^my_')

ansible/win-simple.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
roles:
88
- role: ansible-role-virtio-win
9-
virtio_win_iso_path: 'E:\\'
9+
virtio_win_iso_path: 'E:\\virtio-win\\'
1010
when: ansible_system_vendor == "QEMU"
1111

1212
tasks:

build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
set -eu -o pipefail
44

55
# Packer cache directory (where to store the iso images)
6-
export PACKER_CACHE_DIR=${PACKER_CACHE_DIR:-${PWD}/packer_cache}
6+
export PACKER_CACHE_DIR=${PACKER_CACHE_DIR:-/var/tmp/packer_cache}
77
# VirtIO win iso URL (https://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers)
88
export VIRTIO_WIN_ISO_URL=${VIRTIO_WIN_ISO_URL:-https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso}
99
export VIRTIO_WIN_ISO=${VIRTIO_WIN_ISO:-${PACKER_CACHE_DIR}/$(basename "${VIRTIO_WIN_ISO_URL}")}
10+
export VIRTIO_WIN_ISO_DIR=${VIRTIO_WIN_ISO_DIR:-${PACKER_CACHE_DIR}/virtio-win}
1011
# Do not use any GUI X11 windows
1112
export HEADLESS=${HEADLESS:-true}
1213
# Qemu Accelerator - use kvm for Linux and hvf for MacOS
@@ -163,7 +164,10 @@ cmdline() {
163164

164165
echo "* NAME: ${NAME}, WINDOWS_ARCH: ${WINDOWS_ARCH}, WINDOWS_VERSION: ${WINDOWS_VERSION}, WINDOWS_EDITION: ${WINDOWS_EDITION}, PACKER_FILE: ${PACKER_FILE}"
165166
ISO_CHECKSUM=$(awk "/$(basename ${ISO_URL})/ { print \$1 }" win_iso.sha256)
166-
test -f "${VIRTIO_WIN_ISO}" || curl -L "${VIRTIO_WIN_ISO_URL}" --output "${VIRTIO_WIN_ISO}"
167+
if [[ ${NAME} =~ "virtualbox" ]]; then
168+
test -f "${VIRTIO_WIN_ISO}" || curl -L "${VIRTIO_WIN_ISO_URL}" --output "${VIRTIO_WIN_ISO}"
169+
test -d "${VIRTIO_WIN_ISO_DIR}" || xorriso -report_about SORRY -osirrox on -indev "${VIRTIO_WIN_ISO}" -extract / "${VIRTIO_WIN_ISO_DIR}"
170+
fi
167171
;;
168172
*)
169173
echo "*** Unsupported build type: \"${NAME}\" used from \"${BUILD}\""

http/windows-10/Autounattend.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@
8080
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" language="neutral" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
8181
<DriverPaths>
8282
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
83-
<Path>E:\NetKVM\w10\amd64\</Path>
83+
<Path>E:\virtio-win\NetKVM\w10\amd64\</Path>
8484
</PathAndCredentials>
8585
<PathAndCredentials wcm:action="add" wcm:keyValue="3">
86-
<Path>E:\viostor\w10\amd64\</Path>
86+
<Path>E:\virtio-win\viostor\w10\amd64\</Path>
8787
</PathAndCredentials>
8888
</DriverPaths>
8989
</component>
@@ -144,7 +144,7 @@
144144
<RequiresUserInput>true</RequiresUserInput>
145145
</SynchronousCommand>
146146
<SynchronousCommand wcm:action="add">
147-
<CommandLine>cmd.exe /c powershell -File a:\fixnetwork.ps1</CommandLine>
147+
<CommandLine>cmd.exe /c powershell -File A:\fixnetwork.ps1</CommandLine>
148148
<Description>Fix public network</Description>
149149
<Order>2</Order>
150150
<RequiresUserInput>true</RequiresUserInput>

http/windows-2012/Autounattend.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" language="neutral" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
1515
<DriverPaths>
1616
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
17-
<Path>E:\NetKVM\2k12R2\amd64\</Path>
17+
<Path>E:\virtio-win\NetKVM\2k12R2\amd64\</Path>
1818
</PathAndCredentials>
1919
<PathAndCredentials wcm:action="add" wcm:keyValue="3">
20-
<Path>E:\viostor\2k12R2\amd64\</Path>
20+
<Path>E:\virtio-win\viostor\2k12R2\amd64\</Path>
2121
</PathAndCredentials>
2222
</DriverPaths>
2323
</component>
@@ -153,7 +153,7 @@
153153
<RequiresUserInput>true</RequiresUserInput>
154154
</SynchronousCommand>
155155
<SynchronousCommand wcm:action="add">
156-
<CommandLine>cmd.exe /c powershell -File a:\fixnetwork.ps1</CommandLine>
156+
<CommandLine>cmd.exe /c powershell -File A:\fixnetwork.ps1</CommandLine>
157157
<Description>Fix public network</Description>
158158
<Order>2</Order>
159159
<RequiresUserInput>true</RequiresUserInput>

http/windows-2016/Autounattend.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" language="neutral" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
1515
<DriverPaths>
1616
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
17-
<Path>E:\NetKVM\2k16\amd64\</Path>
17+
<Path>E:\virtio-win\NetKVM\2k16\amd64\</Path>
1818
</PathAndCredentials>
1919
<PathAndCredentials wcm:action="add" wcm:keyValue="3">
20-
<Path>E:\viostor\2k16\amd64\</Path>
20+
<Path>E:\virtio-win\viostor\2k16\amd64\</Path>
2121
</PathAndCredentials>
2222
</DriverPaths>
2323
</component>
@@ -153,7 +153,7 @@
153153
<RequiresUserInput>true</RequiresUserInput>
154154
</SynchronousCommand>
155155
<SynchronousCommand wcm:action="add">
156-
<CommandLine>cmd.exe /c powershell -File a:\fixnetwork.ps1</CommandLine>
156+
<CommandLine>cmd.exe /c powershell -File A:\fixnetwork.ps1</CommandLine>
157157
<Description>Fix public network</Description>
158158
<Order>2</Order>
159159
<RequiresUserInput>true</RequiresUserInput>

http/windows-2019/Autounattend.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" language="neutral" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
1515
<DriverPaths>
1616
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
17-
<Path>E:\NetKVM\2k16\amd64\</Path>
17+
<Path>E:\virtio-win\NetKVM\2k16\amd64\</Path>
1818
</PathAndCredentials>
1919
<PathAndCredentials wcm:action="add" wcm:keyValue="3">
20-
<Path>E:\viostor\2k16\amd64\</Path>
20+
<Path>E:\virtio-win\viostor\2k16\amd64\</Path>
2121
</PathAndCredentials>
2222
</DriverPaths>
2323
</component>
@@ -153,7 +153,7 @@
153153
<RequiresUserInput>true</RequiresUserInput>
154154
</SynchronousCommand>
155155
<SynchronousCommand wcm:action="add">
156-
<CommandLine>cmd.exe /c powershell -File a:\fixnetwork.ps1</CommandLine>
156+
<CommandLine>cmd.exe /c powershell -File A:\fixnetwork.ps1</CommandLine>
157157
<Description>Fix public network</Description>
158158
<Order>2</Order>
159159
<RequiresUserInput>true</RequiresUserInput>

my_centos-7.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
4545
"ssh_password": "{{ user `ssh_password` }}",
4646
"ssh_username": "{{ user `ssh_username` }}",
47+
"ssh_timeout": "30m",
4748
"type": "virtualbox-iso",
4849
"vboxmanage": [
4950
[
@@ -119,10 +120,10 @@
119120
"centos_tag": "{{ env `CENTOS_TAG` }}",
120121
"centos_type": "{{ env `CENTOS_TYPE` }}",
121122
"centos_version": "{{ env `CENTOS_VERSION` }}",
122-
"cpus": "2",
123+
"cpus": "4",
123124
"disk_size": "51200",
124125
"headless": "false",
125-
"memory": "4096",
126+
"memory": "8192",
126127
"name": "{{ env `NAME` }}",
127128
"packer_images_output_dir": "{{ env `PACKER_IMAGES_OUTPUT_DIR` }}",
128129
"preseed_file_name": "my-ks.cfg",

my_ubuntu-server.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
5757
"ssh_password": "{{ user `ssh_password` }}",
5858
"ssh_username": "{{ user `ssh_username` }}",
59+
"ssh_timeout": "30m",
5960
"type": "virtualbox-iso",
6061
"vboxmanage": [
6162
[
@@ -119,10 +120,10 @@
119120
],
120121
"variables": {
121122
"accelerator": "kvm",
122-
"cpus": "2",
123+
"cpus": "4",
123124
"disk_size": "51200",
124125
"headless": "false",
125-
"memory": "4096",
126+
"memory": "8192",
126127
"name": "{{ env `NAME` }}",
127128
"packer_images_output_dir": "{{ env `PACKER_IMAGES_OUTPUT_DIR` }}",
128129
"preseed_file_name": "my-preseed.cfg",

0 commit comments

Comments
 (0)