444 Intermediate C Programming
more stable in Linux than in MacOS. Therefore, I recommend installing Linux even
if you already have MacOS. The advantage of dual booting is that each operating
system has the resources of the entire computer. The disadvantage is that it is more
difficult for the operating systems to share data and co-operate, since only one operat-
ing system can be used at a time. Changing the operating system requires restarting
the computer.
• Dual booting used to be more popular than it is today. Now we have access to high
quality and affordable (or free) virtual machines that are well supported by special
hardware. This is my preferred option because of the convenience, and also the wide-
spread usage in industry. A virtual machine is a computer program that runs an
operating system inside of it. The operating system thinks it is running directly on
the hardware, but it is actually embedded in a type of container. The vast majority
of modern computers have special hardware to support virtual machines. The two
operating systems run simultaneously, and it is often easy to move data between the
two “computers”—either moving files, or simply using the clipboard to copy data
from a Windows or MacOS program and paste it into a running Linux program. The
two operating systems must share the resources of your computer. If your computer
has less than 4GB of memory, you may notice occasional slowdown and you should
consider dual booting.
Assuming that your computer has 4GB or more memory, and is currently running
Windows, then when we install a virtual machine, Windows is called the host operating
system. The operating system (Linux) inside the virtual machine is called the guest
operating system. There are several choices for a virtual machine. VirtualBox from
Oracle is an excellent choice and it is free.
If you choose dual boot or virtual machine, you should always save the files already in
your computer before installing Linux. It is possible (even though unlikely) that something
may be wrong and you may lose the files in your computer.
After choosing how to install Linux, you now have to choose which distribution of Linux
you want to use. The common choices are: Fedora, Ubuntu, Mint, and SUSE. This chapter
uses Ubuntu as an example, but all of the distributions listed above are good choices. The
following sections explain how to install Linux as dual boot and how to install Linux inside
Virtualbox.
A.2 Getting Ubuntu Linux
To install Linux, first download the most recent image. An image contains all the files
needed for installation. The file should have an .iso extension. Please go to web site
www.ubuntu.com. Select the correct iso file and click “Download”. The size of a CD iso file
is approximately 700 MB. It is helpful to find a fast network connection before downloading
the file. Please select the correct version for your computer. If your computer is bought
after 2009, then it is likely to use a 64-bit CPU and thus you should download the 64-bit
installation ISO file.
If you want to make the computer dual boot, then you need to find a flash drive that
is at least 700 MB. The iso file cannot be copied onto the flash drive. Instead a special
program is needed to rewrite all of the data on the flash drive such that it looks like what
the iso file specifies. This will make the flash drive bootable. If you search on-line “ISO
to USB”, then you can easily find a program to do this. After you make the flash drive