synthwave-vscode icon indicating copy to clipboard operation
synthwave-vscode copied to clipboard

Cant enable Neon Dreams on Ubuntu

Open TimeBandit opened this issue 5 years ago • 42 comments

Cant enable Neon Dreams on Ubuntu. VScode gives message. You must run VS code with admin priviliges in order to enable Neon Dreams This is a non standard thing for a VScode extension to ask for. Doing so would defeat the purpose of not using it for security reasons.

TimeBandit avatar Feb 15 '20 21:02 TimeBandit

VS doesn't support the glow by default and to patch support the extension has to modify core VS code files. In most cases that modification requires elevated permissions. As the readme says, enabling the glow (and therefore modifying the core) is experimental and done at the user's own discretion.

If you choose not to enable the glow, the base colour theme can still function without making any modifications.

robb0wen avatar Feb 16 '20 14:02 robb0wen

I'd really like to enable the neon, but running vscode as root? no way man... There's a lot of extensions running on it. There's no other way?

Sabrinovsky avatar Feb 21 '20 01:02 Sabrinovsky

You need to change the owner of VSCode installation files folder into you current user, most likely you can find that folder in /usr/share then apply this command : sudo chown -R ${whoami} /usr/share/code

After that you can apply the Neon Dreams setup in VSCode and then run this command again to set the owner back to the root: sudo chown -R root /usr/share/code

yaser-alazm avatar Feb 23 '20 20:02 yaser-alazm

You need to change the owner of VSCode installation files folder into you current user, most likely you can find that folder in /usr/share then apply this command : sudo chown -R ${whoami} /usr/share/code

After that you can apply the Neon Dreams setup in VSCode and then run this command again to set the owner back to the root: sudo chown -R root /usr/share/code

I tried this on my arch machine and still end up getting the same original error. I had to change the installation path according to whereis code which spat out /opt/visual-studio-code/bin/code So I ended up running the command:

sudo chown -R ${whoami} /opt/visual-studio-code/bin/code

yet when running the "enable" command in VSCode, I still get the error :/

bradtaniguchi avatar Mar 11 '20 18:03 bradtaniguchi

You need to change the owner of VSCode installation files folder into you current user, most likely you can find that folder in /usr/share then apply this command : sudo chown -R ${whoami} /usr/share/code After that you can apply the Neon Dreams setup in VSCode and then run this command again to set the owner back to the root: sudo chown -R root /usr/share/code

I tried this on my arch machine and still end up getting the same original error. I had to change the installation path according to whereis code which spat out /opt/visual-studio-code/bin/code So I ended up running the command:

sudo chown -R ${whoami} /opt/visual-studio-code/bin/code

yet when running the "enable" command in VSCode, I still get the error :/

You need to replace ${whoami} for your system user, like: sudo chown -R perrito /opt/visual-studio-code/bin/code

RafaelZamora69 avatar Jun 20 '20 04:06 RafaelZamora69

You need to replace ${whoami} for your system user, like: sudo chown -R perrito /opt/visual-studio-code/bin/code

That didn't work either. After playing around with it some more again I was able to get it to work, but by using the following:

sudo chown -R brad /opt/visual-studio-code

I turned on the glow, then reverted the permissions back with:

sudo chown -R root /opt/visual-studio-code

bradtaniguchi avatar Jun 20 '20 04:06 bradtaniguchi

You need to change the owner of VSCode installation files folder into you current user, most likely you can find that folder in /usr/share then apply this command : sudo chown -R ${whoami} /usr/share/code

After that you can apply the Neon Dreams setup in VSCode and then run this command again to set the owner back to the root: sudo chown -R root /usr/share/code

Thanks! I was looking for that. Also don't use snap installation and ubuntu software (both the same). Install your VSCode with the .deb file from official website.

berakoc avatar Jun 28 '20 17:06 berakoc

I'm using Manjaro KDE Plasma with VScode 1.48.2-1 and the way it worked for me was :point_down: all other ones mentioned above did not work in my case

sudo chown -R ${whoami} /usr/lib/code
sudo chown -R root /usr/lib/code

Just in case anyone else is having the same distro :nerd_face:

Willibaur avatar Sep 10 '20 21:09 Willibaur

