Download, but don't run, the Sierra installer from the Mac App Store. This places the installer at
/Applications/Install\ macOS\ Sierra.app/
.
Now run the following commands to build a suitable VM image from the installer:
git clone https://github.com/jonanh/osx-vm-templates
cd osx-vm-templates/packer
sudo ../prepare_iso/prepare_vdi.sh -D DISABLE_REMOTE_MANAGEMENT -o macOS_10.12.vdi /Applications/Install\ macOS\ Sierra.app/ .