The first thing you need to do is to download an ISO file for a 32-bit Ubuntu 16.04. Since Ubuntu 16.04 is not the current release of Ubuntu, if you just go to the Ubuntu web site, you will be downloading the WRONG version of Ubuntu. Also, it's best not to install Ubuntu 16.04 from scratch. It's better to install from a virtual appliance. But if you would prefer to install a 32-bit Ubuntu 16.04from scratch, please follow the instructions on this page.

To download the right 32-bit Ubuntu 16.04, you need to go to the Ubuntu 16.04 (Xenial Xerus) web site and download the desktop release of Ubuntu 16.04. We strongly encourage you to use the 32-bit Ubuntu 16.04 since all examples used in class will assume that your CPU is a 32-bit CPU. At the time of this writing, the file you should be downloading is "ubuntu-16.04.7-desktop-i386.iso". We will use this file name here. The important part of the file name is "16.04". The number after "16.04" is a release number and anything ≥ 4 would be fine. Please replaces all references to "ubuntu-16.04.7-desktop-i386.iso" with the file name of the ".iso" file you actually downloaded.

Follow the instruction to download and install VirtualBox. Then launch VirtualBox and you will get a screen that looks like the following:

If you click on About VirtualBox under the Help Menu, you will see the version of the VirtualBox you are running. The screenshots below are from a mix of VirtualBox-6.0.8 and VirtualBox-6.1.6. If you are using a newer version of VirtualBox, your screens may look different and some of the default values may be different.

Step 1: Create An Empty Virtual Machine

To install Ubuntu 16.04 into VirtualBox, first you need to create an empty virtual machine. Start with the above screen, if you click on the New button in the left-top corner and you should see the following screen:
Enter "u32-16.04.7" in the Name textbox (to mean "ubuntu", "32-bit", "version 16.04", and "release 6"). (Please ignore my typo! Instead of "u32", I have "u34" in all the screenshots! Also, if you are installing version 16.04.7, you should name it "u32-16.04.7".) Select "Linux" as Type and select "Ubuntu (32-bit)" as Version, then click on the Next button. You should then see the following screen:
The default memory size is shown as 1GB (it may be different for a different version of VirtualBox) and 1GB is plenty if you just want to do your programming assignments! You should run as few applications inside your 32-bit Ubuntu 16.04 as possible and only use it to do your programming assignments. If you want to play around with Ubuntu 16.04, you can install another virtual machine. But you should keep this virtual machine lean and clean! You should definitely try to avoid running things like a web browser or a music player in this virtual machine. By the way, this value can be changed easily after everything is installed. So, just set it to 1GB for now and it would be fine.

If you have to run a web browser inside this virtual machine and you have 8GB or more memory in your host machine (Windows 10 or Mac OS X), you should increase the memory for this virtual machine to 2BG. (A web browser is a memory hog!) Please do NOT set the memory size to anything more than 2GB because the more memory you give to Ubuntu 16.04, the less memory the rest of your machine has. In general, you should run memory intensive applications inside your host machine and not inside a virtual machine. If your host machine has only 4GB memory, the maximum memory I would give to the virtual machine would be 1.5GB (and you will only have 2.5GB to run everything else in your host machine).

After you set your memory size and click on the Next button, you should see the following screen:

Don't change a thing and click on the Create button, you should see the following screen:
Don't change a thing and click on the Next button, you should see the following screen:
Don't change a thing and click on the Next button, you should see the following screen:
Since the goal here is to work on your programming assignments, at least 10GB of disk space is required. If it's showing something smaller than 10GB, please change it to 10GB. Then click on the Create button, you should see the following screen:
In the above screenshot, it's showing that the name of the virtual machine is "md32xu16047eolvm-vbox6118-f1", and that's because I'm using the same screenshot for both installing a pre-canned 32-bit Ubuntu 16.04 system and installing a 32-bit Ubuntu 16.04 system from scratch. If you got here by following the instructions above, the name of your virtual machine should be "u32-16.04.7".

Step 2: Setup The Virtual Machine

Please note that in all the screenshots below, some will be showing the name of the virtual machine as "md32xu16047eolvm-vbox6118-f1" and some will be showing the name of the virtual machine as "u32-16.04.7". This is because I'm using the same screenshot for both installing a pre-canned 32-bit Ubuntu 16.04 system and installing a 32-bit Ubuntu 16.04 system from scratch.

Starting with the above screen, if you click on the Settings button (orange color) near the middle-top part of the window and you should see the following screen:

You can see that General is selected on the left and the Basic tab is selected in the right pane. We should see that under the Basic tab, we are setting up the virtual machine that we set out to build (Name being "u32-16.04.7"), Type being "Linux", and Version "Ubuntu (32-bit)"). If your Version is "Ubuntu (64-bit)", please change it to "Ubuntu (32-bit)". Select the Advanced tab and you should see the following screen:
Change the Shared Clipboard from "Disabled" to "Bidirectional" so that you can use the clipboard to copy from something running in the host and paste into something running inside the virtual machine or copy from something running inside the virthal machine and paste into something running in the host.

