Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
app-notes:virtualisation [2016/07/29 08:57]
sypianski
— (current)
Line 1: Line 1:
-====== Virtualization ====== 
- 
-Virtualization gives customers the possiblity to execute their own applications. Usage of containers allows to isolate the applications and the entire OS images from the other processes which are running on a host system. 
- 
-This tutorial shows how to get started with it using LXC container. 
- 
-===== Prerequisites ===== 
- 
-NetModule Router NB2800 
- 
-===== Configuration ===== 
- 
-  - Download the container jessie.tgz ​ 
-  - Transfer it (you can use WinSCP) to the router and put in ''/​mnt/​storage/<​name>''​ (for example ''/​mnt/​storage/​OS''​) ​ 
-  - Unpack it using <​code>​ tar -xvzf jessie.tgz </​code>​ 
-  - Open GUI and go to System -> Virtualization. 
-  - Click //+// (add) to add container. ​ 
-  - Set type, description,​ root filesystem ( ''/​mnt/​storage/​OS/​lxc/​jessie/​rootfs''​ in this case) and press //​Apply//​. ​ 
-  - Click on //Edit// button (the one to the left of //Delete// button), go to "​Networking",​ select //routed// or //bridged// by the Network Interface VIRT1 and press //Apply//. You should see a following screen:{{ :​app-notes:​virtpath.png |}} 
-  - Create a new session using SSH client (for example Putty) {{ :​app-notes:​0.png?​200 |}} 
-  - Log in as root  
-  - Attach to the specified container <​code>​ lxc-attach -n <​name>​ </​code>​ in this example: <​code>​ lxc-attach -n guest0 </​code>​ 
- 
-===== Installing nano/vim editor ===== 
- 
-By default, no text editor is installed. I recommend installing two most popular editors, namely vim and nano. 
- 
-Being attached to the container (root@jessie:​~#​ displayed in the left corner of the CLI), type <​code>​ apt-get install <​name>​ </​code>,​where <​name>​ is either '​vim'​ or '​nano'​. 
- 
-When a line similar to the following appears: //After this operation, 27.9 MB of additional disk space will be used. Do you want to continue? [Y/n]//, type '​y'​ and confirm by pressing enter. 
- 
- 
- 
-===== Hello World in C ===== 
- 
-  - First of all we need to install gcc: GNU Compiler Collection 
-  - At the beginning, update the packages by typing <​code>​ apt-get update </​code> ​ 
-  - Subsequently install the compiler by typing <​code>​ apt-get install gcc </​code> ​   
-  - Now create and open a .c file using nano editor <​code>​ nano hello.c </​code>​ 
-  - Type following code: <code c hello.c >#​include <​stdio.h> ​ 
-int main() ​ 
-{ 
- printf("​Hello World"​);​ 
- return 0;  
-} 
-</​code> ​ 
-  - Save it using Ctrl + O (German keyboard: Strg + O) 
-  - Exit using Ctrl + X (German keyboard: Strg + X) 
-  - Compile the program using gcc <​code>​ gcc hello.c -o hello </​code>​ 
-  - Type <​code>​ ls -l </​code>​ 
-  - The created file has rights 644. Change it to 755 <​code>​ chmod 755 hello </​code>​ 
-  - Type <​code>​ ./hello </​code>​ to run the program 
- 
-===== Hello World shell script ===== 
- 
-  - Create and open file using nano editor <​code>​ nano helloBash </​code>​ 
-  - Type following code: <code bash helloBash >    
-#!/bin/bash 
-echo "Hello World" 
-</​code>​ 
-  - Save it using Ctrl + O (German keyboard: Strg + O) 
-  - Exit using Ctrl + X (German keyboard: Strg + X) 
-  - Type <​code>​ ls -l </​code>​ 
-  - The created file has rights 644. Change it to 755 <​code>​ chmod 755 helloBash </​code>​ 
-  - Type <​code>​ ./helloBash </​code>​ to run the program 
- 
- 
- 
- 
- 
-===== Hello World in Python ===== 
- 
-  - First of all we need to install Python 
-  - At the beginning, update the packages by typing <​code>​ apt-get update </​code> ​ 
-  - Subsequently install Python by typing <​code>​ apt-get install python </​code>​ 
-  - Create and open a .py file using nano editor <​code>​ nano helloPt.py </​code>​ 
-  - Type following code: <code python helloPt.py>​ print "Hello World" </​code>​ 
-  - Save it using Ctrl + O (German keyboard: Strg + O) 
-  - Exit using Ctrl + X (German keyboard: Strg + X) 
-  - Run the program using <​code>​ python helloPt.py </​code>​ 
-