Packer Hyperv-iso build for Centos8 - Waiting for SSH

100 views
Skip to first unread message

Santhosh Ganesan

unread,
Jan 21, 2020, 6:53:00 PM1/21/20
to Packer
==> hyperv-iso: Creating build directory...
==> hyperv-iso: Retrieving ISO
==> hyperv-iso: Trying C:/San/SV65/CentOS/CentOS-8.1.1911-x86_64-boot.iso
==> hyperv-iso: Trying file://C:/San/SV65/CentOS/CentOS-8.1.1911-x86_64-boot.iso?checksum=sha256%3A7fea13202bf2f26989df4175aace8fdc16e1137f7961c33512cbfad844008948
==> hyperv-iso: file://C:/San/SV65/CentOS/CentOS-8.1.1911-x86_64-boot.iso?checksum=sha256%3A7fea13202bf2f26989df4175aace8fdc16e1137f7961c33512cbfad844008948 => C:\San\SV65\hyper-packer\hyper-packer\packer_cache\90f663ae9e6efa846d32fef93d7a21fac2d5236a.iso
==> hyperv-iso: Starting HTTP server on port 8601
==> hyperv-iso: Creating switch 'vSwitch' if required...
==> hyperv-iso:     switch 'vSwitch' already exists. Will not delete on cleanup...
==> hyperv-iso: Creating virtual machine...
==> hyperv-iso: Enabling Integration Service...
==> hyperv-iso: Setting boot drive to os dvd drive C:\San\SV65\hyper-packer\hyper-packer\packer_cache\90f663ae9e6efa846d32fef93d7a21fac2d5236a.iso ...
==> hyperv-iso: Mounting os dvd drive C:\San\SV65\hyper-packer\hyper-packer\packer_cache\90f663ae9e6efa846d32fef93d7a21fac2d5236a.iso ...
==> hyperv-iso: Skipping mounting Integration Services Setup Disk...
==> hyperv-iso: Mounting secondary DVD images...
==> hyperv-iso: Configuring vlan...
==> hyperv-iso: Determine Host IP for HyperV machine...
==> hyperv-iso: Host IP for the HyperV machine: 169.254.78.116
==> hyperv-iso: Attempting to connect with vmconnect...
==> hyperv-iso: Starting the virtual machine...
==> hyperv-iso: Waiting 5s for boot...
==> hyperv-iso: Typing the boot command...
==> hyperv-iso: Waiting for SSH to become available...


@ VM End , It stops with dracut-intiqueue timeout - starting timeout scripts

Could not boot.
 
/dev/root/ doest not exist
 
Entering emergency mode.

ks.cfg are 

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig  --startxonboot
# Keyboard layouts
# old format: keyboard us
# new format:
keyboard --vckeymap=us --xlayouts='us','pl'
# Root password
rootpw password
# Use network installation
# Use cdrom
cdrom
# System language
lang en_US --addsupport=en_GB.UTF-8
# Firewall configuration
firewall --disabled
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use graphical install
# graphical
# Use text install
text
# Run the Setup Agent on first boot
firstboot --disable
# SELinux configuration
selinux --disabled
# License agreement
eula --agreed

# System services
services --enabled="chronyd"
services --enabled="sshd"
services --enabled="NetworkManager"

ignoredisk --only-use=sda
# Network information
network  --bootproto=dhcp --device=eth0 --noipv6 --activate
# Reboot after installation
reboot
# System timezone
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
# autopart --type=lvm
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot/efi --fstype="vfat" --size=200
part /boot --fstype="ext4" --size=1024
part swap --fstype="swap" --size=16384
part / --fstype="ext4" --grow --size=1

# pre part
%pre

%end

