Enable auto-login on Debian VM boot

NimbleGoddess

New Member
Joined
Dec 9, 2022
Messages
13
Reaction score
3
Credits
99
I got a KVM with Debian 10.

I want it to just immediately begin without having to enter a password or username. I know this is less secure, but it’s not important data in this VM.



I tried a couple of things from this guide:

https://vitux.com/how-to-enable-disable-automatic-login-in-debian-10/



Including editing this file:

/etc/gdm3/daemon.conf


I uncommented those sections, but it still has the login prompt.



As far as the GUI method goes, I don’t even have any icons in the top right. They are there during the login prompt ironically, but then disappear once I enter the desktop enviornment.
 


If she has done so with no joy, I have a workaround I have tested in both an installed Debian and a VM, so let me know.

G'day @NimbleGoddess and welcome to linux.org :)

Chris Turner
wizardfromoz
 
You're welcome.

OK what I did was as follows - I didn't have a Debian GNOME in my stable, so I used two Voyager (French distro) I have.

One I call Voyager GNOME is based on Debian. The other I call Voyager4VMs - it is based on Ubuntu 20.04 and has space for several VM to be installed, currently it has Pop!_OS , which is GNOME, but still based on Ubuntu.

First of all, check in your File Manager (Nautilus aka Files) for the content of your folder

/etc/gdm3/

If there is a file already there named

custom.conf

we can use that, no need to re-invent the wheel. If not, we will create it.

I'll take it you have used Nano the console-based Text Editor as was illustrated by the author in the linked article, so you are not shy of using Terminal. If you prefer a GUI method, then you just need to check for the presence of a package

nautilus-admin

Code:
apt policy nautilus-admin

# and if not already installed

sudo apt install -y nautilus-admin

You can then use the GUI Text Editor Gedit to effect the same results.

If daemon.conf is there but no custom.conf , then you can cd to /etc/gdm3 , or use the full path from your current working directory, to perform the following operation

Code:
sudo cp /etc/gdm3/daemon.conf /etc/gdm3/custom.conf

This will duplicate the content of daemon.conf, but in a newly created file custom.conf.

Then we'll edit the content of custom.conf to include the lines by the author.

In my case, I end up with a custom.conf that looks like this

Code:
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]
# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false

# Enabling automatic login
  AutomaticLoginEnable=true
  AutomaticLogin=chris

# Enabling timed login
#  TimedLoginEnable = true
#  TimedLogin = user1
#  TimedLoginDelay = 10

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true

The astute observer who has read the article will have noticed that there are some inconsistencies in the use of a space either side of the = sign , which is not good, but it will work with or without the space, I have tested. It is not a good practice to so so, but if it works, don't fix it.

When you have completed the operation, power down your (virtual) machine, then restart it and see if it works OK, and let us know.

Cheers

Wizard
 
You're welcome.

OK what I did was as follows - I didn't have a Debian GNOME in my stable, so I used two Voyager (French distro) I have.

One I call Voyager GNOME is based on Debian. The other I call Voyager4VMs - it is based on Ubuntu 20.04 and has space for several VM to be installed, currently it has Pop!_OS , which is GNOME, but still based on Ubuntu.

First of all, check in your File Manager (Nautilus aka Files) for the content of your folder

/etc/gdm3/

If there is a file already there named

custom.conf

we can use that, no need to re-invent the wheel. If not, we will create it.

I'll take it you have used Nano the console-based Text Editor as was illustrated by the author in the linked article, so you are not shy of using Terminal. If you prefer a GUI method, then you just need to check for the presence of a package

nautilus-admin

Code:
apt policy nautilus-admin

# and if not already installed

sudo apt install -y nautilus-admin

You can then use the GUI Text Editor Gedit to effect the same results.

If daemon.conf is there but no custom.conf , then you can cd to /etc/gdm3 , or use the full path from your current working directory, to perform the following operation

Code:
sudo cp /etc/gdm3/daemon.conf /etc/gdm3/custom.conf

This will duplicate the content of daemon.conf, but in a newly created file custom.conf.

Then we'll edit the content of custom.conf to include the lines by the author.

In my case, I end up with a custom.conf that looks like this

Code:
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]
# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false

# Enabling automatic login
  AutomaticLoginEnable=true
  AutomaticLogin=chris

