Xbox.drv on boot; no rc.local

Hi. My xbox controller won't work for games outside Steam unless I run: sudo xboxdrv --detach-kernel-driver. I found that I just need to edit a file in /etc/rc.local, as that file runs with root permission at startup. Requiring root, just adding to Startup Programs is not going to work. I have provided a screenshot that shows that I have no rc.local file and another screenshot that shows that there are two service files that relate to rc.local. I checked the cron files, but haven't had luck editing for startup options; there are screenshots of those files, too.




1 Like

Hi, @Anthony_Craig :slight_smile:

I don't have an Xbox (controller) and I don't think I've ever created or changed the "/etc/rc.local" file. Having said that, in my Ubuntu MATE 22.04 LTS ("Jammy Jellyfish"), I have a file "/usr/lib/systemd/system/rc-local.service" with the following content:

#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

So, my suggestion is:

1 - Create a file called "rc.local" in the "/etc" folder.

2 - Edit that "/etc/rc.local" file with a text editor and insert the specific content that I assume you have found somewhere to be necessary for the "xbox" controller to work.

3 - Enable the executable permission of the "/etc/rc.local" file with the following command:

sudo chmod +x /etc/rc.local

4 - Reboot the computer and test it.

5 - After rebooting, you may check the status of the "rc-local" Systemd service by running the following command:

systemctl status rc-local

I hope this helps :slight_smile:

1 Like