Install Linux Ubuntu and Related Tools
Contents
Ubuntu in VirtualBox
-
Run VirtualBox in your laptop.
-
Click “New” in the VirtualBox toolbar.
-
In the dialog, specify machine name as “ACOS Ubuntu 20.04 LTS” and click “Continue”.
-
Allocate for the new virtual machine 2048 MB of RAM. Click “Continue”.
-
Select “Create a virtual hard disk now” and click “Create”.
-
Specify hard disk file type as “VDI (VirtualBox Disk Image)” and click “Continue”.
-
Specify storage on physical hard disk as “Dynamically allocated” and click “Continue”.
-
Specify file location and size for the virtual disk and press “Continue”. Location is default. Recommended size is 16 GB.
-
Now the virtual machine is created. The next step is to install Linux Ubuntu in it.
-
Select the “ACOS Ubuntu 20.04 LTS” virtual machine and click “Start” in the toolbar.
-
In the dialog that appears, select the downloaded
.iso
image with Linux Ubuntu distribution (e.g.ubuntu-20.04.1-desktop-amd64.iso
) to start the virtual machine from. Click “Start”. -
VirtualBox will run the virtual machine, which will start loading the Linux Ubuntu distribution from the
.iso
file. -
When the Ubuntu installer is loaded, click “Install Ubuntu”.
-
Select “English (US)” for the keyboard layout and click “Continue”.
-
Select “Minimal installation” and click “Continue”. We do not need a full installation. Many tools are useless for us. Later we will install tools that we need.
-
Select installation type as “Erase disk and install Ubuntu” and click “Install Now”.
-
In the appearing “Write the changes to disk?” dialog, click “Continue”.
-
In the “Where are you?” dialog, specify “Moscow” and click “Continue”.
-
Specify your name as “ACOS” (username will be “acos”), computer name as “acos-vm”, and password as “acos2020” (or as you wish). Click “Continue”.
-
Wait for Ubuntu to be installed. This will take about 1 hour.
-
When installation is finished, restart the virtual machine.
-
Virtual machine “ACOS Ubuntu 20.04 LTS” will start.
-
Network must work in the virtual machine.
SSH and port forwarding
After Linux Ubuntu is installed in VirtualBox, we need to make sure that the network interface is enabled and set up port forwarding. We need to set up forwarding for port 22 in order to be able to connect to the Ubuntu Linux VM from our host operating system using SSH.
Configuring the virtual machine in VirtualBox:
- Select the “ACOS Ubuntu 20.04 LTS” virtual machine and click “Settings” in the toolbar.
-
In the dialog, switch to the “Network” page and click “Port Forwarding”.
-
Set up a rule for port forwarding.
127.0.0.1
is the local host IP address, 2022 is the port used for forwarding,10.0.2.15
is the IP address for the guest OS (Linux Ubuntu), 22 is the SSH port in Linux Ubuntu. -
Click “OK” to apply the settings.
- Start the Ubuntu VM.
Set up SSH in Linux Ubuntu
-
Open “Terminal” (Ctrl+Alt+T) and execute the following command to install and run the SSH server:
acos@acos-vm:~$ sudo apt install openssh-server
Connecting to Ubuntu via SSH
After SSH server is installed, you can connect to from terminal of your host operating system using the following command:
ssh acos@localhost -p2022
To disconnect, you can type the exit
command.
Git
Git is a version-control system that we well use to get and put source code to GitHub.
To install it, open Terminal (Ctrl+Alt+T) in Ubuntu or connect via SSH and execute the following command:
acos@acos-vm:~$ sudo apt install git
GCC
GCC is required to compile C programs created in classes and external open-source tools that will be used in classes.
GCC can be installed using the following command:
acos@acos-vm:~$ sudo apt install gcc
Java
If you want to run the RARS simulator inside the Ubuntu virtual machine, you need to install Java. Also, you may need a Java compiler.
Execute the following commands:
acos@acos-vm:~$ sudo apt install openjdk-8-jre-headless
acos@acos-vm:~$ sudo apt install openjdk-8-jdk-headless