Virtual network setup

Authors: Mikhail Zolotukhin and Timo Hämäläinen

1. Introduction

This tutorial explains how to create a virtual network. We will use this network to test different kinds of network attacks during the course. To complete the tutorial you need a PC with at least 16 Gb of RAM. The remainder of this tutorial is organized as follows. Section 2 describes how to configure different network elements. Assignments are listed in Section 3. Section 4 concludes the tutorial.

2. Configuring network elements

To build our virtual network we need to create and configure several virtual machines. In this tutorial, we concentrate on setting up gateway, admin, web server, client and attacker as can be seen on the figure above. For the gateway, we will use pfSense, for the admin and the client - Ubuntu Desktop, for the web server - Ubuntu Server, and for the attacker - Kali Linux.

ISO-images for the installation of operating systems mentioned above can be found here:

Download all the images for further installation.We will use 64-bit versions of everything, but all tutorials can also be done in 32-bit ones in case you have any problems with installing 64-bit versions (see F.A.Q. for details). pfSense ISO comes in gz archieve, to extract the image file you can use for example 7z. Other images should be ready to go.

Some of these ISO-images will be used in future assignments to install new virtual machines, so it is recommended to keep them if possible.

2.1 Gateway

  1. Create a new virtual machine in VirtualBox. Name it "gateway", select operating system BSD, version - FreeBSD, base memory size - 512 MB, virtual disk’s size - 16 GB.
  1. Configure network settings for just created VM. Go "Settings -> Network". Choose Attached to: "NAT". Go to Adapter 2 and put the mark in "Enable Network Adapter" check box, then choose Attached to: as "Internal Network" and name it "lan". Go to Internet Adapter 3 and put the mark in "Enable Network Adapter" check box, then choose Attached to: as "Internal Network" and name it "opt1". Finally go to Adapter 4, enable this adapter and choose Attached to: "Internal Network" and name it "opt2". Click OK.

    All students who are working on one of the course's servers users should use different names for the VM interfaces "lan", "opt1" and "opt2". For this reason, add your JyU account name after the interface name, i.e. your interface names should look as follows: "lan_Anonymous", "opt1_Anonymous" and "opt2_Anonymous". You should obviously use the same pattern for all other VMs!

  1. Insert pfSense installation ISO-image into CD/DVD drive of your new VM as follows: "Settings -> Storage", select CD/DVD drive (it is by default called "Empty" and can be found in "Storage Tree" under "Controller: IDE"), click on "Disk with tiny arrow"-icon in the right top corner, select "Choose Optical Virtual Disk File..." in drop-down menu and browse to the ISO-image. Click OK.
  1. Start VM. If you have never run VirtualBox or other virtualization software on your laptop, there is a probability, that virtualization is disabled in your computer's BIOS. You will notice that if you start a VM and see an error messege of kind "VT-X is disabled...". You should enable it in BIOS: restart computer, when it is starting up, enter BIOS by pressing the required key. The key can be F2, F10, etc depending on the manufacturer. Find "VT-X" or "Virtualization" or something similar to this in menu "Device Configuration" (menu title also can be different in your case) and enable it. The easiest way to find out how to do it is to google "How to enable virtualization on" and add the model of your laptop. Once virtualization has been enabled, save changes and exit BIOS. After reboot, you should be able to start your VM.

    One more error message that you might see when staring a VM in Linux for the first time looks as follows: "Kernel driver not installed (rc=-1908). The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv". In this case, you have to disable "Secure boot" in your laptop's BIOS. If you do not want to disable "Secure Boot", try this method.

  1. If you have managed to start your gateway-VM, press enter to accept the copyright, and then "Install" to start installing pfSense. During installation, you can use all default settings, probably except for keymap - you can switch to Finnish or another keyboard layout if you like. Press space when you reach ZFS configuration screen to select ada0 disk and continue.
  1. After the installation has been completed, you can select "No" when asked about going to shell for additional configurations and go straight to Reboot. After that, shutdown the VM (just click cross button and select "Send shutdown signal"). Otherwise your VM again starts using live image and asks you to install pfSense again :) Once you shutdown the VM, in VirtualBox manager, select your VM, go to "Settings -> Storage" and remove disk from virtual drive.
  1. Run gateway VM again, wait until pfSense starts. Once it has booted, you will see the main menu. Here is the fun part: for some reason pfSense will ignore the keymap you specified during the installation and starts with default US one. To change the keymap, in the main menu of the pfSense console, select option 8 (Shell) and then input to change to the Finnish keymap (symbol “#” is not part of the commands below):

    # kbdcontrol -l /usr/share/syscons/keymaps/finnish.iso.kbd

    If you need a keymap other than Finnish, you can find its exact name if you type:

    # ls /usr/share/syscons/keymaps

    Exit the shell by typing:

    # exit
  1. In the main console menu, press 1 to assign network interfaces. Press "n" when it asks "Do you want to set up VLANs now?". You should have four interfaces: em0, em1, em2 and em3:

    • Enter the WAN interface name: "em0".
    • Enter the LAN interface name: "em1".
    • Enter the Optional 1 interface name: "em2".
    • Enter the Optional 2 interface name: "em3".
    • Do you want to proceed: "y". After few seconds you will see the main menu.
  1. Now interface IP addresses are supposed to be set up. Type "2" and press Enter. Enter "1" as the number of the interface you wish to configure and answer the questions as follows:
    • Configure IPv4 address WAN interface via DHCP: "y".
    • Configure IPv6 address WAN interface via DHCP6: "y".
    • Do you want to revert to HTTP as the webConfigurator protocol: "n".
  1. Press "2" again in the main menu, enter "2" as the number of the interface you wish to configure and answer the questions as follows:
    • Configure IPv4 address LAN interface via DHCP: "n".
    • Enter the new LAN IPv4 address: "192.168.10.1".
    • Enter the new LAN IPv4 subnet bit count: "24".
    • Enter the new LAN IPv4 gateway address: just press "Enter".
    • Configure IPv6 address LAN interface via DHCP: "n".
    • Enter the new LAN IPv6 address: just press "Enter".
    • Do you want to enable the DHCP server on LAN: press "y".
    • Enter the start address of the IPv4 client address range: "192.168.10.101"
    • Enter the end address of the IPv4 client address range: "192.168.10.200"
    • Do you want to revert to HTTP as the webConfigurator protocol: "n".
  1. Press "2" again in the main menu, enter "3" as the number of the interface you wish to configure and answer the questions as follows:
    • Configure IPv4 address OPT1 interface via DHCP? "n".
    • Enter the new OPT1 IPv4 address "192.168.11.1".
    • Enter the new OPT1 IPv4 subnet bit count "24".
    • Enter the new OPT1 IPv4 upstream gateway address: just press "Enter".
    • Configure IPv6 address OPT1 interface via DHCP? "n".
    • Enter the new OPT1 IPv6 address: just press "Enter".
    • Do you want to enable the DHCP server on OPT1? Press "n".
    • Do you want to revert to HTTP as the webConfigurator protocol? Press "n".
  1. One more time press "2" in the main menu, enter "4" as the number of the interface you wish to configure and answer the questions as follows:
    • Configure IPv4 address OPT2 interface via DHCP: "n".
    • Enter the new OPT2 IPv4 address: "192.168.12.1".
    • Enter the new OPT2 IPv4 subnet bit count: "24".
    • Enter the new OPT2 IPv4 upstream gateway address: just press Enter.
    • Configure IPv6 address OPT2 interface via DHCP: "n".
    • Enter the new OPT2 IPv6 address: just press "Enter".
    • Do you want to enable the DHCP server on OPT2: "n".
    • Do you want to revert to HTTP as the webConfigurator protocol: "n".
  1. Test that the gateway is connected to the Internet: press "7" in the main menu and enter some host name, e.g. "google.fi".
  1. Remember, that the gateway VM should be always up and running when you work with the environment as it is the one that provides connectivity between subnets and access to the Internet.

2.2 Admin

  1. Create new VM. Name this new VM "alice", select operating system - Ubuntu (32 or 64 depending on the Ubuntu Desktop image you downloaded), base memory size - 4096 MB, virtual disk’s size – 50 GB.
  1. Install Ubuntu Desktop on it by using the ISO-image you downloaded earlier in a similar way as it has been done with pfSense. When asked about disk partitions during the installation, select "Erase disk and install Ubuntu". Enter username "alice" and password "alice" during the installation.
  1. Once the installation has been completed (after restart), log-in on the VM, open terminal: in the left top corner click on "Activities" and type "terminal", or simply press Ctrl+Alt+T when on the desktop, and type the following (symbol "$" is not part of the commands below):

    $ ip link

    and check the name of your network interface. You are interested in the second interface (not lo interface). In my case, this second network interface was called "enp0s3", but it can be different in your case.

  1. In the terminal of the VM, edit network configuration files:

    $ sudo nano /etc/netplan/01-network-manager-all.yaml

    and edit (add) lines in the file as follows (spaces should be the exactly the same as here, netplan is very sensitive):

    network:
     version: 2
     ethernets:
      enp0s3:
       dhcp4: yes

    Remember that the name of the ethernet interface "enp0s3" can be different in your case. Save changes and exit. Finally, apply netplan changes:

    $ sudo netplan apply
  1. Shut down alice-VM:

    $ sudo shutdown now

    Now you can add alice-VM to the LAN network. In VirtualBox manager, select alice-VM and go to "Settings -> Network". Choose Attached to: as "Internal Network" and name it "lan" (or "lan_Anonymous", if working on one of the course's servers). The network name should be already in the list, so you can simply select it.

  1. Start the VM. You also need to have gateway-VM running. Check that alice-VM has access to the Internet. For example, try to browse to "google.fi" in Firefox.

2.3 Firewall rules in pfSense

Before we start working with the rest of the VMs, it would be reasonable to configure simple firewall rules for subnets OPT1 and OPT2. By default, pfSense allows computers from LAN connect to everywhere. However, from networks OPT1 and OPT2 you cannot go anywhere, since the access is blocked by pfSense's firewall.

  1. In alice-VM's Firefox, go to

    https://pfsense.home.arpa/

    and login (by default, username: "admin", password: "pfsense").

  1. Go to "Firewall -> Rules". Here you can create, edit and remove rules of your firewall for different interfaces. Check default rules for WAN and LAN. Notice that there are two Default rules for LAN that allow IPv4 and IPv6 traffic from LAN to anywhere.
  1. Now, we will create a simple rule to allow computers from OPT1 subnet 192.168.11.0/24 to connect anywhere. Go to OPT1 rules and click "Add rule to the top of the list" button. Select
    • action: "Pass"
    • interface: "OPT1"
    • address family: "IPv4"
    • protocol: "Any"
    • source: "OPT1 net"
    • destination: "any"
    and click "Save". Then click "Apply changes" in the appearing dialogue. Now you are supposed to have the Internet connection in OPT1 network, even though you cannot test it as there are still no VMs in that subnet.
  1. Repeat the previous step for OPT2 subnet 192.168.12.0/24 by creating similar rule in OPT2 section. There are only two differences: the interface is "OPT2" instead of "OPT1" and the source is "OPT2 net" instead of "OPT1 net".

2.4 Web server

  1. Create new VM. Name this new VM "webserv", select operating system - Ubuntu (32 or 64 depending on the Ubuntu Server image you downloaded), base memory size - 1024 MB, virtual disk's size - 50 GB.
  1. Insert Ubuntu Server ISO-image into the VM's CD/DVD drive and install the operating system. When asked about storage layout during the installation, select "Use an entire disk". Enter username "webserv" and password "webserv" during the installation.
  1. Once the installation has been completed, login on webserv VM, type

    $ ip link

    and check the name of your network interface. In my case, this second network interface was called "enp0s3", but it can be different in your case.

  1. Open file

    $ sudo nano /etc/netplan/00-installer-config.yaml

    and edit (add) lines in the file as follows:

    network:
     version: 2
     ethernets:
      enp0s3:
       dhcp4: no
       addresses: [192.168.11.2/24]
       gateway4: 192.168.11.1
       nameservers:
        addresses: [8.8.8.8,8.8.4.4]

    Remember that the name of the interface "enp0s3" can be different in your case. Finally, apply netplan changes:

    $ sudo netplan apply
  1. Shutdown the VM:

    $ sudo shutdown now

    Configure network settings for this VM in VirtualBox. Go "Settings -> Network". Choose Attached to: as "Internal Network" and select "opt1" (or "opt1_Anonymous", if working on one of the course's servers)

  1. Run this VM. Now you should be able to access the Internet. Try to ping some host in the Internet, e.g.

    $ ping google.fi

    It must work. If it does not, you either configured the network interface incorrectly (double-check lines in yaml-file) or did not add firewall rules for OPT1 subnet as described in the previous subsection.

  1. Install the LAMP stack:

    $ sudo apt install apache2 mysql-server php8.1 php8.1-mysql -y
  1. Enable "mysqli" extension by editing "php.ini":

    $ sudo nano /etc/php/8.1/apache2/php.ini

    Find the following line (you can use Ctrl + W):

    ;extension=mysqli

    and uncomment by removing ";". Save and exit.

    Restart Apache service:

    $ sudo systemctl restart apache2
  1. Download bank accounts database "bankaccounts.sql" (the command below is one line):

    $ wget http://student:Ties327_2023@users.jyu.fi/%7Emizolotu/teaching/files/bankaccounts.sql
  1. Execute in webserv's terminal to run Mysql:

    $ sudo mysql -u root

    Create new database and import the content of bankaccounts.sql to this database:

    create database bank;
    use bank;
    source bankaccounts.sql;
    create user bankuser@localhost identified by '';
    grant all privileges on bank.* to bankuser@localhost;
    quit
  1. Download the archive which contains bank web site "bankserver.zip":

    $ wget http://student:Ties327_2023@users.jyu.fi/%7Emizolotu/teaching/files/bankserver.zip
  1. Install unzip:

    $ sudo apt install unzip -y
  1. Extract all files from the bank archive to "/var/www/html/":

    $ sudo unzip bankserver.zip -d /var/www/html/

    and then change the access permissions for this directory:

    $ sudo chmod -R 755 /var/www/html/
  2. Open "config.inc":

    $ sudo nano /var/www/html/accounts/config.inc

    Check that $dbname and $username are respectively equal to the names of the database and the user you created.

  1. From alice-VM's Firefox try to browse

    http://192.168.11.2/accounts/index.php 

    Make sure you can see the bank's web page. Login using Alice's account. Send some small amount of money to another account (any name, any number, the program does not check if such an account exists). Check that your current balance has been changed. Log out.

    Alice's account data:

    • Username: alice
    • Password: hackmenot
    • Name: Alice Liddell
    • Security question 1: What comes after drink me?
    • Security answer 1: eat me
    • Security question 2: Who gives good advices?
    • Security answer 2: caterpillar
  1. On the webserv-VM, enable SSL by typing in the terminal:

    $ sudo a2enmod ssl

    and

    $ sudo systemctl restart apache2
  1. On the webserv-VM, download the certificate file "server_oceanic.pem" to directory "/etc/ssl/certs/" (the command below is one line):

    $ sudo wget -O /etc/ssl/certs/server_oceanic.pem http://student:Ties327_2023@users.jyu.
    fi/%7Emizolotu/teaching/files/server_oceanic.pem
  1. Open "default-ssl" file:

    $ sudo nano /etc/apache2/sites-available/default-ssl.conf

    Find and comment line "SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key", using "#" symbol. Find the "SSLCertificateFile" directive and change the value to

    SSLCertificateFile /etc/ssl/certs/server_oceanic.pem

    Save the file.

  1. Enable the default SSL site:

    $ sudo a2ensite default-ssl

    and restart Apache:

    $ sudo systemctl restart apache2
  1. Install damn vulnerable web application (DVWA). For this purpose, first install git:

    $ sudo apt install git

    Next, clone DVWA repositoy:

    $ git clone https://github.com/digininja/DVWA

    Create a new config file:

    $ cp DVWA/config/config.inc.php.dist DVWA/config/config.inc.php

    Edit the config file:

    $ nano DVWA/config/config.inc.php

    Change default security level to low:

    $_DVWA['default_security_level'] = 'low'

    Save and exit. Copy the whole DVWA directory to /var/www/html:

    $ sudo cp -r DVWA /var/www/html/dvwa

    Finally, create dvwa database and user by first entering mysql console:

    $ sudo mysql -u root

    and then executing:

    create database dvwa;
    use dvwa;
    create user dvwa@localhost identified by 'p@ssw0rd';
    grant all privileges on dvwa.* to dvwa@localhost;
    quit

    On alice-VM, go to:

    https://192.168.11.2/dvwa

    Enter username "admin" and password "p@ssw0rd", select "Setup DVWA" and then press "Create / Reset Database". In case of success you should be redirected to the index page again. Now enter username "admin" and password "password" (password is different this time!). Proceed to "DVWA Security" which can be found on the left panel, change security level to "Low" (it should already be low by this point) and click "Submit".

  1. Finally, install OpenSSH server on the web server VM:

    $ sudo apt install openssh-server

    and regenerate its keys:

    $ sudo rm -rf /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server

2.5 Client

  1. Create new VM. Name this new VM "bob", select operating system - Ubuntu (32 or 64 depending on the Ubuntu Desktop image you downloaded), base memory size - 4096 MB, virtual disk’s size - 50 GB.
  1. Install Ubuntu Desktop on it by using the ISO-image you downloaded before. When asked about disk partitions during the installation, select "Erase disk and install Ubuntu". Enter username "bob" and password "bob" during the installation.
  1. Once the installation has been completed (after restart), login, type in terminal:

    $ ip link

    and check the name of your primary network interface. In my case, this network interface was called "enp0s3", but it can be different in your case.

  1. In bob-VM's terminal, open file

    $ sudo nano /etc/netplan/01-network-manager-all.yaml

    and edit (add) lines in the file as follows:

    network:
     version: 2
     ethernets:
      enp0s3:
       dhcp4: yes

    Remember that the name of the interface "enp0s3" can be different in your case. Save changes and exit. Finally, apply netplan changes:

    $ sudo netplan apply
  1. Shut down bob-VM. Now you can add bob-VM to the LAN network. In VirtualBox, go to "Settings -> Network". Choose Attached to: as "Internal Network" and name it "lan" (or "lan_Anonymous", if working on one of the course's servers).
  1. Run this VM. Now you should be able to access the Internet. Try to ping some host in the Internet, e.g.

    $ ping google.fi

    It must work. If it does not, you most likely configured the network interface incorrectly.

2.6 Kali Linux

  1. Create new virtual machine in your VirtualBox. Name it "kali", select operating system - Ubuntu (32 or 64 depending on the Kali Linux image you downloaded), base memory size - 4096 MB, virtual disk's size - 50 GB.
  1. Insert ISO-image with Kali to the VM's drive, and install Kali Linux on this VM by selecting "Graphical install". Enter username "kali" and password "kali" during the installation. When asked about disk partitions during the installation, select "Guided - use entire disk".
  1. Once the operating system has been installed (after reboot), login as the user which you set up during installation.

    Password for root user is not set up for security reasons. Therefore you can either add sudo to each command for Kali which starts with "#", or set up root password as follows.

    In terminal, execute:

    $ sudo su

    and enter your password. Execute

    $ passwd root

    enter a new password for root user and then type:

    $ exit
  1. Open terminal and configure the network interfaces ("#" is not part of the commands below, just an indicator that you are logged in as root user in Kali):

    $ sudo nano /etc/network/interfaces

    Add (or edit) the following lines:

    auto eth0
    iface eth0 inet static
    address 192.168.12.2
    gateway 192.168.12.1
    netmask 255.255.255.0
    dns-nameservers 8.8.8.8 8.8.4.4
    

    save and exit. Notice, that here we assume that the interface's name is eth0, it can be different in your case. As previously, we are interested in the second interface name, not the 'lo' one.

  1. Shut down the VM. Configure network settings for this VM in VirtualBox. Go to "Settings -> Network". Choose "Attached to:" as "Internal Network" and select "opt2" (or "opt2_Anonymous", if working on one of the course's servers).
  1. Start the VM and check if it has network connectivity:

    $ ping google.fi

    If everything is working then just go the next section. In older versions of Kali, "dns-nameservers" directive used above did not work. Therefore, if you have problems with pinging external addresses by their names, check the instructions below.

    In order to add dns servers, you have to directly edit resolv.conf. For this purpose, open file

    $ sudo nano /etc/resolv.conf

    and add the following lines:

    nameserver 8.8.8.8
    nameserver 8.8.4.4

    You can also use DNS server of your home provider network here.

    Next, run in the terminal the following command to set immutable bit for this file:

    $ sudo chattr +i /etc/resolv.conf

    If you have the following error "Operation not supported while reading flags on /etc/resolv.conf", try to stop Network-Manager:

    $ sudo service network-manager stop

    then try again to set immutable bit for file "/etc/resolv.conf". If this did not help, try to remove file "/etc/resolv.conf":

    $ sudo rm /etc/resolv.conf

    and then create again:

    $ sudo nano /etc/resolv.conf

    Then add your nameserver there

    nameserver 8.8.8.8
    nameserver 8.8.4.4

    and set immutable bit

    $ sudo chattr +i /etc/resolv.conf

    Reboot the VM and check that both nameservers are still in /etc/resolv.conf:

    $ cat /etc/resolv.conf

    The file should contain your DNS servers. Ping some host in the Internet, e.g.

    $ ping google.fi

    It should work. If it does not, try

    $ ping 8.8.8.8

    if it works, then check that "nameserver 8.8.8.8" is still in file /etc/resolv.conf. If even "ping 8.8.8.8" does not work, you either configured the network interface incorrectly or did not add firewall rules for OPT2 subnet.

3. Conclusion and F.A.Q.

This tutorial explains how to configure different components of the virtual network: pfSense gateway, admin and client with Ubuntu Desktop, web server with Ubuntu Server, and attacker with Kali Linux.

This is a notice for the (future) teacher: once the network has been configured according to these instructions, the following actions should be done before uploading the VMs to the cloud for the course students to use:

  • Remove firewall rules created for subnets OPT1 and OPT2
  • Clear cache in the alice-VM's Firefox

Below are also the answers to some questions frequently asked by the students of previous years when this tutorial was a part of the mandantory assignments:

  1. If you have difficulties with installing software on one of your VMs when completing tutorial, there is a high probability that you simply do not have Internet connection established on that VM. Remember that all the VMs go to the Internet through your pfSense gateway, which means that the gateway VM should be always up and running when you do the exercises.

    Check that you have the Internet connection on your host machine (real computer where you run VirtualBox). Then check that you have Internet connection on pfSesne gateway by pinging some external web sites. If everything works fine, try to ping your pfSense gateway from the VM where you have connection problems: "ping 192.168.10.1" ("ping 192.168.11.1" for VMs in OPT1 and "ping 192.168.12.1" for VMs in OPT2). If this does not work, then you configured your network interfaces incorrectly, check once again network interface configuration file on your VM and how it is supposed to be configured in the corresponding section of the tutorial, also check Network Settings of that VM in VirtualBox.

    If you can ping gateway, try to ping some external web site, e.g. ping google.fi. If this does not work, try to ping Google’s server 8.8.8.8. If "ping 8.8.8.8" works, but "ping google.fi" does not work, then the problem is in DNS servers you specified in network configuration file. You cannot use 130.234.4.30 and 130.234.5.30 if you are not in JYU network, use the DNS servers that you use in your home network, or simply google's DNS servers 8.8.8.8 and/or 8.8.4.4. If you cannot ping 8.8.8.8 then type "route" in the terminal of the VM and check that gateway IP 192.168.10.1 (for OPT1 network it is 192.168.11.1 and for OPT2 - 192.168.12.1) is the default gateway. If you actually have the Internet connection on your VM, but still cannot install any software as it is explained in the tutorial, check that your apt source list is not empty by typing in the terminal:

    $ sudo nano /etc/apt/sources.list

    If it is empty (or contains only lines commented with # symbol), then you should add some sources to this file manually. For example, for Ubuntu Focal Fossa:

    deb http://fi.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
    deb http://fi.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://fi.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse

    For Kali Linux:

    deb http://http.kali.org/kali kali-rolling main non-free contrib

    Save changes in the file, and then execute in the terminal:

    $ sudo apt update

    If this does not help, then send us email with detailed explanation what you did and what is the problem, or come to our Lab.

  1. If you have never run VirtualBox or other virtualization software on your laptop, there is high probability, that virtualization is disabled in your computer's BIOS. You will notice that if you start a VM and see an error messege of kind "VT-X is disabled...". You should enable it in BIOS: restart computer, when it is starting up, enter BIOS by pressing the required key. The key can be F2, F10, etc depending on the manufacturer. Find "VT-X" or "Virtualization" or something similar to this in "Device Configuration" (menu title also can be different in your case) and enable it. The easiest way to find out how to do it is to google "How to enable virtualization on" and add the model of your laptop. Once virtualization has been enabled, save changes and exit BIOS. After reboot, you should be able to start your VM.

    One more error message that you might see when staring a VM in Linux for the first time looks as follows: "Kernel driver not installed (rc=-1908). The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv". In this case, you have to disable "Secure boot" in your laptop's BIOS. If you do not want to disable "Secure Boot", try this method.

  1. If you work with Virtual Box in Windows 8 or 10, Mac OS, or Fedora and have problems with assigning IP address to one of the gateway's interfaces, e.g. after assigning 192.168.10.1 to LAN interface, it still remains empty:

    LAN (lan) --> em1 --> ? 

    while the rest of the interfaces are fine, try to use another IP address for this problematic interface, e.g. 192.168.20.1. Obviously after that, you also have to change 192.168.10.x to 192.168.20.x in all settings of all VMs in this and in future tutorials. This might take place if you work at your home network with your router that has the same IP address 192.168.10.1, and for some reason Virtual Box in Windows and Mac OS considers your host machine as a part of the internal virtual network, it is not supposed to be like this :)

These are the current permissions for this document; please modify if needed. You can always modify these permissions from the manage page.