Problem using Auto Install feature of dietpi.txt


I am trying to switch my Raspberry Pi 4 over from 32 bit to 64 as I use Nextcloud. I have edited the dietpi.txt file to try and automate some of the process (static IP etc). My dietpi.txt has the autostart login user set to root. This does not seem to be working though as I am getting the following error:

[FAILED] Unknown install state/First run setup failed on another screen (PID=873).
You can the error handling on this screen and kill the other DietPi-Login session.
Else you can finish the error handling on the other DietPi-Login session and the login script on this session afterwards.

At this point if I hit retry it fails again with the same error so I decided to try to ‘Take over’ the prcoess. On doing so I was prompted by the following:

/boot/dietpi/dietpi-login: line 116: kill: (873) - Operation not permitted
rm: remove write-protected regular file ‘/tmp/’?

I decided not to delete the file but rather drop to out of the install and try and get some info. Both the firstrun_setup ‘.pid’ and ‘_err’ files just contain the value 873. So I decided to run htop to check the pid of 873 see below:

863 root       3428   0  0.0  0:00.01 └─ /bin/login -f
870 root       5432   0  0.0  0:00.03    └─ -bash
873 root       4712   0  0.0  0:00.03       └─ /bin/bash /boot/dietpi/dietpi-login
954 root       3500   0  0.0  0:00.01          └─ whiptail --title DietPi-Login --backtitle RPi 4 Model B (aarch64) | IP: --yesno [FAILED] Unkn 

Thank you for any assistance resolving this issue. I hope that some of the info I have provided can help.

One additional note, I used dietpi.txt to set the global password but this also seemed to change the user login password. Is it meant to change both the login and global passwords?

Is this new fresh installation?

Sorry, yes this is a fresh new install I downloaded the DietPi 64 bit image today.

are you able to share your dietpi.txt file? Just remove private data like password.

Sure, I was in the process of editing my last reply to include it as you was typing your reply. :slightly_smiling_face:

I kept the global password as ‘dietpi’ default on this last attempt as I was not sure if that was messing things up as it was changing the login password as well or seemed to be.

Below is my 'dietpi.txt file, I have removed the SSH key that I set.

# - This is intended for advanced users, unless you know what you are doing, do not edit this file. Please use the DietPi programs instead.
# - Do not remove uncommented lines, as the items are scraped by DietPi programs, on demand.

##### DietPi-Automation settings, applied on first boot of DietPi only, ONCE! #####

##### Language/Regional options #####
# Locale: e.g.: "en_GB.UTF-8" / "de_DE.UTF-8" | One entry and UTF-8 ONLY!

# Keyboard layout e.g.: "gb" / "us" / "de" / "fr"

# Time zone e.g.: "Europe/London" / "America/New_York" | Full list:

##### Network options #####
# Enable Ethernet or WiFi adapter: 1=enable | 0=disable
# - If both Ethernet and WiFi are enabled, WiFi will take priority and Ethernet will be disabled.
# - If using WiFi, please edit dietpi-wifi.txt to pre-enter credentials.

# Force Ethernet speeds: 0=automatic speed | 10 = 10 Mbit/s | 100 = 100 Mbit/s etc.
# - Use this when your Ethernet adapter has an unstable 1 Gbit/s link.

# WiFi country code: 2 uppercase character value (e.g. GB US DE JP):

# Enter your static network details below, if applicable.

# Set to "1" to convert DHCP leased network settings into static settings automatically on first boot.

# Hostname

# Delay service starts at boot until network is established: 0=disabled | 1=enabled

##### Misc options #####
# Swap space size to generate: 0 =disable | 1 =auto | 2 and up =size in MiB
# Swap space location: "zram" =swap space on /dev/zram0 (auto-size = 50% of RAM size) | /path/to/file =swap file at location (auto-size = 2 GiB minus RAM size)

# Set to "1" to disable HDMI/video output and framebuffers on Raspberry Pi, to reduce power consumption and memory usage: Works on RPi only!

# Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi

# Custom Script (pre-networking and pre-DietPi install)
# - Allows you to automatically execute a custom script before network is up on first boot.
# - Copy your script to /boot/ and it will be executed automatically.
# - Executed script log: /var/tmp/dietpi/logs/dietpi-automation_custom_prescript.log

