Master SIAME | Université Toulouse 3

Internet of things and System on Chip

Master SIAME | Université Toulouse 3

Internet of things and System on Chip

User Tools


Differences

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

Link to this comparison view

info:virtualisation [2015/08/26 20:37]
info:virtualisation [2015/08/26 20:37] (current)
Line 1: Line 1:
 +====== Virtualisation ======
 +\\
 +We're using the [[http://​www.virtualbox.org|VirtualBox]] solution to launch VMs on the various nodes of the CAMSI platform.\\
 +Those VMs will leverage the needs for kernel-level developments,​ experiments with linux kernel queing disciplines etc.\\
 +
 +In the following we'll see these different points:
 +  * make a local copy of a virtual machine disk image,
 +  * create a new [[info:​virtualisation#​Create new Linux VM|Linux VM]],
 +  * create a new [[info:​virtualisation#​Create new XP VM|XP VM]] (intended to CAN bus experiments).
 +===== Local copy of VM images ======
 +All VM images are located in the ''/​camsi/​images''​ directory hosted on the main server. This NFS exported directory is mounted in all of the desktop nodes. Thus, in order to avoid contention while accessing image files from all nodes, you ought to copy the desired image file to the desktop'​s local folder ''/​media/​storage/​images''​.\\
 +
 +In the following example, let's assume user **camsi1** wants to work with the **SL6.vdi** linux image file:
 +
 +<​code>​
 +cp /​camsi/​images/​SL6.vdi /​media/​storage/​images/​SL6_camsi1.vdi
 +</​code>​
 +
 +Then, in the new virtual machine that you're about to create, you will specifiy ''/​media/​storage/​images/​SL6_camsi1.vdi''​ as the image file to use.
 +\\
 +
 +===== Launch VirtualBox =====
 +In a shell, just type the ''​virtualbox''​ command to launch the VirtualBox GUI.\\
 +
 +<​code>​
 +virtualbox
 +</​code>​
 +
 +===== Create new Linux VM =====
 +We're now about to start the creation of a VirtualBox Linux virtual machine. This new VM instance will make use of  a local copy of a virtual disk image you already retrieved from the ''/​camsi/​images''​.\\
 +
 +In the following, we'll consider the current setup as being:
 +  * User ''​francois'',​
 +  * On node ''​archi18'',​
 +  * VM disk image ''/​media/​storage/​images/​SL6_francois.vdi''​.
 +
 +Having launched VirtualBox, click on ''​New''​\\
 +
 +{{ :​vbox:​vbox_2.png?​direct |Name that brand new virtual machine}}
 +\\
 +Next step is to specifiy the total amount of memory that will be dedicated to the new VM (512M to 1G).\\
 +
 +{{ :​vbox:​vbox_3.png?​direct |Memory size of a new VM}}
 +\\
 +Finally we now tell virtualbox to use an already existing vm disk image that you will select from the ''/​media/​storage/​images/''​ local directory.\\
 +
 +{{ :​vbox:​vbox_4.png?​direct |Selected local disk image}}
 +\\
 +Okay, at this point, you just definied the basis of a new virtual machine that we'll delve into to setup its internal settings. To do that, you need to select the newly created VM from the list and to click on ''​settings''​. \\
 +
 +{{ :​vbox:​vbox_5.png?​direct |Settings of the newly created VM}}
 +\\
 +Next step you ought to enable **I/O APIC** and to let the VM boot the hard drive.\\
 +
 +{{ :​vbox:​vbox_6.png?​direct |Boot parameters of the VM}}
 +\\
 +In the storage section, you will activate ''​Host I/O cache''​. This setting will allow the VM to make use of the page cache of the host. This will greatly improve the overall performance of the VM.\\
 +
 +{{ :​vbox:​vbox_7.png?​direct |Storage setup of the VM}}
 +\\
 +Self explanatory ;)\\
 +
 +{{ :​vbox:​vbox_8.png?​direct |Sound setup of the VM}}
 +\\
 +Probably the most important step is that about network setup.\\
 +**[Network - Bridge]**
 +To communicate,​ every VM need an IP address. When you tell the VM to attach its network card to ''​NAT'' ​ => this means that the host will activate the IP forwaring that in turn will prevent your VM from being reached from the other nodes and/or VMs.
 +Instead, you need to attach the VM's network card to the ''​Bridge''​ named ''​br0''​. This bridge has been automatically created at the install time of the host and is available on every node (even on the main server). A bridge means that all VMs on all nodes will be able to reach each other.\\
 +
 +**[Network - MAC]]**
 +The MAC address is used to uniquely identify a network card. A DHCP server will deliver a name and an IP according to policies whose MAC address depend on use. All MAC address of VMs ought to start with ''​02:​00''​ and there ought not to be two VMs with same MAC.\\
 +Then, in order to guarantee uniqueness of a MAC address, users will combine the required MAC prefix along with node number as suffixe:\\
 +
 +In the example below, we're running on node ''​archi18''​ => MAC address of our VM will be <wrap info round box> 02:​00:​00:​00:​00:​18 </​wrap>​\\
 +
 +{{ :​vbox:​vbox_9.png?​direct |Network setup of the VM}}
 +\\
 +
 +===== Create new XP VM =====
 +We're now about to start the creation of a VirtualBox XP virtual machine. As for the [[info:​virtualisation#​Create new Linux VM|Linux version]], this new VM instance will make use of  a local copy of a virtual disk image you already retrieved from the ''/​camsi/​images''​.\\
 +
 +Since creating an XP VM has many similiarities withe the creation of a Linux VM, we'll show there only the main differences with this later.\\
 +
 +{{ :​vbox:​vbox_10.png?​direct |Create new XP VM}}
 +\\
 +
 +**[RAM]** same as Linux (512M to 1G)\\
 +
 +**[Disk Image]** We'll select the locally copied ''/​media/​storage/​images/​XPpro_BusCAN_francois.vdi''​\\
 +
 +{{ :​vbox:​vbox_12.png?​direct |Select a local disk image}}
 +\\
 +Now let's start to tweak this new VM => select the newly created VM and click ''​Settings''​\\
 +
 +**[System settings]** XP requires that you enable **I/O APIC** otherwise the system won't boot.\\
 +
 +{{ :​vbox:​vbox_13.png?​direct |I/O APIC ought to be activated for XP}}
 +\\
 +**[Disk settings]** As for Linux VM, best is to enable **Host I/O cache**.\\
 +
 +{{ :​vbox:​vbox_14.png?​direct |Disk settings}}
 +\\
 +**[Network settings]** Same as Linux VM applies\\
 +
 +{{ :​vbox:​vbox_15.png?​direct |XP network settings}}
 +\\
 +**[USB devices]** To enable XP to access the USB CAN bus adapter, it ought first to be added to the VM.\\
 +TO BE UPDATED\\
 +
 +{{ :​vbox:​vbox_16.png?​direct |Adding CAN bus USB device to XP VM}}
 +\\