Module 0246: Running a pre-installed Linux system

Tak Auyeung, Ph.D.

December 14, 2016

1 About this module

2 Installed or Preinstalled?

Linux, like most operating systems, can run as an installed OS. This is the most efficient and flexible option because once installed, system files can be accessed efficiently, and the system can be customized in many ways.

However, the installation and maintenance of Linux can overwhelm someone who has not used Linux before. This is especially the case when Linux is used as a the environment in a programming class where using Linux is not even the focus of the class.

A preinstalled system makes it easy for a novice Linux user to get up to speed (to programming assignments) quickly. There is no need to worry about the installation or maintenance of the operating system. Everything comes preinstalled and ready-to-go.

3 Getting the Preinstalled Live Debian Linux ISO file

The latest one is always at http://power.arc.losrios.edu/ auyeunt/deblive.iso.

This file is the ISO 9660 image of a data DVD. The DVD is made bootable. When a computer boots with this DVD, it runs the Debian distribution of Linux with a full GUI and many applications installed.

Even this approach has one disadvantage: the system must be rebooted to run Linux. First, some computers may have the BIOS locked out from booting from an optical disk drive, rendering this method useless. Secondly, a novice Linux user may still prefer to perform certain tasks in a more familiar environment (such as Windows for most).

4 Running Debian Live as a Virtual Machine

This method makes use of the ISO file mentioned in the previous section, but does not reboot a computer to use a DVD burned with the ISO file.

Instead, a computer emulator used to run Linux from the ISO file. There are many emulators that can do this: QEMU, VirtualBox, VMWare are a few examples.

This approach turns Debian Live Linux into a “guest” OS that runs in a virtual PC. The virtual PC is an instance of an emulator running in a “host” operating system. The host OS can be Windows, Mac OSX, BSD or any suported modern OS.

In other words, the Linux system runs as any application program. A user who is familiar with Windows can perform all tasks in native Windows applications, and only perform programming tasks that must be done in Linux.

5 Getting QEMU and Installing it

Assuming Windows is the host OS, The latest versin of QEMU is available at http://lassauge.free.fr/qemu/.

Installing QEMU is easy: simply unzip the archive file to a folder.

6 Setting up a flexible and portable platform

Instead of installing QEMU on an internal hard disk drive, unzip it to a portable device. A “normal” USB thumb drive is not recommended because it is likely to be a slow device, making the virtual machine run very slowly despite available processing power. Instead, it is best to use a class 4 or class 6 SD flash card, combined with a fast USB reader/writer. For the purpose of most programming assignments, a device with 4GB free space left should be sufficient. Note that the device should be formatted to NTFS to handle large files.

Create a folder on the portable drive to contain all the necessary files. I am assuming the folder \debianLive is used in this example.

Copy the Debian Live Linux ISO image (the file name is deblive.iso, but Windows may not display the file extension) to \debianLive. Also unzip QEMU to the same subfolder. Note that QEMU unzips to its own subfolder that contains its version as a part of the folder name. I am assuming that folder is called qemu here. This means that \debianLive\deblive.iso is the ISO file, and \debianLive\qemu is the folder containing all the QEMU files.

With the Debian Live ISO image and QEMU “installed” (copied and unzipped) to the portable device, we can move on to the next step.

7 Create a batch file to start the virtual machine

Because we will gradually add more options to start the virtual machine, it is handy to create a batch file to do so. For convenience, create this batch file in the \debianLive\qemu folder.

In notepad, create a file with the following line:

qemu -m 512 -L bios -cdrom ..\deblive.iso

Then, save the file as vmDeblive.bat in the folder \debianLive\qemu. Let me quickly explain the options of the command:

Once you save the file, double-click it, and Debian Live should boot in the virtual machine. Select the first option to start using the virtual machine.