40

When I boot up my Ubuntu 20.02 laptop, MT (Microsoft Teams) always starts. Since I would like to avoid this, I went to the default program "Startup Applications" and removed the tick for MT.

Though this works for two or three boots, afterwards, I am still stuck with the same problem. Interestingly, the tick for MT in Startup Applications is still there, even though I removed MT from the list.

Help would be appreciated!

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
  • 5
    There's possibly an option in the program itself to disable this behavior.But if not , you can delete the corresponding .desktop file in the ~/.config/autostart directory.It's possible to do it each time you login (via ~/.profile file). – Parsa Mousavi Jun 27 '20 at 08:19
  • @ParsaMousavi you should write this as answer. Teams does have an option that controls startup behavior, and this should be used instead. – Brian Richardson Jun 27 '20 at 08:26
  • 5
    Exact same issue for me. It's incredibly annoying. I would delete teams in a heartbeat except for the fact that my new company requires me to use it. – cyrusbehr Feb 16 '22 at 17:13

8 Answers8

36

The only method I have found so far to solve the problem is configuring settings in Teams:

  • Right click the Teams icon on the system tray
  • open Settings
  • uncheck Auto-start Application

teams settings

Note: In some versions, you can right click the system tray icon and disable autostart right there.

The following methods do not work.

  1. If you disable Teams as a startup application, it will enable itself the next time you open Teams.
  2. If you restrict the write access to autostart folder only to superusers (so that Teams cannot add itself to startup applications), Teams will refuse to open and show errors.
Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
  • Isn't it the same as unchecking it in the Startup Applications ? – Parsa Mousavi Jun 27 '20 at 08:38
  • 3
    No. When you open Teams the next time, it will again register itself to startup application. I was referring to settings within teams – Archisman Panigrahi Jun 27 '20 at 08:42
  • For me it does not work to right click on system tray and uncheck autostart (teams would not store that I unchecked the option), however I had success from the settings within the app. – Johannes Lemonde Apr 28 '21 at 14:07
  • I don't see the option to Uncheck / Disable Auto-start via System Tray. @JohannesLemonde: Are you saying that you were able to disable it after logging in to the Microsoft Account via Teams? Using Ubuntu 20.04.3 LTS. – Rajesh Omanakuttan Oct 16 '21 at 13:55
  • To @RajeshOmanakuttan : Yes, within the app, after logging in. If I translate to English, it would be in Settings > General > Start the app automatically (uncheck that box). I used ubuntu 21.04 but it should be the same. – Johannes Lemonde Oct 17 '21 at 14:55
  • I'm using the version 1.4.00.26453, when I right click the tray icon, under Settings, there a two options, Auto-start Teams and Do not auto-start teams. – André M. Faria Jan 03 '22 at 12:28
  • In my case it was not the right-click, but left-click on Teams tray icon (the right-click only displayed the "About" option for Ubuntu notification panel, not anything Teams-related, but the left-click had the autostart option). – raj Jan 05 '22 at 19:33
  • @raj It keeps changing between versions and may also depend on the DE. Please feel free to edit my answer to add this information. For me, in XFCE, both right click and left click works. – Archisman Panigrahi Jan 05 '22 at 19:34
  • 5
    The fact that you don't ever want teams to start automatically aside, why is the automatic startup setting even part of Teams' own settings? That seems like a questionable practice at best. Respect the Startup Applications please, Microsoft. – user1283068 Jun 17 '22 at 07:04
20

Another way is to achieve this is to add the following line into your ~/.profile file :

rm ~/.config/autostart/whatever_the_name_is.desktop

When you login , even before the DE starts the profile file gets executed and removes the .desktop file.So even if the Microsoft teams creates that file each time you open it , after logout and log-back there shouldn't be any problem.

Or even if that doesn't work(i.e the DE starts before the profile gets executed which I don't think to be the case),you can just kill the process via the killall command in ~/.profile.

