ECE472/572 (UCLX) Assignment 1
Prepare for the lab
Answer these questions while doing this lab – they will help you understand the procedure and better prepare for the tests.
- What is a virtual machine? What are the main benefits of virtual machines? Consider if you were using this at your job.
- How does a virtual machine create space for a new operating system without partitioning your hard drive?
- What are the main limiting factors on the number of virtual machines that can be running simultaneously?
- What are the host operating system (host OS), and guest operating system (guest OS)? Can both be Windows, or both be Linux?
- Can you share files between your host PC and a Virtual Machine? Think of a situation where this is not desirable.
- Do you need a valid license to run an OS in a virtual installations?
- What is GRUB2 loader? How does it differ from GRUB1? What will this program allow you to do?
- Protected files cannot be modified by users. How do you gain root access to a file, or open a program with root access?
- In GRUB: What does (hd1,0) refer to?
- What is apt-get?
- What is the difference between Ubuntu, Kubuntu, Xubuntu, Lubuntu, and Ubuntu
( See also
This Assignment task has been reviewed and enhanced by Mr. Jonathon Taylor, class of 2009.
You do not have to set up a virtual machine; you can set up a dual boot system, or simply use the existing Ubuntu setup in the computer lab. However, you still need to get familiar with the setup procedure one way or another. You will find it convenient to do all the lab exercises using your computer except for testing Microcontroller Linux on the embedded system in the lab. As for this lab, you need to turn in only a proof that you are able to use Linux, open a terminal window, edit, compile and run a simple program written either in C or C++, and capture a screen shot.
Setting up Ubuntu inside a virtual machine
- Skip this step if you do your work in the computer lab as the VM is already installed:
Download and install Oracle's Virtual Machine - Virtual Box from
https://www.virtualbox.org/. It is a desktop application.
Alternatively use VmWare's Virtual Machine - VMWare Player from
- The guest OS will be a lightweight distribution of Ubuntu 16, so start downloading
to have it handy for later step. To make your future life easier make sure
that you download the desktop version and not server version of Ubuntu.
In the computer lab: Ubuntu *.iso files are already in folder C:\UBUNTU.
- Mean while before your download is being completed start working on the virtual machine. Choose "Create a new Virtual Machine"
- "I will install OS later".
- "Linux" type of OS, Version "Ubuntu" or "Ubuntu64" (ubuntu64 only if you are running a 64-bit OS as a host.)
- If you cannot choose 64-bit operating systems you need to restart
your computer, run BIOS setup before starting your operating system,
and enable virtualization support.
- Pick a name for your virtual machine, and remember the location so that you could later inspect the files supporting your machine.
If you are experimenting in the lab, place the files in a folder on the Desktop.
- Hard drive
- you need at least 8GB total hard drive space for playing with Linux,
and for the first four labs, and to do only the first parts of Lab 8
- you need at least 20GB plan to complete Lab 5 (recompile Kernel for your OS)
- you need 16GB to 20GB to do Lab 6, and continue
full development related to microcontroller Linux in the second parts
of Lab 7 through 12 even if you delete your Lab 5 work.
If your hard drive space is a problem then you could do these in the lab instead as you would eventually need to test your work on the embedded system there.
- Your hard drive will not be expanded immediately (unless you request to do so for the sake of faster performance). It will grow as necessary. Because of that do run disk defragmentation program on your host machine every now and then.
- Customize hardware
- Memory size is NOT the amount of RAM in your PC! This is the amount of RAM you want to dedicate to the Virtual installation. It is recommended to leave a minimum of 512MB for the host operating system use (i.e. for Windows) and allow the guest system (i.e. Ubuntu Linux) to use the reminder if necessary.
For our purposes (software and operating system development) we need at least 1024MB,
preferably 2048MB or more RAM for smooth operation and to get away without a memory swap file.
- Remove printer, floppy, e.t.c.
- Consider disconnecting the real DVD drive, and connect to the *.ISO file as necessary.
- By the way, have your Ubuntu *.ISO file download that you started a
while ago complete by the time you read this?
- You can always customize the virtual machine later as long as it is not running. It would be hard to change the hard drive though, especially to shrink it.
- Start the virtual machine. Start the Ubuntu install process. You can use the automatic install process.
At some point you will be asked about the destination hard drive. Choose
"other" solution and then configure the hard disk space manually: select no swap file, and the whole space as one ext4 partition mounted as / ..
- Reboot the virtual machine computer and log in into Ubuntu.
- In case of problems with screen resolution when running inside
VirtualBox: (Similar solutions are available for VmWare.)
- Open terminal window and run:
apt-get install virtualbox-guest-dkms
- Restart the machine and test if the screen can be enlarged after
In case the procedure above did not work:
- sudo apt-get
- In the virtual box MENU → devices → Inser guest additions CD
- and restart the virtual machine.
- In case your OS GUI responds slowly inside of the virtula machine
install a lightweight user interface. Run the update below, log out, select
a different GUI and log in again:
sudo apt-get install gnome-session-fallback
- Update the OS. You will see a pop up box alerting you to probably just two updates available. If only that were all. After you complete the first updates, check again for updates. Select and update all. This will take a significant amount of time, and does not need to be attended. Find something to keep you busy for a while.
- Under the application menu, select Add/Remove. Find the Gnome Partition Manager and install it. (This package is an application so it can be installed from the console, but you should explore the graphical interface as well.)
- To clean up cached installation files open a terminal window and run: sudo apt-get clean.
- If you're having problems with the screen size, The default is 800x600. It won't stretch. Use
Menu → Settings → Display → screen resolution to change the window size, then maximize the window.
Additional configuration that needs to be applied to the system
Attention. In case your update fails due to an unrecognized package name, or package unavailable, repeat the command with that particular package name removed.
Then inspect the spelling of the failed package name and try to install it
separately. In case of error message stating that one (or more)
package cannot be found, repeat the installation command without listing that
package. This request applies to all future lab instructions as well until the end of the semester.
- sudo apt-get update
- sudo apt-get install grub2 gparted
- sudo apt-get install gedit gedit-plugins
- sudo apt-get install build-essential gcc g++ gcc-doc
- sudo apt-get install git git-gui
- Did you remember to download and apply the system updates? It can be done from the console:
sudo apt-get update
sudo apt-get upgrade
Proof of work
As a proof of work please write a simple program in C or C++ that prints your
first and last name to the standard output (printf/cout). Open the program source code in a text editor, recompile
the program again and run it in the console window, rearrange windows that both of them are
visible at the same time, and capture the entire Linux desktop screen and save
as PNG or JPG file. You can either capture the screen using Ubuntu
screen capture, or if you run a virtual machine, you could use Windows PrintScreen
Drop off the screen shot image in PNG or JPG file format
in the corresponding assignment drop box on Sakai.