# Install Microsoft Teams for Linux using Ubuntu on WSL2

Install Microsoft Teams for Linux using Ubuntu on WSL2

Published by Guillaume Meyer  a year ago, tagged as teams linux wsl ubuntu

# Why would-you do that?

Well, first, just because it's fun!
Second, it's a nice technical challenge that may lead you to learn some new stuff, and you may be interested in testing Microsoft Teams for Linux.
Third, of course, you could install a full-blown Linux VM using Hyper-V or VirtualBox, but as you probably already have WSL installed, it makes sense to reuse this resource and keep your CPU/RAM consumption low.

# Prerequisites

For this tutorial, I'll assume your configuration matches the following requirements (even if you could probably follow a similar procedure in a different configuration, with WSL v1 for instance):

If you need to upgrade your config to WSL 2, just follow this tutorial (opens new window)

# Setup WSL 2 to support GUI apps

To run GUI apps from WSL, we'll use an X server on windows that will act as a remote display for your linux distro. To do so, you'll have to update your DISPLAY environment variable in WSL with your IP using this command:


But as it may change frequently, here is a script that you may include in your .bashrc config file that will update it automatically during your session initialization.

# Open your .bashrc config file
sudo nano  ~/.bashrc

Add the following to your ~/.bashrc:

# Set the DISPLAY environment variable dynamically
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0

As WSL is by default command-line only, it doesn't includes all the necessary required packages to execute GUI apps. Depending on the app, you may need some other packages, but as far as I know, for Microsoft Teams, you'll only need d-bus, as many Linux GUI apps use the D-Bus for inter-process communication (IPC). Install it using:

# Install d-bus
sudo apt install dbus-x11

# Install an X server on Windows

You have multiple options on the market, but from my experience, the best choice so far is VcxSrv that you can download here (opens new window).

Once installed, create a new configuration, choose the "Multiple windows" option and -1 as a display number (automatic detection):

Then "Start no client":

Enable "Disable access control":

Refer to this thread (opens new window) to learn why you need to disable access control.

Save your configuration and launch the VcxSrv server.

# Use your first GUI app

You should now be ready to use your first GUI app. As we'll have to download the Microsoft Teams for Linux Ubuntu package, and that the download page only shows the download link for Linux when using a linux box, let's install and start firefox:

sudo apt install firefox

Firefox should be opened as a new window in your host Windows. Now open the Microsoft Teams download page https://aka.ms/getteams (opens new window)

# Download Microsoft Teams "Insiders"

Download the .deb package in your downloads folder, and install it:

# Open your downloads folder
cd ~/Downloads
# Install teams-insiders
sudo apt install ./teams-insiders_1.3.00.16851_amd64.deb


Doing the install this way is useful to test your X server configuration. But you can also download the latest "non-insiders" version from an official repo using the following commands:

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/ms-teams stable main" > /etc/apt/sources.list.d/teams.list' 
sudo apt update
sudo apt install teams

Once teams-insiders is installed, just launch it from the command-line:


You should now have a fully functional Microsoft Teams client for Linux running on Windows!

If you have any issue with this tutorial, you can refer to these useful links: