Difference between revisions of "Vnx-install-ubuntu3"

From VNX
Jump to: navigation, search
 
(38 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Title|VNX Installation over Ubuntu}}
 
{{Title|VNX Installation over Ubuntu}}
  
This section describes the procedure for manually installing VNX over Ubuntu 12.04, 12.10 and 13.04.  
+
This section describes the procedure for manually installing VNX over Ubuntu 13.*, 14.*, 15.*, 16.*, 17.*, and 18.*.
  
 
Open a root shell window and follow these steps:
 
Open a root shell window and follow these steps:
 
<ul>
 
<ul>
  
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li>
+
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages). In case of Ubuntu 18.10 change 'libvirt-bin' by 'libvirt-clients':</li>
  apt-get update
+
  sudo apt-get update
 +
sudo apt-get install \
 +
  bash-completion bridge-utils curl eog expect genisoimage gnome-terminal \
 +
  graphviz libappconfig-perl libdbi-perl liberror-perl libexception-class-perl \
 +
  libfile-homedir-perl libio-pty-perl libmath-round-perl libnetaddr-ip-perl \
 +
  libnet-ip-perl libnet-ipv6addr-perl libnet-pcap-perl libnet-telnet-perl \
 +
  libreadonly-perl libswitch-perl libsys-virt-perl libterm-readline-perl-perl \
 +
  libvirt-bin libxml-checker-perl libxml-dom-perl libxml-libxml-perl \
 +
  libxml-parser-perl libxml-tidy-perl lxc lxc-templates net-tools \
 +
  openvswitch-switch picocom pv qemu-kvm screen tree uml-utilities virt-manager \
 +
  virt-viewer vlan w3m wmctrl xdotool xfce4-terminal xterm
  
apt-get install qemu-kvm libvirt-bin vlan xterm bridge-utils screen virt-manager \
+
<li>Tune libvirt configuration to work with VNX. In particular, edit /etc/libvirt/qemu.conf file and set the following parameters (see this simple [[Vnx-install-modify-qemuconf|script]] to do it):</li>
  virt-viewer libxml-checker-perl libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \
 
  libnet-ipv6addr-perl liberror-perl libexception-class-perl \
 
  uml-utilities libxml-libxml-perl libterm-readline-perl-perl libnet-telnet-perl \
 
  libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \
 
  libdbi-perl graphviz genisoimage gnome-terminal tree libio-pty-perl libsys-virt-perl \
 
  libfile-homedir-perl curl w3m picocom expect lxc
 
<li>Tune libvirt configuration to work with VNX. In particular, edit /etc/libvirt/qemu.conf file and set the following parameters:</li>
 
 
  security_driver = "none"
 
  security_driver = "none"
 
  user = "root"
 
  user = "root"
Line 24: Line 27:
 
     "/dev/random", "/dev/urandom",
 
     "/dev/random", "/dev/urandom",
 
     "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
 
     "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
     "/dev/rtc", "/dev/hpet", "/dev/net/tun",
+
     "/dev/rtc", "/dev/hpet", "/dev/vfio/vfio", "/dev/net/tun"
 
  ]
 
  ]
and restart libvirtd for the changes to take effect:
+
(you have to add "/dev/net/tun") and restart libvirtd for the changes to take effect:
  restart libvirt-bin
+
  sudo restart libvirt-bin               # for ubuntu 14.10 or older
 +
sudo systemctl restart libvirt-bin      # for ubuntu 15.04 or later
 
<li>Check that libvirt is running correctly, for example, executing:</li>
 
<li>Check that libvirt is running correctly, for example, executing:</li>
  virsh list
+
  sudo virsh list
  virsh capabilities
+
  sudo virsh capabilities
Note: Have a look at [[Vnx-install-trobleshooting|this document]] in case you get an error similar to this one: virsh: /usr/lib/libvirt.so.0: version LIBVIRT_PRIVATE-XXX not found (required by virsh)
+
Note: Have a look at [[Vnx-install-trobleshooting|this document]] in case you get an error similar to this one:  
 
+
virsh: /usr/lib/libvirt.so.0: version LIBVIRT_PRIVATE-XXX not found (required by virsh)
<!--li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li>
 
  apt-get install ia32-libs
 
 
 
<li>For Ubuntu 11.04/10.10/10.04 an additional package has to be installed:</li>
 
apt-get install kvm-pxe
 
 
 
<li>Upgrade libvirt to 0.9.3:</li>
 
  /etc/init.d/libvirt-bin stop
 
  wget http://libvirt.org/sources/libvirt-0.9.3.tar.gz
 
  tar xfvz libvirt-0.9.3.tar.gz
 
  cd libvirt-0.9.3
 
  ./configure --without-xen --prefix=/usr && make && make install
 
  /etc/init.d/libvirt-bin start
 
