Linux: Ubuntu Installation and Basics
So far in this course every program ran on Windows. This section moves to Linux. We start with what Linux actually is and why there are so many "Linux" systems, then build a virtual machine in VirtualBox and install Ubuntu inside it without touching Windows. The second half is spent inside the new system as a normal user: the desktop, the settings, the Files application and the Linux folder tree, and installing and updating software. The last half hour is yours: sizing questions on paper, then a checklist of tasks to do in your own Ubuntu machine.
Objectives
By the end of the section you should be able to:
- Explain the difference between the Linux kernel, a Linux distribution and a desktop environment, and name several famous distributions.
- Compare the ways to get Linux on a computer and explain why this course uses a virtual machine.
- Size a VirtualBox virtual machine (RAM, CPUs, virtual disk) for a given host computer, and choose between a dynamically allocated and a fixed size disk.
- Install Ubuntu 24.04 LTS inside VirtualBox, install the Guest Additions, and fix the "virtualization is disabled" start-up error.
- Find your way around the Ubuntu (GNOME) desktop: the dock, the Activities overview, search, workspaces and the Settings application.
- Translate a Windows path into a Linux path, name the purpose of
/home,/etc,/mediaand/mnt, and hide or show hidden files. - Install, remove and update software, and tell a native package, a Snap and an AppImage apart.
Part 1: Linux and its distributions
Linux is a kernel
Strictly speaking, Linux is not a whole operating system; it is a kernel, the core that talks to the hardware. A useful picture is a vehicle:
| Part of a Linux system | In the vehicle picture |
|---|---|
| The Linux kernel | The engine: you cannot use the vehicle without it |
| Shell, commands and other tools | The controls you use to drive the engine |
| The desktop environment (the graphical interface) | The body and the interior |
| Applications | The accessories |
Because the "Linux engine" is free to use and modify, anyone can build a vehicle on top of it: desktop operating systems (cars), small embedded systems in toys and TVs (bikes), servers (trucks) and supercomputers (jet planes). That is why there are hundreds of "Linux operating systems".
Distributions
A Linux distribution (a "distro") is one of those complete vehicles: the kernel plus the tools, a desktop environment and a set of applications, packaged together so you can install them. Famous distributions include:
- Ubuntu (the one we install today)
- Debian
- Fedora
- Linux Mint
- SUSE
- Manjaro, Gentoo and elementary
Different distributions also ship different desktop environments. Well-known ones are GNOME, KDE, Cinnamon, MATE and Xfce. Ubuntu uses GNOME by default, with a few modifications made by Ubuntu. So when an app or a website says "GNOME" (sometimes with a little foot logo), it is simply naming the desktop you are using.
Ubuntu is described as the world's most widely used free and open source desktop operating system. The installation steps in this section are Ubuntu-specific, but the same steps apply to other distributions: their installer screens only look slightly different.
Which Ubuntu: LTS or the latest release?
The Ubuntu download page offers two kinds of release.
| LTS (long-term support) | Latest (interim) release | |
|---|---|---|
| Support | security updates and critical fixes for up to 10 years | 9 months |
| How people use it | stay on it about two years, until the next LTS | upgrade every 6 months to the newest release |
| Strength | rock-solid stability | newest desktop and application versions |
| Constraint | no big desktop upgrades during its life | you must keep upgrading |
This section uses Ubuntu 24.04 LTS. Its desktop ISO image is about 5.7 GB, so start the download early.
Part 2: Virtual machines
Four ways to get Linux
| Way | What happens to Windows |
|---|---|
| Clean install | Windows is removed; Linux takes the whole disk |
| Dual boot | Both stay; you choose one of them every time the computer starts |
| From the Microsoft Store | Linux runs inside Windows, but only as a command line |
| Virtual machine | Nothing changes: Linux runs like a regular Windows application |
When you only want to try or learn Linux, the virtual machine is the most comfortable option, so it is the one we use.
What is a virtual machine?
A virtual machine (VM) is a complete computer made of software. It has its own (virtual) RAM, CPUs and hard disk, all borrowed from the real computer it runs on, which we call the host. The operating system inside the VM is the guest.
VirtualBox is free and open source virtualization software from Oracle. It lets you create virtual machines and install other operating systems in them. Everything the guest writes to "its" hard disk actually goes into one file on the host, the virtual disk.
What the host needs
| Requirement | Why |
|---|---|
| At least 4 GB of RAM | the host and the guest share it; with less, the guest lags |
| At least 12 GB of free disk space | for the virtual disk file |
| A good internet connection | to download VirtualBox and the Ubuntu ISO (another computer can download them for you) |
| Virtualization enabled in the BIOS | without it the VM refuses to start (see Troubleshooting) |
Step 1 and 2: download the two pieces
- The Ubuntu ISO: from
ubuntu.com/download/desktop, press the green download button for 24.04 LTS. An ISO file is an image of the whole installation disc. - VirtualBox: from
virtualbox.org, download VirtualBox 7 for your operating system (for Windows, the "Windows hosts" package), then run the installer and press Next until it finishes, like any Windows program.
Sizing the VM: three rules of thumb
The sources give these rules for the three resources you choose in the wizard:
- RAM (base memory): give the VM as much as you can spare, but stay out of the red area of the slider, or the host itself becomes overwhelmed. A safe rule is at most half of the host RAM.
- CPUs: the same idea. Every core you give the VM is taken from the host; going too far "stresses your PC". In this lab we use at most half of the host cores.
- Virtual disk: 10 GB is the old minimum; 15 to 20 GB is preferable for a desktop distribution, and the Ubuntu 24.04 video uses 30 GB.
Worked example 1: RAM for an 8 GB host
Question. The lab document's host has 8 GB of RAM. How much should the VM get?
Predict first, then read on.
Answer. Half of the host RAM is the upper limit. With R_h the host RAM and R_v the VM RAM, both in GB:
R_v <= R_h / 2 = 8 / 2 = 4The lab document gives the VM 2 GB, which is inside the limit and leaves 6 GB for Windows. Giving it more (up to 4 GB) makes Ubuntu faster, as long as the host has that much to spare.
Worked example 2: CPUs for a 12-core host
Question. The installation video runs on a host with 12 CPU cores and gives the VM 5. Is that inside our rule? What about 8?
Answer. With C_h the number of host cores and C_v the number of VM cores:
C_v <= C_h / 2 = 12 / 2 = 6- 5 is at most 6: inside the rule.
- 8 is more than 6: too many. The host is left with only 4 cores and slows down.
The virtual disk: VDI, dynamic or fixed
The wizard asks for the disk type and how its space is allocated. Choose the VDI type (VirtualBox Disk Image). For allocation:
| Allocation | What the host loses on day one | Later |
|---|---|---|
| Dynamically allocated (the default) | only a small file | the file grows as the guest stores files, up to the size you chose |
| Fixed size | the whole size, reserved at once | the file never grows or shrinks |
Worked example 3: 20 GB, dynamic or fixed
Question. The host has 50 GB free. You create a 20 GB virtual disk. How much free space is left on the host right after creating the disk, for each allocation?
Answer.
- Fixed size: the whole disk is reserved immediately. With
F_0the free space before,Dthe disk size andFthe free space after, all in GB:F = F_0 - D = 50 - 20 = 30. - Dynamically allocated: the file starts small, so almost all 50 GB are still free; it only grows while Ubuntu is installed and while you save files.
Either way the guest sees one 20 GB disk. Dynamic saves host space; fixed takes the space up front.
Interactive: the VirtualBox wizard
Try the wizard below. Pick a host, move the RAM and CPU sliders into and out of the red area, choose dynamic or fixed and watch the host disk, then press Start. Switch virtualization off in the host panel to see the error you would get in a real lab.
Part 3: Installing Ubuntu in VirtualBox
Create the virtual machine
- Start VirtualBox and press New.
- Give the VM a name and choose the folder where it will be saved (the default is fine).
- Choose the ISO image you downloaded. VirtualBox detects it: type Linux, version Ubuntu (64-bit).
- Enter a username and a password (twice). Leave the host name as it is. Press Next.
- Base memory and processors: set RAM and CPUs using the rules above, staying out of the red area.
- Virtual hard disk: create a new VDI disk; 30 GB is a comfortable size for Ubuntu 24.04.
- Press Finish. The VM powers on and boots from the ISO.
If VirtualBox does not detect the ISO when the VM starts, click the folder icon in the start-up dialog and browse to the ISO file.
Run the Ubuntu installer
When the VM boots you see Try or Install Ubuntu. "Try" runs a live session: the full system runs from the ISO without installing anything. We want to install.
- Choose your language (English).
- Accessibility options (high contrast, screen reader and more) can be set now or skipped.
- Choose the keyboard layout (for example English US).
- Internet connection: use the wired connection. The update of the installer itself can be skipped.
- Choose Install Ubuntu (not Try).
- Choose Interactive installation. The automated installation is for advanced users who install many machines at once from one configuration file.
- Applications: the default selection gives the basic utilities; the extended selection adds more applications. The default is enough for this course.
- Check Install third-party software for graphics and Wi-Fi hardware and additional media formats (for example MP3 and video codecs).
- How do you want to install Ubuntu? Choose Erase disk and install Ubuntu (see the worked example below).
- Enter your name, the computer name, a username and a password you will remember. Choose your time zone.
- Press Install. Files are copied and installed; this takes about 10 to 15 minutes.
- When it finishes, press Restart now. If the VM gets stuck on the final screen, you may close the VirtualBox window and start the VM again.
After the restart, click your name, type your password, and you are on the Ubuntu desktop. The ISO is no longer needed: from now on you just start the VM from VirtualBox.
Worked example 4: "Erase disk" in a VM
Question. The installer says Erase disk and install Ubuntu. Does this erase Windows?
Predict first.
Answer. No. Inside the VM, "the disk" is the virtual disk you created (one file on the host). Erasing it wipes only that file's contents. Windows and your files are untouched. On a real computer the same option really does erase everything, which is why the installer calls it the point of no return and asks you to back up first; on a real Windows laptop you would also see an option such as "install alongside Windows", which is dual booting.
Install the Guest Additions
Right after installation the guest screen may be small and unable to go full screen. The VirtualBox Guest Additions fix the graphics and add copy-paste and drag-and-drop between the host and Ubuntu.
- In the VirtualBox menu choose Devices, Insert Guest Additions CD image. A disc icon appears in Ubuntu.
- Before running it, open a Terminal in Ubuntu and install two tools the installer needs,
bzip2andtar:
sudo apt-get install bzip2 tarsudo asks for your password (typing shows nothing; that is normal), and apt-get may ask you to confirm with y.
- Open the disc, choose Run Software, enter your password and Authenticate. When it finishes, press Enter.
- Power the machine off and start it again.
- Now View, Full-screen Mode fills the screen at a good resolution.
Here is what apt-get prints for that command on an Ubuntu 24.04 based machine where both tools are already installed. We ran it with -s (simulate), which needs no password and changes nothing; some unrelated lines are left out:
$ apt-get install -s bzip2 tar
NOTE: This is only a simulation!
apt-get needs root privileges for real execution.
Reading package lists...
Building dependency tree...
Reading state information...
bzip2 is already the newest version (1.0.8-5.1ubuntu0.1).
tar is already the newest version (1.35+dfsg-3ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded."Already the newest version" means there is nothing to install; on a fresh Ubuntu, apt-get downloads what is missing instead.
Troubleshooting: virtualization is disabled
If the VM refuses to start with this message:
Not in a hypervisor partition (HVP=0) (VERR_NEM_NOT_AVAILABLE).
AMD-V is disabled in the BIOS (or by the host OS) (VERR_SVM_DISABLED).
Result Code:
E_FAIL (0x80004005)then virtualization is blocked on the host. Restart the computer and, as soon as it powers up, press F2, F10 or F12 (it depends on the computer) to enter the BIOS settings. Find the virtualization option, enable it, save and restart.
Part 4: Exploring Ubuntu as a user
The first login
A welcome window appears the first time you log in:
- Online accounts: sign in to an Ubuntu One or Google account (for example, your cloud files then appear in the Files sidebar). Optional: you can press Skip.
- Send system information: your hardware details (CPU, RAM, graphics) are sent to Ubuntu to help hardware compatibility. Optional.
- Privacy, location services: off unless you turn it on.
The desktop
| Area | What it does |
|---|---|
| Dock (left edge) | launches and switches applications; a dot counter shows an app is running |
| Show Applications (bottom of the dock) | the application grid, like the Windows Start menu, with All and Frequent views |
| Activities overview (top left, or the Super key) | spreads all open windows so you can pick one; holds the search bar and the workspaces |
| Clock (top middle) | calendar and notifications |
| System menu (top right) | volume, network, lock, settings, power off and restart |
Some habits to learn:
- Dock favorites: right-click an app in Show Applications (or in search results) and choose Add to Favorites, or drag it onto the dock. Right-click a dock icon and choose Remove from Favorites to take it off. Drag icons along the dock to reorder them.
- Search from the keyboard: press Super (the Windows key), type
fire, press Enter, and Firefox opens. The same search finds settings (typenetwork), files and applications you can install. Arrow keys move through the results; Esc clears the search. - Workspaces are separate desks on one screen: keep work windows on one, other windows on another. In the Activities overview, the workspace switcher lets you move to a new empty workspace, and you can drag a window from one workspace to another.
- The name of the active window appears on the top bar.
The Settings application
Open Settings by searching for settings or from the gear in the system menu. The panels you will use most:
| Panel | Use it to |
|---|---|
| Appearance | choose the light or dark style and the desktop background |
| Ubuntu Desktop | the dock: auto-hide, icon size, position on the screen (bottom, left or right); desktop icons |
| Notifications | stop a specific app from showing pop-ups |
| Search | choose which apps and folders the overview search looks in |
| Privacy & Security, Screen Lock | turn the automatic screen lock on or off |
| Power | when the screen turns off, automatic suspend |
| System, Users | add a user: the Administrator switch makes an administrator, off means a standard user (press Unlock and enter your password first) |
| System, About | device name, operating system, hardware model, processor, memory, disk capacity; System Details adds the GNOME version, the OS type (64-bit or not) and virtualization |
| Apps, Default Apps | which app opens web pages, music, videos |
In Ubuntu 24.04 some panels sit inside a group: System holds Users and About, and Apps holds Default Apps.
To change more than Settings allows (themes such as the default Yaru, Yaru Dark or GNOME's Adwaita, the cursor, extensions), install GNOME Tweaks (the package gnome-tweaks).
Part 5: Files and the Linux folder tree
Windows paths and Linux paths
The Files application (in the dock) is the file browser. Its paths look strange at first because Linux organises storage differently:
| Windows | Linux |
|---|---|
C:\ is the top of the main drive | / (called root) is the top of everything |
C:\Users holds one folder per user | /home holds one folder per user |
C:\Users\student\Documents | /home/student/Documents |
\ separates folders | / separates folders |
each drive has a letter (E:) | a flash drive appears as a folder under /media |
Some folders directly under / and their purpose:
/home: the users' personal folders (your home folder is/home/yourname)./etc: configuration files of programs and of the operating system itself./media: where removable devices such as a flash drive are loaded (mounted)./mnt: another place where drives are mounted, used when you troubleshoot a drive.
Other folders you will see there (bin, boot, dev, usr, var and more) belong to the system and are covered in later sections. To see the root yourself in Files, go to Other Locations, Computer. Hover over a sidebar entry such as Documents to see its real path, for example /home/student/Documents.
Worked example 5: translate the paths
Question. A user named student saved report.odt in C:\Users\student\Documents on Windows. Where is the same file in Ubuntu? And where is C:\Users\student\Pictures\trip\beach.png?
Answer. Replace C:\Users with /home and every \ with /:
C:\Users\student\Documents\report.odt -> /home/student/Documents/report.odt
C:\Users\student\Pictures\trip\beach.png -> /home/student/Pictures/trip/beach.pngWorking in Files
- Create a folder: right-click an empty area, New Folder, type the name. Rename: right-click the folder, Rename. The right-click menu also has cut, copy, move to trash, open in a new tab or window, and Properties.
- Properties shows the size, the contents, the free space and the permissions (who can access the file, and for what).
- Search (the magnifier) searches only the current folder and what is inside it. Its filter can also search inside the text of files (full text), or limit results to folders, PDFs, pictures and so on.
- Views: switch between the icon grid and a detailed list. Starred keeps the files you mark with a star; Recent lists what you opened lately.
- Delete moves a file to the Trash; right-click it in Trash and choose Restore to bring it back. A mistake can be undone right away with Undo. Deleting permanently is off by default; you can switch it on in the Files preferences.
Hidden files
A file or folder whose name starts with a dot is hidden. Programs keep their data in hidden folders in your home folder, for example Firefox keeps its data in .mozilla. To see them, open the Files menu and check Show Hidden Files.
Worked example 6: hide a folder
Question. In your home folder you create a folder called Hidden Folder, then rename it to .Hidden Folder. What happens?
Predict first.
Answer. Files warns that folders with a period at the beginning of their name are hidden, and after you press Rename the folder disappears from the view. It still exists: turn on Show Hidden Files and it appears again, next to .mozilla and the other hidden folders.
Interactive: explore the folder tree
The widget below is a small Files window. Click through /, /home and the home folder, compare every Linux path with its Windows equivalent, toggle hidden files, and rename a folder with a leading dot to watch it hide.
Part 6: Installing, removing and updating software
App Center
Ubuntu 24.04 installs applications through App Center (older releases called it Ubuntu Software); search for it in the overview. Its main pages:
- Explore: featured apps and categories such as productivity, development and games.
- Manage: every installed app, with Check for updates and Update all for the apps.
To install, open an app's page and press Install; to remove, press Uninstall. Every install and removal asks for your password, so nothing is installed without your consent. The app page also shows its version and its publisher: check both.
Native, Snap and AppImage
The same program can be packaged in different ways, so one search can find it more than once:
| Format | Where it comes from | Updates | Notes |
|---|---|---|---|
| Native package | the Ubuntu repositories | only critical fixes until you move to a new Ubuntu release | loads fastest |
| Snap | the Snap Store | automatic, to the newest version | contains all its dependencies; slower to start |
| AppImage | the developer's website, one file | download a newer file | runs on any distribution without installing |
Worked example 7: two GIMP entries
Question. You search App Center for GIMP, but a classmate says there are two GIMPs. Where is the second one, and how do you tell them apart?
Answer. App Center shows Snap packages first, so the GIMP you see is the snap from the Snap Store. Change Filter by on the results page to Debian packages and GIMP appears again: that is the native package from the Ubuntu repositories. If you install both, the overview search shows two GIMPs; About in each one tells you its version (the snap is usually newer), and the snap usually takes longer to start.
Worked example 8: the AppImage that does nothing
Question. You download an AppImage, double-click it, and nothing happens. Why, and what is the fix?
Answer. A downloaded file is not allowed to run as a program until you say so. Right-click it, choose Properties, turn on Executable as Program, close the dialog, then open it again. No installation step is needed. If it still does nothing, it may need the FUSE 2 library; for Ubuntu 24.04 the AppImage documentation gives this fix: sudo apt install libfuse2t64.
Updating the whole system
App Center's Manage page updates your apps. For the whole system (Ubuntu's own packages), use the Software Updater application (search for it in the overview): it checks every system package, then Install Now downloads and installs the updates. If it offers an upgrade to a newer Ubuntu release, back up your personal files first.
Office applications
Ubuntu comes with LibreOffice, an office suite similar to Microsoft Office: Writer for documents, Calc for spreadsheets and Impress for presentations. They work the way you expect: New, Open, Save As with a name and a location, Insert Table in Writer, and new slides with a chosen layout in Impress.
Practice
About 30 minutes. Problems 1 to 4 are on paper (answers at the end). Problem 5 is done in your own Ubuntu VM.
Practice 1: size three virtual machines
Using the lab rules (VM RAM and CPUs at most half of the host, host needs at least 4 GB RAM and 12 GB free disk), decide for each host the largest RAM and CPU count you would give the VM, and whether the host can run the VM at all.
| Host | RAM | CPU cores | Free disk |
|---|---|---|---|
| A | 8 GB | 4 | 40 GB |
| B | 16 GB | 12 | 100 GB |
| C | 4 GB | 2 | 10 GB |
Then: a classmate gives the VM on host B 10 GB of RAM. Inside the rule or not?
Practice 2: Windows to Linux
Write the Linux path for each, for a user named student:
C:\Users\student\DownloadsC:\Users\student\Pictures\trip\beach.pngC:\- A flash drive that Windows calls
E: - The configuration files of the operating system
Practice 3: hidden or not?
Which of these names are hidden in Files by default? Documents, .mozilla, notes.txt, .Hidden Folder, my.photos, .config
Practice 4: diagnose it
- The VM will not start and the error contains
VERR_SVM_DISABLED. - Ubuntu runs in a small window and full-screen mode does not help.
- You want an application that updates itself automatically to the newest version.
- App Center says your apps are up to date, but a classmate says there are system updates.
- The installer shows "Erase disk and install Ubuntu" inside VirtualBox, and a classmate is afraid of losing Windows.
Practice 5: hands-on in your VM
Do each task and tick it off:
- Open Settings, System, About and write down the Ubuntu version (Operating System), the memory and the processor. Do they match what you gave the VM? System Details shows more, including the Virtualization line.
- Add Terminal to the dock favorites, then move the dock to the bottom of the screen.
- In your home folder create
lab8, rename it to.lab8, confirm it disappears, then show hidden files and find it. - Put a text file in
Documents, hover over Documents in the sidebar and read its full path. - Install one application from App Center, open it from the overview search, then remove it (Uninstall).
- Open a second workspace and move a window to it.
Answers
Practice 1
Half of the host RAM and half of the host cores:
| Host | Max VM RAM | Max VM CPUs | Can it run the VM? |
|---|---|---|---|
| A | 8 / 2 = 4 GB | 4 / 2 = 2 | yes |
| B | 16 / 2 = 8 GB | 12 / 2 = 6 | yes |
| C | 4 / 2 = 2 GB | 2 / 2 = 1 | RAM is enough (4 GB), but 10 GB free is below 12 GB: free some disk space first |
For host B, 10 GB of RAM is more than 8 GB, so it is in the red area: the host keeps only 6 GB for itself.
Practice 2
/home/student/Downloads/home/student/Pictures/trip/beach.png/- A folder under
/media(removable devices are mounted there) /etc
Practice 3
Hidden: .mozilla, .Hidden Folder, .config (they start with a dot). Visible: Documents, notes.txt and my.photos: a dot in the middle of a name does not hide it.
Practice 4
- Virtualization is disabled in the BIOS. Restart, press F2, F10 or F12 at power-up, enable the virtualization option, save.
- Install the Guest Additions: Devices, Insert Guest Additions CD image, install
bzip2andtarwithsudo apt-get install bzip2 tar, Run Software, restart, then View, Full-screen Mode. - A Snap (source: Snap Store); snaps update automatically.
- Use the Software Updater application: App Center's Manage page updates apps, while Software Updater updates the whole system.
- Nothing on Windows is erased: the "disk" is the VM's virtual disk file.
Practice 5
Check with your instructor. For task 1, the memory and processors in About should match the RAM and CPU count you chose in the VirtualBox wizard; for task 3, .lab8 is visible only while Show Hidden Files is on.