Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i can't run as root though i specify an alternate user data directory with the --user-data-dir argument #7243

Closed
fregie opened this issue Jun 6, 2016 · 4 comments

Comments

@fregie
Copy link

fregie commented Jun 6, 2016

  • VSCode Version:1.1.1
  • OS Version:ubuntu 14.04

Steps to Reproduce:

  1. sudo code --user-data-dir /home/fregie/.config/Code/
  2. 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.
@darryldalton
Copy link

I had the same issue. I was able to finally get it to work by running ...
sudo code . --user-data-dir='.'

@Tyriar
Copy link
Member

Tyriar commented Jun 6, 2016

sudo code --user-data-dir /home/fregie/.config/Code/ doesn't work because it needs to be a new user data directory, one whose permissions are not as restrictive as ~/.config. This should work for example:

sudo code --user-data-dir /home/fregie/.code-root-user-data

Note that once we reshuffle the configuration directories this will no longer be necessary to explicitly indicate the root user data dir. See #5570 and #2741

@Tyriar Tyriar closed this as completed Jun 6, 2016
@lovettchris
Copy link
Member

I had the same problem, but after reading this thread very closely I found the magic trick. The command line requires and equals sign (=) between the --user-data-dir and the actual directory, which is NOT indicated by the --help.

usage: --user-data-dir=path

would be nice to fix the help or remove the '=' (which would be more consistent with most other unix tools)...

@freeman42x
Copy link

As a root user inside a VM I used: code --user-data-dir=~/.config/Code/ and also added the same to the command line inside KDE menu.

Not sure how to set it though so that it always uses that path when launching it from Konsole as that would be very useful.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants