I tried this:

  "builders": [
    {
      "accelerator": "kvm",
      "boot_command": [
        "<enter><enter><f6><esc><wait> ",
        "autoinstall ds='nocloud-net;s=http://127.0.0.1:3003/'",
        "<wait><enter>"
      ],
      "boot_wait": "10s",
      "cpus": "1",
      "disk_cache": "none",
      "disk_compression": true,
      "disk_interface": "ide",
      "disk_size": "30G",
      "format": "qcow2",
      "headless": "true",
      "http_directory": "./http",
      "iso_checksum": 
"sha256:f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98",
      "iso_urls": [
        "/var/lib/libvirt/images/ubuntu-20.04.3-live-server-amd64.iso"
      ],
      "memory": "1024",
      "name": "ubuntu-packer1",
      "net_device": "virtio-net",
      "net_bridge": "virbr0",
      "output_directory": "output/ubuntu",
      "shutdown_command": "shutdown -P now",
      "ssh_handshake_attempts": "20",
      "ssh_password": "huuhaa",
      "ssh_pty": "true",
      "ssh_timeout": "20m",
      "ssh_username": "ubuntu",
      "type": "qemu",
      "use_default_display": false
    }
  ],
  "provisioners": [
    {
      "inline": [
        "ls /"
      ],
      "type": "shell"
    }
  ]
}

user-data:
#cloud-config
autoinstall:
  version: 1
  early-commands:
    - sudo systemctl stop ssh
  identity:
    hostname: ubuntu-vm
    password: 
"$6$Yvfsk9tx64XW.w77$4mq6vQDclsQiJMAEc.TwPguRRRntVWmINa9ubpZwJG4SpAJgNYgBaBjwIokSO3X3bkulCeZr2bqMfXeiOupL.1"
    username: ubuntu
  locale: en_US.UTF-8
  keyboard:
    layout: fi
  user-data:
    disable_root: false
    timezone: Europe/Helsinki
  late-commands:
    - echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
    - sudo systemctl start ssh

2022/02/05 21:14:26 ui: ==> ubuntu-packer1: Waiting for SSH to become 
available...
2022/02/05 21:14:26 packer-builder-qemu plugin: [INFO] Attempting SSH 
connection to 192.168.122.78:22...
2022/02/05 21:14:26 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP 
connection for SSH
2022/02/05 21:14:26 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2022/02/05 21:14:28 packer-builder-qemu plugin: [DEBUG] SSH handshake err: 
ssh: handshake failed: ssh: unable to authenticate, attempted methods [none 
password], no supported methods remain
2022/02/05 21:14:28 packer-builder-qemu plugin: [DEBUG] Detected 
authentication error. Increasing handshake attempts.
lauantai 5. helmikuuta 2022 klo 1.33.16 UTC+2 [email protected] kirjoitti:

