Running VS Code on Linux
- Download Visual Studio Code for your distribution, .deb for Debian-based distributions such as Ubuntu or .rpm for Red Hat-based distributions such as Fedora or CentOS. Note that 32-bit binaries are also available on the download page.
- Install the package through a GUI package manager by double clicking on the package file, or through the command line:
# For .deb sudo dpkg -i <file>.deb # install dependencies sudo apt-get install -f # For .rpm (Fedora 21 and below) sudo yum install <file>.rpm # For .rpm (Fedora 22 and above) sudo dnf install <file>.rpm
- VS Code should now be available to run through the launcher or the command line by running
code .in any folder to start editing files in that folder.
VS Code ships monthly and you can see when a new release is available by checking Updates. Unfortunately, VS Code does not yet support auto-update on Linux, so you will need to manually install each new release.
If you'd like to install Node.js on Linux, see Installing Node.js via package manager to find the Node.js package and installation instructions tailored to your Linux distribution.
Setting VS Code as the default text editor
You can set the default text editor for text files (
text/plain) that is used by
xdg-open with the following command:
xdg-mime default code.desktop text/plain
Debian alternatives system
Debian-based distributions allow setting a default editor using the alternatives system, without concern for the mime type. You can set this by running the following and selecting code.
sudo update-alternatives --set editor /usr/bin/code
Once you have installed VS Code, these topics will help you learn more about VS Code:
- Additional Components - Learn how to install Git, Node.js, TypeScript and tools like Yeoman.
- The Basics - A quick orientation around VS Code.
- User/Workspace Settings - Learn how to configure VS Code to your preferences through settings.
Azure VM Issues
I'm getting a "Running without the SUID sandbox" error?
You can safely ignore this error.
Debian and Moving Files to Trash
If you see an error when deleting files from the VS Code Explorer on the Debian operating system, it might be because the trash implementation that VS Code is using is not there.
Run these commands to solve this issue:
sudo apt-get install gvfs-bin
When you see this error, it indicates that the VS Code file watcher is running out of handles. The current limit can be viewed by running:
The limit can be increased to its maximum by editing
/etc/sysctl.conf and adding this line to the end of the file:
While 524288 is the maximum number of files that can be watched, if you're in an environment that is particularly memory constrained, you may wish to lower the number. Each file watch takes up 540 bytes (32-bit) or ~1kB (64-bit), so assuming that all 524288 watches are consumed that results in an upper bound of around 256MB (32-bit) or 512MB (64-bit).
I can't see Chinese characters in Ubuntu
We're working on a fix. In the meantime, open the application menu, then choose File > Preferences > User Settings. Then set
editor.fontFamily as shown:
"editor.fontFamily": "Droid Sans Mono, Droid Sans Fallback"
Package git is not installed
This error can appear during installation and is typically caused by the package manager's being out of date. Try updating it and installing again:
# For .deb sudo apt-get update # For .rpm (Fedora 21 and below) sudo yum update # For .rpm (Fedora 22 and above) sudo dnf update
The code bin command does not bring the window to the foreground on Ubuntu
Running 'code .' on Ubuntu when VS Code is already open in the current directory will not bring VS Code into the foreground. This is a feature of the OS which can be disabled using
# Install sudo apt-get update sudo apt-get install compizconfig-settings-manager # Run ccsm
Under General > General Options > Focus & Raise Behaviour, set "Focus Prevention Level" to "Off". Remember this is an OS-level setting that will apply to all applications, not just VS Code.