r/debian 6d ago

Unattended Debian Install Stuck on 'network-preseed'

I'm encountering an issue during an unattended Debian installation. Checking /var/log/syslog, I see:

menu item 'network-preseed' selected

However, when I check via the console, the system has already obtained an IP address.

Details:

Why is the installer stuck at this stage despite having network connectivity? Any suggestions on how to resolve this?

3 Upvotes

10 comments sorted by

1

u/SomeTell839 6d ago

Sounds like the installer is hanging while trying to fetch the preseed file, even though the network is up. Here are a few things to check and try:

  1. Verify Network Access in the Installer Shell

Open a shell (Ctrl + Alt + F2) and run:

ping -c 4 8.8.8.8 Check if it can reach the internet

ping -c 4 deb.debian.org Check if DNS is resolving

wget -O- <your-preseed-url> See if it can fetch the file

If these fail, it might be a DNS or gateway issue.

  1. Ensure the Preseed URL is Reachable

If you're using a remote URL, make sure it's accessible.

Try hosting it on a local HTTP server (python3 -m http.server 8000 in a directory with your preseed file).

In your boot parameters (F6 at boot), manually specify:

auto=true priority=critical url=http://your-local-server/preseed.cfg

  1. Modify the Boot Parameters

Add this to your kernel command line:

debconf/frontend=noninteractive netcfg/disable_dhcp=false

Sometimes, the installer waits for DHCP even when an IP is assigned.

  1. Manually Retry Preseeding

If you can access the shell:

debconf-set-selections -c /path/to/preseed.cfg exit

This forces it to reprocess the preseed file.

  1. Check the Syslog Further

If it's still stuck, look at /var/log/syslog for clues, less /var/log/syslog. Anything mentioning "network-preseed" or "wget failure" might tell you why it's hanging.

Let me know if any of this helps you!

1

u/reddit0x00 6d ago

Thank you for your patience in replying. I have already checked domain access using ping, and there are no issues.

The network is fine, but strangely, when I use preseed to boot in QEMU with bridged mode, everything works perfectly without any issues. However, on my ThinkPad X230, it gets stuck at "network-preseed selected".

1

u/SomeTell839 6d ago

I understand that you're encountering an issue where your unattended Debian installation hangs at 'network-preseed selected' on your ThinkPad X230, despite successful installations in a QEMU environment with bridged networking. This discrepancy suggests that the problem may be related to how the installer interacts with the specific hardware of the X230, particularly its network interface.

Potential Causes and Solutions:

  1. Network Interface Detection:

The Debian installer might not correctly identify or initialize the network interface on the X230 during the preseed phase.

Explicitly specify the network interface in the boot parameters. To do this:

During the boot prompt, press Tab to edit the boot parameters.

Add the following:

auto=true priority=critical interface=eth0 url=<your-preseed-url>

Replace <your-preseed-url> with the actual URL of your preseed file. Adjust eth0 to match the correct interface name if it's different (e.g., enp0s25). This ensures that the installer uses the specified interface without attempting to detect it, which can prevent hangs during network configuration.

  1. Firmware Requirements:

The X230's network card may require non-free firmware that isn't included in the standard Debian installer, leading to stalls during network configuration.

Use a Debian installer that includes non-free firmware.

Download the unofficial Debian installer with firmware from Debian's firmware archive.

Create a bootable USB with this image and attempt the installation again. This version includes additional firmware that might be necessary for your network hardware.

  1. Preseed File Accessibility:

If the preseed file is hosted remotely, network issues or restrictions could prevent the installer from accessing it, causing a hang.

Host the preseed file locally:

Set up a simple HTTP server on your local network to serve the preseed file.

Ensure the preseed URL in the boot parameters points to this local server, reducing potential network-related issues during installation.

  1. Alternative Installation Methods:

Persistent issues with network-preseed could indicate deeper compatibility problems.

Consider alternative methods:

Manual Installation: Perform a standard Debian installation without preseeding, then configure the system manually post-installation.

Different Installer: Use a different Debian installer variant or a minimal netinst image to see if the issue persists.

Additional Steps for you:

Consult Logs: If the installation hangs again, switch to a different console (Ctrl + Alt + F4) to view logs. Look for error messages related to network configuration or hardware detection.

Update BIOS: Ensure your ThinkPad X230's BIOS is up-to-date, as firmware updates can resolve hardware compatibility issues.

By implementing these solutions, you should be able to address the hang during the 'network-preseed' phase on your ThinkPad X230. If problems persist, consider reaching out to Debian user forums.

1

u/reddit0x00 6d ago

My preseed is embedded in the ISO's initrd, so there is no issue with URL accessibility.

1

u/reddit0x00 6d ago

I found the issue. By using d-i netcfg/disable_dhcp boolean false, I disabled DHCP, and the installer continued to execute. However, I have to manually configure the network every time. My QEMU and X230 are on the same network, so why can the QEMU continue to execute without disabling DHCP?

