2. Ubuntu Virtual Machine Installation - anhtien17/free5GC GitHub Wiki

In this first step, we:

  • Install Virtualbox
  • Create and install a Ubuntu virtual machine
  • Install a specific Kernel version (5.4.0-42-generic).

A. Install Virtualbox

  1. Download Virtualbox from https://www.virtualbox.org/ and install (currently 6.1.26).
  2. Install following the instruction on the software.

B. Create a Ubuntu VM

  1. Download Ubuntu ver 20.04.2.0.

  2. Launch VirtualBox and create your first Ubuntu VM using the downloaded .iso image file. Some notes when creating a new VM:

    • Name the first VM using a generic name as ubuntu, or ubuntu-20.04
    • You can pick 1 or 2 (or more) CPUs, and about 2048M memory, although you can change them later
    • In addition, change the default NAT network interface to Bridged Apdater network interface (in Setting of Virtualbox interface).
  3. Install Ubuntu:

    It is recommended that you should:

    • Choose a short username and password for ease of typing later
    • Choose Minimal Installation and uncheck Download updates while installing ubuntu, to do not install new Kernel which may cause error when running make of free5gc as well as ueransim.
  4. Install plugin Insert Guest Addition CD Image from Virtualbox/Devices interface after booting Ubuntu VM on the first time to enhance display solution.

C. Install a specific Kernel version

  1. Check Kernel version

        uname -r
    
  2. Check a specific kernel version and install

       # To find all kernels in version 5
         sudo apt search 'linux-image-5*'	
    
       # Install specific kernel version
         sudo apt install 'linux-image-5.4.0-42-generic'
    
  3. Update initramfs

       sudo update-initramfs -u -k all
    
  4. Set default grub kernel boot

    See Set default grub kernel boot.

  5. Update grub then reboot

       sudo update-grub
       sudo reboot
       uname -r # check version again
    
  6. Install kernel header file

        sudo apt install linux-headers-$(uname -r)