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/08/15 14:00]
sypianski [Configuration]
— (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 
-  - Open GUI and go to System → Virtualization 
-  - Click + to add container 
-  - By settings, choose type, create a description and select storage. Root file system will be set automatically 
-  - If you want to enable networking, go to “Networking”,​ select routed or bridged by the Network Interface and press Apply 
-  - You should see a following screen (if you chose extended storage, the path will have storage1 instead of storage0: ''/​mnt/​storage1/​lxc/​guest0''​) {{ :​app-notes:​virt.png |}} 
-  - Transfer the downloader container (you can use WinSCP) to the router and put in ''/​mnt/​storage0/​lxc''​ 
-  - Unpack the container: <​code>​ tar –xvf jessie.tar –C ./guest0 </​code>​ 
-  - Check access rights using <​code>​ ls –l </​code>​ 
-  - If the created folder has rights 644, change them* to 755: <​code>​ chmod 755 -R guest0 </​code>​ 
-  - The extracted container contains rootfs directory. You need to copy the content of it to the specified root file system. Go to jessie folder: <​code>​ cd guest0/​lxc/​jessie </​code> ​ 
-  - Type <​code>​ lxc-start –n guest0 </​code>​ 
-  - Information about container can be accesed by typing <​code>​ lxc-info –n guest0 </​code>​ {{ :​app-notes:​info.png |}} 
-  - Now you can attach to the container by typing <​code>​ lxc-attach –n guest0 </​code>​ 
- 
-* Later you should remove executable permission bits from some system files, start container in foreground mode <​code>​ lxc-start –F –n guest0 </​code>​ to get more Information ​ 
-  
-===== 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>​ 
-