Parsa Mousavi
  • 3,305
  • 16
  • 37
  • 1
    The first solution may not work if the autostart applications are run before this command is executed. However, if the desktop file is removed before the software runs, it will certainly work. And Teams is a pretty heavy piece of software, so first running it, and then killing it may significantly increase startup time. – Archisman Panigrahi Jun 27 '20 at 08:48
  • @ArchismanPanigrahi Yes you're right but I'm pretty confident that the profile file is executed first.I've tried a similar solution before.Because the login shell executes the profile file when the DE is still starting.But also it can be dependent on the DE's preferences. – Parsa Mousavi Jun 27 '20 at 08:50
  • 2
    An interesting workaround! I needn't do that for Teams, but I keep that hack in a corner of my head for the next time I get problems with some intrusive proprietary software. – Johannes Lemonde Apr 28 '21 at 14:11
  • 2
    Worked like a charm – Benyamin Jafari Apr 10 '22 at 14:15
  • 2
    On my system for MS teams that line for ~/.profile is rm ~/.config/autostart/teams.desktop – mlncn Jun 22 '22 at 02:47
  • 1
    This is genius, thanks!, also possibly generic for other non-conforming apps, the option to do it from within the teams gui isn't there anymore ? BTW, From the next version of Teams on, when you go : Settings -> Privacy , you'll see this: 'no' :P – mistige Nov 02 '22 at 10:06
  • Software such as teams and zoom that insists on automatically starting up and logging on is just rude and intrusive. Goodness knows what teams is communicating back to Microsoft; storing and attributing for future use. We should look for an open source solution or write our own. – MagicLAMP Nov 05 '22 at 22:18
11

If you like me haven't logged in to the app, it seems you can't access the app settings (or I'm just blind). But I found a config file located here (on my system):

~/.config/Microsoft/Microsoft Teams/desktop-config.json

Change appPreferenceSettings.openAtLogin to false, then Teams will stop creating the ~/.config/autostart/teams.desktop file at startup, and no more autostart ️

This is probably what happens if you follow Archisman Panigrahi accepted answer, but if you are like me can't find the settings in the UI, this might help.

If the config file is not located in the same place as on my system, you might be able to figure out where it is by cat:ing the start script:

cat $(which teams)

For me, the config file is located in the parent directory of TEAM_LOGS that is set by that script.

ThunderBird
  • 1,955
fredrik
  • 211
7

They've coded the app to check and set itself to autostart everytime you open the app. bad microsoft.....bad.. Clean way to stop that is to lock its autostart in your user profile..

vi ~/.config/autostart/teams.desktop

#set autostart to false

X-GNOME-Autostart-enabled=false

#lock file from write changes.

sudo chattr +i ~/.config/autostart/teams.desktop
David Foster
  • 71
  • 1
  • 1
4

After opening teams, click on your profile picture on the top right corner and then settings. Under General uncheck "Auto-start application".

Open teams->click profile image->settings->uncheck Auto-start application

1

Another way is to replace Exec command in autostart file ~/.config/autostart/teams.desktop to something different like Exec=/bin/true and disallowing writing to this file with the following command: chmod 440 ~/.config/autostart/teams.desktop

as after each run MS Teams will restore content of this file

It is impossible at this moment to disable autostart in settings without having an account in Team (account is not required when joining always as a guest)

Also it's possible to join call in chromium based browser (firefox is not supported)

1

As D. Foster answer but you may have to search for desktop file;

search for "teams.desktop" in your home directory

edit the file e.g. ~/snap/teams/6/.config/autostart/teams.desktop set X-GNOME-Autostart-enabled=false

prevent changes to file;

sudo chattr +i ~/snap/teams/6/.config/autostart/teams.desktop

0

Following the main answer by @Archisman Panigrahi, here's what the new interface looks like:

Left-click the blue Teams icon in the top-right of Ubuntu --> click "Settings" --> click "Do not auto-start Teams."

enter image description here

Reboot and you'll see it did NOT automatically start up this time! THANK YOU.

There's a reason I left Microsoft and went to Linux Ubuntu (Microsoft was too controlling), and not being able to disable Teams from the Ubuntu startup menu was feeling just like that (Microsoft being too controlling) all over again.