Vyatta 6.6 Core Installation on QEMU

What is the Vyatta ?

The free community Vyatta Core software(VC) is an open source network operating system providing advanced IPv4 and IPv6 routing, stateful firewalling, IPSec and SSL OpenVPN, intrusion prevention, and more. When you add Vyatta to a standard x86 hardware system, you can create an enterprise grade network appliance that easily scales from DSL to 10Gbps. Vyatta is also optimized to run in VMware, Citrix XenServer, Xen, KVM, and other hypervisors, providing networking and security services to virtual machines and cloud computing environments. Vyatta has been downloaded over 600,000 times, has a community of hundreds of thousands of registered users and counts dozens of fortune 500 businesses among its commercial customers.

What does Vyatta stand for?
The word "vyatta" (pronounced vee-AH-tah) is ancient Sanskrit and means "open."

In this tutorial I  would like to show  install Vyatta 6.6 Core Virtualization ISO on Qemu image and run it from GNS3.

1. Download Vyatta Core 6.6 Virtualization iso

wget http://www.vyatta.com/downloads/vc6.6/vyatta-livecd_VC6.6R1_i386.iso

2. Create Qemu qcow2 image

/usr/bin/qemu-img create -f qcow2 ./vyatta6.6vc.img 1G

3. Boot Qemu image with Vyatta 6.6 LiveCD

/usr/local/bin/qemu-system-i386 -boot d vyatta6.6vc.img -cdrom  vyatta-livecd_VC6.6R1_i386.iso -m 1024

login/password: vyatta/vyatta

4. Install Live CD

To install Live CD to Qemu image enter run an installation script.

vyatta@vyatta:~$ install system

The wizard is opened and you are going to through installation process:
Would you like to continue? (Yes/No) [YES]: Enter
Partition (Auto/Union/Parted/Skip) [Auto]: Enter
Install the image on? [sda]: Enter
This will destroy all data on /dev/sda.
Continue? (Yes/No) [No]: Yes
How big of root partition should I create? (1000MB - 1074MB) [1074]MB: Enter
I found the following configuration files
/opt/vyatta/etc/config/config.boot

Which one should I copy to sda? [/opt/vyatta/etc/config/config.boot] Enter
Enter password for administrator account
Enter vyatta password: vyatta
Retype vyatta password: vyatta
Which drive should GRUB modify the boot partition on? [sda]: Enter
Done!

You have successfully installed Vyatta.  Type sudo su and halt Vyatta with the halt command. Start a new installed Vyyata with the following command.

/usr/local/bin/qemu-system-i386 -boot c vyatta6.6vc.img  -m 1024

5. Make a serial console to be a default option in the boot menu

Basically those are options presented in the Grub boot menu:

Vyatta VC6.6R1 (KVM console)
Vyatta VC6.6R1 (Serial console)
Vyatta VC6.6R1 (USB console)
Lost password change VC6.6R1 (KVM console)
Lost password change VC6.6R1 (Serial console)
Lost password change VC6.6R1 (USB console)

According to the words of developer:

Which console to use was traditionally defined automatically during install, by vyatta-grub-setup, based on which console the user was logged in on. i.e. if you install while on a serial console, your default console in grub would be the serial one.

If you installed vyatta connected to kvm console and want to change the default console to the serial console you can do it as following. Type sudo su and edit /boot/grub/grub.cfg and set option "set default" to 1.

To check if Vyatta sends output to the serial port start Vyatta Qemu image as following.

/usr/local/bin/qemu-system-i386 -boot c vyatta6.6vc.img -m 1024 -serial telnet:127.0.0.1:4444,server,nowait

Telnet to Vyatta with command.

telnet localhost 4444

6. Adapt Vyatta NIC to deal with  GNS3 Qemuwrapper behaviour

GNS3 qemuwrapper script runs an Qemu image with random MAC address generated for Ethernet interface.  Next time the Qemu image is started a new MAC address is generated for the same interface. Vyatta is programmed to save MAC address of existing Ethernet interfaces. If the new MAC address of existing interface is generated, Vyatta preserves the interface with an original MAC address and create a completely new interface with the new MAC address.

For this reason, every time an Qemu instance is restarted the number of interfaces is doubled.

