# No autostart to Desktop as user

**URL:** <https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680>\
**Category:** Troubleshooting\
**Created:** [18 June 2025 21:50 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680 "2025-06-18T21:50:24Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [18 June 2025 21:50 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/1 "2025-06-18T21:50:24Z")

</div>

### Creating a bug report/issue

I have searched the existing open and closed issues

> [@Booting on Pi4 Mate - this now has a 1,5 minute delay](https://dietpi.com/forum/t/booting-on-pi4-mate-this-now-has-a-1-5-minute-delay/21877):
>
> Because our system worked for years and was very fast (also in booting) I refreshed everything. So I did a new Image from scratch for Raspberry-Pi 4 8GB-RAM. Everything works as expect, BUT not the loading-process. First impression was the internet-connection, but with the I’ve got this feedback (changed the @-sign to the %-sign because of board-issues here) The time when unit became active or started is printed after the “%” character. The time the unit took to start is printed after the “…

#### Required Information

- DietPi version 9.14
- Distro version | Bookworm
- Kernel version | 6.12.20
- Architecture | arm64
- SBC model | RPi4

I have a similiar issue like mentioned above. Tried everything what was mentioned there but I have no devce timeouts. And would also not start after a delay.  
As my standard user I can autologin to console, and startx into mate. That works.  
But autologin to Desktoop does not- I tried 16 and in diet-pi-autostart. Both only brings me to the ‘hit return to login’ prompt. It works fine with root.  
I tried downgrading to version 1.26

I have now added startx to my .bashrc what kind of works but I’d like to know what’s going on.  
I have no clue what to do anymore since it coorelates with problem no 2. I have a feeling that it has to do with the vnc server.  
I am using TigerVNC to usually connect via vnc to the server since it’s remote. But that doesn’t work anmore if I have an active desktop running on my monitor. And vice versa, so the autologin maybe fails because the vncserver is already started. I can also not start a desktop if an active vnc desktop is running. The error message: “Could not acquire name on session bus”.  
I tried the SHARE\_DESKTOP=1 setting in Dietpi.txt but that didnt work either.

One point I just want to mention because I don’t know whether it’s important or not: I know that I run xhost + on startup. I forgot why exactly that was neccessary but I think it was because of vncserver not working without it.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [18 June 2025 22:16 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/2 "2025-06-18T22:16:59Z")

</div>

Thanks for your report.

In both cases (auto and manual), login as non-root user is done via LightDM. Can you check its service logs:

```sh
journalctl -u lightdm

```

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [18 June 2025 23:24 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/3 "2025-06-18T23:24:30Z")

</div>

At the moment: no entries

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [19 June 2025 00:10 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/4 "2025-06-19T00:10:29Z")

</div>

Hmm, does that symlink exist and point to the LightDM service?

```sh
ls -l /etc/systemd/system/display-manager.service

```

And if so, is it “WantedBy” the graphical target as expected?

```sh
systemctl show -p WantedBy display-manager

```

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [19 June 2025 08:42 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/5 "2025-06-19T08:42:48Z")

</div>

No, the sysmlink does not exist.  
and  
❯ cat /etc/X11/default-display-manager  
/usr/sbin/lightdm  
❯ systemctl status display-manager.service  
Unit display-manager.service could not be found.

systemctl show -p WantedBy display-manager  
WantedBy=graphical.target

update: I have created the link and started the service.  
It seems to work, got a login mask could login.  
Then changed autostart to 16 and 2 again und that still didnt work.  
After reboot  
systemctl status display-manager.service  
lightdm.service - Light Display Manager  
Loaded: loaded (/lib/systemd/system/lightdm.service; enabled  
; preset: enabled)  
Active: inactive (dead)

Starting it manually still works though.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [19 June 2025 16:02 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/6 "2025-06-19T16:02:56Z")

</div>

Please try again to select one of the two desktop options in `dietpi-autostart`. If you select a different user than root, the symlink is created, or you would see an error prompt.

It is essential for LightDM to start, there is no other (intended) mechanism. Even

```sh
systemctl enable lightdm

```

does nothing else than creating that symlink, just with a bunch of noisy hassle around (which is why we skip it).

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [19 June 2025 22:48 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/7 "2025-06-19T22:48:17Z")

</div>

You are right if I choose 2 or 16 the link will be created. It wasn’t because 2 and 16 are not working and I switched to 7. Autologin to console works and hence I chose to add

```auto
if [-z "$DISPLAY"] && ["$XDG_VTNR" = 1]; then
    exec startx
fi

```

to my `.bashrc`.  
This actually works.  
Everything else still doesn’t. If I go to 2 or 16 there won’t be a login.

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [21 June 2025 11:06 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/8 "2025-06-21T11:06:16Z")

</div>

Is there anything else you could say to fix this?

And how can I fix that I can use vncserver again?

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [21 June 2025 12:26 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/9 "2025-06-21T12:26:35Z")

</div>

What happens if you start the LightDM service manually?

```sh
systemctl start lightdm

```

And then check its logs:

```sh
journalctl -u lightdm

```

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [21 June 2025 14:50 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/10 "2025-06-21T14:50:03Z")

</div>

To avoid misinterpretation, I am on autostart setting 7 right now because that is the only way I get it running. Problems occur with 2.  
If I do what you said:

```auto
systemctl start lightdm

```

```auto
starts the login mask and journalctl:
Jun 21 16:48:17 THALIN systemd[1]: Starting lightdm.service - Light Display Manager...
Jun 21 16:48:17 THALIN systemd[1]: Started lightdm.service - Light Display Manager.
Jun 21 16:48:19 THALIN lightdm[433633]: pam_unix(lightdm-greeter:session): session opened for user lightdm(uid=105) by (uid=0)

```

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [22 June 2025 17:44 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/11 "2025-06-22T17:44:56Z")

</div>

Okay, so the LightDM service generally works well, and the symlink is created. But despite that, the service does not seem to be started, even if the symlink exists?

Can you check the following:

```sh
systemctl show -p WantedBy display-manager
journalctl -u graphical.target

```

Ah, and maybe, since `display-manager.service` is invoked, not `lightdm.service`, we just checked for the wrong unit in the logs. So with autostart option 2 or 16, if LightDM does not show up:

```sh
journalctl -u display-manager -u lightdm -u graphical.target

```

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [26 June 2025 10:37 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/12 "2025-06-26T10:37:14Z")

</div>

> [@MichaIng](#):
>
> `systemctl show -p WantedBy display-manager`

```auto
❯ systemctl show -p WantedBy display-manager
WantedBy=graphical. Target

```

```auto
❯ journalctl -u graphical.target
Jun 20 16:03:38 saruman systemd[1]: Stopped target graphical.target - Graphical Interface.
-- Boot 91ec47d2d6ad41ada3c10c98eec4e43d --
Jun 20 18:40:56 saruman systemd[1]: Reached target graphical.target - Graphical Interface.
Jun 20 19:41:21 saruman systemd[1]: Stopped target graphical.target - Graphical Interface.

```

```auto
❯ journalctl -u display-manager -u lightdm -u graphical.target
-- Boot 6b027605f5a940e88a106d2758a1c5fb --
Jun 20 19:43:14 saruman systemd[1]: Starting lightdm.service - Light Display Manager...
Jun 20 19:43:14 saruman systemd[1]: Started lightdm.service - Light Display Manager.
Jun 20 19:43:15 saruman lightdm[1565]: pam_unix(lightdm-autologin:session): session opened for user sour(uid=1000) by (uid=0)
Jun 20 19:43:17 saruman systemd[1]: Reached target graphical.target - Graphical Interface.
Jun 20 22:51:23 saruman systemd[1]: Stopped target graphical.target - Graphical Interface.
Jun 20 22:51:23 saruman systemd[1]: Stopping lightdm.service - Light Display Manager...
Jun 20 22:51:24 saruman systemd[1]: lightdm.service: Deactivated successfully.
Jun 20 22:51:24 saruman systemd[1]: Stopped lightdm.service - Light Display Manager.
Jun 20 22:51:24 saruman systemd[1]: lightdm.service: Consumed 2min 16.286s CPU time.

```

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [26 June 2025 20:34 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/13 "2025-06-26T20:34:37Z")

</div>

I need to know how I can access the running desktop via vnc. Do I need to use something else than TigerVNC?

I will try realvnc.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [27 June 2025 18:13 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/14 "2025-06-27T18:13:48Z")

</div>

So this time it worked well, doesn’t it? LightDM was starting as expected, no error etc, should show up on an attached screen.

> [@Pausentee](#):
>
> I need to know how I can access the running desktop via vnc. Do I need to use something else than TigerVNC?
> 
> I will try realvnc.

Either of both should work the same way. To connect to the already running local X session:

```sh
G_CONFIG_INJECT 'SOFTWARE_VNCSERVER_SHARE_DESKTOP=' 'SOFTWARE_VNCSERVER_SHARE_DESKTOP=1' /boot/dietpi.txt
systemctl restart vncserver

```

Without this, it will create a new virtual X session for the VNC server only, suitable for headless/server/remote systems.

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [27 June 2025 18:49 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/15 "2025-06-27T18:49:36Z")

</div>

Ok I managed to get Realvnc running, so that’s out of he way.  
Regarding the LightDM. I don’t know what you are refering to. I think you always think that I am on one of th eautostart options 2 or 16 but I am - and that’s why I said this: “To avoid misinterpretation, I am on autostart setting 7”. Nothing is working unless I do it myself aka exec startx.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [27 June 2025 19:16 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/16 "2025-06-27T19:16:03Z")

</div>

> [@Pausentee](#):
>
> To avoid misinterpretation, I am on autostart setting 7”. Nothing is working

This option 7 is the option to login to command line, it is not supposed to start a desktop. Of course there you need to run `startx` manually.

---

<div class="post-metadata">

**Author:** ![Pausentee](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pausentee](https://dietpi.com/forum/u/Pausentee)\
**Post date:** [27 June 2025 19:47 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/17 "2025-06-27T19:47:08Z")

</div>

Joulinar thank you for jumping in, but please read the whole thread and understand the problem before trying to lecture me.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [29 June 2025 14:29 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/18 "2025-06-29T14:29:20Z")

</div>

Let me know if you want to try fixing the autostart options 2 or 16 for you, since this is what I intended to. You did show output of LightDM service logs, showing that it started, so I assume, to get these logs, you did enable option 2 or 16, and hence I was asking whether, in this case you had a LightDM login prompt or desktop on your locally attached screen.

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [25 December 2025 02:29 UTC](https://dietpi.com/forum/t/no-autostart-to-desktop-as-user/23680/19 "2025-12-25T02:29:40Z")

</div>

Closed on 25 December 2025 02:29 UTC

This topic was automatically closed 178 days after the last reply. New replies are no longer allowed.
