guix vagrant script stuck after reboot

52 views
Skip to first unread message

Bashid

unread,
Dec 18, 2019, 5:56:08 AM12/18/19
to Packer
I run this script with packer (with some modification), it's a script that generate custom guix image. 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.

it seems that a ssh problem but how i could solve this?

Bashid

unread,
Dec 18, 2019, 6:38:18 AM12/18/19
to Packer
in below is also debug messages.


2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [INFO] 35 bytes written for 'uploadData'
2019/12/18 11:28:41 [INFO] 35 bytes written for 'uploadData'
2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [DEBUG] Opening new ssh session
2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [ERROR] ssh session open error: 'client not available', attempting reconnect
2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [DEBUG] reconnecting to TCP connection for SSH
2019/12/18 11:28:41 packer: 2019/12/18 11:28:41 [DEBUG] handshaking with SSH
2019/12/18
 
11:28:45 packer: 2019/12/18 11:28:45 Retryable error: Error uploading
script
: ssh: handshake failed: ssh: unable to authenticate, attempted
methods
[none password publickey], no supported methods remain





Rickard von Essen

unread,
Dec 18, 2019, 1:52:02 PM12/18/19
to packe...@googlegroups.com
Run with flag --on-error=ask.

When if fails you troubleshoot ssh both from the host and inside the VM. And don't run headless when troubleshooting. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/5f873f17-96ea-4318-a30d-01f1fae94c8b%40googlegroups.com.

Bashid

unread,
Dec 19, 2019, 1:26:20 AM12/19/19
to Packer
what topic i must explore when it's stick in error position?

you troubleshoot ssh both from the host and inside the VM

What's you mean? is it possible to explain more?

Rickard von Essen

unread,
Dec 19, 2019, 12:18:59 PM12/19/19
to packe...@googlegroups.com
It's a very big topic and largely depends on related knowledge of networking and Linux system administration etc.

Maybe check this

Or familiarize more with Linux administration:

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Bashid

unread,
Dec 21, 2019, 5:05:46 AM12/21/19
to Packer
Yes, I check my /var/log/message in vm after stop on error
it was a password root error, correct password then it's ok.
Thanks

On Thursday, December 19, 2019 at 8:48:59 PM UTC+3:30, Rickard von Essen wrote:
It's a very big topic and largely depends on related knowledge of networking and Linux system administration etc.

Maybe check this

Or familiarize more with Linux administration:

On Thu, Dec 19, 2019, 07:26 Bashid <farsh...@gmail.com> wrote:
what topic i must explore when it's stick in error position?

you troubleshoot ssh both from the host and inside the VM

What's you mean? is it possible to explain more?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages