M01: Introduction to Operating Systems TU1: Installing, configuring and exploiting a computer system
ASIX/DAW/DAM-1
Pràctical Exercise 1: Initial installations and configuration of virtualbox and Debian GNU/Linux 21-09-2021

PRACTICAL EXERCISE 1: INITIAL INSTALLATION AND CONFIGURATION OF VIRTUALBOX AND DEBIAN GNU/LINUX  


GENERAL CONDITIONS
Deadline ASIX1: On 5-10-21 teacher will check that your operating system is working properly   
Deadline DAW1: On 6-10-21 teacher will check that your operating system is working properly


PRACTICAL EXERCISE

PART 1: BEFORE STARTING


What is an operating system?

An operating system (OS) is software that:

    * manages the computer hardware (CPU, RAM, Hard drives, peripheral devices)
    *
manages applications (text editors, web browser games,.....) running on the computer
    * acts as a Interface between user and hardware and applications running on the computer
    * manages files and folders

For users, software developers and system administrators  it would be extremely difficult to work with computers without the help of an operating system.  Only people with broad  knowlegde of electronics and programing would be able to work with computers without the help of an operating system.


Typical operating systems for laptops and desktops:
    * GNU/Linux
    * Microsoft Windos
    * MAC OS X

What is a Virtual Machine?
A V
irtual Machine (VM) is compute resource that uses software instead of a physical computer to run programs and deploy appsOne or more virtual “guest” machines run on a physical “host” machine.  Each virtual machine runs its own operating system and functions separately from the other VMs, even when they are all running on the same hostThis means that, for example, a virtual MacOS virtual machine can run on a physical PC.

A virtual machine, commonly shortened to just VM, is no different than any other physical computer like a laptop, smart phone, or server. It has a CPU, memory, disks to store your files, and can connect to the internet if needed. While the hardware that make up your physical computer is tangible (physical), virtual hardware (virtual hard drive, virtual ram memory, virtual network cards,.....) exist  only as files stored in a physical hard drive or physical ram memory. Virtual hardware is not physical but it is as real as a physical hardware.


What are virtual machines used for?

Virtual machines(VMs) allow a business to:
    * run an operating system
 that behaves like a completely separate computer in an app window on desktop.

    * run 
software that requires a different operating system
    * test
 applications in a safe and isolated environment.
    * I
mprove efficiency => Saving physical hard drive space, time and managements costs
    * P
erform specific tasks considered too risky to carry out in a host environment, such as accessing virus-infected data or testing operating systems.
    * run multiples operating systems on a single physical computer
    * run legacy (old version)  applications => Reducing migration to a new operating system costs
    * Easy management and maintenance of multiple operating system


PART 2: INSTALLING VIRTUALBOX AND VIRTUAL BOX EXTENSION PACK

1- Hardware requirements: https://www.virtualbox.org/wiki/End-user_documentation

2-  Download VirtualBox 6.1.26:

3- Install VirtualBox 6.1.26:
4- Download and Install VirtualBox 6.1.26 Oracle VM VirtualBox Extension Pack:
5- VirtualBox Language: File ->  Preferences -> Language ->  English(built-in)


PART 3: INSTALLING DEBIAN 11.0.0 AND VIRTUALBOX GUEST ADDITIONS STEP BY STEP

3.1- INSTALLATING DEBIAN 11.0.0


1- Download the installation image of Debian 11.0.0 from this link

2
- Create a new virtual machine with te following specifications:
3- Extra features:
4- Start your newly created virtual machine.

5- Select Graphical install.

6- Select a language: English.

7-  Select your location: Other --> Europe --> Andorra or Spain
.

8- Configure locales: United States - en_US.UTF-8.

9- Keymap to use: Catalan or Spanish

10- Configure the network:
11- Set up users and passwords:
12-  Partition disks --> Guided-use entire disk

