Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning about differences from the shell when using qemuargs #138

Open
MalikKillian opened this issue May 9, 2023 · 0 comments
Open

Comments

@MalikKillian
Copy link

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Add a warning about the differences between using QEMU arguments from a command line versus including them as an argument in Packer. Specifically, certain special characters like semi-colons require escaping when used on the command line. Packer passes arguments directly to the QEMU executable without involving the special character interpretation of the shell. Therefore, attempts to escape these characters as you would on the command line can actually result in a bad argument being passed.

A likely small, but very important, use-case for adding an additional QEMU argument is performing cloud-init by serving files from an HTTP server. The cloud-init docs directly mention this use-case and provide an example for starting QEMU.

https://cloudinit.readthedocs.io/en/latest/tutorial/qemu.html#launch-a-virtual-machine-with-our-user-data

It shows the -smbios argument as partially quoted to avoid the interpretation of the semi-colon as a break in the command. From a shell this is necessary but from Packer it will cause the argument to essentially be rejected, only silently. So it may be very hard to notice the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant