USC CSD Home
 

Preparation for Kernel Assignments (OLD Procedure) - CSCI 402, Summer 2022

 
Requirements
Since we will grade your kernel assignments ONLY on a Ubuntu 14.04 machine running QEMU 2.0 (Ubuntu 12.04 machine running QEMU 1.0 is also acceptable), you MUST implement and test your kernel assignments on either of these platforms. Unless specifically noted, we are talking about Ubuntu 14.04 in the text below to mean either Ubuntu 14.04 or Ubuntu 12.04 (although the figures may show something older and there may be minor differences between these two versions of Ubuntu; therefore, please do not be surprised if things don't look exactly the same as the figures or text on this web page).

If you don't want to install Ubuntu 14.04 on your machine because you already have another version of Ubuntu installed, please do this at your own risk. The kernel assignments are only known to work properly on Ubuntu 14.04. You may have to reinstall the right version of Ubuntu. We apologize for the inconvenience. If you choose to implement and test your kernel assignments on the wrong platform, you may end up getting zeroes in your kernel assignments. We will not grade your assignments on a different platform.

Ubuntu 14.04 is not the current release of Ubuntu. (Nevertheless, it is a "current version of Ubuntu" since it is supported by Ubuntu till April of 2019.) If you just go to the Ubuntu web site, you will be downloading the wrong version of Ubuntu. To download Ubuntu 14.04, you need to go to the Ubuntu 14.04 (Trusty Tahr) web site and download a desktop release of Ubuntu 14.04 (or go to Ubuntu 12.04 (Precise Pangolin) for Ubuntu 12.04). We strongly encourage you to use the 32-bit Ubuntu 14.04.

It looks like our kernel assignments are NOT compatible with Ubuntu 16.04. Please do NOT use Ubuntu 16.04 to do our kernel assignments.

 
Options
There are a few ways to install Ubuntu 14.04 so you can do your kernel assignments. The options are (if you are planning on NOT choosing option (1), please talk to the instrctor first before you proceed to see if it's really the right option for you):
  1. Install Ubuntu 14.04 inside a virtual machine (e.g. install VMware Workstation Player 12, VirtualBox, Parallels, etc. first on your machine; then download a Ubuntu 14.04 image and install it into the virtual machine). This is the preferred approach if your machine is relatively new (Intel Core i3 or faster CPU with ≥ 4GB memory). This should have no compatibility issue because Ubuntu 14.04 will be running inside a virtual machine interacting with virtual devices.

  2. If you have an older Windows 7/8 machine, you can install Ubuntu 12.04 using the Windows Ubuntu Installer (WUBI). This may have compatibility issues because Ubuntu 12.04 will be dealing with real hardware and it may not be 100% compatible with all the hardware on your laptop/desktop. If your machine is NOT Intel Core i3 or faster (i.e., you have an older machine), then there may be a good chance that WUBI would work just fine. If this is the case and approach 1 above is too slow for you, you should give WUBI a try. Please follow my my general installation notes and look for "WUBI" related stuff.

  3. Your last resort is to install a standalone or dual-boot Ubuntu 12.04. This may have compatibility issues because Ubuntu 12.04 will be dealing with real hardware and it may not be 100% compatible with all the hardware on your laptop/desktop. You should ONLY choose this option if none of the above options are available to you. You should talk to the instructor first before you proceed with this option!
Below is my instruction on how to install Ubuntu 14.04 in VirtualBox on Windows (which corresponds to the first and preferred approach mentioned above). For other methods (or installing different version of Ubuntu Linux for general use), please see my general installation notes.

If you are installing Ubuntu 14.04 so that you can do the kernel assignments, please do not forget to install additional software needed for the kernel assignments after you have installed and updated Ubuntu 14.04.

 
Using VirtualBox
If you have an Intel Core i3 or faster processor with 4GB or more memory, a good way to go is to install VirtualBox and then install either a 64-bit or 32-bit Ubuntu 14.04 into it. If you have an Intel Core i3 or faster processor with only 2GB or more memory, you can still use VirtualBox and then install a 32-bit Ubuntu 14.04 into it. Here, I will describe the basic steps on Windows 7/8. (If you are using a Mac, please check out a YouTube video link below.)

If you are running Windows 7/8/10 and your machine supports "virtualization" in BIOS, it's a good idea to have it enabled. If you don't know how to do that or check that, just google "Enable virtualization in BIOS in Windows 7/8/10".

Before you begin, just want to mention that there is a way to run Ubuntu 14.04 in VirtualBox without using the VirtualBox graphical user interface. This requires the use of something call Vagrant and the installation seems to be easier. If you are having trouble with the steps below, please take a look at the section about Vagrant below.

Visit the VirtualBox web site and download, install, and launch VirtualBox. (If you have a Windows machine, you should login to an account with administrator privileges.) You will get a screen that looks like the following:

  1. Click on the New button and enter "Ubuntu 14.04" under Name, "Linux" under Type, and "Ubuntu" under Version (or "Ubuntu (64 bit)" if you really want to use the 64-bit version of Ubuntu 14.04), and click on the Next button. Ubuntu recommends that you use the 32-bit version if you have less than 2GB of memory. I will assume that 1GB of memory will be used for our installation. Therefore, we should install the 32-bit version of Ubuntu 14.04.

  2. Change memory size to 1024MB (i.e., 1GB) and click on Next. (When VirtualBox is running, this much memory will be taken away from Windows. So, you shouldn't set this value too large.) 1GB is plenty for our kernel assignments. You should never give more than 50% of your memory to a virtual machine!

  3. Use the default ("Create a virtual hard drive now") and click on Next.

  4. Use the default ("VDI") and click on Next.

  5. Click on "Fixed size" (since it will run faster) and click on Next.

  6. Use the default ("8GB") and click on Create. Wait for the popup windows to disappear and then wait for the previous popup windows to also disappear. (If you plan to use Ubuntu 14.04 way beyond this class, you should select a larger size.)

  7. Your VirtualBox should now look like the following (without my "ubuntu 12.04" of course):
  8. With "Ubuntu 14.04" selected, click on the Settings button then click on Storage in the left panel of the popup window. Click on the Empty icon under Controller: IDE and you should see something like the following:

  9. Now click on the CD/DVD icon as shown above to setup the virtual CD/DVD drive. Select "Choose a virtual CD/DVD file..." from the popup list, change directory to where you have downloaded the Ubuntu 14.04 .iso image file (from the Ubuntu 14.04 (Trusty Tahr) web site). If you have not downloaded the .iso, just download it and repeat this step. Since we are giving Ubuntu 14.04 only 1GB of memory, you should select ubuntu-14.04.4-desktop-i386.iso. Your screen should look something like the following:
    Notice that it's showing the .iso file you have selected under Controller: IDE (although the picture above is showing a slightly different version number because I can't keep updating the picture to match the latest version number).

    Please note that if a previous installation was successful but when you restart Ubuntu 14.04, you are asked to install Ubuntu 14.04 again, you should come back to this screen and see what's in the virtual CD/DVD drive. The virtual CD/DVD drive should not show the original installation Ubuntu 14.04 .iso image file. If it does, you should eject the virtual CD/DVD drive. (If it's showing something called VBoxGuestAdditions.iso, it's perfectly fine.)

  10. There is one more thing you should do. Click on Display on the left and check the "Enable 3D Acceleration" checkbox. Then click on the OK button and you are done with setting up your VirtualBox. At this point, Ubuntu has not been installed into your VirtualBox, yet. We are almost there.

  11. With "Ubuntu 14.04" selected, you can click on the Start button. If Ubuntu 14.04 is not installed into your VirtualBox, it will install it into your VirtualBox. If Ubuntu 14.04 is installed already, it should boot it into VirtualBox.

    The installation process is similar to installing Ubuntu from a DVD on your machine. The difference here is that the DVD is a virtual DVD and the machine is the VirtualBox. Basically, you need to click on Install Ubuntu, Continue (check the "Download updates while installing" and "Install this third-party software" checkboxes), Continue (keep the "Erase disk and install Ubuntu" selected -- don't worry, this will only erase the 8GB virtual disk), and Install Now. A few minutes later, you will be prompted for a bunch of things such as time zones, keyboard layout, and your loginname and password. I would suggest that your loginname should be the same as your nunki.usc.edu loginname. Please read the on-screen instructions and decide which way you would like to proceed. The installation process can take quite some time (20 minutes on my Intel Core i3 laptop).

    For best results, you should connect your laptop/desktop machine to a wired Internet during the installation process. If you don't have a wired Internet, you need to setup wireless networking for your laptop/desktop before proceeding or just not check the Download updates while installing checkbox mentioned above.

    Please note that even though your laptop/desktop may have a wireless Internet connection, your Ubuntu 14.04 should always use a wired connection because it's running inside a vitual machine.

    When installation is finished, your will be prompted to restart Ubuntu 14.04. Please follow the on-screen instruction.

  12. When you reboot for the first time, you should update the Ubuntu 14.04 system. Click on the "power" button in the right-top corner and select "Software Up To Date". (This is only available on Ubuntu 12.04. On Ubuntu 14.04, you should look for the update button and click on it.) At this time, if you get a popup window to ask you to upgrade the system to a new version of Ubuntu, do NOT upgrade! Or you have to restart the entire process.

    The only popup box you should don't need to close is the one that shows a list of packages to update (there should be like 200 something packages that needs to be updated). In this popup box, click on the Settings button on the lower-left-hand corner. In its popup window, the last item is "Notify me of a new Ubuntu version". Please select Never (you may get an authentication box at this point because you are making important system changes, just enter your password and press <ENTER>). Then click on the Close button. Wait for the screen to settle and click on Install Updates button. It will ask for your password again, so go ahead and enter it. This update will most likely take a long time to run (like an hour), so keep your machine's power chord plugged in. When it's done doing all the updates, you will need to restart your machine.

    This should be the ONLY time you need to run software update for your Ubuntu 14.04 system. You should NOT update or upgrade your system if you just want to use this system for doing the kernel assignments. (If you want to use Ubuntu in general, you should download and install the latest Ubuntu "long-term-support/LTS" version. However, you may not be able to use that version for doing the kernel assignments! One thing you can do is to install and run the LTS version in another VirtualBox instance.)

  13. After reboot, if you see that maximizing the Ubuntu 14.04 window does not look right, there's one more thing you should do.

    Your VirtualBox have 4 menus at the top of the VirtualBox window. Click on the Devices menu and select Install Guess Additions... and click on the OK button in the popup window and click on the Run button in the next popup window. If you are prompted to enter a password, just enter the password you have setup for your main login account. This will take about a minute to run. When it's all done, shutdown Ubuntu 14.04 and restart Ubuntu 14.04 from VirtualBox. (Actually, if you check the storage settings for "Ubuntu 14.04" in VirtualBox, you should see that it's showing VBoxGuestAdditions.iso instead.)

    By the way, if you update Ubuntu 14.04 in the future (not upgrades), you may have to re-do this step and reboot again. If you get an error message, you may have to eject the guest additions disk first. Look for a icon in the left ("Launcher") panel for something that looks like a CD (and if you move your mouse over it, you will see something like "VBOXADDITIONS_..."). Right click on it and select Eject.

  14. There are a couple of useful things I would do to make life a little easier for transfering data between the Windows host and Ubuntu inside VirtualBox. You don't need to do this if everything you need to do can be done inside the Ubuntu 14.04 VirtualBox. I do it because I cannot print from the Ubuntu 14.04 VirtualBox and I have to go to Windows to print documents. The features I use in VirtualBox are called Shared Clipboard and Shared Folder. To set these up, you must first shutdown Ubuntu.

    In VirtualBox, you go to Settings for "Ubuntu 14.04" and click on General in the left panel. In the right pantel, click on the Advanced tab. Change Shared Clipboard to Bidirectional so that you can copy and paste between Ubuntu 14.04 and Windows.

    Click on Shared Folders in the left panel then click on the icon on the right with a blue folder and green plus sign on it to add a shared folder. Click on the Folder Path drop-down list, select Other..., and select a folder (I would create a brand new folder somewhere first and share it; I named the folder "shared-ubuntu-12.04"). By default, it will then show the folder path you just selected. Under Folder Name, it will show the name of the folder. You need to memorize the name of this folder because you will need to use a matching name when you get back to Ubuntu. Check the Auto-mount checkbox and click on OK and then click on OK again to finish setup. Now start Ubuntu 14.04

    After you login to Ubuntu 14.04, you should create a mount point for the shared folder. For example, to create a mount point called "/mnt/shared-windows", do:

        sudo mkdir /mnt/shared-windows
    From this point on, if you want to access the Shared Folder, just run the following command in a terminal (assuming that the name of the folder is "shared-ubuntu-12.04"):
        sudo mount -t vboxsf -o uid=1000,gid=1000 shared-ubuntu-12.04 /mnt/shared-windows
    If you put anything into /mnt/shared-windows, it will show up in Windows, and vice versa.

    If you forget the name you gave for the shared folder, just run the df command and look for something that looks like /media/sf_*. The name is in the left-most column.

  15. At this point, you should follow the procedures to install login shell and install software needed for the kernel assignments.

Other Resources

Here are a couple of YouTube videos on how to install Ubuntu Linux in VirtualBox in general. Here are more YouTube videos on other things you may need to do to your computer.
 
Using Vagrant With VirtualBox
VirtualBox may be a bit involved to get it installed. Another way to use VirtualBox is to run VirtualBox without user interface using Vagrant. I've found some instructions on the web about how to install Vagrant with VirtualBox on Windows and it's summarized here.
  1. Follow these instructions to download and install VirtualBox and Vagrant. If your machine is a 64-bit machine, download and install the 64-bit version of these software.
  2. Follow these instructions to create a project directory. We will assume that your project directory is "C:\Vagrant\sitepoint".
  3. Using the File Explorer, navigate to "C:\Vagrant", with the <Shift> key held down, right-click on the "sitepoint" folder and select "Open Powershell window here"
  4. Inside the Powershell window, type "vagrant init".
  5. Inside the Powershell window, type "del Vagrantfile" to delete the newly created "Vagrantfile".
  6. Inside the Powershell window, type "vagrant init ubuntu/trusty32".
  7. Inside the Powershell window, type "vagrant up".
  8. Inside the Powershell window, type "vagrant ssh" to connect to your Vagrant Box.
  9. Use "vagrant" as your user name and "vagrant" as your password whenever you are prompted for a password.
  10. If you would prefer to use "tcsh" as your login shell, follow the above instruction to change your login shell. Then type "exit" and re-connect with "vagrant ssh".
  11. Follow the above instruction to install all the necessary software to do your kernel assignments.
  12. Run the following commands to install more software since this is a barebone system:
        sudo apt-get install -y gdb
        sudo apt-get install -y genisoimage
        sudo apt-get install -y Xorg
        sudo apt-get install -y gnome-terminal
  13. Type "exit" to disconnect from your Vagrant Box. From this point on, you should not be use "vagrant ssh" command to connect to your Vagrant Box any more because these is no way to run an application that needs to create a window on your screen. One such application is QEMU. What you need is either X-Win32 or Cygwin to be able to connect to your Vagrant Box and for your Vagrant Box to connect back to your display.
  14. To use a shared folder between Ubuntu and Windows, simply uncomment the config.vm.synced_folder line in the Vagrantfile. The first argument in that line is the directory in Windows, relative to the directory Vagrantfile is in. You need to make sure that this directory exists. If it doesn't exist, you should manually create it before you can use the shared folder. The 2nd argument is the directory in Ubuntu that will be created for data exchange. By default, "../data" is the first argument and "/vagrant_data" is the 2nd argument If you want to use the default values, you need to manually create the "../data" directory, relative to the location of the Vagrantfile.
  15. Below are the steps for installing and setting up X-Win32. The problem with X-Win32 is that it's not free. USC has a licence for you to run X-Win32. When you are on campus, it's no problem to run X-Win32. But when you are at home, in order to run X-Win32, you have to run a Virtual Private Network (VPN) so your laptop/desktop would appear on the USC campus network. An alternative to X-Win32 is Cygwin, but it's more involved to get it installed. If you want to give it a try, please see my instruction on how to install Cygwin on Windows.
  16. Download and install X-Win32 from the ITS software site.
  17. Start X-Win32. Click on Autostart on the left and click on the Manual button.
  18. Click on "ssh" and click on the Next button.
  19. In the General tab, enter "vagrant" as the Connection Name, "127.0.0.1" as the Host, "vagrant" as the Login, "/usr/bin/xterm -ls -fn 9x15" as the Command, "vagrant" as the Password, and "vagrant" as the Confirm Password.
  20. In the Advanced tab, change Port to "2222". Then click on the Save button.
  21. In X-Win32, select the Security tab, in the Allowed Host Addresses area, click on the Add button and enter "127.0.0.1".
  22. Go back and select the Connections tab, select the newly create "vagrant" item on the left and click on the Launch button. (If you get a popup window asking you if you want to accept a Host Key, click on the Accept button.)
  23. If you get an error message about Licensing, it's probably because you are not on the USC campus network. You should run a Virtual Private Network (VPN) so your laptop/desktop would appear on the USC campus network. You can download and install VPN from the ITS software site. After you start VPN, you need to quit X-Win32 and restart it again.
  24. If you don't like "xterm", you can download and install "gnome-terminal" (which is the "Terminal" program mentioned above).
  25. If you want to turn off the Vagrant Box, type "vagrant halt" in the Powershell.
Below as the instructions for installing Vagrant on a Mac OS X machine.
  1. Follow these instructions to download and install VirtualBox and Vagrant. If your machine is a 64-bit machine, download and install the 64-bit version of these software.
  2. Download and install XQuartz, which includes X11 server and client software. After it's installed, run XQuartz.app from the Utilities folder in Applications. You should get a window with "xterm" in the titlebar.
  3. Create a project directory (for example, in "Vagrant/sitepoint") and change directory into it (i.e., type "cd Vagrant/sitepoint").
  4. In the "xterm" window, type "vagrant init".
  5. In the "xterm" window, type "rm Vagrantfile" to delete the newly created "Vagrantfile".
  6. In the "xterm" window, type "vagrant init ubuntu/trusty32".
  7. In the "xterm" window, type "vagrant up".
  8. In the "xterm" window, type "vagrant ssh" to ssh into your Vagrant Box. (Use "vagrant" as your user name and "vagrant" as your password whenever you are prompted for a password.)
  9. If you would prefer to use "tcsh" as your login shell, follow the above instruction to change your login shell. Then type "exit" and re-connect with the "vagrant ssh" command.
  10. Follow the above instruction to install all the necessary software to do your kernel assignments.
  11. Run the following commands to install more software since this is a barebone system:
        sudo apt-get install -y gdb
        sudo apt-get install -y genisoimage
        sudo apt-get install -y Xorg
        sudo apt-get install -y gnome-terminal
  12. Type "exit" to disconnect from your Vagrant Box.
  13. To use a shared folder between Ubuntu and Mac OS X, simply uncomment the config.vm.synced_folder line in the Vagrantfile. The first argument in that line is the directory in Mac OS X, relative to the directory Vagrantfile is in. The 2nd argument is the directory in Ubuntu that will be created for data exchange. By default, "../data" is the first argument and "/vagrant_data" is the 2nd argument and you need to manually create the "../data" directory, relative to the location of the Vagrantfile.
  14. From this point on, if you want to connect to your Vagrant Box, you should run "xterm" (using XQuartz.app) and type (remember, your password is "vagrant"):
        ssh -X -Y vagrant@127.0.0.1 -p2222
    Once you get into your Vagrant Box, you can run "gnome-terminal" to connect back to your Mac OS X display.
  15. If you want to turn off the Vagrant Box, you should disconnect from your Vagrant Box and then type "vagrant halt" in the "xterm" window.
 
Using VMware Player 7 (or VMware Workstation Player 12)
On Windows machines, VMware Player 7 (or VMware Workstation Player 12) performs better than VirtualBox. So, I do recommend VMware Player 7 (or VMware Workstation Player 12) if you are running Windows 7/8/10. If you have a Windows machine, you should login to an account with administrator privileges before you proceed. Below, I will use "VMware Player 7" or "VMware Workstation Player 12" interchangeably since they are very similar.

If your machine supports "virtualization" in BIOS, it's a good idea to have it enabled. If you don't know how to do that or check that, just google "Enable virtualization in UEFI BIOS in Windows 8/10".

Visit the VMware Workstation Player 12 web site and download, install, and launch VMware Player 7. (Please note that there's something called "VMware Workstation Pro" which is not free.) You will get a screen that looks like the following (please note that things may not look exactly like the screenshots here since I'm not updating the screenshots whenever VMware Player 7 got upgraded):

  1. Click on the Create New Virtual Machine button on the right and you will get a popup windows that looks like the following:
  2. Select the "Installer disk image file (.iso)", click on the "Browse" button, change directory to where you have downloaded the Ubuntu 14.04 .iso image file (from the Ubuntu 14.04 (Trusty Tahr) web site). If you have not downloaded the .iso, just download it and repeat this step. Assuming you have selected ubuntu-14.04.4-desktop-i386.iso, your screen should look something like the following (the path to your .iso file will be different):
    The above shows that VMware Player have detected that the selected image is Ubuntu 14.04 and that it will use Easy Install.

  3. Click on the Next button to proceed with Easy Install. Your screen should look like the following:
    This is the information about the admin account (which is you). I would suggest that your "User name" should be the same as your nunki.usc.edu loginname. Fill it out and click on the "Next" button. The password you choose on this screen in the admin password which you will need every time you do something serious to Ubuntu (such as installing new software).

  4. In the next screen, you will be asked to enter a name for the virtual machine. You can just use the default name and click on the "Next" button. Your screen should look like the following:
    Change the "Maximum disk size" to what you need and select the "Store virtual disk as a single file".

  5. Click on the "Next" button and your screen should look like the following:
    Just click on the "Finish" button and installation will begin.

    When installation is finished you will be running Ubuntu 14.04. Now that Ubuntu 14.04 is running inside VMware Player, you should setup Ubuntu 14.04 using the same procedure as installing under VirtualBox (although you don't need "Install Guest Additions" because VMware has no such things).

    At the end of the installation process, if you see something about VMware Tools were not automatically installed. Don't worry, you can install it later.

  6. To setup Shared Folder, you need to change the settings of the virtual machine. (Shared Clipboard is automatically enabled in VMware Player.) The name I gave my virtual machine was "u32-14.04-4" and my VMware player screen now looks like the following:

  7. Right-click on the virtual machine name and select "Settings" to change virtual machine settings. Click on the "Options" tab and your screen should look like the following:

  8. Click on "Shared Folders" and enable the shared folder on the right. Click on "Add" and your screen should look like the following:
    Click on "Browse" to select a folder and enter a name and click on the "Next" button and save the settings. When you start Ubuntu 14.04, you can get to the shared folders under /mnt/hgfs. If you cannot get there, please try the following command:
        df
    and see if you can see a file system mounted on /mnt/hgfs. If you cannot see such a file system, please try the procedure below.

    Click on the Player menu in the VMware Workstation Player 12 window (left-top corner), click on Manage and then click on Reinstall VMware Tools. Drag and drop the VMwareTools-*.tar.gz file in the popup window into your Home directory. The do the following:

        cd
        tar xzpf VMwareTools-*.tar.gz
        cd vmware-tools-distrib
        sudo ./vmware-install.pl
    You will be prompted with a lot of questions at this point. Just keep pressing <ENTER> and it should all work (can take a while to install all the stuff). When you are done, type "df" again in a terminal and see if you have a file system mounted on /mnt/hgfs. If not, re-run the sudo ./vmware-install.pl command again. This time, read the questions carefully. Most of the time, you should just press . But watch out for this one:
        The VMware Host-Guest Filesystem allows for shared folders between the host OS
        and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
        to enable this feature? [no]
    Since the default answer is [no], you have to type "yes" here (without the quotation marks). Continue and answer all the remaining questions until everything is done. When it's done, type "df" again and see if you can see a file system mounted on /mnt/hgfs. If you do, then do:
        ls /mnt/hgfs
    to see the directory that's shared between your Ubuntu system and the outside Windows/Mac system.
 
Ubuntu Desktop
On your Ubuntu desktop, there are a bunch of buttons on the left. This is the Laucher area. It's like the Dock on Mac OS X. Here's a brief explanations of the functionalities of these buttons in the Launcher.
This is the "dashboard" button and it allows you to search for a program on your machine and run it. If you simply press the <ALT> key (or the Windows key, if you have a Windows keyboard) on your keyboard, it would be the same as pressing this button.

Try this... Click on it and type "Terminal" and click on the Terminal icon to run the gnome-terminal program. A Terminal button will be added temporarily to your Launcher. Right-click on that button and select Lock to Laucher since you would most likely use the gnome-terminal to ssh to nunki/aludra.usc.edu. The gnome-terminal program can have multiple tabs. You can press <Cntrl+Shift+t> to add a tab and press <Cntrl+PageUp/Dn> to circulate between tabs. Select Set Title from the Terminal menu to give each tab a title can also be quite useful.

This gnome-terminal program is very important for this class! When you debug your kernel assignments, you will be running this program all the time.

If you cannot see anything inside gnome-terminal, try clicking on Profile Preferences under the Edit Menu, selected the Colors tab, and uncheck the "use colors from system theme".

This lauches your filesystem viewer (similar to Windows Explorer on Windows or Finder on Mac OS X).
This lauches the Firefox web browser.
This lauches the LibreOffice Writer program. It's quite compatible with Microsoft Word. It can read and write .doc, .docx, and .rtf files.
This lauches the LibreOffice Calc program. It's quite compatible with Microsoft Excel. It can read and write .xls, .xlsx, and .csv files.
This lauches the LibreOffice Impress program. It's quite compatible with Microsoft PowerPoint. It can read and write .ppt and .pptx files.
This lauches the Software Center whenere you can download and install additional software onto your machine (kind of like an App Store). In addition, it can also show you what programs are installed on your machine and let you uninstall them.

If you use Adobe Photoshop a lot, the free software that comes closest to the functionality of Adobe Photoshop is probably the "gimp" program. Launch the Software Center and type "gimp". The rest should be easy to figure out.

Sometimes, the Software Center popups by itself if you are installing something in Firefox. For example, if you go to "www.youtube.com" with Firefox, you should see that a plugin (to play Adobe Flash) is missing. If you proceed to install the plugin on Firefox, you will see that the Software Center is needed to finish the installation.

This lauches the Ubuntu One client program. Ubuntu One is a free "personal cloud". Unfortunately, Ubuntu One has been discontinued. For backuping your assignment files and collaborating with your group members, please see the section on Git and GitHub below.
This lauches the System Settings program (similar to Control Panel on Windows and System Preferences on Mac OS X).
This lauches the Update Manager program (similar to Windows Update on Windows). This button is only visible sometimes.
This lets you switch workspaces (not the same as desktops). By default, you get four workspaces. After you click this button, double-click which workspace you want to work in. This is pretty useful if you are running too many applications all at once.
If you have a small laptop, you can right-click on the 3 LibreOffice buttons and uncheck "Keep in launcher" to remove these button. You can still access these applications from the dashboard.
 
Login Shell
By default, your login shell is bash. If you want your login shell to be tcsh, you need to install it first. But you have to wait for all other installation activity to finish before you can proceed. After all other installation activity are done, start Terminal and enter:
    sudo apt-get install -y tcsh
You will be prompted for your password, so go ahead and enter it. After installation is done, you can change your login shell by doing the following:
    chsh
You will be prompted for your password, again. Then enter:
    /bin/tcsh
Next time you reboot, your terminal will be running the new login shell.
 
Install More Software
Many software on Ubuntu Linux are free, although they may not be installed by default. You can use the Software Center to install more software. Alternately, you can install them over the commandline using the Terminal (i.e., gnome-terminal) program, if you know the precise names of the software packages.

In order to do your kernel assignments, please start an instance of Terminal. Then enter the following commands to install git, gitk, git-core, qemu, and cscope.

    sudo apt-get update
    sudo apt-get install -y git
    sudo apt-get install -y gitk
    sudo apt-get install -y git-core
    sudo apt-get install -y qemu
    sudo apt-get install -y cscope
    sudo apt-get install -y xorriso
The apt-get is the program for downloading and installing a piece of software. But only administrator can install software. Although you are an administrator on your own machine, you do not run at the administrator privilege level normally. The sudo command is used to temporarily raise you security privilege to the level of an administrator in order to execute the rest of the command you typed into the commandline. Therefore, when you run the above command, you will be prompted to enter your password before the rest of the command can be executed. The good news is that if you run the sudo command subsequently in the same console, you will not be prompted to enter your password, unless your console has been idle for some time.

Please note that you can only run one instance of apt-get at a time. Internally, the Software Center also invokes apt-get to download and install software. So, if the Software Center is busy installing a program, you will be blocked from running apt-get until the Software Center is finished.

By default, your login shell is bash. If you would prefer to use tcsh as your login shell (so it's more like the default USC Solaris environment on nunki.usc.edu), please also install tcsh and switch to using it as your login shell.

 
Use Git and BitBucket/GitHub
It is imperative that your group uses a version management system. The software of choice is Git, originally designed and written by Linus Torvalds.

If you are not familiar with Git, please read the free online book, Pro Git, mentioned in the textbooks section of our course description web page.

There are free web sites on the Internet that provide free Git repository service. You should be able to create an account there and share it along your team members. Please make sure that your code is private so that no one other than your team members can see or change the code. Please note that if others (such as the teaching staff) can see your code repository (because it is not private), it will be considered cheating and there are serious consequences. As I have mentioned in the first lecture, you do not have the right to display your assignment-related code in public (even if your prospective employer asks you to). If you display your assignment-related code in public in the middle of the semester, your group will get a zero for the assignment. (If others have cheated off of your code, then your case will be reported to the university and everyone in your group may end up failing the course.) If you display your assignment-related code in public after the semester is over, I will ask the university to change the grades of everyone in your team because you are helping future students cheat. So, please make double sure that your code repositories related to this class are all private.

To start using BitBucket/GitHub, please visit the projects page.

 
What Machine Is Fast Enough
If you are not using a virutal machine (such as VirtualBox, VMware Player, Parallels, etc.), then pretty much any hardware should be fast enough since Ubuntu 14.04 is not very demanding.

If you have hardware compatibility issue and the only way that would work for you is to first install a virtual machine and then install Ubuntu 14.04 into the virtual machine, then your hardware may need to be some what powerful. Usually, the newer the machine, the more powerful it is. So, if you have a 2012 or newer machine, you are all set.

If you have an old laptop that runs Windows XP and you want to get a replacement laptop but want to spend minimum amount of money, here's a Windows 8 touch screen laptop I got for less than $500 (around the end of 2012):

  • Intel Core i3 processor running at 1.8GHz
  • 4GB DDR3 Memory running at 1333MHz
  • 500GB Hard Drive
I installed VirtualBox on it and then install Ubuntu 14.04 into it and it runs perfectly!

By the way, if you are going to get a Windows 8 machine, it's better to get it with a touch screen display because this means that the machine was designed with Windows 8 in mind. Therefore, it doesn't have to be compatible with Windows 7 and is probably more robust. (A Windows 8 laptop that's not touch screen is probably a Windows 7 machine upgraded to Windows 8 and potentially may have more compatibility issues.) You may also have to turn off "secure boot" in order to install Ubuntu Linux 12.04 on a Windows 8 machine. If you have a Windows 8.1 machine, even if you turn off "secure boot", it will probably not allow you to setup dual-boot for your machine.

 
HP Stream 11 (or Other Low-end Machines)
(Disclaimer: I'm not afficliated with HP or Acer. I'm using HP Stream 11 as an example here because of its low prices, availability, and the fact that I own one.)

I have an HP Stream 11 (which has an Intel Celeron N2840 CPU with 2GB of memory and 32GB of solid-state drive). I would consider this a low-end machine since (1) the Celeron CPU is slow, (2) 2GB memory is too little, and (3) 32GB of disk storage is really not much storage. This machine costs less than $200. Another machine in the same category is the Acer Aspire E 11. Please keep in mind that these machines are designed to compete with Chromebooks.

[UPDATE: 11/23/2016] These days, you can get an HP Stream 11 or 14 with Intel Celeron N3060 CPU with 4 GB of memory and 32 GB of solid-state drive for about $20 more than the configuration mentioned above. Having 4GB of memory is a lot better than having 2GB of memory. 32GB of SSD is probably not enough. But you can get a 32GB external SD card mentioned below.

If you have one of these machines, it is possible to use it for our kernel assignments. But if you are not carefully when you use such a machine, it can get too slow to do our assignments. Here are the things I recommend that you do, if you want to use such a machine:

  1. For this semester, you should only do serious work on this machine. Don't load up the machine with videos or photos or too much downloads. Don't play video games on this machine!

  2. These machines should support an external SD card. Find out what the maximum capacity SD card it supports and get one. Use it as drive D and install VMware Player and virtual machines on this drive. For HP Stream 11, the maximum size for an external SD card is 32GB. Make sure it's Class 10 (which is faster than Class 2/4/6 and costs almost the same). This should cost around $12.

  3. Turn on virtualization support in UEFI BIOS. If you don't know how to do it, just google "Turn on virtualization support in UEFI BIOS in windows 8/10".

  4. Install VMware Player 7.1.3 or later. It's fine to use all the default settings.

  5. Install a 32-bit Ubuntu 12.04 or 14.04. The reason is that 64-bit Ubuntu is only recommended if you have at least 2GB of memory to run Ubuntu. Since you can only dedicate 1GB of memory to Ubuntu, you must only use the 32-bit version of Ubuntu. (And in case you are wondering, it's perfectly okay to install a 32-bit Ubuntu into a 64-bit VMware Player.) On my HP Stream 11, I'm running Ubuntu 14.04.3 and it works just fine. I will use that as an example below.

  6. When you are installing Ubuntu 14.04.3, on the "Name the Virtual Machine" screen, make sure you replace "C:" with "D:" to install Ubuntu 14.04 on to the SD card. You can shorten the path if you want. For 32-bit Ubuntu 14.04.3, I use the path, "D:\Player\Virtual Machines\u32-14.04.3".

  7. When you are installing Ubuntu 14.04.3, on the "Specify Disk Capacity" screen, change the disk size to 8GB (to save space) and select the "Store virtual disk as a single file" option (so Ubuntu can run faster).

  8. When you are installing Ubuntu 14.04.3, on the "Specify Disk Capacity" screen, change the disk size to 8GB (to save space) and select the "Store virtual disk as a single file" option (so Ubuntu can run faster).

  9. After you login to Ubuntu for the first time and when you get to the Ubuntu Desktop, you would notice that things are kind of slow. Turns out this is mainly because the default window/display manager is doing a lot of fancy graphics and uses up a lot of memory. The solution is to install a light-weight display manager called LXDE. It's important to fix this problem before doing anything else; otherwise, everything else will take a long time. So, fire up a terminal and run the following command:
        sudo apt-get install -y lxde
    Don't do anything else with the virtual machine and wait for it to finish. This can take a while and the screen saver may kick in and you need to type your admin password to unlock the screen saver. When it's done, click on "power"-looking icon in the right top corner of Ubuntu and select "Log Out". In the login screen, click on the Ubuntu logo, which looks like the following (except the color is probably inverted):
    and select LXDE. (Make sure you don't select Openbox, which will put you in some sort of an expert mode! If you do that, you may have to reinstall Ubuntu from scratch!)

  10. When you login again, you will see a row of icons on the bottom of the screen that looks like the following:
    and it's known as the Launcher Bar. You can reconfigure the Launcher Bar by right-click on the Files icon and select "Application Launcher Bar Settings" and you should see something that looks like:
    What's currently in the Launcher Bar is on the left. You can select them, one by one, and click on the Remove button to remove them. To add icons to the Launcher Bar, you need to find the application on the right and click on the Add button. For example, you can find the Terminal program under Accessories and Firefox under Internet.

  11. To learn more about LXDE, please see a LXDE tutorial.

  12. One last thing. When you run the Terminal program under LXDE, you may not see anything inside the terminal. That's probably because both the text and the background are in black! To change that, you can select Profile Preferences from the Edit menu and uncheck the Use Colors From System Scheme checkbox.

  13. That's it! You can now proceed to setup Shared Folder, install tcsh if you are not familiar with bash, and install all the software you need for doing the kernel assignments.
 
List of Problematic Systems
Some students have reported that they had trouble installing Ubuntu 14.04 into VirtualBox. It does not mean that these systems won't work. I'm just keeping track of what people have seen here. It usually mean that the standard procedure may not work and you should try the suggestions in "Solutions" below to see what you need to do. If you have the same system and are experiencing the same problem, please send me an e-mail so I know the problem is wide spread. If you are having trouble getting Ubuntu 14.04 to work on a system that's not listed, please send me an e-mail so I can add it to the list.
System Description Solutions
HP Spectre running Windows 10 Get error message "VMware Player unrecoverable error: (vcpu-0)" when starting Ubuntu. Enable "virtualization" in UEFI BIOS. (If you don't know how to do that or check that, just google "Enable virtualization in UEFI BIOS in windows 10".)
Lenovo G500 (Windows 8),
Dell Inspiron 15R (Windows 8)
After installation, when it asked you to reboot, the VM crasheed with a message saying, "Oracle VM VirtualBox Manager has stopped working".
1)   Just ignore the crash (since installation was completed)! Reboot VirtualBox and start Ubuntu and it should work. (If it starts installing Ubuntu again, this means that it did not work.)
2)   If (1) doesn't work, instead of using VirtualBox, try the VMware Workstation Player 12. The installation steps are kind of similar.
Lenovo G500 Install Ubuntu 12.04.5 into VMware Player. Only get a blank/black screen in Ubuntu.
1)   Install Ubuntu 12.04.4 instead. (Ubuntu 12.04.x where x can be anything is fine for kernel assignments.)
2)   This may be a graphics card issue. Try the follow commands:
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install xserver-xorg-lts-quantal
    sudo dpkg-reconfigure xserver-xorg-lts-quantal
    sudo reboot
Also, if you are using VMware Workstation, you can open a Terminal by pressing <Cntrl+Alt+F1>.
HP Pavillion G6 running Windows 8.1 Get error message "VMprocess could not be started". According to https://www.virtualbox.org/ticket/13187, a solution is to: "uninstall and reinstall 4.3.12". Got to older builds of VirtualBox, click on 4.3 and look for 4.3.12 and give that a try. (Please note that I have not verified that this is a valid fix.)
HP Stream 11 running Windows 8.1 When finished installing VMware Player 7, Ubuntu reboots with a small screen and the bottom of the screen says "installation failed for VMwareTools". Try the following:
    cd /tmp
    tar xzf /media/VMware\ Tools/VMwareTools-*.tar.gz
    cd vmware-tools-distrib
    sudo ./vmware-install.pl
When prompted, just press <ENTER> to accept default values for everything.
Mac OS X Switching or moving windows is slow inside VirtualBox. Make sure you turn on 3-D acceleration.

Shutdown VirtualBox and restart it. Select Ubuntu but don't start it. Clickc on Settings and then Display and make sure the 3-D accelation checkbox is checked.

VirtualBox (in Windows) Wifi stopped working. If you have something called Lavasoft Web Companion, it may have interfered with VirtualBox networking. Uninstalling Lavasoft Web Companion would fix the problem. Please see https://superuser.com/questions/1192452/networking-on-virtualbox-suddenly-stopped-working.
VMware Workstation 12 Ubuntu screen will not resize when you maximize the VMware window. Run Terminal and type the following:
    sudo apt-get autoremove open-vm-tools
    sudo apt-get install open-vm-tools-desktop
Then restart Ubuntu.
 

   [Please see copyright regarding copying.]