Difference between revisions of "Vnx-tutorial-vagrant"

From VNX
Jump to: navigation, search
 
Line 1: Line 1:
 
{{Title|Testing VNX using a Vagrant}}
 
{{Title|Testing VNX using a Vagrant}}
  
You can easily test VNX over a system with Linux, Mac OS X or Windows using the  VNX demo virtual machine (VM). This VM can be run over [http://www.virtualbox.org/ VirtualBox] or other hypervisor that accepts OVA virtual machine format.
+
The easiest way to test VNX over a system with Linux, Mac OSX or Windows is to install [http://www.vagrantup.com/ Vagrant] and clone the virtual machine we have prepared with VNX software and examples installed.
  
Beware that with this VM you only can start LXC based virtual machines ([https://www.google.es/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwj9w4rz5IbLAhWDUBQKHVBJCLMQFggkMAA&url=https%3A%2F%2Fwww.virtualbox.org%2Fticket%2F4032&usg=AFQjCNE_xpDVPghBq0dVaV-qyn4spNfHXg no nested virtualization supported by VirtualBox]).
+
Beware that with this virtual machine you only can start LXC based virtual machines ([https://www.google.es/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwj9w4rz5IbLAhWDUBQKHVBJCLMQFggkMAA&url=https%3A%2F%2Fwww.virtualbox.org%2Fticket%2F4032&usg=AFQjCNE_xpDVPghBq0dVaV-qyn4spNfHXg no nested virtualization supported by VirtualBox]).
  
Once you have VirtualBox or other hypervisor installed in your system:
+
Once you have Vagrant installed in your system, follow this procedure to create the VM:
* Download the demo VM OVA file from http://idefix.dit.upm.es/vnx/vnx-vm. There are two versions: '''vnx-ubuntu-XX-XX-gui-v01.ova''', with an LXDE (Lubuntu) GUI; and '''vnx-ubuntu-XX-XX-v01.ova''', without GUI.
+
vagrant box add vnx http://idefix.dit.upm.es/vnx/vnx-vm/vnx-ubuntu-15.10-v01.box
* Import the OVA file into VirtualBox using "File|Import Appliance" menu option.
+
mkdir vnx
* Start the newly created VM.
+
cd vnx
 
+
vagrant init vnx
Once the VM has started, you can access it through the GUI or, if you have installed the one without GUI, you can access it using:
+
vagrant up
 +
Once the VM has started, you can access it using:
 
  slogin vnx@10.11.11.2 -X      # password 'xxxx'
 
  slogin vnx@10.11.11.2 -X      # password 'xxxx'
 
+
or:
and test, for example, the LXC VNX tutorial scenario:
+
vagrant ssh
 +
And test, for example, the LXC VNX tutorial scenario:
 
  cd /usr/share/vnx/examples/
 
  cd /usr/share/vnx/examples/
 
  sudo vnx -f tutorial_lxc_ubuntu.xml -v -t
 
  sudo vnx -f tutorial_lxc_ubuntu.xml -v -t
Line 19: Line 21:
  
 
=== Aditional notes: ===
 
=== Aditional notes: ===
 
If you use the VM without GUI take into account the following notes:
 
 
<ul>
 
<ul>
 
<li>Installation on Windows:</li>
 
<li>Installation on Windows:</li>
Line 30: Line 30:
 
<ul>
 
<ul>
 
<li>'''X11 server''': to allow virtual machine consoles to be shown properly, you need to install an X11 server. The recommended one for Mac OSX is Xquartz (http://xquartz.macosforge.org/landing/)
 
<li>'''X11 server''': to allow virtual machine consoles to be shown properly, you need to install an X11 server. The recommended one for Mac OSX is Xquartz (http://xquartz.macosforge.org/landing/)
 +
</ul>
 +
<li>You can customize the VM (e.g. memory assigned or the number of cpus) by editing Vagrantfile. For example, to increase memory to 2Gb and the number of CPUs to 4, add the following lines:</li>
 +
<pre>
 +
config.vm.provider :virtualbox do |vb|
 +
  vb.customize ["modifyvm", :id,
 +
                "--memory", "2048",
 +
                "--cpus", "4"]
 +
end
 +
</pre>
 +
<li>You can see the procedure followed to create the VNX ready Vagrant VM [[Vnx-create-vagrant-vm|here]]
 
</ul>
 
</ul>

Latest revision as of 19:32, 21 February 2016

Testing VNX using a Vagrant

The easiest way to test VNX over a system with Linux, Mac OSX or Windows is to install Vagrant and clone the virtual machine we have prepared with VNX software and examples installed.

Beware that with this virtual machine you only can start LXC based virtual machines (no nested virtualization supported by VirtualBox).

Once you have Vagrant installed in your system, follow this procedure to create the VM:

vagrant box add vnx http://idefix.dit.upm.es/vnx/vnx-vm/vnx-ubuntu-15.10-v01.box
mkdir vnx
cd vnx
vagrant init vnx
vagrant up

Once the VM has started, you can access it using:

slogin vnx@10.11.11.2 -X       # password 'xxxx'

or:

vagrant ssh

And test, for example, the LXC VNX tutorial scenario:

cd /usr/share/vnx/examples/
sudo vnx -f tutorial_lxc_ubuntu.xml -v -t

See more details about LXC tutorial scenario here.

Aditional notes:

  • Installation on Windows:
    • X11 server: to allow virtual machine consoles to be shown properly, you need to install and start an X11 server in your Windows machine. We recommend using Xming (http://sourceforge.net/projects/xming/).
    • SSH client: for "vagrant ssh" command to work on windows you need a "ssh" command available from PATH directories. We recommend using git for windows (http://git-scm.com/download/win), which includes and ssh command and automatically modifies PATH variable. Just download and install it choosing "Use Git and optional Unix tools from the Windows Command Prompt" in "Adjusting your PATH enviromnment" step. Use default values for the rest of parameters.
  • Installation on Mac OSX:
  • You can customize the VM (e.g. memory assigned or the number of cpus) by editing Vagrantfile. For example, to increase memory to 2Gb and the number of CPUs to 4, add the following lines:
  • config.vm.provider :virtualbox do |vb|
      vb.customize ["modifyvm", :id,
                    "--memory", "2048",
                    "--cpus", "4"]
    end
    
  • You can see the procedure followed to create the VNX ready Vagrant VM here