Using packer without ssh?

1,070 views
Skip to first unread message

Michael Sumulong

unread,
Mar 6, 2014, 11:19:16 AM3/6/14
to packe...@googlegroups.com
Is it possible to use packer on a bare bones Linux distro (ie. Tiny Core Linux) that doesn't have ssh installed by default? Right now I'm building a virtual box image by hand using netcat to transfer shell scripts from the host to the virtual machine.

Alvaro Miranda Aguilera

unread,
Mar 6, 2014, 4:20:55 PM3/6/14
to packe...@googlegroups.com

On Fri, Mar 7, 2014 at 5:19 AM, Michael Sumulong <msum...@gmail.com> wrote:
Tiny Core Linux


tiny core is the host?

what guest are you building?


Michael Sumulong

unread,
Mar 7, 2014, 9:02:35 AM3/7/14
to packe...@googlegroups.com
No, tiny core is the guest I'm trying to build and the host is Linux Mint.

Alvaro Miranda Aguilera

unread,
Mar 7, 2014, 2:49:24 PM3/7/14
to packe...@googlegroups.com
if you can share the json file, i can give it a try..




--
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/d/optout.

Michael Sumulong

unread,
Mar 7, 2014, 2:53:51 PM3/7/14
to packe...@googlegroups.com
Here you go...
tinycore.json

Alvaro Miranda Aguilera

unread,
Mar 7, 2014, 3:18:46 PM3/7/14
to packe...@googlegroups.com
ok, pretty much what i was able to do..

I was thinking to use the boot command and wait to write all the commands on the console and do the install in that way.. will that work ??

Michael Sumulong

unread,
Mar 7, 2014, 3:28:34 PM3/7/14
to packe...@googlegroups.com
Ah I'll have to try it out. It'd have to run the installer, do a reboot, then install ssh and add the packer user. 

How does the boot command work exactly? How does it send keystrokes into the VM?

Alvaro Miranda Aguilera

unread,
Mar 7, 2014, 3:44:20 PM3/7/14
to packe...@googlegroups.com
it use a keyboard driver from virtualbox, pretty clever trick.

So basically the install, for a OracleLinux is:

boot, wait few seconds, and then type all the necesary commands to kickstart an un-attended install.

I think you can use that to actually do all the installation.

check the last quarter of this page


here is what I use at OracleLinux

        "boot_command" : [

            "<tab>",

            " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg ",

            "HOSTNAME={{user `hostname`}} ",

            "SWAPSIZE={{user `swapsize`}} ",

            "ROOTFS={{user `rootfs`}} ",

            "YUM={{user `yumurl`}} ",

            "REPOFILE={{user `repofile`}} ",

            "<enter>"

        ]


so, you have <enter> <tab> and


  • <wait> <wait5> <wait10> - Adds a 1, 5 or 10 second pause before sending any additional keys. This is useful if you have to generally wait for the UI to update before typing more.

so if you want to do something, try

"<wait5><enter><wait10><wait10>",
"the commands",
"more commands",

B. Ehlers

unread,
Oct 12, 2015, 8:08:55 AM10/12/15
to Packer
Just helped on the creation of some tiny core VMs with packer, see https://github.com/GNS3/gns3-registry/tree/master/packer/tinycore-linux

The trick I used is to add openssh early with some boot commands. That doesn't mean that the resulting VM has openssh installed.

Alvaro Miranda Aguilera

unread,
Oct 12, 2015, 4:16:55 PM10/12/15
to packe...@googlegroups.com
Hello,

Not sure how much different is boot2docker of tinycore

but there is this packer template for boot2docker if can help to get ideas

https://github.com/mitchellh/boot2docker-vagrant-box/blob/master/template.json

That's the one used in vagrant to spin a boot2docker vm

Alvaro.
> --
> 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/1ace9f52-b155-4a70-a48b-5ad147556612%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages