-
-
Save olivierlambert/31201e9b205eca8cdd2863dfd2240505 to your computer and use it in GitHub Desktop.
| # Locale Setup | |
| d-i debian-installer/language string en | |
| d-i debian-installer/country string US | |
| d-i debian-installer/locale string en_US.UTF-8 | |
| # Keyboard Setup | |
| d-i keyboard-configuration/xkb-keymap select us | |
| # Clock Setup | |
| d-i time/zone string US/Eastern | |
| # Configure hardware clock | |
| d-i clock-setup/utc boolean true | |
| d-i clock-setup/utc-auto boolean true | |
| # set above to false if making a bootable USB to run on same system as Windows | |
| # User Setup | |
| d-i passwd/root-login boolean true | |
| d-i passwd/root-password-again password debian | |
| d-i passwd/root-password password debian | |
| d-i passwd/user-fullname string debian | |
| d-i passwd/user-uid string 1000 | |
| d-i passwd/user-password password debian | |
| d-i passwd/user-password-again password debian | |
| d-i passwd/username string debian | |
| # Package Setup | |
| d-i apt-setup/cdrom/set-first boolean false | |
| d-i apt-setup/cdrom/set-next boolean false | |
| d-i apt-setup/cdrom/set-failed boolean false | |
| d-i mirror/country string manual | |
| d-i mirror/http/hostname string deb.debian.org | |
| d-i mirror/http/directory string /debian | |
| d-i mirror/http/proxy string | |
| tasksel tasksel/first multiselect ssh-server, standard | |
| popularity-contest popularity-contest/participate boolean false | |
| d-i pkgsel/include string sudo, unattended-upgrades, dpkg, cloud-init, cloud-guest-utils, cloud-initramfs-growroot, cloud-image-utils, cloud-utils | |
| # Whether to upgrade packages after debootstrap | |
| d-i pkgsel/upgrade select full-upgrade | |
| # Disk configuration | |
| d-i partman-basicfilesystems/choose_label string gpt | |
| d-i partman-basicfilesystems/default_label string gpt | |
| d-i partman-partitioning/choose_label string gpt | |
| d-i partman-partitioning/default_label string gpt | |
| d-i partman/choose_label string gpt | |
| d-i partman/default_label string gpt | |
| partman-partitioning partman-partitioning/choose_label select gpt | |
| d-i partman-auto/disk string /dev/xvda | |
| d-i partman-auto/method string regular | |
| d-i partman-auto/expert_recipe string \ | |
| root-swap :: \ | |
| 1000 1000 0 linux-swap \ | |
| $primary{ } \ | |
| method{ swap } format{ } . \ | |
| 1000 20000 -1 ext4 \ | |
| $primary{ } \ | |
| method{ format } format{ } \ | |
| use_filesystem{ } filesystem{ ext4 } \ | |
| mountpoint{ / } . \ | |
| d-i partman-partitioning/confirm_write_new_label boolean true | |
| d-i partman/choose_partition select finish | |
| d-i partman/confirm boolean true | |
| d-i partman/confirm_nooverwrite boolean true | |
| d-i grub-installer/only_debian boolean true | |
| d-i grub-installer/with_other_os boolean true | |
| d-i grub-installer/bootdev string /dev/xvda | |
| # install tools + fix cloudconfig | |
| d-i preseed/late_command string \ | |
| in-target /bin/sh -c "echo 'manage_etc_hosts: true' >> /etc/cloud/cloud.cfg"; \ | |
| in-target wget https://gitlab.com/xen-project/xen-guest-agent/-/jobs/6041608357/artifacts/raw/target/release/xen-guest-agent_0.4.0_amd64.deb; in-target export RUNLEVEL=1; in-target dpkg -i xen-guest-agent_0.4.0_amd64.deb | |
| # Final Setup | |
| d-i finish-install/reboot_in_progress note |
That's very likely, thanks for hunting our typos, and sorry 😨
No worries at all.
I started playing with XCP-ng and I stumbled across this article which I find very useful to get started.
The late_command no longer works, the URI gives a 404. Here is a patch which uses a repo instead. This probably best handled in a provisioner section rather than the pre-seed but regardless this is what I got working for me:
preeseed.cfg:
# install tools + fix cloudconfig
d-i preseed/late_command string \
in-target /bin/sh -c "echo 'manage_etc_hosts: true' >> /etc/cloud/cloud.cfg"; \
in-target /bin/sh -c "echo 'deb [trusted=yes] https://gitlab.com/api/v4/projects/xen-project%252Fxen-guest-agent/packages/generic/deb-amd64/ release/' > /etc/apt/sources.list.d/xen-guest-agent.list"; \
in-target /bin/sh -c "grep -v cdrom /etc/apt/sources.list > /tmp/sources.list && mv /tmp/sources.list /etc/apt/"; \
in-target /bin/sh -c "apt update && apt install xen-guest-agent"
# Final Setup
d-i finish-install/reboot_in_progress note
How could I set a static network for the VM? When I start the creation, the screen shows that the network auto-configuration failed because there is no DHCP server.
In the "preseed.cfg" file I tried to set the following configuration, but it didn't work:
# Network
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/get_nameservers string 8.8.8.8 8.8.4.4
d-i netcfg/get_ipaddress string 192.168.1.100
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 192.168.1.1
d-i netcfg/confirm_static boolean true
@cairoapcampos try to add this to your preseed :
d-i netcfg/disable_dhcp boolean true
d-i netcfg/choose_interface select <auto or interfacename>
Hi @olivierlambert and Everyone else,
I am facing an issue.
I don't have DHCP server who can assign IP automatically.
So I am trying to use Static IP in my boot command like below to make internet available.
###########################################################
http_directory = "http"
ip_getter = "http"
boot_command = [
"",
"/install.amd/vmlinuz ",
"initrd=/install.amd/initrd.gz ",
"auto=true ",
# Static networking required BEFORE fetching preseed (no DHCP available)
"netcfg/disable_autoconfig=true ",
"netcfg/disable_dhcp=true ",
"netcfg/choose_interface=auto ",
"netcfg/get_ipaddress=16x.1x.1xx.2xx ",
"netcfg/get_netmask=2xx.255.2xx.2xx ",
"netcfg/get_gateway=1xx.6x.x.x ",
"netcfg/get_nameservers=2xx.1xx.xx.xx ",
"netcfg/confirm_static=true ",
"domain= ",
"url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg ",
"hostname=debian ",
"interface=auto ",
"vga=788 noprompt quiet--- "
]
###########################################################
Same setting I have added in preseed file also.
But the issue is that my IP is binded to a MAC address. So I need to change the MAC address of newly created instance by packer also.
How I can achieve that? Any urgent help will be appreciated.
Hi @olivierlambert and Everyone else,
I am facing an issue. I don't have DHCP server who can assign IP automatically. So I am trying to use Static IP in my boot command like below to make internet available.
########################################################### http_directory = "http" ip_getter = "http"
boot_command = [ "", "/install.amd/vmlinuz ", "initrd=/install.amd/initrd.gz ", "auto=true ", # Static networking required BEFORE fetching preseed (no DHCP available) "netcfg/disable_autoconfig=true ", "netcfg/disable_dhcp=true ", "netcfg/choose_interface=auto ", "netcfg/get_ipaddress=16x.1x.1xx.2xx ", "netcfg/get_netmask=2xx.255.2xx.2xx ", "netcfg/get_gateway=1xx.6x.x.x ", "netcfg/get_nameservers=2xx.1xx.xx.xx ", "netcfg/confirm_static=true ", "domain= ", "url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg ", "hostname=debian ", "interface=auto ", "vga=788 noprompt quiet--- " ] ###########################################################
Same setting I have added in preseed file also. But the issue is that my IP is binded to a MAC address. So I need to change the MAC address of newly created instance by packer also. How I can achieve that? Any urgent help will be appreciated.
Hello, if you are using proxmox, with the plugin you can use
mac_address (string) - Give the adapter a specific MAC address. If not set, defaults to a random MAC. If value is "repeatable", value of MAC address is deterministic based on VM ID and NIC ID.
https://developer.hashicorp.com/packer/integrations/hashicorp/proxmox/latest/components/builder/iso
Thanks for sharing this.
I think
cloud-guest-should becloud-guest-utilson line 38.