Building VyOS Because…We Can

VyOS is an open source routing operating system and is the successor to Vyatta. VyOS is based on Debian Linux. VyOS is considered an enterprise solution and while it is freely available, there are some limitations as VyOS does offer support contracts to it’s customers and paying customers have access more features (no different than Ubuntu and other Linux distributions).

Why build VyOS?

VyOS is offered in several versions, a stable release (1.2), the upcoming release which will be the next stable major version (1.3) and the future release (1.4). The primary differences between the versions really comes down to the package versions and kernels which each is running on. 1.2 is considered the Long Term Supported version and is based upon Debian 8 Jessie. 1.3 is being tested as the next LTS version release candidate and is based on the newer Debian 9 Stretch. 1.4 is currently being built on Debian 10 Buster. Most businesses prefer to stay on the long term release due to stability and unlike the rolling releases of 1.3 and 1.4 (either monthly built or daily built) access to the images of 1.2 are only provided to customers with support contracts. Being open source however, anyone with Docker can easily build the current most version of 1.2 (in this case 1.2.8) from source code.

Getting Started

First, Docker is of course required. I’m not going into how to install Docker but there is plenty of information on the subject on the Docker website. For those running Windows, I highly recommend using WSL with Ubuntu. In my case, I’m actually doing all of this on a server running Red Hat. Red Hat has it’s own version of Docker with backwards compatible commands so where you see podman in this walk through, just substitute docker. We will be referencing and following the official VyOS documentation regarding building from source located here: https://docs.vyos.io/en/crux/contributing/build-vyos.html#build

Download the Docker Container

First off, we are going to download the Docker container.

podman pull vyos/vyos-build:crux

In Red Hat, you will be presented with several sources to pull the container from. Two which are internal to Red Hat and the option to pull from DockerHub. I opted to pull directly from DockerHub.

Building the image

We need to launch the Docker container.



git clone -b crux --single-branch https://github.com/vyos/vyos-build
cd vyos-build

sudo podman run --rm -it --privileged -v $(pwd):/vyos -w /vyos vyos/vyos-build:crux bash

At first it may look like nothing has happened but if you look your user and hostname have likely changed. The output of cat /etc/os-release verifies we are now running on a Debian 8 machine (which is fun considering the host is actually RHeL 8).

Now we run the configure script and then build the iso.

 ./configure --architecture amd64 --build-by "colin@zappedcom.net" --build-type release --version 1.2.8

sudo make 

This part can take some time depending on the machine being used to build VyOS. After that task is complete, you can exit out of the container by issuing the exit command and you will be back in the vyos-build directory we changed into prior to executing the docker/podman run command. By changing into the build directory under the vyos-build directory we can view some images.

cd build && ls

Which should result in something along the lines of the following…

auto               chroot                   live-image-amd64.contents          local
binary             chroot.files             live-image-amd64.files             version
build-config.json  chroot.packages.install  live-image-amd64.hybrid.iso        vyos-1.2.8-amd64.iso
build.log          chroot.packages.live     live-image-amd64.hybrid.iso.zsync
cache              config                   live-image-amd64.packages

The image that was just created will be the live-imgage-amd64.hybrid.iso file. This is the live image meaning it can be booted and ran directly like any other live image. If we throw it into a VM real quick (default user and password is vyos) we can see more details.

After logging in we run show version to show us the version of VyOS being run. It will print something along the lines of this.

Output of show version

Note the version shows VyOS 1.2.8 (which was something we defined with the configure command, leaving it out will set the version to a string with the build date). Also note we can see who built this version of VyOS. We will also run cat /etc/os-release just to see the OS that we are running on which will verify that Devian 8 is indeed what is in use. We have now completed the build process for building the long term release ISO of VyOS. We can now use it freely as a routing platform.

1 Comment

Comments are closed