'''NOTE''': VNX is known to (basically) work with other libvirt versions like 0.8.5 and 0.8.8. However, as some problems have been detected with that versions and our present development and testing platform uses libvirt 0.9.3, we strongly recommend to use that version.
 
-->
 
<!-- OLD
 
work with other libvirt versions from 0.7.5 to 0.8.5 (it has been mainly tested with 0.7.5 and 0.8.5). Note that, although libvirt 0.7.5 is available as a package in Ubuntu 10.04, it has some problems related with the Apparmor profiles configured for libvirt. If you disable Apparmor (with "/etc/init.d/apparmor stop"), VNX will work with libvirt 0.7.5 installed as package, however we recommend to download and compile version 0.8.5 as described above, in order to maintain Apparmor in your system.
 
-->
 
<!--
 
<li>Install Sys::Virt perl module:</li>
 
<ul>
 
<li>For Ubuntu 11.04/10.10/10.04, just install the libsys-virt-perl package</li>
 
apt-get install libsys-virt-perl
 
-->
 
<!--
 
'''IMPORTANT NOTE''': Windows XP virtual machines started with VNX over Ubuntu 9.10 frequently hang when executing commands or with high traffic loads. The problem could be related with virtual network drivers. We are investigating the problem to find a solution. By now, Ubuntu 10.04 is the recomended platform to test VNX.
 
-->
 
  
 
<li>Install VNX:</li>
 
<li>Install VNX:</li>
Line 67: Line 44:
 
  wget http://vnx.dit.upm.es/vnx/vnx-latest.tgz
 
  wget http://vnx.dit.upm.es/vnx/vnx-latest.tgz
 
  tar xfvz vnx-latest.tgz
 
  tar xfvz vnx-latest.tgz
  cd vnx-*
+
  cd vnx-*-*
  ./install_vnx
+
  sudo ./install_vnx
 +
 
 +
<li>Restart apparmor:</li>
 +
service apparmor restart      # for Ubuntu 14.10 or older
 +
systemctl restart apparmor    # for Ubuntu 15.04 or later
  
 
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li>
 
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li>
  mv /usr/share/vnx/etc/vnx.conf.sample /etc/vnx.conf
+
  sudo mv /usr/share/vnx/etc/vnx.conf.sample /etc/vnx.conf
 +
 
 +
<li>For Ubuntu 15.04 or newer: change parameter 'overlayfs_workdir_option' in vnx.conf to 'yes'</li>
 +
[lxc]
 +
...
 +
overlayfs_workdir_option = 'yes'
 +
...
 +
 
 +
<li>For Ubuntu 16.04 or later: change the LXC union_type to 'overlayfs'
 +
[lxc]
 +
...
 +
union_type='overlayfs'
 +
...
  
 
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and install them following these [[Vnx-install-root_fs|instructions]]</li>
 
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and install them following these [[Vnx-install-root_fs|instructions]]</li>
 +
 +
<li>Optionally, enable bash-completion in your system to allow using VNX bash completion capabilities. For example, to enable it for all users in your system, just edit '/etc/bash.bashrc' and uncomment the following lines:</li>
 +
<pre>
 +
# enable bash completion in interactive shells
 +
if ! shopt -oq posix; then
 +
  if [ -f /usr/share/bash-completion/bash_completion ]; then
 +
    . /usr/share/bash-completion/bash_completion
 +
  elif [ -f /etc/bash_completion ]; then
 +
    . /etc/bash_completion
 +
  fi
 +
fi
 +
</pre>
 +
</ul>
  
 
=== Additional install steps for Dynamips support ===
 
=== Additional install steps for Dynamips support ===
Line 87: Line 93:
 
### BEGIN INIT INFO
 
### BEGIN INIT INFO
 
# Provides:          dynamips
 
# Provides:          dynamips
 +
# Required-Start:
 +
# Required-Stop:
 
# Default-Start:    2 3 4 5
 
# Default-Start:    2 3 4 5
 
# Default-Stop:      0 1 6
 
# Default-Stop:      0 1 6

Latest revision as of 11:04, 13 November 2018

VNX Installation over Ubuntu

This section describes the procedure for manually installing VNX over Ubuntu 13.*, 14.*, 15.*, 16.*, 17.*, and 18.*.

