Hello Rickard No there is no such option to run a command before export but after the vm > stopped. >
Snif, ok ;-) But isn't Vagrant the solution to this problem. You can solve all these > things in a Vagrantfile. > Many thanks for this feedback. I will have a try on it. Best regards Le mardi 25 septembre 2018 16:26:17 UTC+2, Rickard von Essen a écrit : > > No there is no such option to run a command before export but after the vm > stopped. > > But isn't Vagrant the solution to this problem. You can solve all these > things in a Vagrantfile. > > On Tue, Sep 25, 2018, 14:39 Alix Lourme <[email protected] <javascript:>> > wrote: > >> Hello, >> >> I'm using Packer to create a Linux (Ubuntu) VirtualBox VM, usable on >> Windows ; one main feature is to have the C: shared with this VM. >> It works like a charm when VM is packaged on Windows, but sharing the C >> path on Linux during VM creation fails (ie: when VM builded from continuous >> integration process - no Windows agents). >> >> Technically, the builder config: >> >> "vboxmanage[_post]": [ >> [ >> "sharedfolder", "add", "{{.Name}}", "--name", "c", "--hostpath", >> "C:/", "--automount" >> ] >> ], >> >> Provides this correct VirtualBox command, but does nothing (no error, >> ...): >> >> vboxmanage sharedfolder add vm-name --name c --hostpath C:/ --automount >> >> Executed manually, this command provides a (logic) "*Shared folder path >> 'C:' is not absolute*" error. >> If "*/C:*" used it works on Linux packaging or command line, but >> produced VM is not usable on Windows ("*/C:*" not valid on Windows). >> Using UNC path if a fail too. >> *Conclusion*: Hard to configure a shared folder on Linux, usable on >> Windows without error. >> >> A dirty workaround is to update *SharedFolder* parameter directly in the >> *.vbox* file, before the export (when VM is stopped). >> >> *=> Is there a way to add a custom script/command after the * >> *"provisioners**" and before the export, to realize this hack ?* >> >> Many thanks in advance. >> Best regards >> Alix. >> >> -- >> 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 [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/packer-tool/9603ca55-bda3-4e1e-8e4b-fdcc9e8ebb12%40googlegroups.com >> >> <https://groups.google.com/d/msgid/packer-tool/9603ca55-bda3-4e1e-8e4b-fdcc9e8ebb12%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/60205f3d-312b-44ce-ac82-49f847c1dd7e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
