= Getting Spectrum :page-parent: Build and Run :page-nav_order: 2 // SPDX-FileCopyrightText: 2022-2024 Alyssa Ross // SPDX-License-Identifier: GFDL-1.3-no-invariants-or-later OR CC-BY-SA-4.0 To get Spectrum, you need to build it from source. As long as you're running Linuxfootnote:[Building from other operating systems might work, but hasn't been tested. Patches are welcome to support building from other operating systems, as long as they're not too invasive.] and have https://nixos.org/download.html[Nix] and https://git-scm.com/[git] installed, it's very easy to do. TIP: Before you start, consider setting up the xref:binary-cache.adoc[Spectrum binary cache], which will save you a lot of time waiting for builds. TIP: If you encounter build failures, especially timeouts or out-of-memory (OOM) kills, Nix might be configured to run too many builds at once, with too many cores per build. See Nix's documentation for https://nix.dev/manual/nix/2.24/advanced-topics/cores-vs-jobs.html[tuning cores and jobs]. To get Spectrum, run [source,shell] ---- git clone https://spectrum-os.org/git/spectrum ---- Then follow one of the instructions below. If you haven't set up the xref:binary-cache.adoc[binary cache], all of the following Nix commands will take a very long time. == Trying Spectrum If you want to try Spectrum out to get a feel for it, without installing it, you can run it in a development VM with some example applications. [source,shell] ---- cd spectrum/host/rootfs nix-shell --run 'make run' ---- This builds just enough of Spectrum to try it out in a VM. == Installing Spectrum To install Spectrum on a computer, you can use a USB drive as a bootable Spectrum installer device. You will need to choose whether to try out Spectrum without installing it on your system (as a live image), or to install it to your computer's internal storage. To build a live image, run: [source,shell] ---- nix-build spectrum/release/live ---- To build an installer, run: [source,shell] ---- nix-build spectrum/release/combined ---- If you haven't set up the xref:binary-cache.adoc[binary cache], this will take a very long time. When it's done, a symbolic link named "result" will appear in the current directory, pointing to the installer image. Write that image to a USB drive, for example using `dd` (command line) or https://gitlab.com/bztsrc/usbimager[`usbimager`] (graphical, available in Nixpkgs). Then boot your system from the USB drive If you built a live image, Spectrum should be ready for you to use. If you built an installer, you should see a menu allowing you to "Install Spectrum". NOTE: While it's possible to install Spectrum to your internal storage, at this point in Spectrum's development there is not much reason to, as OS updates are not yet implemented, and persistent storage is not yet exposed to VMs. Using a live image to boot Spectrum will let you try out everything in Spectrum, without having to go through the additional step of reinstalling Spectrum every time you want to use a newer version. CAUTION: Do not use Spectrum for anything important or sensitive as it is not yet suitable for real-world use. Many important security properties are currently missing, and there is no procedure for updating to new versions—you have to reinstall the OS.