this also happens on vscode remote container mode.

severity1 avatar Oct 21 '20 00:10 severity1

how did you get it to work on remote container? I'm on WSL ubuntu and all executable "code" files returned by "whereis code" are owned by the same user as "whoami" returns in the vs code terminal

matthalvorson33 avatar Nov 12 '20 02:11 matthalvorson33

For me

sudo chown -R $USER /usr/share/code-insiders/

worked

talk2sunil83 avatar Nov 12 '20 07:11 talk2sunil83

@talk2sunil83 It worked for me too. Thanks dude

sagarpednekar avatar Feb 05 '21 13:02 sagarpednekar

For me (Arch Linux): VScode 1.53.2-1

sudo chown -R ${whoami} /opt/visual-studio-code/
sudo chown -R root /opt/visual-studio-code/

redj45 avatar Feb 28 '21 21:02 redj45

i'm using arch linux, i installed code-insiders through snap, solution doesn't seems to work , please help

Jayprecode avatar Mar 15 '21 18:03 Jayprecode

i'm using arch linux, i installed code-insiders through snap, solution doesn't seems to work , please help

Where is vscode installed in that situation?

Might be able to get more info with whereis code. (or whatever is the name of the binary) I personally haven't used snap much in the past, but I assume a similar solution as above will work once you find where vscode is installed on your system.

bradtaniguchi avatar Mar 15 '21 18:03 bradtaniguchi

You need to change the owner of VSCode installation files folder into you current user, most likely you can find that folder in /usr/share then apply this command : sudo chown -R ${whoami} /usr/share/code After that you can apply the Neon Dreams setup in VSCode and then run this command again to set the owner back to the root: sudo chown -R root /usr/share/code

Thanks! I was looking for that. Also don't use snap installation and ubuntu software (both the same). Install your VSCode with the .deb file from official website.

how do you install the debian file.... i had issues doing this

Jayprecode avatar Mar 15 '21 18:03 Jayprecode

i'm using arch linux, i installed code-insiders through snap, solution doesn't seems to work , please help

Where is vscode installed in that situation?

Might be able to get more info with whereis code. (or whatever is the name of the binary) I personally haven't used snap much in the past, but I assume a similar solution as above will work once you find where vscode is installed on your system.

it brought this: code-insiders: /usr/bin/code-insiders /var/lib/snapd/snap/bin/code-insiders.url-handler /var/lib/snapd/snap/bin/code-insiders

Jayprecode avatar Mar 15 '21 18:03 Jayprecode

You need to change the owner of VSCode installation files folder into you current user, most likely you can find that folder in /usr/share then apply this command : sudo chown -R ${whoami} /usr/share/code After that you can apply the Neon Dreams setup in VSCode and then run this command again to set the owner back to the root: sudo chown -R root /usr/share/code

Thanks! I was looking for that. Also don't use snap installation and ubuntu software (both the same). Install your VSCode with the .deb file from official website.

how do you install the debian file.... i had issues doing this

i mean the tar.gz file....made a mistake, not debian

Jayprecode avatar Mar 15 '21 18:03 Jayprecode

You need to replace ${whoami} for your system user, like: sudo chown -R perrito /opt/visual-studio-code/bin/code

That didn't work either. After playing around with it some more again I was able to get it to work, but by using the following:

sudo chown -R brad /opt/visual-studio-code

I turned on the glow, then reverted the permissions back with:

sudo chown -R root /opt/visual-studio-code

This worked for me but won't work if you installed with snapd or flatpak

Jayprecode avatar Mar 16 '21 17:03 Jayprecode

I can solve it without using Linux Terminal of WSL. steps:

  1. install the extension in Windows and WSL (Window Subsystem For Linux). but, do not configurate nothing yet. you have to execute the program with administrator powers. Imagen1 2.Open the settings in Visual studio Code Imagen2
  2. Open the Json Formatt Settings of Visual Studio Code Imagen3 4.Make sure you have your settings as you want Imagen4 5.Activate the Neon Dreams Imagen5
  3. Until here, it is done for windows, to activate in WSL Imagen6
  4. You have to change using this way. Clicking there and changing to WSL. Imagen7 8.Open any project, and it should be activate automaticly.
    Imagen8 I hope it works for you. For me, it worked

