You are not logged in.
Hello everyone,
Forgive me if my question is stupid, but I spent a lot of time finding a solution to my problem and unfortunately I failed. I have installed visual-studio-code-bin(AUR) on my Arch and I have a problem to run code without sudo. If I just type:
codethen nothing happens. If I run the program with:
sudo code --user-data-dirit immediately starts. Is this a problem with permissions? Someone had such a problem and can advise me what I'm doing wrong?
Thank you in advance for all your answers.
Last edited by CupricSage (2020-04-01 18:27:19)
Offline
What is the output of
which code | xargs ls -lhrWhat are you specifying as the data directory (what comes after --user-data-dir) and what is in it?
Does VS Code run without the --user-data-dir option?
Did you use an AUR helper to install? If so, which one?
Last edited by Spb1994 (2020-03-31 00:38:06)
Offline
This is the output:
lrwxrwxrwx 1 root root 32 Mar 29 18:46 /usr/bin/code -> /opt/visual-studio-code/bin/codeThe problem is that the program starts only if I add --user-data-dir with some parameter, for example I use: VSCode/Code and it works. But there is any option to save this directory as default so that I don't have to give it each time?
I didn't use any AUR helper, just git for clone and makepkg to build package.
Offline
This sounds like it could be a permissions issue. Can you check the permissions of /opt/visual-studio-code directory? For reference, here are my permissions for the /opt/visual-studio-code directory and the actual VS Code binary
drwxr-xr-x 6 root root 4096 Mar 30 20:11 visual-studio-code
-rwxr-xr-x 1 root root 1637 Mar 30 20:07 codeAs for the data dir issue, see if directory ~/.config/Code is present. If so, verify your permissions against mine.
drwx------ 13 myusername myusername 4096 Mar 31 14:54 CodeOffline
My permissions for the /opt/visual-studio-code and VS Code binary:
drwxr-xr-x 6 root root 4096 Mar 29 18:53 visual-studio-code
-rwxr-xr-x 1 root root 1653 Mar 30 20:08 codeI checked again to make sure the folder Code exists in the ~/.config/ directory, and it is there with a such permissions:
drwx------ 7 myuser usersgroup 4096 Mar 31 22:27 CodeIt is interesting that the program starts if I give it this location, but each time I have to do it by entering
code --user-data-dir=~/.config/CodeIt seems like it doesn't know the default folder directory.
Offline
It is interesting that the program starts if I give it this location, but each time I have to do it by entering
code --user-data-dir=~/.config/CodeIt seems like it doesn't know the default folder directory.
Are you able to run VS code without sudo if you specify ~/.config/Code? If so, then try renaming (not deleting) that directory and running vs code without specifying a data directory. I'm curious if there's something going on with the contents of the ~/.config/Code directory...
Offline
Try running
code --verbose to see what is going on with VScode on startup
As mentioned here, it might be some permission issue.
Offline
Are you able to run VS code without sudo if you specify ~/.config/Code?
Yes, it was possible. Therefore, I already doubted that this is a problem with the permission of a file or folder, but after type the command
code --verboseI saw that something is wrong with the folder ~/.config/Code/User. I changed the folder owner to my user and it worked! I can now start VSC with the "code" command.
Thank you Spb1994 and umbrelluck for help, problem solved ![]()
Offline
I saw that something is wrong with the folder ~/.config/Code/User. I changed the folder owner to my user and it worked! I can now start VSC with the "code" command.
This folder will have only had incorrect permissions because you used sudo to launch the application, if you hadn't have done this your issue wouldn't have arised.
TLDR - Don't use sudo unless you know why you need to use it.
Offline