VS Code Server: Cannot install as given user, always installed to root folder #434

Closed
opened 2026-02-04 18:52:41 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @michalstrelec on GitHub (Feb 3, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

code-server.sh

📂 What was the exact command used to execute the script?

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)"

📝 Provide a clear and concise description of the issue.

I have installed Debian 12 LXC container. As per the instruction I have opened shell of LXC itself and as root executed the following command: bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)".
This creates perfectly functioning installation of Code server and stores the configuration in /root/.config/code-server directory.

I have tried to install code server as non root user, but whatever I do, it always install int under root directory. Parts of the script seem to be mentioning $USER and ~ folder, but it always ends up in root folder.

I have tried to create a normal user and add it is to sudo group.

When I execute bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)" it fails as it need higher permission to update the system. So I did execute it as sudo.

sudo bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)"

this installs code server, but always uses /root directory

Is there a way for I can install it into user home directory rather than root?

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

🔄 Steps to reproduce the issue.

I have tried to create a normal user and add it is to sudo group.

When I execute bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)" it fails as it need higher permission to update the system. So I did execute it as sudo.

sudo bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)"

this installs code server, but always uses /root directory

Paste the full error output (if available).

NA

🖼️ Additional context (optional).

No response

Originally created by @michalstrelec on GitHub (Feb 3, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? code-server.sh ### 📂 What was the exact command used to execute the script? bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)" ### 📝 Provide a clear and concise description of the issue. I have installed Debian 12 LXC container. As per the instruction I have opened shell of LXC itself and as root executed the following command: bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)". This creates perfectly functioning installation of Code server and stores the configuration in /root/.config/code-server directory. I have tried to install code server as non root user, but whatever I do, it always install int under root directory. Parts of the script seem to be mentioning $USER and ~ folder, but it always ends up in root folder. I have tried to create a normal user and add it is to sudo group. When I execute bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)" it fails as it need higher permission to update the system. So I did execute it as sudo. sudo bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)" this installs code server, but always uses /root directory Is there a way for I can install it into user home directory rather than root? ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 🔄 Steps to reproduce the issue. I have tried to create a normal user and add it is to sudo group. When I execute bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)" it fails as it need higher permission to update the system. So I did execute it as sudo. sudo bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/code-server.sh)" this installs code server, but always uses /root directory ### ❌ Paste the full error output (if available). NA ### 🖼️ Additional context (optional). _No response_
Author
Owner

@michelroegl-brunner commented on GitHub (Feb 3, 2025):

The path is hardcoeded in the install. Why you need it without root?

@michelroegl-brunner commented on GitHub (Feb 3, 2025): The path is hardcoeded in the install. Why you need it without root?
Author
Owner
@MickLesk commented on GitHub (Feb 3, 2025): https://code.visualstudio.com/docs/setup/linux https://itslinuxguide.com/install-vscode-debian/
Author
Owner

@michalstrelec commented on GitHub (Feb 3, 2025):

The path is hardcoeded in the install. Why you need it without root?

Trying to avoid putting stuff in root folders if I can avoid it and have it in user home directory. The script have some hints of reflecting user folders:
mkdir -p ~/.config/code-server/
systemctl enable -q --now code-server@$USER

It just picks always root even if I execute it as given user via sudo.

@michalstrelec commented on GitHub (Feb 3, 2025): > The path is hardcoeded in the install. Why you need it without root? Trying to avoid putting stuff in root folders if I can avoid it and have it in user home directory. The script have some hints of reflecting user folders: mkdir -p ~/.config/code-server/ systemctl enable -q --now code-server@$USER It just picks always root even if I execute it as given user via sudo.
Author
Owner

@MickLesk commented on GitHub (Feb 3, 2025):

Manual installation without the script necessary. No modifications will be made to the script.

@MickLesk commented on GitHub (Feb 3, 2025): Manual installation without the script necessary. No modifications will be made to the script.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#434