I run your script with some modification. The running is Ok until first reboot that i display at the end of below code.
{
"min_packer_version": "1.4.0",
"builders": [{
"type": "virtualbox-iso",
"vm_name": "guixsd1",
"guest_os_type": "Linux_64",
"memory": 3000,
"headless": true,
"iso_url": "./guix-system-install-1.0.1.x86_64-linux.iso",
"iso_checksum": "4ef645465464613513113ab17537bbead7fb41741e47fedab9451524a292a98de1",
"iso_checksum_type": "sha256",
"ssh_username": "root",
"ssh_password": "password",
"boot_command": [
"<enter><wait30s><enter><wait1s><end><up><up><enter><wait1s><down><enter><enter><wait2s><enter>",
"passwd root<enter>password<enter>password<enter>",
"herd start ssh-daemon<enter>"
],
"ssh_timeout": "5m",
"shutdown_command": "shutdown"
}],
"provisioners": [
{
"type": "shell",
"inline": [
"parted -s --align=none /dev/sda mktable gpt mkpart primary ext2 0 100MB mkpart primary ext2 100MB 100% set 1 bios_grub on",
"mkfs.ext4 -L my-root /dev/sda2",
"mount LABEL=my-root /mnt",
"herd start cow-store /mnt",
"mkdir /mnt/etc"
]
},
{
"type": "file",
"source": "core-config.scm",
"generated": true,
"destination": "/mnt/etc/config.scm"
},
{
"type": "shell",
"inline": [
"guix system init /mnt/etc/config.scm /mnt",
"herd stop ssh-daemon"
]
},
{
"type": "shell",
"expect_disconnect": true,
"skip_clean": true,
"inline": ["reboot"]
},
{
"type": "shell",
"pause_before":"10s",
"inline": ["herd start ssh-daemon"]
},
.
.
.
[Other Commands]
After reboot. it's stuck and after 5 minutes (ssh timeout) i encounter with below error:
==> virtualbox-iso: copying to
'/mnt'...
virtualbox-iso: populating '/mnt'...
virtualbox-iso: bootloader successfully installed on '/dev/sda'
virtualbox-iso: Service ssh-daemon has been stopped.
==> virtualbox-iso: Provisioning with shell script: /tmp/packer-shell108761660
==> virtualbox-iso: Pausing 10s before the next provisioner...
==> virtualbox-iso: Provisioning with shell script: /tmp/packer-shell812273279
==> virtualbox-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
==>
virtualbox-iso: Deregistering and deleting
VM...
==> virtualbox-iso: Deleting output
directory...
Build 'virtualbox-iso' errored: Error uploading script: ssh:
handshake failed: ssh: unable to authenticate, attempted methods
[publickey none password], no supported methods
remain
==> Some builds didn't complete successfully and had
errors:
--> virtualbox-iso: Error uploading script: ssh: handshake
failed: ssh: unable to authenticate, attempted methods [publickey none
password], no supported methods
remain
==> Builds finished but no artifacts were created.