SM1: Open-source Operating Systems ASIX/DAW/DAM-1
sm1act01: Initial installations and configuration of Virtualbox and Debian GNU/Linux 16-09-2024

Task sm1act01: INITIAL INSTALLATION AND CONFIGURATION OF VIRTUALBOX AND DEBIAN GNU/LINUX  


GENERAL CONDITIONS
Deadline DAW1: On 20/23-9-24 teacher will check that your operating system is working properly   
Deadline ASIX1: On 20/23-9-24 teacher will check that your operating system is working properly


TASK

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?
1- A V
irtual Machine (VM) is
    * A
virtual computer and it means that it uses virtual hardware.
    * A virtual computer is made of a set of files stored in a physical machine (also called "host" machine).
    * Virtual hardware are CPU, RAM, Drives, etc made of files
stored in a host machine.
    * Virtual machines are also called "guest machines" of a "host machine".

    * Each virtual machine runs its own operating system and applications separately from the other VMs and the host machines. A virtual machine in fact is another computer running inside the host machine.
    * You can run different operating systems in different virtual machines running on a host machine.
This means that, for example, a virtual MacOS virtual machine can run on a physical PC working with Linux.

2- 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.

3- VMs can share resources from the host machine, including CPUs, network bandwidth, memory and disk space. For instance, if you are running a 8 core CPU/16GiB RAM/1TiB hard drive  host machine and also, you are running a 2 core CPU/2GiB RAM/100GiB hard drive virtual machine then, your host machine can work only with the remaining 6 cores, 14GiB of RAM and 900GiB.    

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 syste

What is a virtual machine manager
    * It is a special kind of application whose porpouse is to work as user interface for managing (creating, modifying, removing, starting, stopping,..) virtual machines.
    * Popular virtual machine managers:
        - VirtualBox
        - VMWare Workstation Player

PART 2: INSTALLING VIRTUALBOX AND VIRTUAL BOX EXTENSION PACK

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

2-  Download VirtualBox 7.1.10:

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


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

3.1- INSTALLATING DEBIAN 12.7.0


0-
Before starting: Check that you are working with
VirtualBox 7.1.0 and VirtualBox 7.1.0 Oracle VM VirtualBox Extension Pack

1- Download the installation image of Debian 12.7.0 called debian-12.7.0-amd64-DVD-1.iso from
this link (you can find the image at the bottom).

2
- Create a new virtual machine with te following specifications:
3- Additional configuration parameters:
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-  Configure clock (optional) --> Select a city in your time zone

13-  Partition disks --> Guided-use entire disk

14-
Select SCSI3 (0,0,0) (sda) - 21.5 GB ATA VBOX HARDDISK (Don't worry if the number showed by the system is not 3).

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.
Take it easy!!!.

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 (blank). 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. Take it easy!!!.

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 first phase of the installation process has been completed. Reboot your system. Afterwards:
If everything works properly,  the selected desktop appears.

28- Check your Internet connection: Select Applications --> Internet --> Firefox and surf the net with 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 12.7.0

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

1-
Boot your virtual computer: Select debian12.7 and press Start. Afterwards, log in with your user account.

2- Open a terminal:
Select Applications --> System Tools  --> MATE Terminal.

3- Become the root user running  su - . Write the root user password.

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

5- With the help of the nano text editor we are going to change a file called sources.list:
6- Update the list of sofware packages available of you repository server.  Run on your terminal:  apt-get update

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

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

aptitude install gcc make build-essential dkms module-assistant linux-headers-6.1.0-25-amd64

It takes a few minutes to complete this task.Take it easy!!!.

9-
Select the Devices menu of VirtualBox --> Insert Guest Additions CD image and:

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

11-
Close the MATE Terminal.

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

13- Eject the VBoxGuestAdditions.iso cdrom image:

13-  Boot (Start) Debian GNU/Linux. Gain access to your Desktop.

14-  Resize your window and your Desktop with the help of your mouse.

15- 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

It takes a few minutes to complete this task.Take it easy!!!.

4- Install MATE Tweak. Run:  aptitude install mate-tweak

4- Logout as root. Run: exit

5- Show the Trash bin and Computer icons on your Desktop:
    a)
Select System --> Control Center --> Look and Feel --> MATE Tweak. Enable Trash and Computer.
    b) Check that Trash
bin and Computer appear on your Desktop.

6- 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.
Afterwards,
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.

5-  Attach and open a USB drive into your virtual machine: Click on the  "USB settings.." icon  at the bottom right corner of your virtual machine and select your USB drive. Automatically a folder showing the contents of your USB drive will appear.

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- Select  and open the sf_sharing folder on your Desktop. Check that the file inf1_xxyyzz.txt created in step 2 appears. Copy the file on the Desktop of your virtual machine. 

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