Run RStudio server as non-root

Since the new Electron rendering gives graphics glitches on my system, I'm trying RStudio server.

I installed rstudio-server-bin from AUR, and start the server with rstudio-server start.

It calls polkit to seemingly get root access.

In fact when I try rstudio-server status, it gives the following error:

[ABRIDGED] [118397]: WARNING Server user ' root' does not exist, running as root instead (not recommended); LOGGED FROM: virtual rstudio::core::ProgramStatus rstudio::server::Options::read(int, char* const*, std::ostream&) src/cpp/server/ServerOptions.cpp:282

How can I run the server as a regular user?

Just a thought before I turn in. Create an rstudio user, su and start & ?

RStudio Server is designed for multiple users -- it needs root access so it can process each users' login and load their data.

However with a little coaxing you can get it to run in single user mode. Here are the instructions from the admin guide -- though the guide is for Workbench, they'll work with the open source version too:

https://docs.posit.co/ide/server-pro/access_and_security/server_permissions.html#running-without-permissions

1 Like

I think it already created a rstudio user for me, but it still shows this error in the logs of the service.

Thanks, but that doesn't work.

It doesn't start the server anymore.

Here are the logs:

× rstudio-server.service - RStudio Server daemon
     Loaded: loaded (/etc/systemd/system/rstudio-server.service; disabled; preset: disabled)
    Drop-In: /etc/systemd/system/rstudio-server.service.d
             └─override.conf
     Active: failed (Result: exit-code) since Fri 2023-01-20 10:00:48 CET; 2min 20s ago
   Duration: 28ms
    Process: 53517 ExecStart=/usr/bin/rserver --server-daemonize=0 (code=exited, status=1/FAILURE)
   Main PID: 53517 (code=exited, status=1/FAILURE)
        CPU: 12ms

Jan 20 10:00:48 [ABRIDGED] systemd[1]: Started RStudio Server daemon.
Jan 20 10:00:48 [ABRIDGED] rserver[53517]: Error reading /etc/rstudio/rserver.conf: unrecognised option 'server-project-sharing'
Jan 20 10:00:48 [ABRIDGED] rserver[53517]: ERROR Error reading /etc/rstudio/rserver.conf: unrecognised option 'server-project-sharing'; LOGGED FROM: bool rstudio::core::program_options::parseConfigFile(rstudio_boost::program_options::variables_map&, const string&, const rstudio::core::program_options::OptionsDescription&, bool) src/cpp/core/ProgramOptions.cpp:158
Jan 20 10:00:48 [ABRIDGED] systemd[1]: rstudio-server.service: Main process exited, code=exited, status=1/FAILURE
Jan 20 10:00:48 [ABRIDGED] systemd[1]: rstudio-server.service: Failed with result 'exit-code'.

I have commented out server-project-sharing=0 in /etc/rstudio/rserver.conf.

Then it complained about auth-pam-sessions-enabled=0 and I commented that as well.

Now it gives this error:

× rstudio-server.service - RStudio Server daemon
     Loaded: loaded (/etc/systemd/system/rstudio-server.service; disabled; preset: disabled)
    Drop-In: /etc/systemd/system/rstudio-server.service.d
             └─override.conf
     Active: failed (Result: exit-code) since Fri 2023-01-20 10:07:04 CET; 3min 33s ago
   Duration: 6ms
    Process: 57170 ExecStart=/usr/bin/rserver --server-daemonize=0 (code=exited, status=1/FAILURE)
   Main PID: 57170 (code=exited, status=1/FAILURE)
        CPU: 6ms

Jan 20 10:07:04 [ABRIDGED] systemd[1]: Started RStudio Server daemon.
Jan 20 10:07:04 [ABRIDGED] rserver[57170]: ERROR system error 13 (Permission denied) [path: /var/run/rstudio-server, target-dir: ]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const src/cpp/shared_core/FilePath.cpp:846; LOGGED FROM: int main(int, char* const*) src/cpp/server/ServerMain.cpp:659
Jan 20 10:07:04 [ABRIDGED] systemd[1]: rstudio-server.service: Main process exited, code=exited, status=1/FAILURE
Jan 20 10:07:04 [ABRIDGED] systemd[1]: rstudio-server.service: Failed with result 'exit-code'.

I'm also lost about those changes. Posit Workbench is the new name for RStudio?

@jonathan is there a solution?