# Custom Script (post-networking and post-DietPi install)
# - Allows you to automatically execute a custom script at the end of DietPi install.
# - Option 0 = Copy your script to /boot/ and it will be executed automatically.
# - Option 1 = Host your script online, then use e.g. AUTO_SETUP_CUSTOM_SCRIPT_EXEC= and it will be downloaded and executed automatically.
# - Executed script log: /var/tmp/dietpi/logs/dietpi-automation_custom_script.log

# Restore a DietPi-Backup on first boot: 0 =disable | 1 =interactive restore (show list of found backups) | 2 =non-interactive restore (restore first found backup)
# - Simply attach the drive/disk/stick with contains the backup. All attached drives will be mounted temporarily and searched automatically.

##### Software options #####
# SSH server choice: 0=none/custom | -1=Dropbear | -2=OpenSSH

# SSH server pubkey
# - Public key(s) for "root" and "dietpi" users, which will be added to ~/.ssh/authorized_keys
# - Use the same setting multiple times for adding multiple keys.
# - See SOFTWARE_DISABLE_SSH_PASSWORD_LOGINS below for disabling SSH password logins.
#AUTO_SETUP_SSH_PUBKEY=ssh-ed25519 I used an existing SSH key here.

# Logging mode choice: 0=none/custom | -1=RAMlog hourly clear | -2=RAMlog hourly save to disk + clear | -3=Rsyslog + Logrotate
# RAMlog max tmpfs size (MiB). 50 MiB should be fine for single use. 200+ MiB for heavy webserver access log etc.

# Dependency preferences
# - DietPi-Software installs all dependencies for selected software options automatically, which can include a webserver for web applications, a desktop for GUI applications and one usually wants a web browser on desktops.
# - Especially for non-interactive first run installs (see AUTO_SETUP_AUTOMATED below), you may want to define which webserver, desktop and/or browser you want to have installed in such case. For interactive installs you will be always asked to pick one.
# - With below settings you can define your preference for non-interactive installs. However, it will only installed if any other selected software requires it, and an explicit webserver/desktop/browser selection overrides those settings:
# - Webserver preference: 0=Apache | -1=Nginx | -2=Lighttpd
# - Desktop preference: 0=LXDE | -1=Xfce | -2=MATE | -3=LXQt | -4=GNUstep
# - Browser preference: 0=None | -1=Firefox | -2=Chromium

# DietPi-Autostart: 0=Console | 7=Console autologin | 1=Kodi | 2=Desktop autologin | 16=Desktop | 4=OpenTyrian | 5=DietPi-CloudShell | 6=Amiberry fast boot | 8=Amiberry standard boot | 9=DDX-Rebirth | 10=CAVA Spectrum | 11=Chromium kiosk | 14=Custom script (background) | 17=Custom script (foreground)
# - This will be effective on 2nd boot, after first run update and installs have been done.
# - Related software titles must be installed either on first run installs or via AUTO_SETUP_AUTOMATED=1 + AUTO_SETUP_INSTALL_SOFTWARE_ID (see below).
# Autologin user name
# - This user must exist before first run installs, otherwise it will be reverted to root.
# - Applies to all autostart options but: 0, 6, 14 and 16

##### Non-interactive first run setup #####
# On first login, run update, initial setup and software installs without any user input
# - Setting this to "1" is required for AUTO_SETUP_GLOBAL_PASSWORD and AUTO_SETUP_INSTALL_SOFTWARE_ID.
# - Setting this to "1" indicates that you accept the DietPi GPLv2 license, available at /boot/dietpi-LICENSE.txt, superseding AUTO_SETUP_ACCEPT_LICENSE.

# Global password to be applied for the system
# - Affects "root" and "dietpi" users login passwords and is used by dietpi-software as default for software installs which require a password.
# - During first run setup, the password is removed from this file and instead encrypted and saved to root filesystem.
# - WARN: The default SSH server Dropbear does not support passwords over 100 characters.
# - WARN: We cannot guarantee that all software options can handle special characters like \"$.

