Debian installation on Mac

From Sensors in Schools
Revision as of 10:51, 18 December 2021 by EdmondLascaris (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

The aim of this lesson is to learn how to install and run a second operating system called Debian on your PC or Mac computer. Normally Raspberry Pi computers are used, but because of the global silicon chip shortage we need to use existing computers to support these classes. With every challenge comes an opportunity! One easy way to install a second operating system on a computer is to use Oracle VirtualBox. This software permits a computer to virtualize another operating system. The second operating system is kept separate from the first operating system.

The underlying operating system that runs on the Raspberry Pi is a scaled down version of Debian Linux. If we install Debian on a PC using VirtualBox then it will behave like a Raspberry Pi. The look and feel may be a little different, but the underlying architecture and fundamental workings will be the same. There are many different desktop environments that can be installed over the Debian operating system. We will install the Xfce which is a fast and light weight desktop environment.

In a low carbon future it will be important to extend the life of computers by running light weight operating systems such as Debian Linux and doing less processor intensive activities on a computer – e.g word processing, reading pdf documents, playing audio files, etc. Next time you are using your computer look at the processor temperature or listen for the noise of the processor fan.

Learning Objectives

  • Learn how to install Oracle VirtualBox.
  • Learn how to download the latest Debian Linux operating system.
  • Learn how to install the Debian operating system on a Mac (or PC).
  • Learn how to configure the Debian operating system and install software.


Debian linux operating system installation on Mac or PC

The Debian operating system is very easy to install on a PC or Mac computer. When a PC or Mac is very old the Debian operating system can be installed as a new and clean install on the computer. This will significantly increase the working life of a computer.

In this lesson we will be installing Debian within VirtualBox. The installation will not affect current installation of the Windows or Mac operating system. To do this we need to:

  • Download the latest version of the Debian Linux operating system
  • Download and install Oracle VirtualBox
  • Install the Debian operating system within VirtualBox.

Download the latest Debian Linux operating system

  • Open a browser and enter the search term Debian Linux Download.
  • The URL is https://www.debian.org/distrib/
  • Find a link (normally the first) that gets you to this page.
  • Click on Download an installation image

  • There are different Debian installations.
  • We will choose an installation that will use the Internet.
  • Under the category Small CDs or USB sticks – select the amd64 image.
  • amd64 – is the processor architecture used on most modern PC and Mac computers.
  • The image will start downloading to your Downloads folder on your PC or Mac.
  • The file name will be similar to debian-11.1.0-amd64-netinst.iso and is approximately 400MB in size.

Download and install Oracle VirtualBox

  • In a browser enter the search term Oracle VirtualBox Download
  • Or enter the URL https://www.virtualbox.org/wiki/Downloads
  • Download on the VirtualBox package relevant to your computer and complete the installation.

Installing Debian Linux using VirtualBox

  • Open VirtualBox to the Welcome menu.
  • Select New to set up a new virtualisation of the Debian Linux Operating system.

  • Enter the following details for Name and operating system.

  • Increase the Memory size to 2048 MB.

  • Accept the default hard disk size of 8.00GB. The size will be increased later to 16 GB.
  • Create a virtual hard disk now.

  • Choose a Virtual Disk Image (VDI) for a Hard disk file type.

  • Choose Dynamically allocated physical hard disk. This will change the amount of hard drive used on your main computer based on requirements.

  • Increase Hard drive space to 16.00 GB and click Create.

  • The system is almost ready.
  • At the VM VirtualBox Manager click on Settings.

  • Click on the Storage Tab.

  • Under Controller:IDE click on the Empty disk image.

  • Next to the Optical drive option click on the Disk symbol.
  • From the drop down menu select Choose a disk file...

  • Find the debian ISO disk image previously downloaded and press OK or Enter.

  • Click on OK to accept settings.

  • The system is now ready to Start.
  • Clicking on Start will boot the new Debian Operating system and start the installation process within VirtualBox.
  • The operation of your computer will not be affected; however, the additional operating system will take up more computer memory when running and more hard disk space.

  • As soon as the Start button is click the installation process will start.
  • The default installation is Graphical Install. Press the Enter key.

  • Select a language - English

  • Select your location - Australia

  • Configure the keyboard – American English

  • Configure the network – debian

  • Configure the network – domain name.
  • Leave this blank and press the Enter key.

  • Set up users and passwords. This screen is to set the password for the root user which is equivalent to the highest admin user on the system.
  • Enter the password - techschool

  • Set up users and passwords. A user account needs to be set up.
  • Our default user will be pi. This is the same as the default user on the Raspberry Pi.

  • Enter the password for the user pi. Use the same password as for the root (admin) user.

  • Configure the clock by selecting an appropriate geographic location.

  • Partition disks – Guided – use entire disk.
  • The partitioning of the disk will only apply to the newly created virtual machine – not the entire hard disk of your computer.

  • Partition disks – Click on Continue.
  • Note that this is the VirualBox Harddisk and it is only 17.2 GB in size.

  • Partition disks – All files in one partition (recommended for new users)

  • Partition disks – Finish partitioning and write changes to disk

  • Partition disks – Select Yes and press Continue.

  • Install the base system – the first step of partitioning and software installation will now start.

  • Configure the package manager. We don’t need to install any addition media at this time.
  • Select No.

  • Configure the package manager.
  • This will help the package manager choose a location where new files and applications can be downloaded.
  • The Debian archive for software packages is called a mirror because it is a copy of the main Debian archive.
  • Choose Australia.

  • Configure the package manager – choose the default Debian mirror – deb.debian.org

  • Configure the package manager
  • No HTTP proxy required.

  • The installation will now configure the package manager.

  • Configuring the popularity-contest.
  • Select No

  • Software selection. Choose:
    • Debian desktop environment
    • Xfce (desktop operating envrionment)– is a “fast and lightweight, while still being visually appealing and easy to use”
    • standard system utilities

  • Select and install software – continue with the installation of the operating system.

  • Install the GRUB boot loader.
  • This is a small program that launches the Debian operating system on system start up.
  • The GRUB will sometimes give you the option of selecting which operating system to boot up with, if you have more than one option.
  • Select Yes.

  • Select the GRUB boot loader.
  • Select the VirtualBox Harddisk option for installation.

  • Finish the installation.
  • The installation is now complete. The system will now reboot.
  • Click on Continue.

  • When the system reboots you will be asked to enter your username and password:
    • pi – username
    • techschool - password

Setting the Display settings

Debian operating system is almost ready to use; however some minor operating system configurations are required.

  • Click on the Applications menu at the top left of the screen.
  • Select Settings > Display

  • Choose a suitable Resolution for your display.
  • In this example 1280x1024 is selected.
  • Click on Apply and then Close.

Shutting down the Debian operating system

  • The Debian operating system must be shutdown correctly.
  • From the Applications menu select Log Out

  • From the Log out pi menu select Shut Down.

  • Once shut down is complete you will be returned to the VirtualBox Manager start screen.

Setting pi user as a sudo (super admin user)

  • The default Debian installation has security settings that prevent user pi from installing software.
  • This procedure will make user pi a super user (also called sudo)
  • Start the Debian operating system.

  • In the initial GNU GRUB window use the down arrow key on the keyboard to select – Advanced options for Debian GNU/Linux and press Enter.

  • Then select Debian GNU/Linux (recovery mode) using the arrow keys on the keyboard.

  • The computer will boot up and then will wait until the root password is entered (for maintenance).
  • Enter the root password techschool and press Enter.
  • Note that in Linux no characters are displayed when you enter passwords.

  • Once the root password is entered the Terminal window will display a ~# prompt.

  • Enter the command adduser pi sudo
  • This will allow pi to become a superuser (sudo)

  • For these settings to take effect shutdown the Debian machine with the command sudo shutdown -h now
  • This command will shutdown the computer and halt all processes (-h) now

Installing Geany software on Debian

  • Boot up Debian in the normal way by clicking on Start.
  • Accept the default GNU GRUB option – Debian GNU/Linux

  • From the Applications menu (top left) select Terminal Emulation

  • Enter the command sudo apt-get update
  • Enter the password for user pi when prompted (techschool)
  • This will ensure that the Debian package manager is updated.

  • To install Geany (a software editing tool) enter the command sudo apt-get install geany
  • Enter y (yes) to any prompts and press Enter.

Installing Node-Red

  • To install Node-Red we need to install curl
  • curl is an application that will help us transfer files from a server on the internet to our computer.
  • Enter the command sudo apt install build-essential git curl

  • Enter y (yes) to any prompts during the software installation.

  • From the Applications menu open the default Web Browser.

  • In the Web Browser enter the search term raspberry pi install node-red

  • On the web page titled Running on Raspberry Pi find the subsection Installing and Upgrading Node-RED
  • Copy the code in this section below into the Terminal and add --node16 at the end

  • Copy the code shown in the web site by right mouse button clicking and select Copy

  • Paste this in the Terminal and add --node16 at the end.

  • The Node-Red installation will take approximately one minute.
  • Answer y (yes) to any installation questions.

  • When the installation is complete you should see a column of green ticks.

  • Go back to the Web Browser and web page and look for the title Autostart on boot.

Copy the command sudo systemctl enable nodered.service

  • Paste this command in the Terminal.
  • This will make the node-red service start up automatically every time you launch the Debian operating system.

  • Start node-red from the Terminal with the command node-red
  • You won’t need to do this after you have rebooted the Debian operating system.

  • When Node-Red is running it will output the following messages to the Terminal.
  • You can close the Terminal after Node-Red has started.

  • In the Web Browser open a new Tab.
  • In the Search Bar enter the URL localhost:1880

  • This will launch the Node-Red editor.