|
| 1 | +--- |
| 2 | +title: Source Installation |
| 3 | +weight: 30 |
| 4 | +--- |
| 5 | + |
| 6 | +## Installing from Source |
| 7 | + |
| 8 | +If you prefer to build Lima from source, follow these steps: |
| 9 | + |
| 10 | +### Prerequisites |
| 11 | +Ensure you have the following dependencies installed: |
| 12 | +- `git` |
| 13 | +- `go` |
| 14 | +- `make` |
| 15 | + |
| 16 | +### Build and Install |
| 17 | +Run the following commands: |
| 18 | + |
| 19 | +```bash |
| 20 | +git clone https://github.com/lima-vm/lima |
| 21 | +cd lima |
| 22 | +make |
| 23 | +sudo make install |
| 24 | +``` |
| 25 | + |
| 26 | +> **Note:** `sudo make install` is required unless you have write permissions for `/usr/local`. Otherwise, installation may fail. |
| 27 | +
|
| 28 | +### Alternative Installation (Without Sudo) |
| 29 | +If you prefer installing Lima in your home directory, configure the `PREFIX` and `PATH` as follows: |
| 30 | + |
| 31 | +```bash |
| 32 | +make PREFIX=$HOME/.local install |
| 33 | +export PATH=$HOME/.local/bin:$PATH |
| 34 | +``` |
| 35 | + |
| 36 | +## Packaging Lima for Distribution |
| 37 | +After building Lima from source, you may want to package it for installation on other machines: |
| 38 | + |
| 39 | +```bash |
| 40 | +cd _output |
| 41 | +# Create a compressed archive |
| 42 | +tar czf lima-package.tar.gz * |
| 43 | +``` |
| 44 | + |
| 45 | +This package can then be transferred and installed on the target system. |
| 46 | + |
| 47 | +## Advanced Configuration with Kconfig Tools |
| 48 | +(This step is not needed for most users) |
| 49 | + |
| 50 | +To change the build configuration such as the guest architectures, run: |
| 51 | + |
| 52 | +```bash |
| 53 | +make config # For text-based configuration |
| 54 | +make menuconfig # For a menu-based configuration |
| 55 | +``` |
| 56 | + |
| 57 | +This requires Kconfig tools to be installed. It is also possible to manually edit `.config`. The default configuration can be found in `config.mk` (which follows make syntax). |
| 58 | + |
| 59 | +The tools are available as either `kconfig-frontends` or `kbuild-standalone`. There are two interfaces: |
| 60 | +- `conf` for text-based configuration. |
| 61 | +- `mconf` for a menu-driven interface. |
| 62 | + |
| 63 | +A Python implementation is available at [Kconfiglib](https://pypi.org/project/kconfiglib). It can be installed with: |
| 64 | + |
| 65 | +```bash |
| 66 | +pip install --user kconfiglib |
| 67 | +``` |
| 68 | + |
| 69 | +This also includes support for `guiconfig` (GUI-based configuration). |
| 70 | + |
| 71 | + |
0 commit comments