# Software to automatically install
# - List of available software IDs:
# - Add as many entries as you wish, one each line.
# - DietPi will automatically install all dependencies, like ALSA/X11 for desktops etc.
# - E.g. the following (without the leading "#") will install the LXDE desktop automatically on first boot:

##### Misc DietPi program settings #####
# DietPi-Survey: 1=opt in | 0=opt out | -1=ask on first call
# - (see tab 'DietPi Survey')

##### DietPi-Config settings #####
# CPU Governor: schedutil | ondemand | interactive | conservative | powersave | performance
# Ondemand Sampling Rate | Min value: 10000 microseconds (10 ms)
# Ondemand Sampling Down Factor: Sampling Rate * Down Factor / 1000 = ms (40 = 1000 ms when sampling rate is 25000)
# Throttle Up Percentage: Percentage of average CPU usage during sampling rate at which CPU will be throttled up/down

# CPU Frequency Limits: Disabled=disabled
# - Intel CPUs use a percentage value (%) from 0-100, e.g.: 55
# - All other devices must use a specific MHz value, e.g.: 1600
# - Has no effect on RPi, please set "arm_freq" and "arm_freq_min" in config.txt instead.

# Disable Intel-based turbo/boost stepping. This flag should not be required, setting <100% MAX frequency should disable Turbo on Intel CPUs.

# System-wide proxy settings
# - Do not modify, you must use dietpi-config "Network Options: Adapters" to apply

# Connection timeout in seconds for G_CHECK_NET and G_CHECK_URL. Increase if you have a "flaky" connection or slow DNS resolver.
# - Set this to "0" to allow unlimited time, however this is not recommended to avoid unlimited hanging background scripts, e.g. daily DietPi update check.
# - A negative or non-integer value will result in the default of 10 seconds.
# Connection attempts with above timeout each, before G_CHECK_NET and G_CHECK_URL give up and prompt an error.
# - Any value below "1" or a non-integer value will result in the default of 2 attempts.
# General connection and DNS testing
# - IPv4 address to ping when checking network connectivity. Default: (Quad9 DNS IP)
# - IPv6 address to ping when checking network connectivity. Default: 2620:fe::fe (Quad9 DNS IP)
# - Domain to resolve when checking DNS resolver. Default: (Quad9 DNS domain)

# Daily check for DietPi updates: 0=disable | 1=enable
# - Checks are done by downloading a file of only 7 bytes.

# Daily check for APT package updates: 0=disable | 1=check only | 2=check and upgrade automatically
# - Upgrade logs can be found at: /var/tmp/dietpi/logs/dietpi-update_apt.log

# Network time sync: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift

# Serial Console: Set to 0 if you do not require serial console.

# Sound card

# LCD Panel addon
# - Do not modify, you must use dietpi-config to configure/set options

# IPv6

# APT mirrors which are applied to /etc/apt/sources.list | Values here will also be applied during 1st run setup
# - Raspbian:
# - Debian:

# NTP mirror, applied to /etc/ntp.conf
# - For a full list, please see:
# - Please remove the initial integer and full stop from the value (removing "0."), eg:

##### DietPi-Software settings #####
# SSH Server
# - Disable SSH password logins, e.g. when using pubkey authentication
#	0=Allow password logins for all users, including root
#	root=Disable password login for root user only
#	1=Disable password logins for all users, assure that you have a valid SSH key applied!

# VNC Server

# ownCloud/Nextcloud
# - Optional username for admin account, the default is 'admin', applied during install
# - Optional data directory, default is "/mnt/dietpi_userdata/owncloud_data" respectively "/mnt/dietpi_userdata/nextcloud_data", applied during install
#	NB: This option is for advanced users. For full compatibility, please keep this options defaults, and, use dietpi-drive_manager to move the DietPi user data location.

# WiFi Hotspot
# - Key requires a minimum of 8 characters

# - DPI 96(default) 120(+25%) 144(+50%) 168(+75%) 192(+100%)

# Chromium