Click on System on the left and you should see the following screen:

If you have an older machine, you don't need to change anything here. But if your machine is relative new, you should check the Enable I/O APIC checkbox and click on the Processor tab and increase the number of CPUs from 1 to 2. You should keep the amount of RAM (referred to as "Base Memory" above) unchanged for now. If you later decide that you need more RAM for your virtual machine, you can come back here.

Click on Display on the left and you should see the following screen:

You should see that the "Enable 3D Acceleration" checkbox is not checked. Click on it to enable 3D acceleration. If you don't check this checkbox, your Ubuntu 16.04 will run very slowly.

IMPORTANT for Mac OS X: If your host is Mac OS X, especially for the new Mac models, you should set Video Memory to 128 MB.

Click on Storage on the left and you should see the following screen:

In the middle of the screen, inside a box that says "Storage Devices", there is a line that says "Controller: IDE". Right below it, it shows an icon of an optical disk with the word "Empty" right next to it. Click on the optical disk icon or "Empty" and you should see the following screen:
In the right column, for "Optional Drive", it's showing "IDE Secondary Master". There is another icon (blue color) of an optical disk immediately to the right of it. Click on that icon (and not the "IDE Scondary Master") and you should get a popup menu that looks like the following:
Click on "Choose Virtual Optical Disk File" and navigate to the directory where you have downloaded the "ubuntu-16.04.7-desktop-i386.iso" file. Select the "ubuntu-16.04.7-desktop-i386.iso" file and you should see the following screen:
Notice that in the middle of the screen and right below "Controller: IDE", the previously "Empty" optical disk now becomes "ubuntu-16.04.7-desktop-i386.iso". (The "i386" in "ubuntu-16.04.7-desktop-i386.iso" means that it's a 32-bit system. If you see "amd64" and not "i386", please download and select "ubuntu-16.04.7-desktop-i386.iso" instead.)

Click on Audio on the left and you should see the following screen:

By default, the "Enable Audio" checkbox at the top is checked. On some systems, this can cause your CPU usage to go to 100% and your system may crash or become very very slow. Therefore, it's a good idea to uncheck the "Enable Audio" checkbox. In general, it's a good idea to keep this system lean and mean and ONLY use this system for doing your programming assignments! It's best not to use it for any type of entertainment.

Leave the settings for Network the way it is. Just because your host system is using a wireless network, you should NOT setup your virtual machine to use a wireless network (since the network adapter inside a virtual machine is a "virtual" network adapter).

Click on Shared Folders on the left and you should see the following screen:

A Shared Folder allows your Ubuntu 16.04 to exchanged files with host machine. On the right edge of the screen, there's an icon of a blue folder with a green plus sign on it. Click on it and you should see the following screen:
Immediately to the right of "Folder Path", there is an empty drop-down list. You are suppose to select a directory path for the Shared Folder. On a Windows 10 or Mac OS X host, I would now create a folder on the desktop and name the folder, "Shared-ubuntu". Then I would click on the empty drop-down list and get the following screen:
Click on "Other" and navigate to the "Shared-ubuntu" folder on the desktop and select it. You should see the following screen (of course, your Folder Path should show different from mime):
Please notice that the "Folder Name" is shown to be "Shared-ubuntu". Check the Auto-mount checkbox and type "/Shared-ubuntu" in the text field next to "Mount point" (to mean that this shared folder will appear as "/Shared-ubuntu" inside your Ubuntu 16.04 system). Then click on the OK button to finish setting up the Shared Folder. Your screen should look something like the following:
Finally, click on the OK button at the bottom and you are done with setting up the virtual machine. Later, when you start using the shared folder, if something is not working, you may have to make additional adjustments if you haven't done so already.

Now you are ready to run your virtual machine for the first time.

Step 3: Run Virtual Machine For The First Time

Your screen should now look like what it was at the end of Step 1 (although slightly different since you have changed some settings).

To run the virtual machine for the first time, select the Ubuntu 16.04 virtual machine on the left click on the Start green arrow-shaped button (which is to the right of the Settings button). (On Mac OS X, if you get a popup window asking you to allow VirtualBox to change your accessibility settings, just cancel it.) A separate application window will pop up that looks like the following (it may take up to a minute or so before the screen will look like the following, so be patient):

You may get messages such as the "Auto capture keyboard" message and the "mouse pointer integration" message like in the above screenshot. To the right of each message, there is blue check mark and a white speech bubble. If you click on the blue check mark, the message box will be closed but you will get the same message over and over again in the future. If you click on the white speech bubble, the the message box will be closed and you will never get this message again. Please click on the white speech bubbles.

If you don't see the above screen, please note the problem and go here and try to match what you see with the items there and follow the steps to fix your problem. You may have to delete Ubuntu 16.04 and reinstall it from scratch if you have used a bad setting (i.e., go back to Step 1 or Step 2).

If the above window is too small, you can click on the View Menu of the virtual machine window that Ubuntu is running in and look at the very bottom of that menu and select the "virtual screen" that corresponds to your virtual machine and select a suitable scaling percentage there. Please do NOT use the "Scale Factor" in the Display setting screen in VirtualBox.

Click on the big Install Ubuntu on the right and you should see the following screen:

Please do NOT change the networking setting in the right-top corner of the window! Right now it's showing two arrows, one points up and one points down. This means that you are using a "wired Internet connection". Some people would think that since they are connected to the Internet via a wireless connection, they should change it to a wireless Internet connection. Please do not do that! You are inside a virtual machine. The Internet connection is a virtual/fake connection! Keep it that way so that your virtual machine will automatically use the Internet connection of your host machine indirectly. That's the best way!

Check the "Download updates while installing Ubuntu" checkbox and click on the Continue button. (Please do NOT check the "Install third-party software" checkbox because you should keep this virtual machine as lean and mean as possible and use it only to do your programming assignments!) You should see the following screen:

Don't change a thing and click on the Install Now button to erase the "virtual disk" inside the virtual machine and install Ubuntu 16.04 into this newly erased "virtual disk". You should see the following screen:
Since we are installing Ubuntu 16.04 into a newly erased "virtual disk", it's perfectly okay to proceed. Click on the Continue button and wait a few seconds and you should see the following screen:
If your timezone is not "Los Angeles", please click on the map where Los Angeles is and make sure that your timezone is "Los Angeles". If your timezone is not "Los Angeles", some functions may return unexpected results! So, please make sure you set the timezone correctly. Again, this virtual machine should be used only for doing your programming assignments. If you need a different timezone setting for something else, you should do that in a separate virtual machine. Set your timezone to "Los Angeles" and click on the Continue button and you should see the following screen:
Select your keyboard. The next thing to do is to click on the Continue button. If you can see the Continue button, just click on it. On some systems, you would see something that looks like the above screenshot where the window is wider than the virtual machine window. You should try dragging the window towards the left until you can see the Continue button and click on the Continue button. If dragging the window failed, you would have no choice but to do the following... Imagine the entire window looks just like the window you just used to set the timezone, i.e., at the bottom and to the right, the first button is a Back button and the 2nd button is a Continue button. Although you cannot see them, they are where they are suppose to be and you can reach them by pressing the <TAB> key on your keyboard. If you press the <TAB> key on your keyboard, you will see that different part of the window gets highlighted. Keep pressing the <TAB> key until you see the Detect Keyboard Layout button highlighted (it will get a thin orange border). Press the <TAB> key one more time and the Back button will be highlighted (even though you may not see the Back button). Press the <TAB> key one more time and the Continue button will be highlighted (again, you cannot see it). Now press the <Space> bar on your keyboard (which will have the same effect as pressing the Continue button) and you should see the following screen:

After you have clicked on the Continue button, you should see the following screen:

This is a VERY IMPORTANT screen! So, please set it up carefully or you may have to redo everything from scratch.

Enter your name in the first textbox and come up with a name for your "virtual" computer (or just keep whatever that was suggested to you). Under username, I would STRONGLY suggest that you use the "local-part" of your USC E-mail address (i.e., your USC e-mail address without the "@usc.edu") AND use the same password for your USC E-mail. This way, you will never forget what they are and this can make your life a lot easier! Please note that this password will also be your "Admin Password". Any time when you are running Ubuntu 16.04 and you are prompted for an "Admin Password", please enter this password. Again, using your USC E-mail password here would mean that you have one less password to memorize.

Click on "Log in automatically" (since this is not a real machine) and click on the Continue button. You may be in the same situation as the above where you don't see the Back and Continue buttons and you should do the same thing as above by either dragging the window towards the left until you can see all the buttons, or keep pressing the <TAB> key. After you see the "Encrypt my home folder" highlighted, press the <TAB> key twice and press the <Space> bar on your keyboard to continue.

When you continue, Ubuntu 16.04 would start to install itself into the virtual machine and this can take a long time (anywhere from 15 minutes to half an hour, depending on the speed of your machine). When installation is eventually finished, your will see the following screen:

Click on the "Restart Now" button to finish the installtion. After a few seconds, you may see the following screen:
Click anywhere inside the window (your pointer may disappear and that's perfectly fine) and press <ENTER> and the virtual machine should restart. When the virtual machine finished restarting, Ubuntu 16.04 should be running. If you get a login screen (may be because your screensaver clicked in), please enter your admin password. After you login, you should see the following screen:
If you don't have the popup window in the middle of the screen, that's perfectly fine. You will see it at a later time. The rest of what you see is the Ubuntu's Unity Desktop. Let's first talk about this particular popup window. The title of the window says, "Ubuntu 18.04.2 LTS Upgrade Available". This means that if you click on the "Yes, Upgrade Now" button, you will no longer be running Ubuntu 16.04! Therefore, it's VERY IMPORTANT that you click the Don't Upgrade button! (If you see this popup window later, you must do the same thing.) If you click on the "Yes, Upgrade Now" button, you will end up with the wrong system and you will have to delete everything and restart the entire process! For this class, the ONLY system for grading your programming assignments is a 32-bit Ubuntu 16.04 system! If you ask the grader to grade on Ubuntu 18.04, the grader must decline!

If you don't see the Ubuntu's Unity Desktop, please note the problem and go to the bottom of this web page and try to match what you see with the items there and follow the steps to fix your problem. You may have to delete Ubuntu 16.04 and reinstall it from scratch.

The panel of buttons on the left is known as the "Launcher".

  • The first button is the Desktop Search button that can be used to look for installed applications.
  • The 2nd button is for launching the File Manager.
  • The 3rd button is for launching the Firefox web browser.
  • The 4th button is for launching LibreOffice Writer (i.e., "Word for Linux"). You should remove this icon by right-click on it and select "Unlock from Launcher". (On Mac OS X, right-click is <Ctrl+Shift>-click or two-finger-click.)
  • The 5th button is for launching LibreOffice Calc (i.e., "Excel for Linux"). You should remove this icon by right-click on it and select "Unlock from Launcher".
  • The 6th button is for launching LibreOffice Impress (i.e., "PowerPoint for Linux"). You should remove this icon by right-click on it and select "Unlock from Launcher".
  • The 7th button is for launching the Software Center which is used to download and install new software. You should AVOID using this button because you may unintentionally make this system incompatible with our programming assignments and you will have to delete everything and reinstall Ubuntu 16.04 from scratch.
  • The 8th button is for launching the Amazon app. You should remove this icon by right-click on it and select "Unlock from Launcher".
  • The 9th button is for changing your system settings.
  • The 10th button is for updating and upgrading your system. This button may not appear at first. You may see this button appearing once in a while when you need to update your system. You should AVOID using this button because you may unintentionally make this system incompatible with our programming assignments and you will have to delete everything (remember to backup all your work) and reinstall Ubuntu 16.04 from scratch. If you simply want to update your system (and not upgrade it to a new version), please follow the instructions below.
  • The last button is the trash.
Since we are setting up this machine for the sole purpose of doing the programming assignments, please remove LibreOffice Writer, LibreOffice Calc, LibreOffice Impress, and Amazon from the Launcher by right-clicking on the icon and select "Unlock from Launcher". Please do NOT click on the Software Updater in the Launcher.

Step 4: Running Ubuntu 16.04 For The First Time

The first thing you should do is to disable the screen lock so that you don't have to be entering your password all the time. The reason you don't need screen lock is that you are running inside a virtual machine. If your host machnie's laptop/desktop is locked, you don't have to worry about the virtual machine inside. Please click on the Settings icon in the Launcher to setup your desktop. Your screen should look like the following:
Click on "Brightness & Lock" and you should see the following screen:
Change "5 minutes" to "Never" and click on Lock to turn screen lock off and your screen should look like the following:
Click on the orange close box in the left-top corner of the "Brightness & Lock" window to finish up "Settings".

The next thing you should do is to add the Terminal program to the Launcher. (The actual name for the Terminal program is the "gnome-terminal".) Move the pointer to the first icon in the Launcher and click on it. Then type "Terminal" and your screen should look like the following:

Click on the icon for the Terminal program to run it. Your screen should look like the following:
You should keep the Terminal icon in the Launcher so you don't have to search for it over and over again. Right-click on the Terminal icon in the Launcher and select "Lock to Launcher" (on Mac OS X, right-click is <Ctrl+Shift>-click or two-finger-click).

Step 5: Switch To Xfce/Xubuntu Desktop

The default "desktop" for Ubuntu 16.04 is the Unity desktop, which works fine on a Windows machine. On Mac OS X, for unknown reasons, the Unity desktop can be extremely slow after Guest Additions are installed! We must have the Guest Additions installed because we want to be able to copy and paste between the host system and Ubuntu, and we want to be able to have Ubuntu go full-screen or stretch to a desirable size.

The solution is to use a light-weight desktop. The lightest weight Ubuntu desktop is probably Xfce and that's the one we will use. Please launch a Terminal and type the following to bring the system up-to-date:

    sudo apt-get -y update
    sudo apt-get -y dist-upgrade
    sudo apt-get -y upgrade
This can take several minutes to update the system. When it's done, type the following to install Xfce/Xubuntu desktop:
    sudo apt-get install -y xubuntu-desktop
This can several minutes to install. When it's done, reboot the system and you should end up with the Xfec/Xubuntu deskop that looks like the following:
In the above screen, please take a look at the dark-gray toolbar right below the menubar. There is only one button on the left-hand-side. It's the Xubuntu Main Menu. It's blue and it's like the Start button in Windows. On the right, you can see a row of icons/buttons. From left to right, they are battery level, networking connectivity, the power button, calendar button, volume control, another battery level, language/keyboard, and date and time information. If this toolbar is too small, you should run your VirtualBox with higher magnification.

If for some reason you are not getting the above screen (i.e., you still get the old Unity deskop), you should click on the Power button in the top right corner and select Log Out. When you get the login screen, look for a Ubuntu icon in the top panel and click on it and it should look something like the following:

Click on Xubuntu Session, enter your password, and click on the Log In button. You should get the Xbuntu desktop shown above. If you leave it at GNOME or Ubuntu and if you are running Mac OS X, your system still may be super slow!

Step 6: Install Guest Additions

Without Gest Additions, your virtual machine window will have a maximum dimension of 800 by 600 pixels and you will not be able to perform copy and paste between your host machine and your virtual machine. Also, your shared folder will not work properly. Therefore, it's very important to have the Guest Additions installed and working.

Click on Devices on the menubar above the Xubuntu Desktop and click on "Insert Guest Additions CD Image" and your screen should look like the following:

The program need to run is VBoxLinuxAdditions.run and in the above screen, you can see that this file is in /media/william/VBox_GAs_6.0.14 (which is the "CD image directory"). Of course, instead of "william", it should be your login name and instead of "VBox_GAs_6.0.14", it should match your VirtualBox version. But there is no way to run it from this user interface! So, you need to start a Terminal. To do that, you can click on the Xubuntu Main Menu button and then click on Terminal Emulator and your screen should look like the following:
In the Terminal, type the following to install the Guest Additions (of course, you should change the directory part to your CD image directory mentioned above).
    sudo /media/*/VBox_GAs_*/VBoxLinuxAdditions.run
This can take several minutes to finish. When it's done, your screen should look like the following:
Please notice that in the above screen, the last message in the Terminal says, "Running kernel modules will not be replaced until the system is restarted". Therefore, you need to reboot your system. Please type the following into the above terminal:
    sudo usermod -aG vboxsf ${USER}
    ln -s /Shared-ubuntu ~/Shared-ubuntu
    sudo eject
    sudo sync
    sudo reboot
Please note that if you are installing from the virtual appliance, the "ln -s /Shared-ubuntu ~/Shared-ubuntu" command above may give you an error about either the file already exists or permissions error, you should just ignore the error. Also, in order for shared folder to work, Guest Additions must have been installed.

Once your system has rebooted, you should be able to maximize your VirtualBox window so it takes up the entire screen. Also, copying text from a web browser running in your host system and paste the text into an application running in Ubuntu 16.04 should also work. Try highlighting some text in a browser on your host system and press <Ctrl+c> on Windows (or <Cmd+C> on the Mac) to copy the highlighted text into the shared bidirectional clipboard and click inside a Terminal in Ubuntu 16.04 and press <Ctrl+Shift+v> to paste it into the commandline. This should save you a lot of typing and is also less error-prone!

If you want to copy and paste in the reverse direction, say to e-mail some text you see in a Terminal to someone else, you can highlight some text in a Terminal, press <Ctrl+Shift+c> to copy the highlighted text into the shared bidirectional clipboard and click on an application running in the host system (such as an e-mail app running in a web browser) and press <Ctrl+v> on Windows (or <Cmd+V> on the Mac) to paste the text into your e-mail app.

Your shared folder should also be working. To test out your shared folder, start a Terminal and type the following:

    cd
    cd Shared-ubuntu
    echo "Hello World!" > hello.txt
Then go to your host machine and click open the Shared-ubuntu folder on your desktop and see if you can open the hello.txt file in it.

Step 6: System Update

To minimize accidentally upgrading your system to something that's not Ubuntu 16.04, whenever you are offered to upgrade or update your system, just cancel or close the window. If you really want to update your system, just start a Terminal and type the following:
    sudo apt-get -y update
    sudo apt-get -y dist-upgrade
    sudo apt-get -y upgrade
To minimze typing mistakes, the best way to do this is to copy the above 3 lines of text (one line at a time) from your web browser and paste into the Terminal. When you paste text into the Terminal, the best way is to type <Ctrl+Shift+v> (i.e., hold down the <Ctrl> and the <Shift> keys on your keyboard and then press the "v" key. You will be prompted for your admin password. The first command above can take a lont time to finish if you haven't updated your system for a while! Sometimes, it takes so long that you will be prompted for your admin password again when you run the 3rd command above. If your host machine is connected to the Internet using the USC Wireless network, it is possible that your connection may not last for the entire time you are updating your system, especially if you are moving around! So, it's best that you don't move around. If you lose your Internet connection, you just have to try the above commads over and over again until you can successfully update your system.

Please note that the above 3 commands contain the word "upgrade". This particular "upgrade" is not to upgrade Ubuntu 16.04 to a different version of Ubuntu, but to "upgrade" only within current distribution. The above 3 commands is the only way you should "upgrade" the system. Please do not "upgrade" your system using any other method!

If you unintentionally upgraded your system to something that's not Ubuntu 16.04, you may make your system incompatible with our programming assignments and you will have to delete everything (remember to backup all your work) and reinstall a 32-bit Ubuntu 16.04 system.

The "apt-get" is the program for downloading and installing 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 by default. 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 admin 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.

Step 7: Install Software for Programming Assignments

You should also install all the programs that's needed to do your programming assignments now. Please enter the following commands into the Terminal:
    sudo apt-get install -y tcsh vim dos2unix tmux valgrind git gitk git-core traceroute libssl-dev
    sudo apt-get install -y wireshark
When you are installing wireshark, you will get a window asking if you want to allow "non-superuser to be able to capture packets". The press the <ENTER> key to accept the default choice.

Step 8: Reboot

To shutdown or reboot the system, please follow these steps.

Now you are all setup to use Ubuntu 16.04!

A Linux Shell program runs inside a Terminal program. By default, your Linux Shell is bash. If you want your login shell to be tcsh, you can simply type "tcsh" (assuming that you have installed it already). If you want to change your default login shell, please do the following in a Terminal:
    chsh
You will be prompted for your admin password, again. Then enter:
    /bin/tcsh
After you have rebooted your system, your terminal will be running the new login shell.

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 will 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. (As I have mentioned in Lecture 1 that USC Student Conduct Code says that you must not knowingly allow other students to cheat from you.) So, please make double sure that your code repositories related to this class are all private.

Please do NOT use github.com becuase your private repository automatically turns into a public one if you do not pay them! To start using BitBucket, please visit the relevant part of the projects page.

Some students have reported that they had trouble installing Ubuntu 16.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 the "Solutions" column 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 16.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
Ubuntu Get a "Could not get lock ..." message when trying to install software. You cannot install more than one thing at a time. You should wait until one installation is done before you install something else.

If you know that you are not installing anything else, then you should proceed to remove the lock file mentioned in the message. For example, if you message says

    Could not get lock /var/lib/dpkg/lock-frontend ...
then you should do:
    sudo rm -f /var/lib/dpkg/lock-frontend
    sudo dpkg --configure -a
    sudo apt-get install -f
Ubuntu Got cannot access/open error message when trying to access shared folder. If you have followed the install from virtual appliance instruction and when you type:
    ls /Shared-ubuntu
you get:
    ls: cannot access '/Shared-ubuntu': No such file or directory
Then type the following command to see where the shared folder is:
    df | grep Shared-ubuntu
If the printout looks like (you may see different numbers, but they are not important; what's important is the last string in the printout):
    Shared-ubuntu   12287996 8585840   3702156  70% /media/sf_Shared-ubuntu
The above is saying that your shared folder is not at "/Shared-ubuntu" but at "/media/sf_Shared-ubuntu" instead. In this case, please do:
    cd $HOME
    rm Shared-ubuntu
    ln -s /media/sf_Shared-ubuntu Shared-ubuntu
Now you should be able to access the shared folder in the "Shared-ubuntu" folder in your home directory since it now points to "/media/sf_Shared-ubuntu".
Mac OS X Fail to start virtual machine with VERR_VM_DRIVER_NOT_INSTALLED error (-1908) Maybe VirtualBox was not installed properly due to permission issues (newer Macs have much stricter permissions). Please give this a try: https://medium.com/@Aenon/mac-virtualbox-kernel-driver-error-df39e7e10cd8.

You can also try the following steps:

  1. Uninstall VirtualBox manually.
  2. Install VirtualBox using Homebrew.
  3. Uninstall VirtualBox using Homebrew (This will clean the system of any files of VirtualBox)
  4. Install using Homebrew again. You will get the option to give permission again. Don't forget to allow and restart this time.
Please also see: https://www.howtogeek.com/658047/how-to-fix-virtualboxs-%E2%80%9Ckernel-driver-not-installed-rc-1908-error/.
Mac OS X Big Sur VirtualBox will not run on Big Sur (Mac OS 11) VirtualBox 6.1.6 definitely will not work with Big Sur! You need to get the latest VirtualBox (at least VirtualBox 6.1.18) and give permissions to run it on Big Sur. Please see this web page and this other web page.
  • Uninstall VirtualBox using VirtualBox_uninstall.tool
  • Download the newest VirtualBox and install it
  • At the end of the install, go to System Preferences, Security and Privacy, and the click the allow button to authorize application from Oracle America (you may need to "unlock" the UI with admin password first)
  • Restart the machine when prompted
  • Start VirtualBox and VM
  • Take heed of the change needed in system preferences for key strokes
By the way, this assumes that you have an Intel/AMD Mac. If you have an M1 Mac, I don't think there is a way to run VirtualBox on it. If that's the case, please contact the instructor as soon as possible!

In the end, if there is no way to run Ubuntu 16.04 inside VirtualBox on Big Sur (on a Intel/AMD Mac), you can replace VirtualBox with VMware Fusion and I was told that this can work. On this web page, it says that home users can get VMware Fusion Player free for non-commercial use and you need to register. (I would recommend that you use the Chrome browser for this because the cookies settings on this website seems to be very picky.) If you click on the Register Now link, it should take you to the this registration page (you need to make sure that you authorize their cookies or you will get a blank page). The installation procedure of VMware Fusion is kind of convoluted and you might have to search for some videos to figure out how to get it installed properly. The teaching staff will try their best to help you. But in the end, it's your Mac and you need to figure out a way to get this software installed by searching for helpful information on the Internet.

Mac OS X Failed to import appliance (with result code NS_ERROR_INVALID_ARG) It's possible that the created virtual disk somehow got corrupted. You can try the following. Go to the File Menu of VirtualBox and select Virtual Media Manager. Select md32xu16047eolvm-vbox6118-f1-disk001.vdi and click on the Remove button. If the Remove button is grayed out, you need to find the directory that contains md32xu16047eolvm-vbox6118-f1-disk001.vdi and delete that directory. You should be able to find the location of the directory by selecting Preferences from the File Menu. I think this is the same as removing the md32xu16047eolvm-vbox6118-f1 virtual machine. Then you should re-import the virtual appliance again.

Also, please check and make sure that you are not running out of disk space. Ubuntu 16.04 takes up 10GB of disk space.

Mac OS X Screen goes blank soon after clicking Start in VirtualBox Maybe you didn't give enough video memory to the virtual machine. Slide the video memory slider all the way to the right and see if that would help.
Mac OS X Sublime Text is slow/sluggish Make sure you have Enable 3D Acceleration checkbox checked and set video memory to 128MB, adjust Scale Factor to 100% (in VirtualBox's Display setting), then increase font size of Sublime Text application and icon size to readable size. Do not go into fullscreen mode for your virtual machine and adjust VM window size smaller (typically, the smaller the window size, the smoother the graphics is).

If you want things to look bigger, you can click on the View Menu of the virtual machine window that Ubuntu is running in and look at the very bottom of that menu and select the "virtual screen" that corresponds to your virtual machine and select a suitable scaling percentage there.

Mac OS X Switching or moving windows is slow inside VirtualBox If you are running the Unity desktop, you should install and switch to the Xfce/Xubuntu desktop. On the Mac, it's always a good idea to slide the video memory slider all the way to the right and see if that would help.
Mac OS X Everything seems to install fine but get a message saying that installation failed. By default, Mac will not allow you to install apps downloaded from the Internet. It only allows apps from AppStore. So, try going to System preferences->Security and Privacy->General to provide permissions to VirtualBox. Please see this tech note from Apple.
Mac OS X Everything in VirtualBox looks very small You probably have a retina display. If you want things to look bigger, you can click on the View Menu of the virtual machine window that Ubuntu is running in and look at the very bottom of that menu and select the "virtual screen" that corresponds to your virtual machine and select a suitable scaling percentage there. Please do NOT use the "Scale Factor" in the Display setting screen in VirtualBox.
Mac OS X CPU usage goes to 100% when VirtualBox is running and the system become very slow and unusable You probably have audio enabled. Shutdown Ubuntu and go to the VirtualBox setup screen, click on Audio on the left and make sure the "Enable Audio" checkbox is unchecked.

If audio already is disabled and if you are running the Unity desktop, you should install and switch to the Xfce/Xubuntu desktop.

Mac OS X Ubuntu desktop goes blank when Ubuntu is running or when I maximize the virtual machine window If you are in full-screen mode, press <Cmd+F> to get out of full-screen mode and then shutdown Ubuntu. Then do the above.

The instructions above are suppose to work with VirtualBox 6.x! If it's not working, you can try uninstall everything and reinstall from scratch and follow the instructions as slowly as possible. If it still doesn't work, please contact the instructor. In the end, if nothing would fix these Mac OS X issues, the last resort is to uninstall VirtualBox 6.x (and delete Ubuntu before you uninstall VirtualBox). Then download and install VirtualBox 5.2 and then install Ubuntu into this older and hopefully more stable version of VirtualBox. The screens you see will be slightly different from above. So, you have to make some guesses as to how to proceed.

Mac OS X Cannot see "/Shared-ubuntu" in Step 7 above and copy and paste from host to Ubuntu doesn't work May be when you installed Guest Additions, there was an error. Go back to the Step 7 screen above. The last line looks something like (you may see different numbers and names):
    /dev/sr0           84534   84534         0 100% /media/SOMETHING/VBox_GAs_6.1.6
Type the following in the Terminal window to reinstall the Guest Additions (replace "SOMETHING/VBox_GAs_6.1.6" with something appropriate for your system):
    cd /media/SOMETHING/VBox_GAs_6.1.6
    sudo ./VBoxLinuxAdditions.run
If you are prompted for your admin password, just type it and press <ENTER> to proceed. If you are prompted with yes/no questions, read the questions carefully and respond appropriately (you should probably say "yes" most of the time).

When this is done, reboot your system and see if copy and paste works now and see if you can see the "/Shared-ubuntu" when you type "df" into a Terminal.

Windows 10 When I start the virtual appliance, I see a "Spectre V2" message saying "LFENCE not serializing" followed by some error messages and then it freezes. My machine has an Nvidia graphics card and some blogs I've read on the Internet says that there may be a conflict between Nvidia graphics card and VirtualBox. First, give this a way. Go to the Systems Settings screen and check the Enable I/O APIC, save the settings and restart to see if it would work.

If the above doesn't work, then your only optionn is to give VMware Workstation Player a try. After you've got it installed, when you run it for the first time, select the free license. I seem to remember that if you try to import the virtual appliance, you will get an error message saying that the file format was bad. But if you click on Retry, it will go ahead and install it anyway and that's what you should do.

By the way, I usually don't recommend VMware Workstation Player since it only runs on Windows. On the Mac, there is no VMware Workstation Player, but you can install something called VMware Fusion.

When you run Ubuntu 16.04 for the first time, you will get a popup window asking you to install VMware Tools. Make sure you click on Download/Install. If later on you cannot change the size of the Ubuntu desktop, it means that VMware Tools installation actually didn't work. A common problem is because VMware Workstation Player does not create the CD/DVD device by default. You need to shut down Ubuntu and go to Settings of the VM and add a CD/DVD device then I was able to install VMware Tools (or maybe you should check this before you launch Ubuntu 16.04). VMware Tools are kind of important because if you don't install it, all you get is a small window to work with and you cannot do copy and paste between Windows and Ubuuntu.

To setup shared folder, click on settings, then Options tab, then shared folders, enable it, then add. After starting Ubuntu, do:

    rm Shared-ubuntu
    ln -s /mnt/hgfs/Shared-ubuntu Shared-ubuntu
Someone has suggested that you may also want to try checking the "Enable I/O APIC" checkbox on this screen and click on the Processor tab and increase the number of CPUs to 2 and see if that would help.

According to this post, you can try the following and see if this works:

  • press <Ctrl><Alt><F2>
  • login as "student"
  • type the following:
        sudo apt-get update
  • type the following:
        sudo apt-get install xserver-xorg-video-intel
  • finally, reboot the system by typing:
        reboot
Windows 10 Whenever I start the Ubuntu VM, it prints a few lines of text on top of a black screen (and last line being "/dev/sda0: clean, ...") and then it freezes. Shut the VM down and try this and see if it helps. Click on the Settings button and click on System to get to this screen. Check the "Enable I/O APIC" checkbox and select the Processor tab and increase the number of CPUs to 4. Then start the VM and see if it works. After it's working, change the number of CPUs to 1 or 2 next time you reboot your VM.
Windows 10 Cannot launch VS Code, Sublime Text, or Firefox inside Ubuntu. Start a Terminal and type:
    glxinfo
If this program crashes, it may be the case that your Windows 10 graphics driver is incompatible with VirtualBox. In this case, the only solution I know of is to give up on VirtualBox and try the same fix as the above case.
Windows 10 Got a blank/black screen with a blinking cursor when running Ubuntu (or get a message saying that raw-mode in unavailable because of Hyper-V).
1)   Check to see if you are running Hyper-V (virtualization technology from Microsoft). VirtualBox is not compatible with Hyper-V. So, you should disable Hyper-V. (If you don't want to disable Hyper-V but install Ubuntu 16.04 into Hyper-V instead, you will be doing this at your own risk. Please understand that the grader must grade your programming assignments using Ubuntu 16.04 running in VirtualBox!)

Start Control Panel and search for "Turn Windows features on or off". If the Hyper-V checkbox is checked, then you are running Hyper-V. If you uncheck it, you would turn off Hyper-V and you should reboot the system and verify that Hyper-V has been turned off.

 
2)   If it turns out that you do not have Hyper-V enabled, you should try the following.

First, uncheck 3D acceleration.

Even though you are suppose to have 3D acceleration checked, but if there is a problem with the graphics device driver, you should disable 3D acceleration first, then after you are able to see things, go ahead and install Guest Additions so you get the right graphics device driver. Then you check 3D acceleration and see if it now works.

 
3)   Make sure you have virtualization enable in your BIOS (in UEFI settings). The steps for Windows 10 Home can be found here.
Windows 10 At first reboot after Guest Additions is installed, get a blank/black screen If your Graphics Controller is "VMSVGA", you can go to the Display settings and change it to "VBoxSVGA" or "VBoxVGA" and see if it would make any difference.
Windows 10 Cannot see the button I need to click during installation During installation of the keyboard, the window you see may be too narrow that you cannot see the "Continue" button. When you can do is to press the <TAB> key on your keyboard and you should see that different part of the window got highlighted. Keep tabbing until you see the "Detect Keyboard Layout" button become highlighted. If you tab two more times, the "Continue" button will become highlighted (even though you may not see it because it's off to the right of the window). Just press the <ENTER> key and it would be the same as clicking the "Continue" button.

The screen after this screen has the same problem and you should do the same thing. After you have entered your information, keep pressing the <TAB> key until you see the "Back" button is highlighted (you won't see "Back", but you should check the image above to know where the "Back" button is. Once you are there, if you press the <TAB> key one more time and press the <ENTER> key, it would have the same effect as click the "Continue" button.

Windows 10 Wifi stopped working in Windows 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.
Windows 10 Get "cannot switch monitor configuration" message If you get this popup message box after you installed Guest Additions and you have a high resolution graphics display, it may be that the default video memory was not enough. Try shutdown Ubuntu and increasing Video Memory to something like 128 MB and see if that helps.
Windows 10 VirtualBox fails to start with VERR_NEM_VM_CREATE_FAILED error message Please see this web page for instructions to turn off Hyper-V and Windows Sandbox. Another solution, as proposed by a student, is to launch the "Run" app and enter the following command: "bcdedit /set hypervisorlaunchtype off".