preseed Ubuntu 16.04 local preseed.cfg not loaded

Apr 15, 2016
5
1
3
I would like to perform a unattended installation of ubuntu 16.04 amd64 server. I read and followed this two threads:

https://forum.proxmox.com/threads/u...with-the-qm-create-command.15405/#post-115308
and
https://morph027.gitlab.io/post/pve-kickseed/

I use PVE 4.4

This is my bash script:
-------------------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/env bash

qm create 4003 \
--virtio0 pve1-all-other-data:32,format=qcow2,cache=writethrough \
--net0 virtio,bridge=vmbr0 \
--name unattended-test \
--bootdisk virtio0 \
--ostype l26 \
--memory 1024 \
--cores 2 \
--args '-kernel /root/linux/linux -initrd /root/linux/initrd.gz -append preseed/file=/root/linux/preseed.cfg'

qm start 4003

exit
-------------------------------------------------------------------------------------------------------------------------------------------
The VM and the installation starts but the preseed.cfg is not preseeded and I have to answer all the installer questions.

Does anyone have a suggestion what I'am doing wrong here?

Another question I have is, is it possible to use a local iso and preseed it to perform the installation.

On Ubuntu KVM/QEMU I can perform a preseeded installation with a local iso which is much faster.

Here is my function I use for KVM/QEMU on Ubuntu:
-------------------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/env bash
create_kvm_vm (){
virt-install \
--connect qemu:///system \
--ram ${!VM_RAM} \
--vcpus ${!VM_VCPU} \
--video qxl \
--graphics vnc \
--name ${!HOSTN} \
--disk pool=default,size=${!VM_DISKSIZE},bus=virtio \
--network bridge=${!VM_NIC},model=virtio \
--location /var/lib/libvirt/images/ubuntu-16.04.1-server-amd64.iso \
--initrd-inject=/tmp/${!HOSTN}/preseed.cfg \
--os-type=linux \
--os-variant=ubuntu16.04 \
--virt-type kvm
}
-------------------------------------------------------------------------------------------------------------------------------------------
This works fine and is the same preseed.cfg as I used for qm create.
 
  • Like
Reactions: dbayer
did you verify that the preseed file is available in the installer environment? just switch to a TTY and check the path.. "--append" only edits the kernel command line, it does not inject anything into the initrd (like your virt-install script does)..
 
It seems to be loaded. I switched to the Console (Alt+Left) and run "set" to see the variables.
cat /proc/cmdline yields
preseed/file=/root/linux/preseed.cfg

Screenshot from 2017-01-11 10-46-19.png
 
Last edited:
yes, but does that file actually exist? in the initrd/installer environment

you can check with "lsinitramfs /root/linux/initrd.gz | grep preseed"
 
I'm preseeding from a URL, this makes it easier to change stuff. If you want to use it from a file, you'll need to add it to the initrd first. This is possible by repacking. The URL however is much easier to handle ;)
 
I use all distros ;) But mainly Ubuntu and CentOS.

If it's not accessible within the installer, it should prompt an error message. If it does not, then the args might not be set appropriate.

Can you post the output of the xxx.conf vm config inside /etc/pve/qemu-server ?
 
Well, at least I would consider this as a little success. Now I know where the issue is. Now I can try to pull my preseed file from my webserver.

Are you sure that it's impossible to use local file and local .iso? For me and my workflow it is much faster and more flexible to use a local pressed file.
In my scripts I have function called "create_custom_pressed". The function is more or less a HERE doc and all the parameters like hostname, IP, DNS-Server, username/password and so one are VARs (indirect var refs) that are pulled from a global-config file which describes each host in my infrastructure. This custom preseed is placed in /tmp/${!HOSTN}/preseed.cfg

after that this function is called:
create_kvm_vm (){
virt-install \
--connect qemu:///system \
--ram ${!VM_RAM} \
--vcpus ${!VM_VCPU} \
--video qxl \
--graphics vnc \
--name ${!HOSTN} \
--disk pool=default,size=${!VM_DISKSIZE},bus=virtio \
--network bridge=${!VM_NIC},model=virtio \
--location /var/lib/libvirt/images/ubuntu-16.04.1-server-amd64.iso \
--initrd-inject=/tmp/${!HOSTN}/preseed.cfg \
--os-type=linux \
--os-variant=ubuntu16.04 \
--virt-type kvm
}

This function creates a custom VM based on the custom preseed using a local .iso and parameters pulled from the global-config file. Using the local .iso is much faster than a net-install. the local pressed is automatically created and I don't need a webserver to start...

I would love a tool like virt-install for proxmox which allows to use local .iso's and inject custom preseed files...

preseed.png
 
I wrote an Ansible script for fully automated installation of VMs. It appends a preseed.cfg file to the initrd before starting the VM: gitlab.com/snippets/1707958
 
  • Like
Reactions: dbayer

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!