For packaging I use Hyper-V with VMs for two use cases:
1. Installing software and detecting changes, uses checkpoints to restore
2. Autopilot VMs for testing the packaged application.
After the VM is configured, run through the windows setup with a local user account, make sure to run Windows Update after OOBE and then proceed to power down and make a checkpoint.
Gather the HWID and other information needed during OOBE and register them in your Autopilot devices. Getting the required information can be done by pressing Ctrl+Shift+D during OOBE, this opens the diagnostic menu where you can export autopilot logs congaing the one CSV file you need.
The Autopilot VMs should be reset for testing new packages, for this you can use the Company Portal to reset the device.