# post part
%post
systemctl enable sshd
# systemctl start sshd
systemctl set-default multi-user.target
systemctl disable initial-setup-text
systemctl disable initial-setup-graphical
sed -i 's/__all__ = \["EULAspoke"\]/__all__ = \["LicenseScreen"\]/' /usr/lib/python2.7/site-packages/initial_setup/tui/spokes/eula.py
# secure boot files
cp -pr /boot/efi/EFI/centos/* /boot/efi/EFI/BOOT/
# delete libvirt
systemctl stop libvirtd
systemctl disable libvirtd
%end

%packages
@^graphical-server-environment
@base
@compat-libraries
@core
@desktop-debugging
@development
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@hardware-monitoring
@input-methods
@internet-browser
@multimedia
@network-file-system-client
@performance
@print-client
@security-tools
@x11
chrony
mc
curl
wget
yum-priorities
yum-versionlock
yum-utils
yum-cron
openssh-server
openssh-clients
openssh
%end


Please guide thru - why its failing to load the OS

Is this something related to harddisk not being created?

Dan Linder

unread,
Jan 22, 2020, 2:33:20 PM1/22/20
to Packer
Please share the packer file you're using, too.

Santhosh Ganesan

unread,
Jan 22, 2020, 3:47:39 PM1/22/20
to packe...@googlegroups.com
attached now, 

On Thu, Jan 23, 2020 at 6:33 AM Dan Linder <d...@linder.org> wrote:
Please share the packer file you're using, too.

--
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/3183b9ae-70ee-4fd9-807e-4e4deacd1337%40googlegroups.com.


--
Cheers
Santhosh Ganesan
hyperv_centos8_g2.json

Santhosh Ganesan

unread,
Jan 22, 2020, 6:03:08 PM1/22/20
to Packer
with revised switch values , now getting a error like 

curl failed to connect to packer set http server , which failed to fetch ks.cfg and which aborted the linux boot

update2 (2).JPG


pls guide


On Thursday, January 23, 2020 at 7:47:39 AM UTC+11, Santhosh Ganesan wrote:
attached now, 

On Thu, Jan 23, 2020 at 6:33 AM Dan Linder <d...@linder.org> wrote:
Please share the packer file you're using, too.

--
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+unsubscribe@googlegroups.com.


--
Cheers
Santhosh Ganesan

Dan Linder

unread,
Jan 23, 2020, 1:21:32 PM1/23/20
to Packer
So the curl error might be due to a local firewall on your build system - can you try turning it off as a quick test. Report of that helps any.

Can you hit the inst.ks URL from your build system and see the kickstart file?

Additionally, the inst.stage2 looks like it is for the CentOS7 ISO, so that will need to be checked.

Santhosh Ganesan

unread,
Jan 23, 2020, 4:01:28 PM1/23/20
to packe...@googlegroups.com
Hi Dan, 
am able to access the file with http on my machine,
tried with having the firewall rules specifically for a port, tried a turn around way as well, but didnt work, wondering something related file share on windows? error says it couldnot fetch the file, RTNETLINK confirms the file exists, wondering!!

inst.stage2 - would chk that for sure

--
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/7438e6d6-be6b-4095-8ba7-10b67ffe484c%40googlegroups.com.


--
Cheers
Santhosh Ganesan

Santhosh Ganesan

unread,
Jan 23, 2020, 7:05:24 PM1/23/20
to packe...@googlegroups.com
tried windows file sharing ticked as well but still the same error, what could be the possible solution to this issue?

updated inst.stage2 for centos8 
--
Cheers
Santhosh Ganesan

Santhosh Ganesan

unread,
Jan 23, 2020, 7:07:47 PM1/23/20
to packe...@googlegroups.com
curl from my local results

C:\San\SV65\CentOS>curl http://172.28.158.113:8330
<pre>
<a href="gen1-lv/">gen1-lv/</a>
<a href="gen2-centos/">gen2-centos/</a>
</pre>

--
Cheers
Santhosh Ganesan
Message has been deleted

Rafael Tomelin

unread,
Oct 30, 2020, 8:18:18 AM10/30/20
to Packer
Hi, I have some problems too with Hyper-v and CentOS8.

My script read ks.cfg after return this error.

Screen Shot 2020-10-30 at 09.16.36.png
Screen Shot 2020-10-30 at 09.16.11.png
Reply all
Reply to author
Forward
0 new messages