13- Select SCSI1 (0,0,0) (sda) - 16.1 GB ATA VBOX HARDDISK (Don't worry if the number showed by the system is not 1).

14- Select All files in one partition (recommended for new users).

15- Select Finish partitioning and write changes to disk.

16- Answer  Yes to the question Write the changes to disk?

17- Now, the base system will be installed in your host. It takes a few minutes to complete this task.

18- Configure the package manager --> Answer No to the question Scan extra installation media?

19- Configure the package manager --> Answer Yes to the question Use a network mirror? and select the following mirror: United States --> deb.debian.org.

20- HTTP proxy information: None. Do not write anything.
 
21-  Now, your package manager (a software required to download and install programs on Debian GNU/Linux) will be configured. Afterwards, a first group of important software packages will be downloaded from the server and installed in your computer.
It takes a few minutes to complete this task.

22- Answer No to the question made by the system in the window  Configuring popularity-conquest.

23-  In Software selection  select :
Now, part of the selected software will be downloaded and installed. It could take a few minutes to complete this task (it depends on your internet connection and  features of your laptop). Take it easy!!!.

24- Select gdm3 as a default display manager.
Now, the rest  of the selected software will be downloaded and installed. It could take several minutes to complete this task. Take it easy!!!.

25-  Answer Yes to the question Install the GRUB boot loader to your primary drive?.

26- Select /dev/sda at the next section.

27- Now, the installation is complete. Reboot your system. Select the first option in the GRUB menu (*Debian GNU/Linux). Afterwards,  select  your  user and  write  your password. Select MATE as your desktop by clicking on the gear icon  and  finally press Enter (or click on Sign in). If everything works properly,  the selected desktop appears.

28- Check your Internet connection: Surf the net with Firefox. Select Applications --> Internet --> Firefox.

29-
Power off your system in the right way.
Select System --> Shut Down --> Shut Down.

3.2-  INSTALLING VIRTUALBOX GUEST ADDITIONS ON DEBIAN GNU/Linux 11.0.0

0- Before starting -> What are VirtuaThelBox Guest Additions?

1-
Open a terminal (
Select Applications --> System Tools  --> MATE Terminal. Become the root user running  su - . Write the root user password.

2- Gain access to the directory /etc/apt running on your terminal:  cd /etc/apt

3- With the help of the nano text editor we are going to change a file called sources.list. Run on your terminal: nano sources.list

Add # before any line starting with deb cdrom. Save sources.list (press <ctrl + o> and <enter>). Leave the nano text editor
(press <ctrl + x>).

5- Update the list of sofware packages available of you repository server.  Run on your terminal:  apt-get update

6- Install the command line package manager called aptitude. Run
on your terminal: apt-get install aptitude

7- Install the following software packages: gcc, make,build-essential, dkms, module-assistant  and linux-headers-5.10.0-8-amd64. Run on your terminal:

aptitude install gcc make build-essential dkms module-assistant linux-headers-5.10.0-8-amd64

It takes a few minutes to complete this task.

8-
Select Devices --> Insert Guest Additions CD image and:

  9- Run the command: /bin/bash /media/cdrom0/VBoxLinuxAdditions.run.

10- Close the MATE Terminal.

11- Shutdown your system in the right way.: Select System --> Shut Down --> Shutdown.

12- Eject the VBoxGuestAdditions.iso cdrom image:

13-  Boot (Start) Debian GNU/Linux. Gain access to your Desktop. Resize your window and your Desktop with the help of your mouse.

14- Power off your system in the right way. Select System --> Shut Down --> Shut Down.


3.3- ADD NEW REPOSITORIES TO YOUR PACKAGE MANAGER

0- Before starting:


1-
 
As a root user, change /etc/apt/sources.list in order to add the contrib and non-free repository addresses (or sources).  Adding these new repositories allows the system  to gain access to some extra useful software packages.  The new sources.list  file should have the following contents:



After changing  the contents of /etc/apt/sources.list, run: aptitude update

2- Install a useful  GUI text editor called  Geany  on your system. Just follow the next steps as a root user:  aptitude  install geany

3- Install the arial font (and another useful fonts).
Run: aptitude install ttf-mscorefonts-installer

4- Logout as root. Run: exit 

4- Show the Trash bin and Computer icons on your Desktop:
    a) Install MATE Tweak. Run as a root user:  aptitude install mate-tweak
    b) Show Trash bin
and Computer icons.  Select System --> Control Center --> Look and Feel --> MATE Tweak. Enable Trash and Computer.
    c) Check that Trash
bin and Computer appear on your Desktop.

5- Start the LibreOffice Writer text editor: Applications --> Office --> LibreOffice Writer. 
Check that the arial font is now available.


3.4- ATTACH A physical USB DRIVE TO DEBIAN GNU/Linux

1-
Start a terminal (MATE Terminal) and using the su - command, become the root user.

2-
Provide your user with the proper permissions to work with shared folders by running the command:

gpasswd  -a  xxyyzz  vboxsf

where xxyyzz is the user created by you during the installation process of Debian GNU/Linux.

3-
Log out as root.
Afterward,
Close  the terminal window properly and  log out as standard user from your desktop. Finally, gain access to your desktop again.
 
4-
Plug your USB drive into your laptop.  Attach and open a USB drive into your virtual machine:

3.5- SHARING FOLDERS BETWEEN THE HOST (PHYSICAL)  MACHINE AND THE VIRTUAL MACHINE

1- Shutdown
your virtual computer.

2-
Create a new folder, called sharing, inside the folder VirtualBox VMs of your host operating system. Create a new empty file called inf1_xxyyzz.txt inside the folder sharing
of your host operating system. Remember: xx=two first letters of your name, yy=two first letters of your first surname and zz=two first letters of your second surname.

3- On VirtualBox Manager, select your virtual machine and, afterwards, select Shared folders.

4-
Select Machine Folders and click on the small blue rectangle with a green cross at the right side of the window. A window will appear with a form to add a new shared folder. Add a new one with the following features:
    a) Folder Path: Look for sharing on your system and select it.
    b) Folder Name -->
sharing
    c) Select Auto-mount
    d)
Mount point --> Do no write anything

5-
Boot your virtual machine.

6
- As a root user run the following commands:

7- Logout as a root user.

8- Select  and open the sf_sharing folder on your Desktop. Check that the file created in 2 appears. Copy the file on the Desktop. 


PART 4: CHECKING YOUR SYSTEM

1- Your system boots and you can gain access to your system.

2- Username. If your user  does not have the proper username,  we will not accept your system and your mark will be zero.

3- Host name. If your machine does not have the proper hostname,  we will not accept your system and your mark will be zero.

4- Yo can surf the internet with the help of your browser.

5- You can resize you virtual system
.

6- Geany has been installed on your system

7- The arial font has been installed on your system

8- Show the Trash bin and Computer icons on your Desktop

9- Show the contents of a USB drive on Debian GNU/Linux

10- Show the contents of sharing on Debian GNU/Linux