According to the official Docker Desktop installation page for Ubuntu...
The latest Ubuntu 24.04 LTS is not yet supported. Docker Desktop will fail to start. Due to a change in how the latest Ubuntu release restricts the unprivileged namespaces,
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
needs to be run at least once. Refer to the Ubuntu Blog for more details.
So I decided to write a small service for doing just that. Here are the installation steps:
git clone https://github.com/guidanoli/ubuntu-24.04-lts-docker-desktop-fix
sudo cp fix-docker-desktop /usr/libexec
sudo cp fix-docker-desktop.service /etc/systemd/system
sudo systemctl enable fix-docker-desktop.service