2022-08-18 22:58:47 +02:00
|
|
|
## Recommended environment setup tutorial
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2016-11-29 23:23:54 +01:00
|
|
|
This section guides first-time contributors through installing the
|
2021-11-08 22:12:57 +01:00
|
|
|
Zulip development environment on Windows, macOS, and Linux.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
The recommended method for installing the Zulip development environment is
|
|
|
|
to use WSL 2 on Windows, and Vagrant with Docker on macOS and Linux.
|
2023-06-26 20:10:29 +02:00
|
|
|
This method uses the Windows Subsystem for Linux or creates a Linux container
|
2022-08-18 22:58:47 +02:00
|
|
|
(for macOS and Linux) inside which the Zulip server and all related
|
|
|
|
services will run.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
|
|
|
Contents:
|
2021-08-20 22:54:08 +02:00
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- [Requirements](#requirements)
|
2022-02-16 01:39:15 +01:00
|
|
|
- [Step 0: Set up Git & GitHub](#step-0-set-up-git--github)
|
2021-08-20 21:45:39 +02:00
|
|
|
- [Step 1: Install prerequisites](#step-1-install-prerequisites)
|
|
|
|
- [Step 2: Get Zulip code](#step-2-get-zulip-code)
|
|
|
|
- [Step 3: Start the development environment](#step-3-start-the-development-environment)
|
|
|
|
- [Step 4: Developing](#step-4-developing)
|
|
|
|
- [Troubleshooting and common errors](#troubleshooting-and-common-errors)
|
2022-04-19 03:18:48 +02:00
|
|
|
- [Specifying an Ubuntu mirror](#specifying-an-ubuntu-mirror)
|
2021-08-20 21:45:39 +02:00
|
|
|
- [Specifying a proxy](#specifying-a-proxy)
|
|
|
|
- [Customizing CPU and RAM allocation](#customizing-cpu-and-ram-allocation)
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2017-02-13 02:08:22 +01:00
|
|
|
**If you encounter errors installing the Zulip development
|
2020-08-11 01:47:54 +02:00
|
|
|
environment,** check [troubleshooting and common
|
|
|
|
errors](#troubleshooting-and-common-errors). If that doesn't help,
|
2019-05-21 00:36:10 +02:00
|
|
|
please visit [#provision
|
|
|
|
help](https://chat.zulip.org/#narrow/stream/21-provision-help) in the
|
|
|
|
[Zulip development community
|
2021-12-09 20:15:18 +01:00
|
|
|
server](https://zulip.com/development-community/) for real-time help or
|
2019-05-21 00:36:10 +02:00
|
|
|
[file an issue](https://github.com/zulip/zulip/issues).
|
2016-11-20 20:38:16 +01:00
|
|
|
|
|
|
|
When reporting your issue, please include the following information:
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- host operating system
|
|
|
|
- installation method (Vagrant or direct)
|
|
|
|
- whether or not you are using a proxy
|
|
|
|
- a copy of Zulip's `vagrant` provisioning logs, available in
|
2017-01-14 11:19:26 +01:00
|
|
|
`/var/log/provision.log` on your virtual machine
|
2016-07-15 06:51:37 +02:00
|
|
|
|
|
|
|
### Requirements
|
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
Installing the Zulip development environment requires downloading several
|
|
|
|
hundred megabytes of dependencies. You will need an active internet
|
|
|
|
connection throughout the entire installation processes. (See
|
|
|
|
[Specifying a proxy](#specifying-a-proxy) if you need a proxy to access
|
|
|
|
the internet.)
|
|
|
|
|
|
|
|
- 2GB available RAM
|
|
|
|
- active broadband internet connection
|
|
|
|
- [GitHub account](#step-0-set-up-git--github)
|
|
|
|
|
|
|
|
::::{tab-set}
|
|
|
|
|
|
|
|
:::{tab-item} Windows
|
|
|
|
:sync: os-windows
|
|
|
|
:name: windows-10-or-11
|
|
|
|
|
|
|
|
- Windows 64-bit (Windows 10 recommended)
|
|
|
|
- hardware virtualization enabled (VT-x or AMD-V)
|
|
|
|
- administrator access
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} macOS
|
|
|
|
:sync: os-mac
|
|
|
|
|
|
|
|
- macOS (10.11 El Capitan or newer recommended)
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Ubuntu/Debian
|
|
|
|
:sync: os-ubuntu
|
|
|
|
|
2024-03-25 22:31:39 +01:00
|
|
|
- Ubuntu 22.04, or 24.04
|
|
|
|
- Debian 12
|
2024-03-12 20:28:44 +01:00
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Fedora
|
|
|
|
:sync: os-fedora
|
|
|
|
|
|
|
|
- tested for Fedora 36
|
|
|
|
:::
|
|
|
|
|
|
|
|
::::
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2018-05-30 18:42:03 +02:00
|
|
|
Other Linux distributions work great too, but we don't maintain
|
2019-05-27 23:47:40 +02:00
|
|
|
documentation for installing Vagrant and Docker on those systems, so
|
2022-09-09 01:12:59 +02:00
|
|
|
you'll need to find a separate guide and crib from these docs.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2017-06-13 18:52:55 +02:00
|
|
|
### Step 0: Set up Git & GitHub
|
|
|
|
|
2017-06-15 20:30:35 +02:00
|
|
|
You can skip this step if you already have Git, GitHub, and SSH access
|
|
|
|
to GitHub working on your machine.
|
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
Follow our [Git guide][set-up-git] in order to install Git, set up a
|
2017-06-15 20:30:35 +02:00
|
|
|
GitHub account, create an SSH key to access code on GitHub
|
2021-08-20 21:53:28 +02:00
|
|
|
efficiently, etc. Be sure to create an SSH key and add it to your
|
2017-06-15 20:30:35 +02:00
|
|
|
GitHub account using
|
2024-03-12 20:29:15 +01:00
|
|
|
[these instructions](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
|
2017-06-13 18:52:55 +02:00
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
### Step 1: Install prerequisites
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
::::{tab-set}
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::{tab-item} Windows
|
|
|
|
:sync: os-windows
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
Zulip's development environment is most easily set up on Windows using
|
|
|
|
the Windows Subsystem for Linux ([WSL
|
2024-03-12 20:29:15 +01:00
|
|
|
2](https://learn.microsoft.com/en-us/windows/wsl/compare-versions))
|
2023-06-09 01:12:49 +02:00
|
|
|
installation method described here. We require version 0.67.6+ of WSL 2.
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
1. Enable virtualization through your BIOS settings. This sequence
|
|
|
|
depends on your specific hardware and brand, but here are [some
|
|
|
|
basic instructions.][windows-bios-virtualization]
|
2016-11-29 02:00:03 +01:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
1. [Install WSL 2](https://docs.microsoft.com/en-us/windows/wsl/setup/environment).
|
2016-11-29 03:20:47 +01:00
|
|
|
|
2023-06-09 01:12:49 +02:00
|
|
|
1. It is required to enable `systemd` for WSL 2 to manage the database, cache and other services.
|
2024-03-12 20:29:15 +01:00
|
|
|
To configure it, please follow [these instructions](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#systemd-support).
|
2023-06-09 01:12:49 +02:00
|
|
|
Then, you will need to restart WSL 2 before continuing.
|
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
1. Launch the Ubuntu shell as an administrator and run the following command:
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ sudo apt update && sudo apt upgrade
|
2022-08-18 22:58:47 +02:00
|
|
|
```
|
2017-06-15 15:50:11 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
1. Install dependencies with the following command:
|
2017-06-15 15:50:11 +02:00
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ sudo apt install rabbitmq-server memcached redis-server postgresql
|
2022-08-18 22:58:47 +02:00
|
|
|
```
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
1. Open `/etc/rabbitmq/rabbitmq-env.conf` using e.g.:
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ sudo nano /etc/rabbitmq/rabbitmq-env.conf
|
2022-08-18 22:58:47 +02:00
|
|
|
```
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
Confirm the following lines are at the end of your file, and add
|
2024-03-12 20:28:44 +01:00
|
|
|
them if not present:
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
```ini
|
|
|
|
NODE_IP_ADDRESS=127.0.0.1
|
|
|
|
NODE_PORT=5672
|
|
|
|
```
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
Then save your changes (`Ctrl+O`, then `Enter` to confirm the path),
|
|
|
|
and exit `nano` (`Ctrl+X`).
|
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
1. Run the command below to make sure you are inside the WSL disk and not
|
|
|
|
in a Windows mounted disk. You will run into permission issues if you
|
2024-03-12 20:13:59 +01:00
|
|
|
run `./tools/provision` from `zulip` in a Windows mounted disk.
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ cd ~ # or cd /home/USERNAME
|
2022-08-18 22:58:47 +02:00
|
|
|
```
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2023-08-07 21:36:33 +02:00
|
|
|
1. [Create a new SSH key][create-ssh-key] for the WSL 2 virtual
|
|
|
|
machine and add it to your GitHub account. Note that SSH keys
|
2022-08-18 22:58:47 +02:00
|
|
|
linked to your Windows computer will not work within the virtual
|
|
|
|
machine.
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
WSL 2 can be uninstalled by following [Microsoft's documentation][uninstall-wsl]
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
[create-ssh-key]: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
|
|
|
|
[uninstall-wsl]: https://learn.microsoft.com/en-us/windows/wsl/faq#how-do-i-uninstall-a-wsl-distribution-
|
|
|
|
[windows-bios-virtualization]: https://www.thewindowsclub.com/disable-hardware-virtualization-in-windows-10
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::{tab-item} macOS
|
|
|
|
:sync: os-mac
|
2016-11-29 19:31:32 +01:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
1. Install [Vagrant][vagrant-dl] (latest).
|
|
|
|
2. Install [Docker Desktop](https://docs.docker.com/desktop/mac/install/) (latest).
|
|
|
|
:::
|
2022-08-18 22:58:47 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::{tab-item} Ubuntu/Debian
|
|
|
|
:sync: os-ubuntu
|
2022-08-18 22:58:47 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
##### 1. Install Vagrant, Docker, and Git
|
2022-08-18 22:58:47 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
```console
|
|
|
|
$ sudo apt install vagrant docker.io git
|
|
|
|
```
|
2022-08-18 22:58:47 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
```{include} setup/install-docker.md
|
2022-08-18 22:58:47 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
```
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Fedora
|
|
|
|
:sync: os-fedora
|
|
|
|
|
|
|
|
##### 1. Install Vagrant, Docker, and Git
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ sudo yum install vagrant git moby-engine
|
|
|
|
```
|
|
|
|
|
|
|
|
Fedora does not include the
|
|
|
|
official `docker-ce` package in their repositories. They provide the package
|
|
|
|
`moby-engine` which you can choose instead. In case you prefer the official
|
|
|
|
docker distribution, you can follow
|
|
|
|
[their documentation to install Docker on Fedora](https://docs.docker.com/engine/install/fedora/).
|
|
|
|
|
|
|
|
```{include} setup/install-docker.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::::
|
2019-03-15 15:36:54 +01:00
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
### Step 2: Get Zulip code
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2017-03-19 13:07:57 +01:00
|
|
|
1. In your browser, visit <https://github.com/zulip/zulip>
|
2023-08-07 21:36:33 +02:00
|
|
|
and click the **Fork** button. You will need to be logged in to GitHub to
|
2017-03-19 13:07:57 +01:00
|
|
|
do this.
|
2021-11-08 22:12:57 +01:00
|
|
|
2. Open Terminal (macOS/Linux) or Git BASH (Windows; must
|
2017-03-19 13:07:57 +01:00
|
|
|
**run as an Administrator**).
|
2017-10-17 04:13:46 +02:00
|
|
|
3. In Terminal/Git BASH,
|
2022-02-16 01:39:15 +01:00
|
|
|
[clone your fork of the Zulip repository](../git/cloning.md#step-1b-clone-to-your-machine) and
|
|
|
|
[connect the Zulip upstream repository](../git/cloning.md#step-1c-connect-your-fork-to-zulip-upstream):
|
2017-10-17 04:13:46 +02:00
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ git clone --config pull.rebase git@github.com:YOURUSERNAME/zulip.git
|
|
|
|
$ cd zulip
|
|
|
|
$ git remote add -f upstream https://github.com/zulip/zulip.git
|
2016-07-15 06:51:37 +02:00
|
|
|
```
|
|
|
|
|
2023-08-07 21:36:33 +02:00
|
|
|
This will create a `zulip` directory and download the Zulip code into it.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2023-08-07 21:36:33 +02:00
|
|
|
Don't forget to replace `YOURUSERNAME` with your Git username. You will see
|
2016-07-15 06:51:37 +02:00
|
|
|
something like:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2017-10-17 04:13:46 +02:00
|
|
|
$ git clone --config pull.rebase git@github.com:YOURUSERNAME/zulip.git
|
2016-07-15 06:51:37 +02:00
|
|
|
Cloning into 'zulip'...
|
|
|
|
remote: Counting objects: 73571, done.
|
|
|
|
remote: Compressing objects: 100% (2/2), done.
|
|
|
|
remote: Total 73571 (delta 1), reused 0 (delta 0), pack-reused 73569
|
|
|
|
Receiving objects: 100% (73571/73571), 105.30 MiB | 6.46 MiB/s, done.
|
|
|
|
Resolving deltas: 100% (51448/51448), done.
|
|
|
|
Checking connectivity... done.
|
2023-08-07 21:36:33 +02:00
|
|
|
Checking out files: 100% (1912/1912), done.
|
2016-07-15 06:51:37 +02:00
|
|
|
```
|
|
|
|
|
2016-11-29 23:23:54 +01:00
|
|
|
### Step 3: Start the development environment
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
::::{tab-set}
|
|
|
|
|
|
|
|
:::{tab-item} Windows (WSL)
|
|
|
|
:sync: os-windows
|
|
|
|
|
|
|
|
Run the following to install the Zulip development environment and
|
|
|
|
start it. (If Windows Firewall creates popups to block services,
|
|
|
|
simply click **Allow access**.)
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ # Install/update the Zulip development environment
|
|
|
|
$ ./tools/provision
|
|
|
|
$ # Enter the Zulip Python environment
|
|
|
|
$ source /srv/zulip-py3-venv/bin/activate
|
|
|
|
$ # Start the development server
|
|
|
|
$ ./tools/run-dev
|
|
|
|
```
|
|
|
|
|
|
|
|
If you are facing problems or you see error messages after running `./tools/run-dev`,
|
|
|
|
you can try running `./tools/provision` again.
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Windows (VM)
|
|
|
|
:sync: os-windows-vm
|
|
|
|
|
2023-08-07 21:36:33 +02:00
|
|
|
Change into the zulip directory and tell Vagrant to start the Zulip
|
2019-07-15 20:16:26 +02:00
|
|
|
development environment with `vagrant up`:
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ cd zulip
|
|
|
|
$ vagrant plugin install vagrant-vbguest
|
|
|
|
$ vagrant up --provider=virtualbox
|
2024-03-12 20:28:44 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
```{include} setup/vagrant-up.md
|
|
|
|
|
|
|
|
```
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
On Windows, you will see the message
|
|
|
|
`The system cannot find the path specified.` several times. This is
|
|
|
|
normal and is not a problem.
|
|
|
|
|
|
|
|
```{include} setup/vagrant-ssh.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} macOS
|
|
|
|
:sync: os-mac
|
|
|
|
|
|
|
|
Change into the zulip directory and tell Vagrant to start the Zulip
|
|
|
|
development environment with `vagrant up`:
|
|
|
|
|
|
|
|
```console
|
2024-03-12 20:13:59 +01:00
|
|
|
$ cd zulip
|
|
|
|
$ vagrant up --provider=docker
|
2016-07-15 06:51:37 +02:00
|
|
|
```
|
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
**Important note**: There is a [known upstream issue on
|
|
|
|
macOS](https://chat.zulip.org/#narrow/stream/21-provision-help/topic/provision.20error.20ERR_PNPM_LINKING_FAILED/near/1649241)
|
|
|
|
that can cause provisioning to fail with `ERR_PNPM_LINKING_FAILED` or
|
|
|
|
other errors. The temporary fix is to open the Docker desktop app's
|
|
|
|
settings panel, and choose `osxfs (legacy)` under "Choose file sharing
|
|
|
|
implementation for your containers." Once Docker restarts, you should
|
|
|
|
be able to successfully run `vagrant up --provider=docker`. Back in
|
|
|
|
Docker, you can return to using VirtioFS for better system performance
|
|
|
|
while developing, but you may need to revert to `osxfs (legacy)`
|
2024-01-04 18:03:00 +01:00
|
|
|
whenever you need to re-provision.
|
2024-03-12 20:28:44 +01:00
|
|
|
|
|
|
|
```{include} setup/vagrant-up.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```{include} setup/vagrant-ssh.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2024-01-04 18:03:00 +01:00
|
|
|
:::
|
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::{tab-item} Ubuntu/Debian
|
|
|
|
:sync: os-ubuntu
|
|
|
|
|
|
|
|
Change into the zulip directory and tell Vagrant to start the Zulip
|
|
|
|
development environment with `vagrant up`:
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ cd zulip
|
|
|
|
$ vagrant up --provider=docker
|
|
|
|
```
|
|
|
|
|
2024-03-12 19:55:37 +01:00
|
|
|
```{include} setup/vagrant-up.md
|
|
|
|
|
|
|
|
```
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
```{include} setup/vagrant-ssh.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Fedora
|
|
|
|
:sync: os-fedora
|
|
|
|
|
|
|
|
Change into the zulip directory and tell Vagrant to start the Zulip
|
|
|
|
development environment with `vagrant up`:
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ cd zulip
|
|
|
|
$ vagrant up --provider=docker
|
|
|
|
```
|
|
|
|
|
|
|
|
```{include} setup/vagrant-up.md
|
|
|
|
|
|
|
|
```
|
2016-11-29 02:00:03 +01:00
|
|
|
|
2024-03-12 19:55:37 +01:00
|
|
|
```{include} setup/vagrant-ssh.md
|
2016-07-15 06:51:37 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::
|
|
|
|
|
|
|
|
::::
|
2016-07-15 06:51:37 +02:00
|
|
|
|
|
|
|
### Step 4: Developing
|
|
|
|
|
|
|
|
#### Where to edit files
|
|
|
|
|
|
|
|
You'll work by editing files on your host machine, in the directory where you
|
|
|
|
cloned Zulip. Use your favorite editor (Sublime, Atom, Vim, Emacs, Notepad++,
|
|
|
|
etc.).
|
|
|
|
|
2016-11-29 23:23:54 +01:00
|
|
|
When you save changes they will be synced automatically to the Zulip
|
|
|
|
development environment on the virtual machine/container.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
|
|
|
Each component of the Zulip development server will automatically
|
|
|
|
restart itself or reload data appropriately when you make changes. So,
|
|
|
|
to see your changes, all you usually have to do is reload your
|
2021-08-20 21:53:28 +02:00
|
|
|
browser. More details on how this works are available below.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2017-10-06 23:02:32 +02:00
|
|
|
Zulip's whitespace rules are all enforced by linters, so be sure to
|
|
|
|
run `tools/lint` often to make sure you're following our coding style
|
|
|
|
(or use `tools/setup-git-repo` to run it on just the changed files
|
|
|
|
automatically whenever you commit).
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
#### VSCode setup (optional)
|
|
|
|
|
|
|
|
::::{tab-set}
|
|
|
|
|
|
|
|
:::{tab-item} Windows (WSL)
|
|
|
|
:sync: os-windows
|
|
|
|
|
|
|
|
The [Visual Studio Code Remote -
|
|
|
|
WSL](https://code.visualstudio.com/docs/remote/wsl) extension is
|
|
|
|
recommended for editing files when developing with WSL. When you
|
|
|
|
have it installed, you can run:
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ code .
|
|
|
|
```
|
|
|
|
|
|
|
|
to open VS Code connected to your WSL environment. See the [Remote development in WSL][remote-wsl] tutorial for more information.
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Windows (VM)
|
|
|
|
:sync: os-windows-vm
|
|
|
|
|
|
|
|
```{include} setup/vscode-vagrant.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} macOS
|
|
|
|
:sync: os-mac
|
|
|
|
|
|
|
|
```{include} setup/vscode-vagrant.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Ubuntu/Debian
|
|
|
|
:sync: os-ubuntu
|
|
|
|
|
|
|
|
```{include} setup/vscode-vagrant.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Fedora
|
|
|
|
:sync: os-fedora
|
|
|
|
|
|
|
|
```{include} setup/vscode-vagrant.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::::
|
|
|
|
|
2023-03-04 02:17:54 +01:00
|
|
|
#### Understanding run-dev debugging output
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2023-03-04 02:17:54 +01:00
|
|
|
It's good to have the terminal running `./tools/run-dev` up as you work since error
|
2016-07-15 06:51:37 +02:00
|
|
|
messages including tracebacks along with every backend request will be printed
|
|
|
|
there.
|
|
|
|
|
2023-03-04 02:17:54 +01:00
|
|
|
See [Logging](../subsystems/logging.md) for further details on the run-dev console
|
2016-11-19 07:41:26 +01:00
|
|
|
output.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
#### Committing and pushing changes with Git
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
When you're ready to commit or push changes via Git, you will do this by
|
2021-11-08 22:12:57 +01:00
|
|
|
running Git commands in Terminal (macOS/Linux) or Git BASH (Windows) in the
|
2016-11-29 03:20:47 +01:00
|
|
|
directory where you cloned Zulip on your main machine.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2016-11-29 03:20:47 +01:00
|
|
|
If you're new to working with Git/GitHub, check out our [Git & GitHub
|
2021-05-10 07:02:14 +02:00
|
|
|
guide][rtd-git-guide].
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2016-11-29 23:23:54 +01:00
|
|
|
#### Maintaining the development environment
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
::::{tab-set}
|
|
|
|
|
|
|
|
:::{tab-item} Windows (WSL)
|
|
|
|
:sync: os-windows
|
|
|
|
|
|
|
|
If after rebasing onto a new version of the Zulip server, you receive
|
|
|
|
new errors while starting the Zulip server or running tests, this is
|
|
|
|
probably not because Zulip's `main` branch is broken. Instead, this
|
|
|
|
is likely because we've recently merged changes to the development
|
|
|
|
environment provisioning process that you need to apply to your
|
|
|
|
development environment. To update your environment, you'll need to
|
|
|
|
re-provision using `tools/provision` from your Zulip checkout; this
|
|
|
|
should complete in about a minute.
|
|
|
|
|
|
|
|
After provisioning, you'll want to
|
|
|
|
[(re)start the Zulip development server](/development/setup-recommended.md#step-3-start-the-development-environment).
|
|
|
|
|
|
|
|
If you run into any trouble, [#provision
|
|
|
|
help](https://chat.zulip.org/#narrow/stream/21-provision-help) in the
|
|
|
|
[Zulip development community
|
|
|
|
server](https://zulip.com/development-community/) is a great place to ask for
|
|
|
|
help.
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Windows (VM)
|
|
|
|
:sync: os-windows-vm
|
|
|
|
|
2024-03-12 19:55:37 +01:00
|
|
|
```{include} setup/vagrant-update.md
|
2016-11-27 04:21:18 +01:00
|
|
|
|
2024-03-12 19:55:37 +01:00
|
|
|
```
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} macOS
|
|
|
|
:sync: os-mac
|
|
|
|
|
|
|
|
```{include} setup/vagrant-update.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Ubuntu/Debian
|
|
|
|
:sync: os-ubuntu
|
|
|
|
|
|
|
|
```{include} setup/vagrant-update.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Fedora
|
|
|
|
:sync: os-fedora
|
|
|
|
|
|
|
|
```{include} setup/vagrant-update.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::::
|
|
|
|
|
2016-11-29 23:23:54 +01:00
|
|
|
#### Rebuilding the development environment
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
::::{tab-set}
|
|
|
|
|
|
|
|
:::{tab-item} Windows (WSL)
|
|
|
|
:sync: os-windows
|
|
|
|
|
2024-03-12 19:55:37 +01:00
|
|
|
```{include} setup/vagrant-rebuild.md
|
2016-07-15 06:51:37 +02:00
|
|
|
|
|
|
|
```
|
2021-08-20 22:54:08 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Windows (VM)
|
|
|
|
:sync: os-windows-vm
|
|
|
|
|
|
|
|
```{include} setup/vagrant-rebuild.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} macOS
|
|
|
|
:sync: os-mac
|
|
|
|
|
|
|
|
```{include} setup/vagrant-rebuild.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Ubuntu/Debian
|
|
|
|
:sync: os-ubuntu
|
|
|
|
|
|
|
|
```{include} setup/vagrant-rebuild.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Fedora
|
|
|
|
:sync: os-fedora
|
|
|
|
|
|
|
|
```{include} setup/vagrant-rebuild.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::::
|
|
|
|
|
2024-03-12 19:55:37 +01:00
|
|
|
#### Shutting down the development environment for use later
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
::::{tab-set}
|
|
|
|
|
|
|
|
:::{tab-item} Windows (WSL)
|
|
|
|
:sync: os-windows
|
|
|
|
|
|
|
|
On Windows with WSL 2, you do not need to shut down the environment. Simply
|
|
|
|
close your terminal window(s).
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Windows (VM)
|
|
|
|
:sync: os-windows-vm
|
|
|
|
|
|
|
|
```{include} setup/vagrant-halt.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} macOS
|
|
|
|
:sync: os-mac
|
|
|
|
|
|
|
|
```{include} setup/vagrant-halt.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Ubuntu/Debian
|
|
|
|
:sync: os-ubuntu
|
|
|
|
|
|
|
|
```{include} setup/vagrant-halt.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Fedora
|
|
|
|
:sync: os-fedora
|
|
|
|
|
2024-03-12 19:55:37 +01:00
|
|
|
```{include} setup/vagrant-halt.md
|
2016-07-15 06:51:37 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::
|
|
|
|
|
|
|
|
::::
|
|
|
|
|
2016-11-29 23:23:54 +01:00
|
|
|
#### Resuming the development environment
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
::::{tab-set}
|
|
|
|
|
|
|
|
:::{tab-item} Windows (WSL)
|
|
|
|
:sync: os-windows
|
|
|
|
|
|
|
|
On Windows with WSL 2, to resume developing you just need to open a new Git
|
|
|
|
BASH window. Then change into your `zulip` folder and verify the Python
|
|
|
|
environment was properly activated (you will see `(zulip-py3-venv)`). If the
|
|
|
|
`(zulip-py3-venv)` part is missing, run
|
|
|
|
`source /srv/zulip-py3-venv/bin/activate`.
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Windows (VM)
|
|
|
|
:sync: os-windows-vm
|
|
|
|
|
|
|
|
```{include} setup/vagrant-resume.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} macOS
|
|
|
|
:sync: os-mac
|
|
|
|
|
|
|
|
```{include} setup/vagrant-resume.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Ubuntu/Debian
|
|
|
|
:sync: os-ubuntu
|
|
|
|
|
2024-03-12 19:55:37 +01:00
|
|
|
```{include} setup/vagrant-resume.md
|
2016-11-29 02:15:28 +01:00
|
|
|
|
2016-07-15 06:51:37 +02:00
|
|
|
```
|
|
|
|
|
2024-03-12 20:28:44 +01:00
|
|
|
:::
|
|
|
|
|
|
|
|
:::{tab-item} Fedora
|
|
|
|
:sync: os-fedora
|
|
|
|
|
|
|
|
```{include} setup/vagrant-resume.md
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
::::
|
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
### Next steps
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2016-11-29 02:20:52 +01:00
|
|
|
Next, read the following to learn more about developing for Zulip:
|
2016-11-19 07:19:16 +01:00
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- [Git & GitHub guide][rtd-git-guide]
|
|
|
|
- [Using the development environment][rtd-using-dev-env]
|
|
|
|
- [Testing][rtd-testing] (and [Configuring CI][ci] to
|
2021-08-20 22:54:08 +02:00
|
|
|
run the full test suite against any branches you push to your fork,
|
|
|
|
which can help you optimize your development workflow).
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
### Troubleshooting and common errors
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2021-08-20 21:53:28 +02:00
|
|
|
Below you'll find a list of common errors and their solutions. Most
|
2018-05-15 11:22:34 +02:00
|
|
|
issues are resolved by just provisioning again (by running
|
|
|
|
`./tools/provision` (from `/srv/zulip`) inside the Vagrant guest or
|
|
|
|
equivalently `vagrant provision` from outside).
|
2016-11-20 20:38:16 +01:00
|
|
|
|
|
|
|
If these solutions aren't working for you or you encounter an issue not
|
|
|
|
documented below, there are a few ways to get further help:
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- Ask in [#provision help](https://chat.zulip.org/#narrow/stream/21-provision-help)
|
2021-12-09 20:15:18 +01:00
|
|
|
in the [Zulip development community server](https://zulip.com/development-community/).
|
2021-08-20 21:45:39 +02:00
|
|
|
- [File an issue](https://github.com/zulip/zulip/issues).
|
2016-11-20 20:38:16 +01:00
|
|
|
|
|
|
|
When reporting your issue, please include the following information:
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- host operating system
|
|
|
|
- installation method (Vagrant or direct)
|
|
|
|
- whether or not you are using a proxy
|
|
|
|
- a copy of Zulip's `vagrant` provisioning logs, available in
|
2021-08-20 21:53:28 +02:00
|
|
|
`/var/log/provision.log` on your virtual machine. If you choose to
|
2016-10-07 11:17:15 +02:00
|
|
|
post just the error output, please include the **beginning of the
|
|
|
|
error output**, not just the last few lines.
|
|
|
|
|
|
|
|
The output of `tools/diagnose` run inside the Vagrant guest is also
|
|
|
|
usually helpful.
|
|
|
|
|
2017-08-09 00:44:40 +02:00
|
|
|
#### Vagrant guest doesn't show (zulip-py3-venv) at start of prompt
|
2016-10-07 11:17:15 +02:00
|
|
|
|
2021-08-20 21:53:28 +02:00
|
|
|
This is caused by provisioning failing to complete successfully. You
|
2016-10-07 11:17:15 +02:00
|
|
|
can see the errors in `var/log/provision.log`; it should end with
|
|
|
|
something like this:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2016-10-07 11:17:15 +02:00
|
|
|
ESC[94mZulip development environment setup succeeded!ESC[0m
|
|
|
|
```
|
|
|
|
|
|
|
|
The `ESC` stuff are the terminal color codes that make it show as a nice
|
|
|
|
blue in the terminal, which unfortunately looks ugly in the logs.
|
|
|
|
|
|
|
|
If you encounter an incomplete `/var/log/provision.log file`, you need to
|
2023-08-07 21:36:33 +02:00
|
|
|
update your environment. Re-provision your Vagrant machine; if the problem
|
2016-10-07 11:17:15 +02:00
|
|
|
persists, please come chat with us (see instructions above) for help.
|
|
|
|
|
|
|
|
After you provision successfully, you'll need to exit your `vagrant ssh`
|
|
|
|
shell and run `vagrant ssh` again to get the virtualenv setup properly.
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2017-05-24 00:11:52 +02:00
|
|
|
#### Vagrant was unable to mount VirtualBox shared folders
|
|
|
|
|
|
|
|
For the following error:
|
2021-08-20 22:54:08 +02:00
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2017-05-24 00:11:52 +02:00
|
|
|
Vagrant was unable to mount VirtualBox shared folders. This is usually
|
|
|
|
because the filesystem "vboxsf" is not available. This filesystem is
|
|
|
|
made available via the VirtualBox Guest Additions and kernel
|
|
|
|
module. Please verify that these guest additions are properly
|
|
|
|
installed in the guest. This is not a bug in Vagrant and is usually
|
|
|
|
caused by a faulty Vagrant box. For context, the command attempted
|
|
|
|
was:
|
|
|
|
|
|
|
|
mount -t vboxsf -o uid=1000,gid=1000 keys /keys
|
|
|
|
```
|
|
|
|
|
|
|
|
If this error starts happening unexpectedly, then just run:
|
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ vagrant halt
|
|
|
|
$ vagrant up
|
2017-05-24 00:11:52 +02:00
|
|
|
```
|
|
|
|
|
2021-08-20 21:53:28 +02:00
|
|
|
to reboot the guest. After this, you can do `vagrant provision` and
|
2019-05-27 23:47:40 +02:00
|
|
|
`vagrant ssh`.
|
2017-05-24 00:11:52 +02:00
|
|
|
|
2017-10-15 18:50:50 +02:00
|
|
|
#### ssl read error
|
|
|
|
|
|
|
|
If you receive the following error while running `vagrant up`:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2017-10-15 18:50:50 +02:00
|
|
|
SSL read: error:00000000:lib(0):func(0):reason(0), errno 104
|
|
|
|
```
|
|
|
|
|
|
|
|
It means that either your network connection is unstable and/or very
|
|
|
|
slow. To resolve it, run `vagrant up` until it works (possibly on a
|
|
|
|
better network connection).
|
|
|
|
|
|
|
|
#### Unmet dependencies error
|
|
|
|
|
|
|
|
When running `vagrant up` or `provision`, if you see the following error:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2017-10-15 18:50:50 +02:00
|
|
|
==> default: E:unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
|
|
|
|
```
|
|
|
|
|
|
|
|
It means that your local apt repository has been corrupted, which can
|
|
|
|
usually be resolved by executing the command:
|
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ apt-get -f install
|
2017-10-15 18:50:50 +02:00
|
|
|
```
|
|
|
|
|
2017-07-22 10:43:19 +02:00
|
|
|
#### ssh connection closed by remote host
|
|
|
|
|
|
|
|
On running `vagrant ssh`, if you see the following error:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2017-07-22 10:43:19 +02:00
|
|
|
ssh_exchange_identification: Connection closed by remote host
|
|
|
|
```
|
|
|
|
|
|
|
|
It usually means the Vagrant guest is not running, which is usually
|
2021-08-20 21:53:28 +02:00
|
|
|
solved by rebooting the Vagrant guest via `vagrant halt; vagrant up`. See
|
2017-07-22 10:43:19 +02:00
|
|
|
[Vagrant was unable to communicate with the guest machine](#vagrant-was-unable-to-communicate-with-the-guest-machine)
|
|
|
|
for more details.
|
|
|
|
|
2016-07-15 06:51:37 +02:00
|
|
|
#### os.symlink error
|
|
|
|
|
|
|
|
If you receive the following error while running `vagrant up`:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2016-07-15 06:51:37 +02:00
|
|
|
==> default: Traceback (most recent call last):
|
|
|
|
==> default: File "./emoji_dump.py", line 75, in <module>
|
|
|
|
==> default:
|
|
|
|
==> default: os.symlink('unicode/{}.png'.format(code_point), 'out/{}.png'.format(name))
|
|
|
|
==> default: OSError
|
|
|
|
==> default: :
|
|
|
|
==> default: [Errno 71] Protocol error
|
|
|
|
```
|
|
|
|
|
|
|
|
Then Vagrant was not able to create a symbolic link.
|
|
|
|
|
2019-06-27 19:10:14 +02:00
|
|
|
First, if you are using Windows, **make sure you have run Git BASH (or
|
|
|
|
Cygwin) as an administrator**. By default, only administrators can
|
2021-08-20 21:53:28 +02:00
|
|
|
create symbolic links on Windows. Additionally [UAC][windows-uac], a
|
2019-06-27 19:10:14 +02:00
|
|
|
Windows feature intended to limit the impact of malware, can prevent
|
2021-08-20 21:53:28 +02:00
|
|
|
even administrator accounts from creating symlinks. [Turning off
|
2019-06-27 19:10:14 +02:00
|
|
|
UAC][disable-uac] will allow you to create symlinks. You can also try
|
|
|
|
some of the solutions mentioned
|
|
|
|
[here](https://superuser.com/questions/124679/how-do-i-create-a-link-in-windows-7-home-premium-as-a-regular-user).
|
|
|
|
|
|
|
|
[windows-uac]: https://docs.microsoft.com/en-us/windows/security/identity-protection/user-account-control/how-user-account-control-works
|
|
|
|
[disable-uac]: https://stackoverflow.com/questions/15320550/why-is-secreatesymboliclinkprivilege-ignored-on-windows-8
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2019-11-26 03:56:57 +01:00
|
|
|
If you ran Git BASH as administrator but you already had VirtualBox
|
|
|
|
running, you might still get this error because VirtualBox is not
|
2021-08-20 21:53:28 +02:00
|
|
|
running as administrator. In that case: close the Zulip VM with
|
2019-11-26 03:56:57 +01:00
|
|
|
`vagrant halt`; close any other VirtualBox VMs that may be running;
|
|
|
|
exit VirtualBox; and try again with `vagrant up --provision` from a
|
|
|
|
Git BASH running as administrator.
|
|
|
|
|
2016-07-15 06:51:37 +02:00
|
|
|
Second, VirtualBox does not enable symbolic links by default. Vagrant
|
|
|
|
starting with version 1.6.0 enables symbolic links for VirtualBox shared
|
|
|
|
folder.
|
|
|
|
|
|
|
|
You can check to see that this is enabled for your virtual machine with
|
|
|
|
`vboxmanage` command.
|
|
|
|
|
|
|
|
Get the name of your virtual machine by running `vboxmanage list vms` and
|
|
|
|
then print out the custom settings for this virtual machine with
|
|
|
|
`vboxmanage getextradata YOURVMNAME enumerate`:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2016-07-15 06:51:37 +02:00
|
|
|
$ vboxmanage list vms
|
|
|
|
"zulip_default_1462498139595_55484" {5a65199d-8afa-4265-b2f6-6b1f162f157d}
|
|
|
|
|
|
|
|
$ vboxmanage getextradata zulip_default_1462498139595_55484 enumerate
|
|
|
|
Key: VBoxInternal2/SharedFoldersEnableSymlinksCreate/srv_zulip, Value: 1
|
|
|
|
Key: supported, Value: false
|
|
|
|
```
|
|
|
|
|
|
|
|
If you see "command not found" when you try to run VBoxManage, you need to
|
|
|
|
add the VirtualBox directory to your path. On Windows this is mostly likely
|
|
|
|
`C:\Program Files\Oracle\VirtualBox\`.
|
|
|
|
|
|
|
|
If `vboxmanage enumerate` prints nothing, or shows a value of 0 for
|
|
|
|
VBoxInternal2/SharedFoldersEnableSymlinksCreate/srv_zulip, then enable
|
2016-11-29 03:20:47 +01:00
|
|
|
symbolic links by running this command in Terminal/Git BASH/Cygwin:
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ vboxmanage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/srv_zulip 1
|
2016-07-15 06:51:37 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
The virtual machine needs to be shut down when you run this command.
|
|
|
|
|
2019-03-02 13:52:58 +01:00
|
|
|
#### Hyper-V error messages
|
|
|
|
|
|
|
|
If you get an error message on Windows about lack of Windows Home
|
|
|
|
support for Hyper-V when running `vagrant up`, the problem is that
|
|
|
|
Windows is incorrectly attempting to use Hyper-V rather than
|
2021-08-20 21:53:28 +02:00
|
|
|
Virtualbox as the virtualization provider. You can fix this by
|
2019-03-02 13:52:58 +01:00
|
|
|
explicitly passing the virtualbox provider to `vagrant up`:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2019-03-02 13:52:58 +01:00
|
|
|
$ vagrant up --provide=virtualbox
|
|
|
|
```
|
|
|
|
|
2016-07-15 06:51:37 +02:00
|
|
|
#### Connection timeout on `vagrant up`
|
|
|
|
|
|
|
|
If you see the following error after running `vagrant up`:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2016-07-15 06:51:37 +02:00
|
|
|
default: SSH address: 127.0.0.1:2222
|
|
|
|
default: SSH username: vagrant
|
|
|
|
default: SSH auth method: private key
|
|
|
|
default: Error: Connection timeout. Retrying...
|
|
|
|
default: Error: Connection timeout. Retrying...
|
|
|
|
default: Error: Connection timeout. Retrying...
|
|
|
|
```
|
2021-08-18 06:13:23 +02:00
|
|
|
|
2016-07-15 06:51:37 +02:00
|
|
|
A likely cause is that hardware virtualization is not enabled for your
|
|
|
|
computer. This must be done via your computer's BIOS settings. Look for a
|
|
|
|
setting called VT-x (Intel) or (AMD-V).
|
|
|
|
|
|
|
|
If this is already enabled in your BIOS, double-check that you are running a
|
|
|
|
64-bit operating system.
|
|
|
|
|
2023-08-07 21:36:33 +02:00
|
|
|
For further information about troubleshooting Vagrant timeout errors [see
|
2020-03-27 01:32:21 +01:00
|
|
|
this post](https://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying#22575302).
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2017-07-22 10:43:19 +02:00
|
|
|
#### Vagrant was unable to communicate with the guest machine
|
|
|
|
|
|
|
|
If you see the following error when you run `vagrant up`:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2017-07-22 10:43:19 +02:00
|
|
|
Timed out while waiting for the machine to boot. This means that
|
|
|
|
Vagrant was unable to communicate with the guest machine within
|
|
|
|
the configured ("config.vm.boot_timeout" value) time period.
|
|
|
|
|
|
|
|
If you look above, you should be able to see the error(s) that
|
|
|
|
Vagrant had when attempting to connect to the machine. These errors
|
|
|
|
are usually good hints as to what may be wrong.
|
|
|
|
|
|
|
|
If you're using a custom box, make sure that networking is properly
|
|
|
|
working and you're able to connect to the machine. It is a common
|
|
|
|
problem that networking isn't setup properly in these boxes.
|
|
|
|
Verify that authentication configurations are also setup properly,
|
|
|
|
as well.
|
|
|
|
|
|
|
|
If the box appears to be booting properly, you may want to increase
|
|
|
|
the timeout ("config.vm.boot_timeout") value.
|
|
|
|
```
|
|
|
|
|
|
|
|
This has a range of possible causes, that usually amount to a bug in
|
2021-08-20 21:53:28 +02:00
|
|
|
Virtualbox or Vagrant. If you see this error, you usually can fix it
|
2019-05-27 23:47:40 +02:00
|
|
|
by rebooting the guest via `vagrant halt; vagrant up`.
|
2017-07-22 10:43:19 +02:00
|
|
|
|
2016-10-15 01:14:14 +02:00
|
|
|
#### Vagrant up fails with subprocess.CalledProcessError
|
|
|
|
|
|
|
|
The `vagrant up` command basically does the following:
|
|
|
|
|
2022-04-19 03:18:48 +02:00
|
|
|
- Downloads an Ubuntu image and starts it using a Vagrant provider.
|
|
|
|
- Uses `vagrant ssh` to connect to that Ubuntu guest, and then runs
|
2017-01-14 11:19:26 +01:00
|
|
|
`tools/provision`, which has a lot of subcommands that are
|
2021-08-20 21:53:28 +02:00
|
|
|
executed via Python's `subprocess` module. These errors mean that
|
2016-10-15 01:14:14 +02:00
|
|
|
one of those subcommands failed.
|
|
|
|
|
|
|
|
To debug such errors, you can log in to the Vagrant guest machine by
|
|
|
|
running `vagrant ssh`, which should present you with a standard shell
|
2021-08-20 21:53:28 +02:00
|
|
|
prompt. You can debug interactively by using e.g.
|
2021-09-08 00:23:24 +02:00
|
|
|
`cd zulip && ./tools/provision`, and then running the individual
|
2021-08-20 21:53:28 +02:00
|
|
|
subcommands that failed. Once you've resolved the problem, you can
|
2021-09-08 00:23:24 +02:00
|
|
|
rerun `tools/provision` to proceed; the provisioning system is
|
|
|
|
designed to recover well from failures.
|
2016-10-15 01:14:14 +02:00
|
|
|
|
2020-10-23 02:43:28 +02:00
|
|
|
The Zulip provisioning system is generally highly reliable; the most common
|
2016-11-28 02:06:41 +01:00
|
|
|
cause of issues here is a poor network connection (or one where you need a
|
|
|
|
proxy to access the Internet and haven't [configured the development
|
|
|
|
environment to use it](#specifying-a-proxy).
|
2016-10-15 01:14:14 +02:00
|
|
|
|
|
|
|
Once you've provisioned successfully, you'll get output like this:
|
2021-08-20 22:54:08 +02:00
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2016-10-15 01:14:14 +02:00
|
|
|
Zulip development environment setup succeeded!
|
2024-03-12 20:13:59 +01:00
|
|
|
(zulip-py3-venv) vagrant@vagrant:/srv/zulip$
|
2016-10-15 01:14:14 +02:00
|
|
|
```
|
|
|
|
|
2017-08-09 00:44:40 +02:00
|
|
|
If the `(zulip-py3-venv)` part is missing, this is because your
|
2016-10-15 01:14:14 +02:00
|
|
|
installation failed the first time before the Zulip virtualenv was
|
2021-08-20 21:53:28 +02:00
|
|
|
created. You can fix this by just closing the shell and running
|
2017-08-09 00:44:40 +02:00
|
|
|
`vagrant ssh` again, or using `source /srv/zulip-py3-venv/bin/activate`.
|
2016-10-15 01:14:14 +02:00
|
|
|
|
|
|
|
Finally, if you encounter any issues that weren't caused by your
|
2021-08-20 21:53:28 +02:00
|
|
|
Internet connection, please report them! We try hard to keep Zulip
|
2016-10-15 01:14:14 +02:00
|
|
|
development environment provisioning free of bugs.
|
|
|
|
|
2021-11-08 22:12:57 +01:00
|
|
|
##### `pip install` fails during `vagrant up` on Linux
|
2016-10-05 20:17:55 +02:00
|
|
|
|
|
|
|
Likely causes are:
|
|
|
|
|
|
|
|
1. Networking issues
|
|
|
|
2. Insufficient RAM. Check whether you've allotted at least two
|
2021-08-20 22:54:08 +02:00
|
|
|
gigabytes of RAM, which is the minimum Zulip
|
2022-02-24 23:25:36 +01:00
|
|
|
[requires](#requirements). If
|
2021-08-20 22:54:08 +02:00
|
|
|
not, go to your VM settings and increase the RAM, then restart
|
|
|
|
the VM.
|
2016-10-05 20:17:55 +02:00
|
|
|
|
2019-11-26 03:56:57 +01:00
|
|
|
#### VBoxManage errors related to VT-x or WHvSetupPartition
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2019-11-26 03:56:57 +01:00
|
|
|
There was an error while executing `VBoxManage`, a CLI used by Vagrant
|
|
|
|
for controlling VirtualBox. The command and stderr is shown below.
|
|
|
|
|
|
|
|
Command: ["startvm", "8924a681-b4e4-4b7a-96f2-4cb11619f123", "--type", "headless"]
|
|
|
|
|
|
|
|
Stderr: VBoxManage.exe: error: (VERR_NEM_MISSING_KERNEL_API).
|
|
|
|
VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
|
|
|
|
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
|
|
|
|
```
|
|
|
|
|
|
|
|
or
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2019-11-26 03:56:57 +01:00
|
|
|
Stderr: VBoxManage.exe: error: Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED)
|
|
|
|
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
|
|
|
|
```
|
|
|
|
|
|
|
|
First, ensure that hardware virtualization support (VT-x or AMD-V) is
|
|
|
|
enabled in your BIOS.
|
|
|
|
|
|
|
|
If the error persists, you may have run into an incompatibility
|
2021-08-20 21:53:28 +02:00
|
|
|
between VirtualBox and Hyper-V on Windows. To disable Hyper-V, open
|
2021-09-08 00:23:24 +02:00
|
|
|
command prompt as administrator, run
|
2021-08-20 21:53:28 +02:00
|
|
|
`bcdedit /set hypervisorlaunchtype off`, and reboot. If you need to
|
2021-09-08 00:23:24 +02:00
|
|
|
enable it later, run `bcdedit /deletevalue hypervisorlaunchtype`, and
|
|
|
|
reboot.
|
2019-11-26 03:56:57 +01:00
|
|
|
|
|
|
|
#### OSError: [Errno 26] Text file busy
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2019-11-26 03:56:57 +01:00
|
|
|
default: Traceback (most recent call last):
|
|
|
|
…
|
|
|
|
default: File "/srv/zulip-py3-venv/lib/python3.6/shutil.py", line 426, in _rmtree_safe_fd
|
|
|
|
default: os.rmdir(name, dir_fd=topfd)
|
|
|
|
default: OSError: [Errno 26] Text file busy: 'baremetrics'
|
|
|
|
```
|
|
|
|
|
|
|
|
This error is caused by a
|
|
|
|
[bug](https://www.virtualbox.org/ticket/19004) in recent versions of
|
2021-08-20 21:53:28 +02:00
|
|
|
the VirtualBox Guest Additions for Linux on Windows hosts. You can
|
2021-02-17 18:44:54 +01:00
|
|
|
check the running version of VirtualBox Guest Additions with this
|
|
|
|
command:
|
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ vagrant ssh -- 'sudo modinfo -F version vboxsf'
|
2021-02-17 18:44:54 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
The bug has not been fixed upstream as of this writing, but you may be
|
|
|
|
able to work around it by downgrading VirtualBox Guest Additions to
|
2022-04-19 03:18:48 +02:00
|
|
|
5.2.44. To do this, create a `~/.zulip-vagrant-config` file and add
|
2021-02-17 18:44:54 +01:00
|
|
|
this line:
|
2018-02-18 05:44:39 +01:00
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2022-04-19 03:18:48 +02:00
|
|
|
VBOXADD_VERSION 5.2.44
|
2020-12-19 08:26:19 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Then run these commands (yes, reload is needed twice):
|
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ vagrant plugin install vagrant-vbguest
|
|
|
|
$ vagrant reload
|
|
|
|
$ vagrant reload --provision
|
2019-11-26 03:56:57 +01:00
|
|
|
```
|
2016-07-15 06:51:37 +02:00
|
|
|
|
2022-04-19 03:18:48 +02:00
|
|
|
### Specifying an Ubuntu mirror
|
2019-05-30 01:18:56 +02:00
|
|
|
|
|
|
|
Bringing up a development environment for the first time involves
|
2022-04-19 03:18:48 +02:00
|
|
|
downloading many packages from the Ubuntu archive. The Ubuntu cloud
|
|
|
|
images use the global mirror `http://archive.ubuntu.com/ubuntu/` by
|
2019-05-30 01:18:56 +02:00
|
|
|
default, but you may find that you can speed up the download by using
|
2021-08-20 21:53:28 +02:00
|
|
|
a local mirror closer to your location. To do this, create
|
2019-05-30 01:18:56 +02:00
|
|
|
`~/.zulip-vagrant-config` and add a line like this, replacing the URL
|
|
|
|
as appropriate:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2022-04-19 03:18:48 +02:00
|
|
|
UBUNTU_MIRROR http://us.archive.ubuntu.com/ubuntu/
|
2019-05-30 01:18:56 +02:00
|
|
|
```
|
|
|
|
|
2016-11-28 02:06:41 +01:00
|
|
|
### Specifying a proxy
|
|
|
|
|
|
|
|
If you need to use a proxy server to access the Internet, you will
|
2023-08-07 21:36:33 +02:00
|
|
|
need to specify the proxy settings before running `vagrant up`.
|
2016-11-28 02:06:41 +01:00
|
|
|
First, install the Vagrant plugin `vagrant-proxyconf`:
|
|
|
|
|
2024-03-12 20:13:59 +01:00
|
|
|
```console
|
|
|
|
$ vagrant plugin install vagrant-proxyconf
|
2016-11-28 02:06:41 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Then create `~/.zulip-vagrant-config` and add the following lines to
|
|
|
|
it (with the appropriate values in it for your proxy):
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2016-11-28 02:06:41 +01:00
|
|
|
HTTP_PROXY http://proxy_host:port
|
|
|
|
HTTPS_PROXY http://proxy_host:port
|
2019-10-06 09:18:45 +02:00
|
|
|
NO_PROXY localhost,127.0.0.1,.example.com,.zulipdev.com
|
|
|
|
```
|
|
|
|
|
|
|
|
For proxies that require authentication, the config will be a bit more
|
|
|
|
complex, e.g.:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2019-10-06 09:18:45 +02:00
|
|
|
HTTP_PROXY http://userName:userPassword@192.168.1.1:8080
|
|
|
|
HTTPS_PROXY http://userName:userPassword@192.168.1.1:8080
|
|
|
|
NO_PROXY localhost,127.0.0.1,.example.com,.zulipdev.com
|
2016-11-28 02:06:41 +01:00
|
|
|
```
|
|
|
|
|
2019-04-07 19:29:39 +02:00
|
|
|
You'll want to **double-check** your work for mistakes (a common one
|
2021-08-20 21:53:28 +02:00
|
|
|
is using `https://` when your proxy expects `http://`). Invalid proxy
|
2019-04-07 19:29:39 +02:00
|
|
|
configuration can cause confusing/weird exceptions; if you're using a
|
|
|
|
proxy and get an error, the first thing you should investigate is
|
|
|
|
whether you entered your proxy configuration correctly.
|
|
|
|
|
2016-11-28 02:06:41 +01:00
|
|
|
Now run `vagrant up` in your terminal to install the development
|
|
|
|
server. If you ran `vagrant up` before and failed, you'll need to run
|
|
|
|
`vagrant destroy` first to clean up the failed installation.
|
|
|
|
|
2019-04-07 19:29:39 +02:00
|
|
|
If you no longer want to use proxy with Vagrant, you can remove the
|
|
|
|
`HTTP_PROXY` and `HTTPS_PROXY` lines in `~/.zulip-vagrant-config` and
|
|
|
|
then do a `vagrant reload`.
|
|
|
|
|
|
|
|
### Using a different port for Vagrant
|
2017-09-14 21:10:14 +02:00
|
|
|
|
2016-11-28 02:06:41 +01:00
|
|
|
You can also change the port on the host machine that Vagrant uses by
|
2021-08-20 21:53:28 +02:00
|
|
|
adding to your `~/.zulip-vagrant-config` file. E.g. if you set:
|
2016-11-28 02:06:41 +01:00
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2016-11-28 02:06:41 +01:00
|
|
|
HOST_PORT 9971
|
|
|
|
```
|
|
|
|
|
2019-05-27 23:47:40 +02:00
|
|
|
(and `vagrant reload` to apply the new configuration), then you would visit
|
2016-11-28 02:06:41 +01:00
|
|
|
http://localhost:9971/ to connect to your development server.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2016-12-30 04:47:04 +01:00
|
|
|
If you'd like to be able to connect to your development environment from other
|
|
|
|
machines than the VM host, you can manually set the host IP address in the
|
2023-08-07 21:36:33 +02:00
|
|
|
`~/.zulip-vagrant-config` file as well. For example, if you set:
|
2016-12-30 04:47:04 +01:00
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2016-12-30 04:47:04 +01:00
|
|
|
HOST_IP_ADDR 0.0.0.0
|
|
|
|
```
|
|
|
|
|
2019-09-21 04:04:58 +02:00
|
|
|
(and restart the Vagrant guest with `vagrant reload`), your host IP would be
|
|
|
|
0.0.0.0, a special value for the IP address that means any IP address can
|
|
|
|
connect to your development server.
|
2016-12-30 04:47:04 +01:00
|
|
|
|
2019-04-10 09:44:39 +02:00
|
|
|
### Customizing CPU and RAM allocation
|
|
|
|
|
|
|
|
When running Vagrant using a VM-based provider such as VirtualBox or
|
2020-10-23 02:43:28 +02:00
|
|
|
VMware Fusion, CPU and RAM resources must be explicitly allocated to
|
2019-05-27 23:47:40 +02:00
|
|
|
the guest system (with Docker and other container-based Vagrant
|
2019-04-10 09:44:39 +02:00
|
|
|
providers, explicit allocation is unnecessary and the settings
|
|
|
|
described here are ignored).
|
|
|
|
|
2023-08-07 21:36:33 +02:00
|
|
|
Our default Vagrant settings allocate 2 CPUs with 2 GiB of memory for
|
2019-04-10 09:44:39 +02:00
|
|
|
the guest, which is sufficient to run everything in the development
|
2021-08-20 21:53:28 +02:00
|
|
|
environment. If your host system has more CPUs, or you have enough
|
2023-08-07 21:36:33 +02:00
|
|
|
RAM that you'd like to allocate more than 2 GiB to the guest, you can
|
2019-04-10 09:44:39 +02:00
|
|
|
improve performance of the Zulip development environment by allocating
|
|
|
|
more resources.
|
|
|
|
|
|
|
|
To do so, create a `~/.zulip-vagrant-config` file containing the
|
|
|
|
following lines:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2019-04-10 09:44:39 +02:00
|
|
|
GUEST_CPUS <number of cpus>
|
|
|
|
GUEST_MEMORY_MB <system memory (in MB)>
|
|
|
|
```
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```text
|
2019-04-10 09:44:39 +02:00
|
|
|
GUEST_CPUS 4
|
|
|
|
GUEST_MEMORY_MB 8192
|
|
|
|
```
|
|
|
|
|
2023-08-07 21:36:33 +02:00
|
|
|
would result in an allocation of 4 CPUs and 8 GiB of memory to the
|
2019-04-10 09:44:39 +02:00
|
|
|
guest VM.
|
|
|
|
|
|
|
|
After changing the configuration, run `vagrant reload` to reboot the
|
|
|
|
guest VM with your new configuration.
|
|
|
|
|
|
|
|
If at any time you wish to revert back to the default settings, simply
|
|
|
|
remove the `GUEST_CPUS` and `GUEST_MEMORY_MB` lines from
|
|
|
|
`~/.zulip-vagrant-config`.
|
2016-12-30 04:47:04 +01:00
|
|
|
|
2016-11-29 02:00:03 +01:00
|
|
|
[vagrant-dl]: https://www.vagrantup.com/downloads.html
|
2022-02-24 00:17:21 +01:00
|
|
|
[install-advanced]: setup-advanced.md
|
2024-03-12 20:28:44 +01:00
|
|
|
[remote-wsl]: https://code.visualstudio.com/docs/remote/wsl-tutorial
|
|
|
|
[remote-ssh]: https://code.visualstudio.com/docs/remote/ssh-tutorial
|
2019-09-30 19:37:56 +02:00
|
|
|
[rtd-git-guide]: ../git/index.md
|
|
|
|
[rtd-testing]: ../testing/testing.md
|
|
|
|
[rtd-using-dev-env]: using.md
|
|
|
|
[rtd-dev-remote]: remote.md
|
|
|
|
[set-up-git]: ../git/setup.md
|
2022-02-16 01:39:15 +01:00
|
|
|
[ci]: ../git/cloning.md#step-3-configure-continuous-integration-for-your-fork
|