Having trouble accessing Packer from the command line

1,240 views
Skip to first unread message

Anna Schreiber

unread,
Jan 15, 2018, 12:08:51 PM1/15/18
to Packer
Hi there,

I'm completing the DevOps course on Udacity, and it requires installation of Packer to create a golden image. I downloaded Packer and tried accessing it from a few different directories, but each time I receive this error: "bash: packer: command not found". However, if I run "/c/Users/Owner/packer.exe" from the command line, that works. I'm fairly new to this stuff, I need to access several of the commands in Packer for this project, but don't know how to reach it using just the "packer" command. For example, I need to run "packer build -only=virtualbox-iso application-server.json" but I get the command not found error.

Any help would be appreciated!

Thank you,

Anna

Nicholas Bayle

unread,
Jan 15, 2018, 2:14:25 PM1/15/18
to packe...@googlegroups.com
I don't do much in Windows, so I don't have any specifics, but you need to put packer.exe in a directory that's in your PATH or add that folder to your PATH. https://www.computerhope.com/issues/ch000549.htm

You can probably also just call it explicitly:
/c/Users/Owner/packer.exe build -only=virtualbox-iso application-server.json

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/fa1e79d2-5500-45d2-bde2-725ffd5bf573%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alvaro Miranda Aguilera

unread,
Jan 16, 2018, 3:02:15 AM1/16/18
to packe...@googlegroups.com
Hello

On top of what Nicholas said, maybe you can use chocolatey that is a package installer that will do the installation for you and configure the path.

But basic command line info here. There is a variable that is called PATH that tells the command prompt where look for executable files and run them.

In Windows, if packer.exe is on the same directory where you are, you can just call packer

but if packer is on a different directory need to be added to PATH so you can call the command without the full path

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/fa1e79d2-5500-45d2-bde2-725ffd5bf573%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Robert Lilly

unread,
Jan 16, 2018, 12:36:16 PM1/16/18
to Packer
Have you manually added the folder where packer.exe resides to your Path? Since the Packer binary doesn't have an installation process the only way your system is going to know where packer.exe is is to add it to your Path manually.

Anna Schreiber

unread,
Jan 16, 2018, 1:24:55 PM1/16/18
to Packer
I believe I moved the directory onto my Path, I'm still a beginner in this stuff, but here's the issue I'm having (attached). If I copy the path and paste it into my command line, it works. But if I try to call it directly (it is in my Owner directory as you can see from the first path), it says it can't be found?

Anna
issue.JPG

Robert Lilly

unread,
Jan 16, 2018, 2:18:07 PM1/16/18
to packe...@googlegroups.com
Hi Anna,

That folder should be in your Path. To verify press the Windows logo key+r. That will open the Run dialogue. Type cmd exe to open a Windows command prompt. There, type path and press Enter. Verify that the path to your Owner folder is listed. If not, follow the instructions provided by Nicholas or Alvaro.

Robert
(Sent from my phone)


--
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 a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/r0Y0DlT6AWw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/17ce1523-7752-4a5d-920c-65d2a0e9b22f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages