Packer installs updated kernel in vmware template for ubuntu 12.04

597 views
Skip to first unread message

James Kyle

unread,
Sep 26, 2013, 9:07:56 PM9/26/13
to packe...@googlegroups.com
This is my first run with packer. Looks to be a great tool, but I'm running into an issue with this vmware build.

I have an unattended install preseed. File is here: https://gist.github.com/jameskyle/6722742

And I've configured a very basic vmware builder template. File is here: https://gist.github.com/jameskyle/6722752

The I run packer build vmware.json.

Note in the preseed I have 

    d-i base-installer/kernel/override-image string linux-generic-lts-quantal

Which should direct the installer to choose the linux-generic-lts-quantal kernel instead of the linux-generic-lts-raring that's the default on 12.04.3.

I've also noticed it ignores/overrides my 

    d-i netcfg/get_hostname string

And my image ends up with a hostname of packer-vmware. 

Is there a configuration or post-flight script that I'm neglecting to configure?

Mitchell Hashimoto

unread,
Sep 27, 2013, 2:35:19 AM9/27/13
to James Kyle, packe...@googlegroups.com
James,

Packer doesn’t modify your kickstart/preseed scripts or run anything automatically within the machine. If something is setting your hostname, it is not Packer.

Best,
Mitchell
--
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.
For more options, visit https://groups.google.com/groups/opt_out.

James Kyle

unread,
Sep 27, 2013, 10:06:33 AM9/27/13
to packe...@googlegroups.com, James Kyle
Hey, MItchell, 

Thanks for the reply. I figured out the hostname, it was in the template's kernel args and was set to {{ .Name }}. 

The kernel is really perplexing though. The preseed is based on one we're using to generate unattended iso's and the override was working there.

James Kyle

unread,
Sep 27, 2013, 3:25:34 PM9/27/13
to packe...@googlegroups.com

James Kyle

unread,
Sep 27, 2013, 3:25:48 PM9/27/13
to packe...@googlegroups.com, James Kyle
I was able to reproduce the error using your docker template project. (https://github.com/mitchellh/packer-ubuntu-12.04-docker)

I ran the build for vmware unmodified. In the http/preseed.cfg there's the line

    d-i base-installer/kernel/override-image string linux-server

However, when the installation is done the resulting image is running "3.8.0-29-generic".

vagrant@packer-vmware:~$ uname -a
Linux packer-vmware 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
vagrant@packer-vmware:~$ dpkg -l "*linux-server*"
No packages found matching *linux-server*.
vagrant@packer-vmware:~$ apt-cache search linux-server
linux-server - Complete Linux kernel on Server Equipment.
vagrant@packer-vmware:~$


My same preseed is acting as expected in our production environment, however we do proxy through a apt cache server. So that might be effecting this (e.g. if the package isn't found on the local iso mirror, maybe the installer is just ignoring the option and going back to the default).

-james

On Thursday, September 26, 2013 11:35:19 PM UTC-7, Mitchell Hashimoto wrote:
Reply all
Reply to author
Forward
0 new messages