Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Visual Studio Code with admin privileges to make effect of the installed extensions

I have Ubuntu 16.04 and I have to download the C# extension for Visual Studio Code, once I installed it, It doesn't make effect. Then, vscode give me and advice that I should open vscode with admin privileges to make effect of the extensions installed, so I wrote on my terminal:

sudo code .

but it doesn't work, the terminal throws me:

It is recommended to start vscode as a normal user. To run as root, you must specify an alternate user data directory with the --user-data-dir argument.

but I don't know how to specify an alternate user data directory. I was searching how to do that in visual studio code docs but there is not a reference for this issue. If you know how to open with admin privileges in linux please help me.

like image 846
Anargu Avatar asked Aug 14 '16 03:08

Anargu


1 Answers

To run with superuser:

$ sudo code --user-data-dir=~/root

By the way you will be able to run without setting params in the upcoming patch 1.5.0.

like image 133
Dauren Akilbekov Avatar answered Sep 21 '22 12:09

Dauren Akilbekov