> I looked at your json code. I have never tried making a vagrant box for 
> kvm with packer.   Also the terminal connection is something for which I am 
> not familiar.  Good luck.
>
> On Fri, Feb 4, 2022 at 3:00 PM Edward Cheadle <[email protected]> wrote:
>
>> Sorry this is for my 21.10 install but I think putting the linux line 
>> before the autoinstall is something to try.
>>
>> My boot command for 20.04
>> "boot_command":  ["<enter><enter><f6><esc><wait> ", "autoinstall 
>> ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/", "<wait><enter>"]
>>
>> On Friday, February 4, 2022 at 2:57:49 PM UTC-7 Edward Cheadle wrote:
>>
>>> THis is my boot command.  You might try putting the line linux 
>>> /casper/vmlinux quiet<wait> before the autoinstall line.
>>> boot_command      =  [
>>>                 " <wait>",
>>>                 " <wait>",
>>>                 " <wait>",
>>>                 " <wait>",
>>>                 " <wait>",
>>>                 "c",
>>>                 "<wait>",
>>>                 "set gfxpayload=keep",
>>>                 "<enter><wait>",
>>>                 "linux /casper/vmlinuz quiet<wait>",
>>>                 " autoinstall<wait>",
>>>                 " ds=nocloud-net<wait>",
>>>                 "\\;s=http://<wait>",
>>>                 "{{.HTTPIP}}<wait>",
>>>                 ":{{.HTTPPort}}/<wait>",
>>>                 " ---",
>>>                 "<enter><wait>",
>>>                 "initrd /casper/initrd<wait>",
>>>                 "<enter><wait>",
>>>                 "boot<enter><wait>"]
>>>
>>>
>>> On Tuesday, January 25, 2022 at 3:20:33 AM UTC-7 [email protected] 
>>> wrote:
>>>
>>>> Hi, I'm, trying this ubuntu.json
>>>>
>>>> {
>>>>   "variables": {
>>>>     "serial": ""
>>>>   },
>>>>
>>>>   "builders": [
>>>>     {
>>>>       "accelerator": "kvm",
>>>>       "boot_command": [
>>>>         "",
>>>>         "append console=ttyS0,115200n8 autoinstall 
>>>> ds=no-cloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/user-data",
>>>>         "initrd=casper/initrd ",
>>>>         "kernel=casper/vmlinuz ",
>>>>         ""
>>>>       ],
>>>>       "boot_wait": "10s",
>>>>       "disk_interface": "virtio",
>>>>       "disk_size": "50G",
>>>>       "disk_cache": "none",
>>>>       "disk_compression": true,
>>>>       "headless": "true",
>>>>       "use_default_display": false,
>>>>       "format": "qcow2",
>>>>       "http_directory": "./http",
>>>>       "iso_checksum": 
>>>> "sha256:f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98",
>>>>       "iso_urls": [
>>>>         "/Scripts/ubuntu-20.04.3-live-server-amd64.iso"
>>>>       ],
>>>>       "name": "ubuntu-packer1",
>>>>       "net_device": "virtio-net",
>>>>       "output_directory": "output/ubuntu",
>>>>       "shutdown_command": "shutdown -P now",
>>>>       "ssh_handshake_attempts": "20",
>>>>       "ssh_password": "ubuntu",
>>>>       "ssh_timeout": "20m",
>>>>       "ssh_username": "ubuntu",
>>>>       "type": "qemu",
>>>>       "cpus": "1",
>>>>       "memory": "1024"
>>>>     }
>>>>   ],
>>>>   "provisioners": [
>>>>     {
>>>>       "inline": [
>>>>         "ls /"
>>>>       ],
>>>>       "type": "shell"
>>>>     }
>>>>   ]
>>>> }
>>>>
>>>> I'm connected to build host trough ssh without X, so no graphics. I get 
>>>> this into packer.log:
>>>> 2022/01/25 11:28:02 packer-builder-qemu plugin: [INFO] Attempting SSH 
>>>> connection to 127.0.0.1:3299...
>>>> 2022/01/25 11:28:02 packer-builder-qemu plugin: [DEBUG] reconnecting to 
>>>> TCP connection for SSH
>>>> 2022/01/25 11:28:02 packer-builder-qemu plugin: [DEBUG] handshaking 
>>>> with SSH
>>>>
>>>> But there's no ssh available, ssh does not respond from cmd line to 
>>>> 127.0.0.1 -p 3299 either. Kickstart file was generated from manual install 
>>>> I did earlier. I'm newbie with Packer so what I doing wrong here?
>>>>
>>>> Br, Jouni
>>>>
>>> -- 
>> 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/hashicorp/packer/issues
>> IRC: #packer-tool on Freenode
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Packer" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/packer-tool/5LXVHM_9PcI/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/5f1747b0-ba0d-4df5-840c-78c7da414c4bn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/packer-tool/5f1747b0-ba0d-4df5-840c-78c7da414c4bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/hashicorp/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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/14eb46d0-b351-4480-bc1b-4febfcf8084fn%40googlegroups.com.

Reply via email to