Howto build VyOS 1.2 ISO image and VMWare .OVF

From VyOS Wiki
Revision as of 15:16, 1 July 2017 by Max1e6 (talk | contribs)
Jump to: navigation, search


I have been interested in getting VyOS to run as a Google Cloud Compete instance for quite sometime. Unfortunately, the current version of VyOS 1.1.x is based upon Debian 6 which just does not work (unless you jump through many more hoops then I am willing to jump through), so I became curious to see if this would be possible with VyOS 1.2. As I began my investigation into what it would take to compile VyOS 1.2 I noticed that all the documentation was present, but it was not that easy to use (IMHO) and I discovered several "gotchas". The purpose of this HowTo is provide a complete set of instructions on how to compile VyOS 1.2 and point out some of the issues I encounter so that others can do what I did easier and faster.

This HowTo assumes you are familiar with installing Linux and are comfortable working in the Linux shell/command line.


--Max Abramowitz.

Building VyOS 1.2

Create Build Machine

  1. Download Debian 8 "Jesse". (
  2. Build vyos build machine. For my testing I created a virtual machine on my ESXi server in my lab environment. Configure the machine appropriate for your environment. The default values should work for most use cases. The only caveat is that you should make sure to install the Debian desktop environment. While most of the build process can be done from the Linux shell troubleshooting the qemu build process requires vncviewer which requires a windowing environment. For my build I chose Cinnamon window manager. Also, install ssh server. You could also do this later, but there is not reason not to do it now.

Preliminary Setup

The first thing to do in install some basic setup:

Annoyance - For some reason the left click did not work initially. There are a couple of articles on the Internet about this. I clicked around a bit (using the right click) until I could get a terminal window open. Once I was able to install open-vm-tools the left click started working.

apt-get install sudo
adduser <username> sudo
apt-get install open-vm-tools
apt-get install emacs

Installing sudo and adding your user account to the sudo group is not strictly necessary and it does mean that you can do the build process from a non-root / non-priviledged account, which is a security best practice

Installing emacs is my preference. I believe Debian comes with nano. Perhaps that works for you. IMHO there are two types of people, those who use vi and those who use emacs. To quote my college friend Steph Baily, "you should know enough vi to compile and run emacs". I am an emacs guy, so I installed emacs. In anycase you want to make sure to have a text editor you are comfortable working with installed.

At this point I rebooted the build machine and logged using my favorite ssh client (putty).

Installing Required Software Components

Install the basic softare needed:

sudo apt-get install git autoconf automake dpkg-dev syslinux genisoimage qemu jq libz-dev zip python3 live-build pbuilder devscripts python3-pystache

There are a few components you will have to download from the Internet in order to build VyOS 1.2:

  • HashiCorp Packer - tool to build automated machine images (
  • VMWare open-vmdk
  • VMWare ovftool


Download Packer. Upload to server. Unzip. Copy to a bin directory.

sudo cp packer /usr/local/bin/

VMWare open-vmdk

git clone
cd open-vmdk/
sudo make install

VMWare ovftool

You will need a VMWare account to download VMWare ovftool. Goto Click Software Download. Download the VMware OVF tool for Linux 64-bit. Upload the bundle to your build machine.

chmod 755 VMware-ovftool-4.2.0-4586971-lin.x86_64.bundle
sudo ./VMware-ovftool-4.2.0-4586971-lin.x86_64.bundle
Follow the prompts to complete the installation
=== Building ISO image ===
At this point all the software for building an ISO image should be installed on your build system and you can proceed with downloading the source code and building an ISO image
 git clone
 cd vyos-build
 sudo make iso
Go get a cup of coffee. Once the build process is complete the .iso file will be in the build folder
=== Building qemu image ===
At this point we have a working .iso image and we can proceed with building the qemu image. Before we build the qemu image you will need to create a private ssl key and while not strictly necessary installing vnc (vncviewer specifically) is helpful to monitor the build process.

Build privatekey.pem

mkdir key
cd key
openssl genrsa -des3 -out privatekey.pem 2048
cd ..

Install VNC Viewer

I installed Tight VNC Viwer using the synaptic package manager.


One of the steps in building the qemu image is to configure the vyos install. This process boots the .iso image, installs it as a virtual machine and then configures the image to work in a virtualization environment. Basically, it sets the ethernet interface to use dhcp, deletes the hardware id and enables ssh. Part of the packer.json file sends the key commands to Packer to do this. My experuience was that this did not work out of the box. I needed to modify the "boot_command" section of the packer.json file to adjust the wait times such that there was enough delay between keypresses and commands for the process to work.

Actually building qemu image

Open vnc viewer on your build machine

sudo make qemu

You will see:

qemu-image: Starting VM, booting from CD-ROM
qemu-image: The VM will be run headless, without a GUI. If you want to
qemu-image: view the screen of the VM, connect via VNC without a password to
qemu-image: vnc://

Type in your vnc viewer client (replace xx with whatever shows up on your build. It changes each time.) This will allow you to monitor the Packer boot commands and determine if you need to make any modifications.

This will take a while.

Executive Summary

This HowTo describes how to build VyOS 1.2 from source. It assumes you are familiar with installing Linux and are comfortable working in a Unix shell/command line. The HowTo is based upon the readme file from the VyOS github site and adds some details and other observations which might not be that obvious.

Step 1: Create Build Machine Setup

For my testing I created a Debian 8 "jesse" virtual machine for building VyOS 1.2. You could use VMWare Workstation, VMWare Fusion, Virtual Box, HyperV or similar. For my testing I used an ESXi server in my lab environment.

  1. Download Debian 8 "jesse" (
  2. Install Debian either on a dedicated machine or as a virtual machines.

Note: Install Gnome, KDE or your favorite windowing system. Most of the build process can be done via the command line. However, troubleshooting the qemu build process requires vncview, so it is recommended that you install a windowing system when you install Debian. I think I used Cinnamon.

Once Debian was installed I logged and ran the following commands as root:

apt-get install sudo
apt-get install open-vm-tools
apt-get install emacs


  • sudo is not strictly necessary, but is useful.
  • open-vm-tools was needed for running my build machine under ESXi.
  • emacs any text editor will do. I think nano is installed by default with Debian. Install your editor of choice.

At this point you should have a pretty clean install of Debian. If you are running a virtual machine and your environment allows for snapshooting now might be a good time to take a snapshot in case you make a mistake and need to revert.

Install Required Software

In addition to all the "standard" tools required to build VyOS there are a few others which are required to build VyOS 1.2:

  • Packer
  • VMWare open-vmdk
  • VMWare ovftool

First install the git and all the other linux tools needed:

sudo apt-get install git autoconf automake dpkg-dev syslinux genisoimage qemu jq libz-dev zip python3 live-build pbuilder devscripts python3-pystache

Download & Install Packer

Never heard of Packer before, neither had is a pretty cool tool. You can download it here form

  • Transfer .zip to your build machine
  • unzip
  • copy to /usr/local/bin

Download & Compile VMWare open-vmdk

Download & Install VMWare ovftool

Download VyOS Source

Generate Private Key

Build VyOS