IntelLabs / IntelLabs/kAFL

Cannot Build Windows VM Template

Open
#331 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Makefile
Stars
814
Forks
109
PR merge metrics
No merged PRs in 30d

Description

Hi, I've been trying this for quite some time now and the windows VM template build step fails differently each time. I can confirm the installation is working (`kafl fuzz` after `make env`).

The issue happens during the vagrant box creation (or the disk creation maybe) when the system crashes with the following output:

```
2025/08/20 04:06:49 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 04:06:49 [INFO] starting remote command: shutdown /s /t 10 /f /d p:4:1 /c "Packer Shutdown"
2025/08/20 04:06:49 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 04:06:49 [INFO] command 'shutdown /s /t 10 /f /d p:4:1 /c "Packer Shutdown"' exited with code: 0
2025/08/20 04:06:49 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 04:06:49 Waiting max 5m0s for shutdown to complete
2025/08/20 04:07:19 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 04:07:19 Qemu stderr: qemu-system-x86_64: Slirp: Failed to send packet, ret: -1
==> qemu.windows: Converting hard drive...
2025/08/20 04:07:22 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 04:07:22 VM shut down.
2025/08/20 04:07:22 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 04:07:22 Executing qemu-img: []string{"convert", "-O", "qcow2", "output-windows/win10.qcow2", "output-windows/win10.qcow2.convert"}
```

When I check `/kAFL/kafl/examples/templates/windows`, there's only the `output-windows` directory (containing - `win10.qcow2.convert` and `win10.qcow2`) but no `packer_windows_libvirt.box` and I see the following output for `make import`:

```
* Output directory 'output-windows' already exists. It must not exist.

on windows.pkr.hcl line 101:
(source code not available)

2025/08/20 04:31:18 [INFO] (telemetry) Finalizing.
Error: 1 error(s) occurred:

* Output directory 'output-windows' already exists. It must not exist.

on windows.pkr.hcl line 101:
(source code not available)
```

Even if I try multiple times after this point (after `rm -rf output-windows/`), the build step fails when trying to setup the Visual Studio Native Desktop Workload:

```
==> qemu.windows: TASK [Install Visual Studio Native Desktop Workload] ***************************
==> qemu.windows: fatal: [default]: FAILED! => changed=true
==> qemu.windows: cmd: vs_community.exe --quiet --wait --norestart --add Microsoft.VisualStudio.Workload.NativeDesktop
==> qemu.windows: delta: '0:09:31.437566'
==> qemu.windows: end: '2025-08-20 09:39:32.583205'
==> qemu.windows: msg: non-zero return code
==> qemu.windows: rc: 1603
==> qemu.windows: start: '2025-08-20 09:30:01.145639'
==> qemu.windows: stderr: ''
==> qemu.windows: stderr_lines:
==> qemu.windows: stdout: |-
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1028\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1033\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1046\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1055\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1045\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1040\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\3082\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1031\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1036\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1041\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1049\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\2052\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1029\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\HelpFile\1042\help.html...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\vs_setup_bootstrapper.exe...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.C2RSignatureReader.Interop.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.C2RSignatureReader.Native.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.Identity.Client.Broker.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.Identity.Client.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.Identity.Client.Extensions.Msal.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.Identity.Client.NativeInterop.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.IdentityModel.Abstractions.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.VisualStudio.RemoteControl.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.VisualStudio.Setup.Common.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.VisualStudio.Setup.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.VisualStudio.Setup.Download.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.VisualStudio.Telemetry.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Microsoft.VisualStudio.Utilities.Internal.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\runtimes\win-x64\native\msalruntime.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\runtimes\win-arm64\native\msalruntime_arm64.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\runtimes\win-x86\native\msalruntime_x86.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\Newtonsoft.Json.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\System.Memory.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\System.Runtime.CompilerServices.Unsafe.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\VSInstallerElevationService.Contracts.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\zh-Hans\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\pl\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\cs\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\it\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\ja\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\zh-Hant\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\tr\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\pt-BR\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\de\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\fr\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\ko\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\es\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\ru\vs_setup_bootstrapper.resources.dll...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\vs_setup_bootstrapper.config...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\vs_setup_bootstrapper.exe.config...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\detection.json...
==> qemu.windows: Preparing: C:\Users\vagrant\AppData\Local\Temp\76b104de170757b4ceedf8320cc692\vs_bootstrapper_d15\vs_setup_bootstrapper.json...
==> qemu.windows: stdout_lines:
==> qemu.windows:
==> qemu.windows: PLAY RECAP *********************************************************************
==> qemu.windows: default : ok=7 changed=6 unreachable=0 failed=1 skipped=4 rescued=0 ignored=0
==> qemu.windows:
2025/08/20 05:39:32 [INFO] (telemetry) ending ansible
==> qemu.windows: Provisioning step had errors: Running the cleanup provisioner, if present...
2025/08/20 05:39:32 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 05:39:32 failed to unlock port lockfile: close tcp [::]:5990: use of closed network connection
2025/08/20 05:39:32 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 05:39:32 failed to unlock port lockfile: close tcp [::]:2662: use of closed network connection
2025/08/20 05:39:32 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2025/08/20 05:39:32 Deleting floppy disk: /tmp/packer2972719003
==> qemu.windows: Deleting output directory...
2025/08/20 05:39:32 [INFO] (telemetry) ending qemu.windows
==> Wait completed after 35 minutes 13 seconds
2025/08/20 05:39:32 machine readable: error-count []string{"1"}
Build 'qemu.windows' errored after 35 minutes 13 seconds: Error executing Ansible: Non-zero exit status: exit status 2
==> Some builds didn't complete successfully and had errors:
2025/08/20 05:39:32 machine readable: qemu.windows,error []string{"Error executing Ansible: Non-zero exit status: exit status 2"}

==> Builds finished but no artifacts were created.
```

It's only after I delete the whole repo and start again that I'm able to at least get to disk conversion (which is the last step I believe). But then too, as I mentioned earlier, the system crashes.

System specification:

- OS: Ubuntu 24.04.3 LTS x86_64
- Kernel: 6.8.0-nyx+
- CPU: Intel Ultra 7 155H

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.