Open a root shell window and follow these steps:

  • Install all packages required (basic development, virtualization, perl libraries and auxiliar packages). In case of Ubuntu 18.10 change 'libvirt-bin' by 'libvirt-clients':
  • sudo apt-get update
    sudo apt-get install \
      bash-completion bridge-utils curl eog expect genisoimage gnome-terminal \
      graphviz libappconfig-perl libdbi-perl liberror-perl libexception-class-perl \
      libfile-homedir-perl libio-pty-perl libmath-round-perl libnetaddr-ip-perl \
      libnet-ip-perl libnet-ipv6addr-perl libnet-pcap-perl libnet-telnet-perl \
      libreadonly-perl libswitch-perl libsys-virt-perl libterm-readline-perl-perl \
      libvirt-bin libxml-checker-perl libxml-dom-perl libxml-libxml-perl \
      libxml-parser-perl libxml-tidy-perl lxc lxc-templates net-tools \
      openvswitch-switch picocom pv qemu-kvm screen tree uml-utilities virt-manager \
      virt-viewer vlan w3m wmctrl xdotool xfce4-terminal xterm
    
  • Tune libvirt configuration to work with VNX. In particular, edit /etc/libvirt/qemu.conf file and set the following parameters (see this simple script to do it):
  • security_driver = "none"
    user = "root"
    group = "root"
    cgroup_device_acl = [
       "/dev/null", "/dev/full", "/dev/zero",
       "/dev/random", "/dev/urandom",
       "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
       "/dev/rtc", "/dev/hpet", "/dev/vfio/vfio", "/dev/net/tun"
    ]
    

    (you have to add "/dev/net/tun") and restart libvirtd for the changes to take effect:

    sudo restart libvirt-bin                # for ubuntu 14.10 or older
    sudo systemctl restart libvirt-bin      # for ubuntu 15.04 or later
    
  • Check that libvirt is running correctly, for example, executing:
  • sudo virsh list
    sudo virsh capabilities
    

    Note: Have a look at this document in case you get an error similar to this one:

    virsh: /usr/lib/libvirt.so.0: version LIBVIRT_PRIVATE-XXX not found (required by virsh)
    
  • Install VNX:
  • mkdir /tmp/vnx-update
    cd /tmp/vnx-update
    rm -rf /tmp/vnx-update/vnx-*
    wget http://vnx.dit.upm.es/vnx/vnx-latest.tgz
    tar xfvz vnx-latest.tgz
    cd vnx-*-*
    sudo ./install_vnx
    
  • Restart apparmor:
  • service apparmor restart       # for Ubuntu 14.10 or older
    systemctl restart apparmor     # for Ubuntu 15.04 or later 
    
  • Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:
  • sudo mv /usr/share/vnx/etc/vnx.conf.sample /etc/vnx.conf
    
  • For Ubuntu 15.04 or newer: change parameter 'overlayfs_workdir_option' in vnx.conf to 'yes'
  • [lxc]
    ...
    overlayfs_workdir_option = 'yes'
    ...
    
  • For Ubuntu 16.04 or later: change the LXC union_type to 'overlayfs' [lxc] ... union_type='overlayfs' ...
  • Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and install them following these instructions
  • Optionally, enable bash-completion in your system to allow using VNX bash completion capabilities. For example, to enable it for all users in your system, just edit '/etc/bash.bashrc' and uncomment the following lines:
  • # enable bash completion in interactive shells
    if ! shopt -oq posix; then
      if [ -f /usr/share/bash-completion/bash_completion ]; then
        . /usr/share/bash-completion/bash_completion
      elif [ -f /etc/bash_completion ]; then
        . /etc/bash_completion
      fi
    fi
    

Additional install steps for Dynamips support

  • Install Dynamips and Dynagen:
apt-get install dynamips dynagen
#!/bin/sh
# Start/stop the dynamips program as a daemon.
#
### BEGIN INIT INFO
# Provides:          dynamips
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Cisco hardware emulator daemon
### END INIT INFO

DAEMON=/usr/bin/dynamips
NAME=dynamips
PORT=7200
PIDFILE=/var/run/$NAME.pid 
LOGFILE=/var/log/$NAME.log
DESC="Cisco Emulator"
SCRIPTNAME=/etc/init.d/$NAME

test -f $DAEMON || exit 0

. /lib/lsb/init-functions


case "$1" in
start)  log_daemon_msg "Starting $DESC " "$NAME"
        start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE
        log_end_msg $?
        ;;
stop)   log_daemon_msg "Stopping $DESC " "$NAME"
        start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME
        log_end_msg $?
        ;;
restart) log_daemon_msg "Restarting $DESC " "$NAME"
        start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME
        start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE
        log_end_msg $?
        ;;
status)
        status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? 
        #status $NAME
        #RETVAL=$?
        ;; 
*)      log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"
        exit 2
        ;;
esac
exit 0

  • Set execution permissions for the script and add it to system start-up:
chmod +x /etc/init.d/dynamips
update-rc.d dynamips defaults
/etc/init.d/dynamips start
  • Download and install cisco IOS image:
 cd /usr/share/vnx/filesystems
 # Cisco image
 wget ... c3640-js-mz.124-19.image
 ln -s c3640-js-mz.124-19.image c3640
dynagen /usr/share/vnx/examples/R3640.net
console R3640     # type 'no' to exit the config wizard and wait 
              # for the router to completely start 
idlepc get R3640

Once you know the idlepc value for your system, include it in /etc/vnx.conf file.