a) Remove vyatta_net_name script (root password needed)

First, switch to the superuser account with  sudo su or set a superuser password.

vyatta@vyatta:~$ configure
vyatta@vyatta# set system login user root authentication plaintext-password root
vyatta@vyatta# commit
vyatta@vyatta# save
vyatta@vyatta# exit

vyatta@vyatta:~$ sudo su

root@vyatta:/home/vyatta# cd /lib/udev/

root@vyatta:/home/vyatta# mv vyatta_net_name vyatta_net_name_backup

Add the following line to /lib/udev/rules.d/75-persistent-net-generator.rules

ENV{MATCHADDR}=="0*", ENV{MATCHADDR}=""

The line adds Ethernet interfaces whose MAC addresses begin with HEX number 0 to the list of  Ethernet interfaces which will be ignored even their MAC address has been changed.

7. Setup GNS3 for Vyatta Qemu image

- Start GNS3

- Edit-> Preferences-> Qemu-> Qemu Host

Configure settings as it is shown on the picture:

Vyatta-gns3-settings

Enable Kvm option  if your CPU supports hardware virtualization. In case you are not  sure with this option let it unchecked otherwise Qemu will not start.

Other parameters such as path to qemu, qemu-img and qemuwrapper must be set on the Qemu General Settings tab.

- Edit-> Preferences-> Qemu-> General Settings

Check the picture below  for details:

Qemu-settings

8. Download

I've created a video to prove functionality of Vyatta Qemu image in GNS3. In this video three Vyatta Qemu instances are running  RIP routing protocol.

Vyatta images can be downloaded from here:
login/pass: vyatta/vyatta  In case if login credentials are not working, try vyatta/vyatta123
 

11 thoughts on “Vyatta 6.6 Core Installation on QEMU

  1. Hi,
    I am follow up your tutorial
    "How to install Vyatta 6.1 Core LiveCD on Qemu image in Linux"

    But why I can not start multiple Telnet console on GNS3?

    TAi

  2. Hi,
    there is a bug in Qemu in Windows OS which doesn't allow you to start more than one instance of Qemu device (Vyatta, Juniper or Microcore).
    I use Fedora Linux and bug is not presented there. If you prefer Windows to Linux follow this article I wrote to solve Qemu bug in Win OS.

    http://www.gns3.net/phpBB/topic2553.html

    If it is not clear enough, ask me please and I will try to answer.

  3. Hi,

    I try to follow tutorial from http://www.gns3.net/phpBB/topic2553.html?sid=dc7662572fac39cf6b3da3a89cc93cf1, as following:

    Solutions 2 Edit-> Preferences-> Qemu-> JunOS. Create the numbers of junos entries according to number of JUNOS router you plan to use for your topology See the attachment , please.
    Uuups, I forget, this option is available only in dev version of GNS3 (not in 0.7.2). You can download devel version from here:

    http://www2.gns3.net/

    the result, still not work...

    Anyway, and your "Video: RIP configuration on Vyatta box", which OS that you are installation into Linux or Windows?

    Thank you

    TAi

    1. Hi,
      I think you created FLASH.img instead of FLASH. It is because Windows hides extensions for known file types by default.
      Anyway I created a video where is showed how to run multiple Qemu instances. I used Microcore Linux this video, but steps are same for Vyatta except the name of base image (that is needed to copy) is vyatta6.1vc.img.

      How to run multiple Qemu instances in GNS3 on Windows OS

      Yes, that RIP configuration was configured in GNS3 that is installed on Fedora Linux

  4. Thanks for the info.. has saved me a headache.

    One question though -- why create a root account? Why not just login as the vyatta user then "sudo bash" to gain root shell access?

  5. Thanks for the pointer on resetting the root password. Now it is possible to activate the quagga CLI and use it for those folks that are more familiar with the quagga CLI.

    To activate:

    login as vyatta user: vyatta / vyatta

    become root: sudo su

    activate quagga CLI: vtysh

    and quagga CLI junkies are at home. :-)

  6. Hi,
    I just did installing Vyatta on VM Ware and set up the interfaces and everything.
    but when i try to ping it with the gateway address or from CMD (pinging vyatta's eth0 IP) it says "network is unreachable"
    how to solve this problem?
    open to all suggestions

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.