How to prepare a fresh Linux VM

March 31, 2026 · View on GitHub

Install Prerequisites

Ubuntu 22.04 and 24.04

# install packages
# Note: libelf-dev, zlib1g-dev, and libnuma-dev are required by the eBPF sandbox (CODESYNC: Public/Src/Sandbox/Linux/ebpf/BuildXL.Sandbox.Linux.eBPF.dsc)
sudo apt-get update 
sudo apt-get install –y git build-essential libc6-dev openssh-server curl dotnet9 clang libelf-dev zlib1g-dev libnuma-dev

# link libdl.so
sudo ln -vs /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so

Mariner / Azure Linux

sudo dnf install -y rsync glibc-static.x86_64 time dotnet-sdk-9.0 clang elfutils-libelf elfutils-libelf-devel zlib-devel libnuma-devel

Install .NET

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get install -y dotnet-sdk-6.0 

Install/configure git credentials provider

Device code authentication

In order to do device code authentication in a Linux headless terminal, a security exception needs to be requested. Check this link for details. Summarizing:

  • Read the TSG linked above
  • Watch the recommended training video
  • Request an exception here (this has to be renewed every 30 days)
  • Connect to a Microsoft network (AzVPN, GSA, CorpNet, or Azure) before running any DCF-based sign-in.