ddelnano / packer-plugin-xenserver

A builder plugin for Packer.IO to support building XenServer images.
Mozilla Public License 2.0
72 stars 37 forks source link

Let user choose if they want tools or not. #82

Closed AtaxyaNetwork closed 1 year ago

AtaxyaNetwork commented 1 year ago

I had some problem with the packer provider and Debian installation. Debian detect the tools ISO as a CD (it's logical, it's a CD) and try to parse it as a Debian disk. Obviously, that didn't work.

Since I found a way to install the tools with preseed (yeah it's ugly, but working):

d-i preseed/late_command string in-target wget https://github.com/xenserver/xe-guest-utilities/releases/download/v7.20.2/xe-guest-utilities_7.20.2-1_amd64.deb; in-target export RUNLEVEL=1; in-target dpkg -i xe-guest-utilities_7.20.2-1_amd64.deb`

and in your Ubuntu example, guest-tools are in the repo:

  packages:
    - xe-guest-utilities

I don't think plugging the ISO tools is needed anymore.

Other user who need to have tools can always plug it by setting tools_iso_name = "guest-tools.iso" in their pkr.hcl.

Tested both use-case after recompiling (with tools_iso_name set and not set) and it's working on my side, but I'm open to other test :)

I'm not a go developer, so maybe it's not the best way to handle this

hoerup commented 1 year ago

Yes - debian is quite annoying with current version thanks @AtaxyaNetwork for figuring this out

I have tested your version and it seems to be working :)

AtaxyaNetwork commented 1 year ago

Yes - debian is quite annoying with current version thanks @AtaxyaNetwork for figuring this out

I have tested your version and it seems to be working :)

Glad to hear it's working! Thanks, @hoerup!

Note: since Debian 12, you'll need the guest-tools version 7.30, due to the change in network interface name (eth0 -> enX0). Currently, the tools are not directly available on the internet, but you can extract it with a VM with guest-tools plugged. Then you'll need to host it somewhere, and replace the preseed late-command line with your hosting: http://185.X.X.X:8000/xe-guest-utilities_7.30.0-11_amd64.deb

If you are unable to retrieve the new tool, tell me and I will provide you directly the .deb :)

ddelnano commented 1 year ago

ah, looks like we still need to update the tests. I've added a commit on top of your changes in #84.

ddelnano commented 1 year ago

As for when the next release will be made, I'll try to do one in the next week.

AtaxyaNetwork commented 1 year ago

Thank you !