# Linux installation

## Installation

VSCode-Anywhere has been tested with several Linux distributions but it is impossible to test with all.

If you have any problems, please open an [issue](https://github.com/gigi206/VSCode-Anywhere/issues).

Installation example:

```
$ bash <(curl -sL https://raw.githubusercontent.com/gigi206/VSCode-Anywhere/V2/VSCode-Anywhere.sh) --help
usage :
  -h | --help        : print this help
  -e | --gitenv      : git branch (default: master)
  -d | --installdir  : installation directory (default: ~/VSCode-Anywhere)
  -v | --saltversion : saltstack version to use
  -p | --profile     : VSCode-Anywhere profile to use (default: linux_user)
  -s | --saltopts    : Salt options
$ bash <(curl -sL https://raw.githubusercontent.com/gigi206/VSCode-Anywhere/V2/VSCode-Anywhere.sh) --installdir <install_dir>
```

{% hint style="info" %}
Replace `<install_dir>` by your installation path.
{% endhint %}

### Options

Installation options are:

* **gitenv** *(optional)*: git branch to use for installation (**V2** by default)
* **installdir** *(optional)*: installation directory (`~/VSCode-Anywhere` by default)
* **saltversion** *(optional)*: Saltstack version to use (value evolves with time). It is not recommended to change this value (only for testing purposes for developers).
* **profile** *(optional)*: type of installation profile (**linux\_user** by default)

#### Profiles

There are 3 kinds of `profile` for different use cases :

* **linux\_admin**: require administrator rights (for local use)
* **linux\_user**: no administrator rights required (for local use)
* **linux\_portable**: does not exist. Use `linux_user` instead (also works with a portable device like an usb stick)

| **profile**         | **advantages**                                                                                                                                                                                                         | **disadvantages**                                                                                                                                                                                                                            |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **linux\_admin**    | <ul><li>No Linux namespaces</li><li>Better compatibility</li></ul>                                                                                                                                                     | <ul><li><code>/nix</code> and <code>/home/linuxbrew</code> will be created on your system</li><li>Not recommended if you already nix or brew is installed on your system</li><li>Need to have a privileged account (<em>sudo</em>)</li></ul> |
| **linux\_user**     | <ul><li>No privileged account needed for the installation process and modules</li><li>‘’/nix’’ and <code>/home/linuxbrew</code> is encapsulated in the <code>installdir</code> directory with the namespaces</li></ul> | <ul><li>less compatibility</li><li>Must have a Linux distribution that manages namespaces</li></ul>                                                                                                                                          |
| **linux\_portable** | <ul><li>Not needed at this time</li></ul>                                                                                                                                                                              | <ul><li>Not needed at this time</li></ul>                                                                                                                                                                                                    |

## Post-installation

### Linux shortcuts icons

For some security reasons, some file managers like the [gnome Files](https://wiki.gnome.org/action/show/Apps/Files) are no longer allowed to run desktop files inside the file manager which causes some problems for VSCode-Anywhere.

If you are in this case, there are multiple choices:

* if you are **root**, you can install another file manager that allow to run desktop files like [nemo](https://en.wikipedia.org/wiki/Nemo_\(file_manager\)) and run the desktop files with this manager
* On [gnome](https://www.gnome.org), you can copy desktop files in the desktop and right-click on them and select `Allow Launching`

{% embed url="<https://youtu.be/fUvqz2G_G64>" %}

* Copy manually desktop files in `~/.local/share/applications` or set  `install_desktop_files` to `True` in [vscode-anywhere.sls](/vscode-anywhere/structure/conf/saltstack/pillar.md#vscode-anywhere-sls) and runthe [install.sh](/vscode-anywhere/structure/tools/install.md) script:

```yaml
vscode-anywhere:
  config:
    linux:
      install_desktop_files: True
```

### HOME

After the installation with the `linux_user` profile (default), the home directory is no longer your home inside VSCode-Anywhere but  it is inside`VSCode-Anywhere/apps/vscode-anywhere/home`.

This mechanism aims to avoid polluting your home directory. If you want to retrieve your real home directory, there are 2 ways:

* remove the `VSCode-Anywhere/apps/vscode-anywhere/home` and create a link that points to your home:

```
rm -fr VSCode-Anywhere/apps/vscode-anywhere/home
ln -s ~ VSCode-Anywhere/apps/vscode-anywhere/home
```

* override settings in [vscode-anywhere.sls](/vscode-anywhere/structure/conf/saltstack/pillar.md#vscode-anywhere-sls):

```yaml
vscode-anywhere:
    env_core:
        USER: myuser
        HOME: myhome
```

{% hint style="info" %}
Replace `myuser` and `myhome` by your real user and your real home directory.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gigi206.gitbook.io/vscode-anywhere/install/advanced/linux-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
