Hi Packer list

I'm new to Packer and I've not been able able to get it to produce a 
qemu/kvm image successfully yet. My host system is Ubuntu 17.10 amd64 (ufw 
firewall is disabled) running packer 1.1.1 and I am trying to create an 
image from CentOS 6.9 - I have tried both the minimal and full DVD CentOS 
ISOs.

When I run:

packer build centos6-kvm.json

CentOS boots, it installs fine then it powers the VM off and all I am left 
with is the message:

qemu: Waiting for SSH to become available...

SSH never does become available so I have to kill packer.

I have searched these groups for similar issues. I noticed someone else 
having this same same issue with qemu/KVM but that user didn't post their 
solution, if they ever did get it to work. I tried to deviate from the 
given example configs as little as possible.

Here are my current configs:

centos6-kvm.json:

{
  "builders":
  [
    {
      "type": "qemu",
      "iso_url": "/home/dan/Downloads/CentOS-6.9-x86_64-minimal.iso",
      "iso_checksum": "af4a1640c0c6f348c6c41f1ea9e192a2",
      "iso_checksum_type": "md5",
      "output_directory": "output_centos6test",
      "shutdown_command": "shutdown -P now",
      "disk_size": 5000,
      "format": "qcow2",
      "headless": false,
      "accelerator": "kvm",
      "http_directory": "/var/www/html/",
      "http_port_min": 10082,
      "http_port_max": 10089,
      "ssh_host_port_min": 2222,
      "ssh_host_port_max": 2229,
      "ssh_username": "root",
      "ssh_password": "longishpassword",
      "ssh_wait_timeout": "10000s",
      "vm_name": "c6test",
      "net_device": "virtio-net",
      "disk_interface": "virtio",
      "boot_wait": "5s",
      "boot_command": [
        "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort 
}}/centos6-ks.cfg<enter><wait>"
      ]
    }
  ]
}




centos6-ks.cfg:

text
skipx
install
url --url http://mirrorservice.org/sites/mirror.centos.org/6/os/x86_64/
repo --name=updates 
--baseurl=http://mirrorservice.org/sites/mirror.centos.org/6/updates/x86_64/
lang en_US.UTF-8
keyboard us
rootpw longishpassword
firewall --disable
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone Etc/UTC
%include /tmp/kspre.cfg

services --enabled=network,sshd/sendmail

poweroff

%packages --nobase
at
acpid
cronie-noanacron
crontabs
logrotate
mailx
mlocate
openssh-clients
openssh-server
rsync
sendmail
tmpwatch
vixie-cron
which
wget
yum
-biosdevname
-postfix
-prelink
%end

%pre
bootdrive=vda

if [ -f "/dev/$bootdrive" ] ; then
  exec < /dev/tty3 > /dev/tty3
  chvt 3
  echo "ERROR: Drive device does not exist at /dev/$bootdrive!"
  sleep 5
  halt -f
fi

cat >/tmp/kspre.cfg <<CFG
zerombr
bootloader --location=mbr --driveorder=$bootdrive --append="nomodeset"
clearpart --all --initlabel
part /boot --ondrive=$bootdrive --fstype ext4 --fsoptions="relatime,nodev" 
--size=512
part pv.1 --ondrive=$bootdrive --size 1 --grow
volgroup vg0 pv.1
logvol / --fstype ext4 --fsoptions="noatime,nodiratime,relatime,nodev" 
--name=root --vgname=vg0 --size=4096
logvol swap --fstype swap --name=swap --vgname=vg0 --size 1 --grow
CFG

%end

%post

%end

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/706eb33e-ec7d-4f1d-98ae-f87bbfbc451e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to