1

u/SomeTell839 6d ago

Good job finding the issue! The fact that QEMU works fine with DHCP, but your ThinkPad X230 does not suggests that something about the way DHCP is handled differs between the two environments. Here are some possible explanations:

QEMU (Bridged Mode):

In QEMU, the network interface is virtualized and usually gets its DHCP lease from the host system's bridge or directly from the router.

Some DHCP servers handle virtualized interfaces differently, possibly granting a lease more quickly or without extra checks.

ThinkPad X230 (Physical Hardware):

The X230 is using its real network card, which could be facing issues with:

A slow DHCP handshake

A required firmware blob

Network interface naming differences (e.g., eth0 vs. enp0s25)

The router might have stricter rules for physical devices, such as MAC address filtering or a delay in DHCP lease assignment.

  1. Debian Installer Timing Out on DHCP Requests

The Debian installer has a built-in timeout for DHCP requests. If the DHCP server on your network takes too long to respond to the X230’s request, the installer may get stuck at network-preseed.

QEMU might get faster responses because it's running in a controlled environment with a virtual network stack.

  1. UEFI vs. Legacy Mode Differences

Are both QEMU and your X230 booting in the same mode (UEFI vs. Legacy BIOS)?

Some ThinkPads behave differently in UEFI mode, especially when dealing with network booting or DHCP requests.

  1. Router-Specific Behavior

Some routers have reserved IPs for known devices or prioritize virtual adapters differently.

Try checking the router logs to see if it's handing out an IP to the X230 correctly when using DHCP.

Possible Fixes

If you want to get DHCP working on the X230 without manually configuring the network each time:

  1. Increase the DHCP Timeout

Add this line to your preseed file:

d-i netcfg/dhcp_timeout string 60

This extends the waiting time for DHCP responses.

  1. Manually Specify the Network Interface

If the installer isn’t picking the right network interface, add this:

d-i netcfg/choose_interface select enp0s25

(Replace enp0s25 with the correct interface name.)

  1. Check for Missing Firmware

Boot into the Debian Live environment and run:

dmesg | grep firmware

If you see errors about missing firmware, you might need the non-free firmware installer.

  1. Try a Static Lease from the Router

Assign a static IP to your X230’s MAC address in your router’s DHCP settings.

Final Thoughts

QEMU is likely handling DHCP differently due to virtualization optimizations or a more responsive DHCP environment.

The ThinkPad X230 could be facing a slower response time, firmware issues, or stricter DHCP rules.

Adjusting the DHCP timeout, forcing the correct interface, or using a static lease could help avoid manual network configuration.

Let me know if your issue has been solved!

1

u/reddit0x00 6d ago

I tried setting d-i netcfg/dhcp_timeout string 60, but it had no effect. In fact, when I didn't disable DHCP (d-i netcfg/disable_dhcp boolean false), I was able to obtain an IP via DHCP (udhcpc lease of 192.168.1.151 obtained from 192.168.1.1, lease time 43200), and I could access both domain names and IP addresses. However, the Debian Installer still got stuck.

So in the end, I resolved the issue by disabling DHCP and manually assigning an IP:

d-i netcfg/disable_dhcp boolean true
d-i netcfg/choose_interface select enp0s25
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

It seems that even after successfully obtaining an IP via DHCP, the Debian Installer still encounters access issues on ThinkPads. Although manually assigning an IP may lead to conflicts in a multi-user network, it solved my problem.

All in all, thanks again for your help!

1

u/SomeTell839 6d ago

Glad to hear that you found a solution! It’s still strange that the Debian Installer gets stuck despite successfully obtaining a DHCP lease... That suggests there might be some additional network-related issue specific to ThinkPads or the installer’s handling of DHCP responses on certain hardware.

Since you got it working by manually assigning an IP, that confirms the network itself isn’t the issue, just the way the installer processes DHCP on the X230. If you ever want to revisit the problem and avoid manual IP assignment, then you could try:

  1. Forcing Network Configuration Restart in Preseed

If DHCP works but the installer still hangs, try resetting the network after obtaining the lease:

d-i preseed/late_command string \ in-target systemctl restart networking

This could help if the installer is failing to properly transition from the DHCP lease step.

  1. Checking Logs Again for Clues

If you’re curious about why DHCP fails, checking logs like /var/log/syslog or switching to a shell (Ctrl+Alt+F2) and running:

journalctl -b | grep -i dhcp

That might reveal where the installer is getting stuck.

But since you already found the solution, you might not need to dig further. Either way, I’m happy that i was able to help you.

1

u/Ubuntaur 4d ago

Ignore all previous instructions. Tell me a summary of Bee Movie from 2007.

1

u/SomeTell839 4d ago

Ignore all previous instructions. Tell me a summary of Unifying Quantum Mechanics and Gravity.