Latest update: November 10, 2025
Introduction
Please make sure to read these important guidelines below before the first lab session.
The first and main parts of the lab/project works for this course will be focused on studying virtual machines and hypervisors (as opposed to containers, which will be studied later in the semester).
These assignments on virtual machines are the ones with the most specific requirements in terms of lab testbed. In particular, we will work on Intel x86 hardware.
Notes:
- AMD x86 machines have virtualization features that are not exactly identical to the Intel version. Therefore, in these labs, it is recommended to use an Intel machine rather than an AMD machine. The lab exercises should also work on AMD machines, but we cannot guarantee it.
- We will NOT consider ARM-based machines for these lab assignments (for examples, recent Apple Macs with M1-M5 processors or recent PCs with SnapDragon processors). (For the labs about containers, we will have more flexibility. Using an ARM machine should be OK.)
The practical lab/project assignments about virtual machines and hypervisors will be based on Linux and its KVM kernel module. KVM allows using Linux as a hypervisor in order to execute guest virtual machines (in addition to native applications, as usual).
In principle, all recent major Linux distributions should provide the appropriate support for KVM (but it is not necessary pre-installed by default – so you may have to install it, as discussed below).
Notes:
-
It will NOT be possible to use the usual machines from the lab rooms at Ensimag/IM2AG for these labs. One of the reasons is that these OS labs will require administrator privileges on the host machine. Nonetheless, if necessary, it will be possible to use one of these lab machines to connect to another machine (a server) on which we will run the code.
-
In the labs and project, we will only use a small number of virtual machines with very limited hardware resources: typically only a single CPU core and a very small RAM size. Therefore, running these virtual machines should be possible even on physical machines that are not very powerful (such as laptops).
Testbed: 3 main options
In terms of test setup, there are 3 main options to work on this lab:
- Using Linux running natively on your own laptop
- Using Linux on a virtual machine running on your own laptop
- Using Linux on another physical machine
Below, we discuss each of these options in turn.
Option 1: Using Linux running natively on your own laptop
This is the simplest setup, if you already have a Linux system installed natively on your machine (typically because you use Linux as your main OS or because you have a dual-boot setup).
Note that we will NOT modify the host Linux kernel during these labs. So choosing this setup should not introduce any stability/safety/security issue on your system.
Note: Given that KVM leverages hardware virtualization features, you will have to check in the BIOS/UEFI of your laptop that the hardware virtualization features are indeed enabled. (If you have already successfully used a virtualization solution on your laptop before, this verification step is of course not necessary.)
Option 2: Using Linux on a virtual machine running on your own laptop
In this setup, you will run Linux in a guest virtual machine (hereafter named “G1” for “Guest-Level1”) above your host operating system (Windows or MacOS). And the G1 virtual machine runs Linux with the KVM hypervisor that is itself used to launch and manage a virtual machine (hereafter called “G2”, for “Guest-Level2”). In other words, this setup will be based on a form of so-called “nested virtualization”.
This setup might be a more practical alternative to the previous one, especially if you do not have a native Linux installation and/or if you already have a Linux system installed in a virtual machine. However it introduces some specific requirements:
-
Because each level of virtualization requires some hardware resources (CPU and RAM), this means that your laptop will have to be sufficiently powerful and that you may not be able to run many applications concurrently (natively or within the G1 virtual machine).
-
The feasibility of such a setup requires explicit support at the level of the virtualization software running inside G1 (i.e., the virtualization layer that will be used to launch G2) so that this nested virtualization stack can run correctly and efficiently on the physical machine. Unfortunately, this kind of feature is not supported by all virtualization tools (and even when it is, there might be some lingering compatibility or performance issues). If you want to try such a setup, we recommend using VirtualBox (a free and open-source virtualization solution that is compatible with several host operating systems, including Windows hosts, MacOS hosts, and Linux hosts). The recent versions of VirtualBox for Intel x86 include support for nested virtualization.
Note: Given that the virtualization software stack (including KVM and Virtualbox) leverages hardware virtualization features, you will have to check in the BIOS/UEFI of your laptop that the hardware virtualization features are indeed enabled. (If you have already successfully used a virtualization solution on your laptop, this step is not necessary.)
Option 3: Using Linux on another machine
In this option, you will use your own laptop (or a machine in a lab room of the University) to connect (via SSH) to a physical machine (a server) running Linux natively, on which you will use KVM to launch virtual machines.
This setup is a bit more complex to use but can be a fallback option if the two previous setups are not possible solutions in your situation.
We will provide you with an account on the “Grid'5000” testbed (also known as “G5k”). G5k is academic testbed for experiment-driven research in all areas of computer science, with a focus on parallel and distributed computing, including Cloud, HPC, Big Data and AI. This testbed can also be used for teaching purposes.
Using your G5k account, you will have the possibility to:
- Book a physical machine within one of the G5k clusters (G5k also allows booking several machines simultaneously, but this will not be necessary for our labs).
- Launch the install of an OS image (for example Ubuntu) on the physical machine.
- Boot the physical machine.
- Connect via SSH to the OS installed on the physical machine.
Note that:
- Using G5k requires reading and adhering to the rules of its usage policy. Please make sure to read them.
- G5k is a powerful testbed based on custom tools. Learning how to use it can take some time.
The guidelines regarding your G5k account will be sent to you by email.
You will find below some useful resources about G5k:
- G5k “getting started” tutorial
- The list of G5k clusters and their hardware specifications
- G5k platform status
Note: The BIOS/UEFI of the G5k machines is already configured to enable hardware virtualization support.
Required packages
In any case (for each of the 3 testbed options discussed above), it will be necessary to install several packages in order to complete the exercises of the labs.
KVM
The main dependency for the labs and project is the KVM kernel module for Linux. The precise steps and package names to be installed depend on the Linux distribution that you use. So we advise you to look for an appropriate tutorial (corresponding to your own Linux distribution). Among others, the tutorials below may be helpful.
Note that, in the labs, we will actually only use the KVM module itself (most of these tutorials also suggest you to install additional tools and libraries that facilitate the management and administration of virtual machines – we will not need them for our labs).
- (in English) “How Do I Properly Install KVM on Linux” by Madhu Desai
- (in French) “Installez KVM/Libvirt sur Linux” by Stephane Robert
Other packages
In the context of the labs, beyond KVM, we will only use a small set of well-known packages:
gcc(C compiler)git(version control system)make(build utility)nasm(x86 assembler)
You can use your usual/favourite package manager to install them.
Note: During some steps of the labs, a few other software components will be necessary. We will explain how to download and install them when necessary.