ivanandresdiaz avatar Mar 25 '21 19:03 ivanandresdiaz

so, if you opened WSL how I told, it should work. This is the last picture, where it shows that the extentio is working on WSL too Imagen9

ivanandresdiaz avatar Mar 25 '21 19:03 ivanandresdiaz

#149 I had a fix for this one. Hope it helps! I'm using Ubuntu 20.04.2 LTS :)

franpas12123 avatar May 24 '21 19:05 franpas12123

You need to change the owner of VSCode installation files folder into you current user, most likely you can find that folder in /usr/share then apply this command : sudo chown -R ${whoami} /usr/share/code After that you can apply the Neon Dreams setup in VSCode and then run this command again to set the owner back to the root: sudo chown -R root /usr/share/code

Thanks! I was looking for that. Also don't use snap installation and ubuntu software (both the same). Install your VSCode with the .deb file from official website.

Thanks for this comment I uninstall VSCode because I was use the Ubuntu Store and install from the official website and all was success.

felepo avatar Jun 03 '21 06:06 felepo

You need to change the owner of VSCode installation files folder into you current user, most likely you can find that folder in /usr/share then apply this command : sudo chown -R ${whoami} /usr/share/code

After that you can apply the Neon Dreams setup in VSCode and then run this command again to set the owner back to the root: sudo chown -R root /usr/share/code

I got an error when I tried to run the first command: chown: missing operand after ‘/usr/share/code. So, I researched a little more and found a similar solution in AskUbuntu that change the name used as username to an echo using $USER as param: sudo chown $USER -R /usr/share/code.

henriquebarrosx avatar Jul 01 '21 17:07 henriquebarrosx

For me

sudo chown -R $USER /usr/share/code-insiders/

worked

Finally managed to get it working thank you!

roytouw7 avatar Jul 14 '21 14:07 roytouw7

For me

sudo chown -R $USER /usr/share/code-insiders/

worked

Thanks worked on debian buster

erlangga092 avatar Jul 18 '21 04:07 erlangga092

For those above having problems, here are some hints. You can figure out where your install is using

realpath $(which code)

which will give you a path like /usr/share/code/bin/code. If you remove /bin/code, the root of the install is at /usr/share/code; you can then do

sudo chown -R $(whoami) /usr/share/code

What's wrong with the command above is in bash, ${whoami} is replaced with the environment variable whoami, which is probably empty; $(whoami) with parentheses executes the command whoami and returns the result, which is your username. You could also just use $USER.

ucfjimg avatar Jul 26 '21 15:07 ucfjimg

You need to replace ${whoami} for your system user, like: sudo chown -R perrito /opt/visual-studio-code/bin/code

That didn't work either. After playing around with it some more again I was able to get it to work, but by using the following:

sudo chown -R brad /opt/visual-studio-code

I turned on the glow, then reverted the permissions back with:

sudo chown -R root /opt/visual-studio-code

Worked for me on Manjaro Gnome 40

sebastianner avatar Aug 15 '21 03:08 sebastianner

I can solve it without using Linux Terminal of WSL. steps:

  1. install the extension in Windows and WSL (Window Subsystem For Linux). but, do not configurate nothing yet. you have to execute the program with administrator powers. Imagen1 2.Open the settings in Visual studio Code Imagen2
  2. Open the Json Formatt Settings of Visual Studio Code Imagen3 4.Make sure you have your settings as you want Imagen4 5.Activate the Neon Dreams Imagen5
  3. Until here, it is done for windows, to activate in WSL Imagen6
  4. You have to change using this way. Clicking there and changing to WSL. Imagen7 8.Open any project, and it should be activate automaticly. Imagen8 I hope it works for you. For me, it worked

it worked for me , on my remote vscode-server, update ~/.vscode-server/data/Machine/settings.json

zhangyuz avatar Sep 10 '21 03:09 zhangyuz

I'd been trying to do this, but I was using the wrong directory as whereis code command gave me two directories. code: /usr/bin/code /usr/share/code For me, the sudo chown -R username /usr/share/code works perfectly <3 Do not forget to revert the permissions to root!!!

m4lf0rm3d avatar Oct 27 '21 09:10 m4lf0rm3d