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


Virtualisation


We're using the 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 Linux VM,
  • create a new 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:

cp /camsi/images/SL6.vdi /media/storage/images/SL6_camsi1.vdi

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.

virtualbox

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

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).

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.

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.

Settings of the newly created VM
Next step you ought to enable I/O APIC and to let the VM boot the hard drive.

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.

Storage setup of the VM
Self explanatory ;)

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 02:00:00:00:00:18

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 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.

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

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.

I/O APIC ought to be activated for XP
[Disk settings] As for Linux VM, best is to enable Host I/O cache.

Disk settings
[Network settings] Same as Linux VM applies

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

Adding CAN bus USB device to XP VM