Unsure of how to run startup terminal command as compatibility workaround

I’ve looked at various sites telling me how I can run a startup command via cron, KDE system settings, etc. I am aware that the application I’m trying to run isn’t supported officially for Arch based distros, as per this article. However, running one command resolves all the issues I’m having with VMWare Player 16. I have kernel headers installed as well. The command in question that makes the program work is vmware-modconfig --console --install-all However, it needs to be run every startup, as the effect of the command seems to terminate after a shutdown or reboot. I never really have worked with cron or other startup related programs in a while, so if anyone can enlighten me on how I can put the command into something that runs at startup, and how such startup tasks are structured in terms of editing them, it would be appreciated. That way I can learn and figure out how to do it without asking again.

Create a systemd service and enable it:
https://askubuntu.com/questions/919054/how-do-i-run-a-single-command-at-startup-using-systemd/919059#919059

Thanks. I tried it but I think the syntax of the two files are off. If someone doesn’t mind correcting me, take a look:
/sbin/vmwarefix.sh
/etc/systemd/system/vmwarefix.service

Is the script file marked executable?
The vmware-modconfig command is lacking a full path and would not be found methinks.
Also, it should not use/need sudo, as the service is run as root.
Why use the script file in the first place - just adjust the service file:

[Unit]
Description=Vmware workaround for running the same command every boot manually.

[Service]
ExecStart=/path/to/vmware-modconfig --console --install-all

[Install]
WantedBy=multi-user.target

Get and replace the /path/to/vmware-modconfig in there:

$ which vmware-modconfig
1 Like

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