Tutorial: LinuxCNC Autologin & Autostart

LinuxCNC Logo

To avoid having to log in and start LinuxCNC every time you switch on your machine, it makes sense to automate this. We will show you how to automatically log in to your system and start LinuxCNC as soon as the PC is booted.


Terminal Selection

In order to log in automatically, the configuration file of the display manager must be adapted. To do this, first start the terminal.

Terminal Command

You can open the config file with the following command:

sudo nano /usr/share/lightdm/lightdm.conf.d/01_debian.conf

Root permissions are required for this.

Autostart file

The following three lines are now inserted at the end of the file:


Where 'username' is replaced with the desired user name.

Run LinuxCNC on system startup

Debian Settings

To start LinuxCNC as soon as the PC is booted, first open the settings menu via "Settings > Session and startup behavior"

Startup Options

A new application can then be added in the "Automatically started applications" tab.

New Startup Application

Any name and description can be entered in the menu that opens. These are only used to find the startup command later in the list.

For command

linuxcnc /PATH-TO-INI-FILE

where /PATH-TO-INI-FILE is replaced by the location of the .ini file to be started. For the axis simulator, the command could be, for example

linuxcnc /home/username/linuxcnc/configs/sim.axis/axis.ini

Select "at login" as the trigger. Then you can save with "OK".

After the next restart, LinuxCNC should start automatically with the selected .ini file.

Start PC as soon as power is switched on

Many manufacturers offer the option of booting the PC automatically as soon as the power is switched on.

This setting varies from manufacturer to manufacturer and can usually be found in the boot menu.

To access the boot menu, press a manufacturer-specific key immediately after switching on the PC, usually F12. The boot menu then opens. From there you can access the BIOS settings, where you can make the appropriate selection. With DELL, for example, this option can be found under "Power Management > AC Recovery", where you then select "Power On" to start the PC automatically.