# Home Assistant
# - Optional Python build dependencies and modules, possibly required for certain HA components
#	Space separated list (no quotation!), will be installed together with Home Assistant automatically, if present
#	Add Python modules with version string at best, e.g.: firstModule==1.2.3 secondModule==4.5.6

# K3s
# Command with flags to use for launching K3s in the service
# The value of this variable is copied directly into the INSTALL_K3S_EXEC environment variable before
# running the K3s installer.
# Optionally, you can add a configuration file named /boot/dietpi-k3s.yaml,
# which will be copied into place during installation.

# DietPi-Dashboard
# Version to use
# - Stable = Use release version of DietPi-Dashboard.
# - Nightly = Use unstable version DietPi-Dashboard. Might have bugs, but will probably have more features.
# Whether to only install backend or not

# - For an unattended install, place a config file named "unattended_pivpn.conf" into the boot partition/directory.
# - For example configs, have a look at:

# Shairport Sync
# - Uncomment and set to "2" to install experimental AirPlay 2 build:

##### Dev settings #####

##### Settings, automatically added by dietpi-update #####

would it be possible to share some log files if available? Best would be all logs available inside /var/tmp/dietpi/logs. Usually you should be able to attach the files directly. No need to copy the plain content as text :smiley:

I could assume that it comes from the OPT IN/OUT questionaire.
Besides Joulinars question you could do a try to execute a test with


changed to




according to your demands (if we can have a wish: Please set it to 1).

Usually it should opt-out automatically on an interactive install

Here are the requested logs, I renamed them to ‘.txt’ as forum will not let me upload ‘.log’ files:
dietpi-firstboot.txt (7.4 KB)
dietpi-ramlog.txt (227 Bytes)
fs_partition_resize.txt (1.1 KB)

Thanks StephanStS for the suggestion.

I have tried previously with the survery opted in settings set to 1 and think I had the same error.
I will try it again now to just double check that I really did change that option.

*** I just tried with the survey setting set to 1 and the result is the same. Thanks for the suggestion though. :slightly_smiling_face:

Hmm no error inside log. Are you able to connect a screen to your RPI and run a fresh new install? (without headless mode). That might give an indication where the automatic setup stuck.

Attached is a picture of the error displayed on the screen.

did you created a new SD card or was this just booting of the failed one?

I used rufus to burn DietPi image I downloaded this morning and reapplied the dietpi.txt. This time I set the survey opt in to 1 and it does not seem to be causing the problem and I would like that to be set to 1 anyway.

So the card was over written again just prior to taking the screenshot. Maybe it is the changing of the hostname that is causing it? I just have a feeling about this and am guessing but am probably wrong. I am tempted to do it again but this time only change the hostname nothing else.

No this has nothing to do with changing the hostname. Your screenshot is showing an issue with a failed first run setup. But this could not be the case if you created a new fresh image. Are you sure there is no other USB device connected that could contain an image? You are booting of the SD card only?

Yes, just the 64GB SanDisk Ultra Plus SD Card, nothing else is connected to the USB ports currently. Maybe Rufus is not over writting the card correctly even though it says that is has written the image to the card. I will give Etcher a try and report back. Could the SD card be faulty would this cause the issue? Maybe the dietpi.txt file is getting the wrong attributes set once I save it after changing the contents, I am using NotePad++ to edit the file.

no the failed status could not be caused by dietpi.txt. Usually I use Rufus as well without issues. Could you try a different SD card? A USB pen stick would be fine as well.

I just tried writting the SD card with Etcher and I manually edited the dietpi.txt file but after trying to boot I get the same error nothing changed.

I am also adding this command to the bottom of the ‘config.txt’ file as I have a fan ‘dtoverlay=gpio-fan,gpiopin=14,temp=60000’.

can you share the direct link of the image you download? I will try to replicate.

I downloaded the image from the DietPi website here is the direct link:

I think from memory the page layout was a little different when I downloaded it this morning I could be wrong but I thought I just clicked on Raspberry Pi image and then had to choose the appropriate file. Now the Raspberry Pi images seem to be broken down into seperate images for Pi 2, 3 and 4.

Anyway I just downloaded it again from the above link and did a file comparison of the image I got this morning and have been using with the one I downloaded seconds ago using HxD and they match.