ctaggart / golang-vscode

docker image with golang and vscode
MIT License
16 stars 9 forks source link

run vscode as root #9

Open ctaggart opened 8 years ago

ctaggart commented 8 years ago

It would be nice to be able to run vscode as root. When experimenting on this image, it is nice to be able to install software as root and edit root config files in vscode.

ctaggart commented 8 years ago

VSCode-linux-x64-stable.zip doesn't run as root https://github.com/Microsoft/vscode/issues/5679

ctaggart commented 8 years ago

With the insiders build, it does run with a warning:

sudo code-insiders --user-data-dir=~/root-data-dir ~/perms-test

image

I think the solution is to allow it to be run via sudo by adding vscode user to sudo group.

apt-get install -y sudo
adduser vscode sudo
echo 'vscode ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
evandrocoan commented 7 years ago

Shouldn't be used gksudo to run GUI programs as root?

You should never use normal sudo to start graphical applications as root. You should use gksudo (kdesudo on Kubuntu) to run such programs. gksudo sets HOME=/root, and copies .Xauthority to a tmp directory. This prevents files in your home directory becoming owned by root.

  1. What is the difference between “gksudo nautilus” and “sudo nautilus”?
  2. https://github.com/Microsoft/vscode/issues/3068 running vscode with gksudo or sudo permission