VyOS is a community fork of Vyatta, a Linux-based network operating system that provides software-based network routing, firewall, and VPN functionality. The VyOS project was started in late 2013 as a community fork of the GPL portions of Vyatta Core 6.6R1 with the goal of maintaining a free and open source network operating system in response to the decision to discontinue the community edition of Vyatta.

VyOS runs on both physical and virtual platforms. It supports paravirtual drivers and integration packages for virtual platforms. It is completely free and open source.

The aim of the tutorial is to show VyOS installation on Qemu virtual machine and get it working on GNS3.

Login as user vyos with the password vyos. Issue the command install system to install a new system to hard drive and follow installation instructions. When installation is finished, do not reboot the system as we are going to adapt VyOS to support GNS3. To make changes in VyOS that is installed on the /dev/sda1 disk we first have to mount it the disk.

vyos@vyos:~$sudo su
root@vyos:/home/vyos#mount -t ext4 /dev/sda1 /tmp

Now our VyOS installation is mounted to the /tmp directory.

5. Stop Generating New Name for Ethernet Interfaces with Changed MAC Address

Qemuwrapper, the script that controls Qemu inside GNS3 always starts Qemu virtual machines with randomly generated MAC addresses for Ethernet interfaces. VyOS with underlying Debian Linux is programmed to remember MAC address of existing Ethernet interfaces. During the boot when VyOS detects that a particular interface has a new MAC address assigned (generated by qemuwrapper), VyOS assigns a new name to this interface. Thanks to this, name of Ethernet interfaces are changed everytime is VyOS rebooted.

This is not a desirable behavior so we are going to configure VyOS to keep an original name of interface even if the interface MAC address had been changed.

They are several boot options available in Grub menu window when VyOS is booted after its installation. Depending how VyOS was installed, the default option is configured by VyOS itself. For instance if we issued a command install system from a Qemu window, an option KVM console would be chosen as the default option. In our case, installation was done from the telnet window (serial console) so the option Serial console is chosen as the default boot option.

Picture 1 - VyOS Grub Menu Window

As we want to integrate VyOS Qemu virtual machine with GNS3 and use a serial console to connect VyOS instances running inside GNS3, we will do such as configuration which ensures that an option Serial console is always selected regardless of the type of installation.

8 thoughts on “VyOS x64 Installation on Qemu”

I adapted to MacOSX and it is working.
I have one question. When I boot VyOS on GNS3 and I open the console I can´t see the VyOS boot messages. I only see something when the boot end with login prompt.
It is possible to put some options to see the boot messages? I think that it is important because the boot is very slow.

Hi,
let's have a look at the available options in Grub menu. As you can see, the first default option is to boot VyOS in KVM console. That's why you cannot see boot messages in serial console window but you can see it in Qemu window. There is a Qemu option -nographic configured in my tutorial (Picture 4) that prevents Qemu popup window to open.
In fact, they're three options here. Either change the default boot options to Serial console in OS or manually select boot to Serial console during the boot when the Grub menu appears. The third option may be to delete -nographic option and check messages in Qemu window.
To change the default boot order from kvm to serial console permanently, navigate to /boot/grub/grub.cfg and change line set default=0 to set default=1.

Hello! Thanks for your tutorial. Have you tried this on 1.0.5 in GNS3? I tried it as the tutorial described but I can't ping between the interface and a cisco router. Also, after rebooting VyOS the interface names will still change.