Mounting Guest additions

156 views
Skip to first unread message

Savage Hacker

unread,
Jun 11, 2018, 4:47:20 PM6/11/18
to Packer
Hello, I am new Packer and I am wondering how can I have Packer mount guest additions. So far, I have Packer attaching guest additions s a CD device to the virtual machine but through Packer guest addition mode but whenever I giv it scripts such as sudo mount /media/cdrom, Packer tells me it can't be done until I manually click Devices | Insert Guest Additions CD Image. How might I automate this with Packer?

Alvaro Miranda Aguilera

unread,
Jun 12, 2018, 4:12:27 AM6/12/18
to packe...@googlegroups.com
Hello

Packer can one of 3 things.

- attach the iso
- upload the iso
- nothing

A popular pattern is upload the iso and mount it manually.

example:

template.json - nothing default is to upload



for attach the iso:
template.json - add "guest_additions_mode": "attach"

at the OS level you need to check the dvd, that depending on the os, 
can be /dev/sr0 /dev/hd[a-c] /dev/sda 

should be an alias in some os like /dev/cdrom or /dev/dvd 

then you can adjust the previous script as reference.


alvaro

On Mon, Jun 11, 2018 at 10:47 PM, Savage Hacker <namel...@gmail.com> wrote:
Hello, I am new Packer and I am wondering how can I have Packer mount guest additions. So far, I have Packer attaching guest additions s a CD device to the virtual machine but through Packer guest addition mode but whenever I giv it scripts such as sudo mount /media/cdrom, Packer tells me it can't be done until I manually click Devices | Insert Guest Additions CD Image. How might I automate this with Packer?

--
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/83b5224c-e487-45b8-b027-5dd451a19df5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages