OPS145 Lab 1 Newversion: Difference between revisions

From Littlesvr Wiki
Jump to navigation Jump to search
No edit summary
Line 39: Line 39:
The key you need to press might be Delete, F10, F12, Escape, or something different. Usually there's a message as your machine boots that says something like "Press X to enter setup".
The key you need to press might be Delete, F10, F12, Escape, or something different. Usually there's a message as your machine boots that says something like "Press X to enter setup".


The setting you need to change isn't just different between AMD and Intel CPUs: it has different names for different motherboard manufacturers and models. So you'll have to figure out what it is for you. I've done this a hundred times and I still struggle finding it on one of my desktops because its extra confusing name and location.
The setting you need to change isn't just different between AMD and Intel CPUs: it has different names for different motherboard manufacturers and models. So you'll have to figure out what it is for you. I've done this a hundred times and I still struggle finding it on one of my desktops because of its extra confusing name and location.
 
=== Create the virtual machine ===
All the work for the rest of the semester will be done in this virtual machine. So try to do it right, and redo it if you know you made a mistake.
*Download the [https://www.linuxmint.com/download.php '''latest Cinnamon version of Linux Mint'''].
*Start VirtualBox and click "New".
*Set '''ops145''' as the name.
*Choose a folder where you'll store the VM's virtual hard drive. If you're using your laptop: you can store it anywhere. If you're using a removable drive: store it in any folder you like on the removable drive.
*Pick '''Ubuntu (64 bit)''' as the Linux version. Linux Mint is based on Ubuntu, so it's almost the same thing.
[[Category:OPS145]]
[[Category:OPS145]]

Revision as of 16:31, 8 January 2024

By the end of this lab you'll have a Linux machine with a graphical inerface set up. You will use this for the rest of the course.

Virtualization

Normally all the software on your computer will ask the operating system kernel to do things, and the operating system will pass on those requests to the hardware. The kernel has exclusive control of the hardware. That's why you can only have one operating system running at one time.

If you have more than one operating system installed on your computer (e.g. Windows and Linux): you'll have to choose which one you want to use when you boot your computer.

That's fine for workstations: you own your computer, you use it when you want to, and noone else gets to touch it. When your computer gets old enough to be annoying: you look to upgrade it or buy a new one. For servers that's very wasteful. A computer, whether it's used or not:

  • Costs money to buy, and it loses its value just because time passes. Computer technology becomes obsolete in just a few years. That's called depreciation, and it means the cost per day of owning a computer is the same whether it's serving customers or gathering dust in a closet.
  • Costs money to run. Even when idle (not serving any requests): the CPU, RAM, and other components use electricity. That cost is small enough to ignore for a personal computer, but in a business with hundreds or thousands of servers that adds up to a meaningful expense.
  • Costs money to have connected to the internet, either directly or via a local network. Internet connections aren't free, and local networks don't build nor maintan themselves.

Given these realities: it's always been clear in a business environment that computer resources need to be shared. But sharing a computer between people who have different interests presents security concerns. You don't want your competitors to have access to your files, and I don't want you to see what applications I'm running, but if we're both using a computer from a third party provider: those security concerns are difficult to address as long as we're using the same operating system.

To get complete separation between clients A and B: the clients need to use separate operating systems, with the kernel from client A having exlusive access to the hardware allocated to client A, and the kernelf from client B having exlusive access to the hardware allocated to client B.

A relatively new (couple of decades old) development in computers is cheap and efficient virtualization. A virtualized operating system (the guest) mostly doesn't have access to the real hardware of the computer. It only has access to the kernel of the host operating system. So as long as the kernel of the host operating system is secure: none of the guests will have any access to each others' resources.

In other words: the host operating system is acting like the hardware for the guest. As far as the guest operating system knows: it's running on real hardware.

This sort of setup used to be very slow, because every instruction which the guests needs to sent to the CPU had to be sent to the host kernel first, the host sent it to the CPU, and then send it back to the guest. These days this performance bottleneck has been solved with some extra instructions in modern CPUs called hardware virtualization.

Today virtual machines are still slower than real machines, but their performance is comparable. And you can run several virtual machines on one computer, making the setup more cost-efficient overall.

Your workstation setup

The software which manages virtualization is called a hypervisor. The host operating system runs the hypervisor. We're going to use VirtualBox as the hypervisor for this course.

Important.png
Use your own computer if you can
The software on the school machines periodically stops working, and that usually happens at the most inconveient time.

Whether you use your own computer or a school computer: keep your coursework on a USB SSD.

Enable virtualization

If you're doing virtualization for the first time on your own computer: it's likely that its virtualization capabilities are disabled. For some reason that's the case for the majority of new computers sold. To enable it:

  1. Reboot your machine,
  2. Press the appropriate key to get to the BIOS settings (technically it's not BIOS any more but let's not argue about that now),
  3. Find the setting to enable CPU virtualisation and make sure it's enabled.

Unfortunately steps 2 and 3 are done differently on different machines.

The key you need to press might be Delete, F10, F12, Escape, or something different. Usually there's a message as your machine boots that says something like "Press X to enter setup".

The setting you need to change isn't just different between AMD and Intel CPUs: it has different names for different motherboard manufacturers and models. So you'll have to figure out what it is for you. I've done this a hundred times and I still struggle finding it on one of my desktops because of its extra confusing name and location.

Create the virtual machine

All the work for the rest of the semester will be done in this virtual machine. So try to do it right, and redo it if you know you made a mistake.

  • Download the latest Cinnamon version of Linux Mint.
  • Start VirtualBox and click "New".
  • Set ops145 as the name.
  • Choose a folder where you'll store the VM's virtual hard drive. If you're using your laptop: you can store it anywhere. If you're using a removable drive: store it in any folder you like on the removable drive.
  • Pick Ubuntu (64 bit) as the Linux version. Linux Mint is based on Ubuntu, so it's almost the same thing.