# Enabling timed login
#  TimedLoginEnable = true
#  TimedLogin = user1
#  TimedLoginDelay = 10

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true

The astute observer who has read the article will have noticed that there are some inconsistencies in the use of a space either side of the = sign , which is not good, but it will work with or without the space, I have tested. It is not a good practice to so so, but if it works, don't fix it.

When you have completed the operation, power down your (virtual) machine, then restart it and see if it works OK, and let us know.

Cheers

Wizard
Thank you so much for writing this out, however unfortunately it did not work. So I did not have the custom.conf file, but created it like you said and copy pasted in those auto login lines with substituting my username for the chris.

It still has me login at VM bootup
 
That's a shame.

1. Can you tell me what OS and version number of Linux or other you are using as your host for running KVM under?

2. Also, any particular reason for using Debian 10 rather than Debian 11?

I have only used Virtualbox for VMs, but I can setup a KVM environment and try to duplicate your footsteps, it may just take me a couple of days to make the time.

In the meantime, if there are any KVM users passing by, perhaps they could stop in here and take a look. (Are you a user of KVM @f33dm3bits ?)

Wiz
 
Auto-login into the DE in a vm has nothing to with Qemu/Kvm or whatever virtualization software you are running. More with the display-manager you are using and maybe the DE you are using, I'm assuming you are using gdm with Gnome having looked at the link in your post?
 
I just installed Gnome on my Debian vm and edited the file /etc/gdm3/daemon.conf. I only removed the following comments.
Code:
#  AutomaticLoginEnable = true
#  AutomaticLogin = user1
So now they look like this.
Code:
AutomaticLoginEnable = true
AutomaticLogin = tux
Then I rebooted and Gnome was automatically logged into the DE, you will have to replayce "tux" with your username.
 
I now see this was with Debian 10, the vm I tried it in is Debian 11. I will try installing Debian 10.
 
Thanks, Maarten.

Wiz
 
Although it might not be a bad idea to upgrade to Debian 11 since it's only a vm and not a physical system OP is using.
 
This works on the Debian 10 vm I just installed as well, I can also get to the GUI user menu and check/uncheck "Automatic Login".
 
This works on the Debian 10 vm I just installed as well, I can also get to the GUI user menu and check/uncheck "Automatic Login".
I did an upgrade and have the same results unfortunately. here's some neofetch info:

OS: Debian GNU/Linux 11 (bullseye) x86_64
Kernel: 5.10.0-19-amd64
DE: Cinnamon 4.8.6

Under the users section of the GUI where that option should be, I don't see anything
 
OK, now you're being nimble with the DEs (Desktop Environments) - you have listed Cinnamon with your new Debian 11.

The previous one you had we thought was with GNOME, which has as its DM (Display Manager) GDM - that is why above was

/etc/gdm3/daemon.conf

The Cinnamon and XFCE DEs use LightDM as a DM.

KDE uses SDDM (Simple Desktop Display Manager).

Each DM controls the Login screen, but protocols to change User settings differ from one to another.

If you are planning to stay with Cinnamon first let us know, and when we receive that commitment, I will download a Debian 11 iso with Cinnamon, run it through a VM and come back with how to do it.

Cheers

Wizard
 
Looks like with lightdm there is no option for the user the configure it themselves through the GUI, only by editing the lightdm configuration.
 
Last edited:
You can configure some things by typing in lightdm

uxbR32s.png


including Large Text enabled at start, User Image Icon, Orca Screen Reader and so on, with some (depends on the Dev) it allows the opportunity to have numlock enabled from the start of the X Session, but not auto login.

In Users and Groups you can change password, add a user, but not change to autologin.

In Linux Mint Cinnamon, I know with the install you get the option to autologin or not, and would be surprised if that is not offered under Debian.

That is, in part why I said

If you are planning to stay with Cinnamon first let us know, and when we receive that commitment, I will download a Debian 11 iso with Cinnamon, run it through a VM and come back with how to do it.

I'll see what she comes back with.

Nite all

Wiz
 
Nite all

Wiz
Unfortunately now that there's no Login password, when I try to run any software I get this prompt:

Code:
Unlock Login Keyring
Authentication Required
The login keyring did not get unlocked when you unlocked your computer
 

Members online


Top