Difference between revisions of "Vnx-install-ubuntu3"
(2 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
<ul> | <ul> | ||
− | <li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages). In case of Ubuntu 18. | + | <li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages). In case of Ubuntu 18.04 and older versions change 'libvirt-clients' by 'libvirt-bin':</li> |
sudo apt-get update | sudo apt-get update | ||
sudo apt-get install \ | sudo apt-get install \ | ||
Line 14: | Line 14: | ||
libnet-ip-perl libnet-ipv6addr-perl libnet-pcap-perl libnet-telnet-perl \ | libnet-ip-perl libnet-ipv6addr-perl libnet-pcap-perl libnet-telnet-perl \ | ||
libreadonly-perl libswitch-perl libsys-virt-perl libterm-readline-perl-perl \ | libreadonly-perl libswitch-perl libsys-virt-perl libterm-readline-perl-perl \ | ||
− | + | libxml-checker-perl libxml-dom-perl libxml-libxml-perl \ | |
libxml-parser-perl libxml-tidy-perl lxc lxc-templates net-tools \ | libxml-parser-perl libxml-tidy-perl lxc lxc-templates net-tools \ | ||
openvswitch-switch picocom pv qemu-kvm screen tree uml-utilities virt-manager \ | openvswitch-switch picocom pv qemu-kvm screen tree uml-utilities virt-manager \ | ||
− | virt-viewer vlan w3m wmctrl xdotool xfce4-terminal xterm lsof | + | virt-viewer vlan w3m wmctrl xdotool xfce4-terminal xterm lsof libvirt-clients |
<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> | <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> | ||
Line 66: | Line 66: | ||
union_type='overlayfs' | union_type='overlayfs' | ||
... | ... | ||
+ | |||
+ | <li>In Ubuntu 20.04 and later, the command lxc-console does not work. Change the configuration of consoles in /etc/vnx.conf to use lxc-attach command:</li> | ||
+ | lxc_console_cmd=lxc-attach | ||
+ | |||
+ | <li>In Ubuntu 24.04, the bridge virbr0 is not created by default. To create it at startup, just create the following symbolic link and reboot:</li> | ||
+ | ln -s /etc/libvirt/qemu/networks/default.xml /etc/libvirt/qemu/networks/autostart/ | ||
<li>Download root file systems from http://vnx.dit.upm.es/vnx/filesystems and install them following these [[Vnx-install-root_fs|instructions]]</li> | <li>Download root file systems from http://vnx.dit.upm.es/vnx/filesystems and install them following these [[Vnx-install-root_fs|instructions]]</li> |
Latest revision as of 18:07, 31 October 2024
VNX Installation over Ubuntu
This section describes the procedure for manually installing VNX over Ubuntu 13.*, 14.*, 15.*, 16.*, 17.*, 18.* and 20.*.
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.04 and older versions change 'libvirt-clients' by 'libvirt-bin':
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 \ 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 lsof libvirt-clients
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 16.04 sudo systemctl restart libvirtd # for ubuntu 18.04 or later
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)
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
service apparmor restart # for Ubuntu 14.10 or older systemctl restart apparmor # for Ubuntu 15.04 or later
sudo mv /usr/share/vnx/etc/vnx.conf.sample /etc/vnx.conf
[lxc] ... overlayfs_workdir_option = 'yes' ...
lxc_console_cmd=lxc-attach
ln -s /etc/libvirt/qemu/networks/default.xml /etc/libvirt/qemu/networks/autostart/
# 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
- Create a file /etc/init.d/dynamips (taken from http://7200emu.hacki.at/viewtopic.php?t=2198):
#!/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
- Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:
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.