Link Search Menu Expand Document

Installing Debian

We will be using Debian version: 10.5.0. You can download it from link1. If the previous link does not work you can try link2. Note than only one of the links will work at a time. Never both. If you attempt to start your VM you will get a prompt asking for a startup disk. Click the little folder icon and select the .iso file you downloaded form one of the previous links, then click start.

If we don't tell you to change something, or you are not sure, you can usually go with the defaults. Even if the defaults are empty / blank
If you have Hyper-V enabled you need to disable it, otherwise you will run into issues when trying to use VirtualBox. If you create your vm and then you see a green turtle in the bottom right of the VirtualBox window, it means there is some form of Hyper-V running on your system. The bar with the turtle icon looks like this: In order to fix this you have to:
  1. From the Start menu type: features and select Turn Windows features on or off
  2. Disable any of the following that are enabled:
    • Hyper-V and any of it's subkeys
    • Virtual Machine Platform
    • Windows Hypervisor Platform

When installing Debian within the VM, you can use either the normal install or graphical install options – either is fine. You must be sure to use the 64-bit installation, however (which will be the case if you downloaded the iso from the link in the last paragraph).

The installer will ask you about two passwords. The first one is the root (i.e. admin) password, and the second one is your user account password. Those 2 can be the same or different, that’s up to you. Just remember them, as we cannot magically know your password for you to fix it.

When you get to the portion about partitioning, you should select the guided partition option and the option to create one large partition on the disk (having a small swap partition is fine as well). Finally, when installing packages later in the installation, be sure to select at least one graphical environment from the list if you want a GUI. I personally suggest using Cinnamon or MATE, as they are both relatively lightweight and will ensure you have ample space to work with later on your virtual hard drive. In that same step, you should also unselect the print server option and select the SSH server option.

Finally, late in the installation, the installer may ask you where to install the boot loader. Be sure to select to install it on the VM's hard drive (/dev/sda).

Select to install the boot loader here:

Select to VM's hard drive here (/dev/sda) here:

For advanced users only: It is possible to do all of the assignments for this class without installing a GUI in your VM, however some of the setup can be a little bit wonky (like getting your SSH key added to your GitHub account). If you wish to do this, then during the installation unselect the "Debian desktop environment" during setup and do not install any of the UI options after it (still make sure to enable the "SSH server" option, though). Later, in the instructions when installing packages, leave out the qt5-default, qtcreator, and gedit packages. Finally, when building the kernel later on, use make menuconfig instead of make xconfig. As mentioned, when doing the SSH key addition to your GitHub account, you will need to find another way to import it, as you will not be able to copy/paste in the terminal. I find it easiest to use scp/sftp to copy it off of the VM to a place easier to access. If you are not comfortable with the Linux terminal, I highly suggest that you just install a GUI environment and ignore this paragraph entirely.

Creating an SSH key

In order to work on repositories hosted on GitHub, you will need to have an ssh key set up on your VM and registered on your GitHub account. To do so, run the following command in a terminal in your VM (replacing the yourumbcemail part as appropriate):

ssh-keygen -t rsa -b 4096 -C "yourumbcemail@umbc.edu"

Make sure to leave the filepath as default (/home/username/.ssh/id_rsa) when prompted!
For security purposes you should provide a passphrase for the key when asked. It can be anything, just make sure you do not forget it. You will need the passphrase anytime you access any git resources from the command line for example.

Now that you've created your key, you must associate that key with your GitHub account. To do so, open up the web browser (it may be either Iceweasel or Firefox, depending on what options you installed at setup time) inside your VM, and go to github.com. Upon logging in with your GitHub credentials, visit the SSH settings section of your GitHub user settings. Use the "New SSH key" option, give the key a title ("421 VM Key" works nicely, if you can't think of anything better), and then run the following command in a terminal and carefully copy/paste the output into the Key box on the page, and hit the Add SSH key button.

cat ~/.ssh/id_rsa.pub

If you run into issues using your SSH key after adding it to your GitHub account properly, you may need to add it to the SSH agent. Follow the instructions on this GitHub documentation page to do so.

Obtaining root privileges

If you left the root password empty, you can skip this section as sudo will be configured for your user account already.

There are quite a few commands that require root privileges. This means that such a command must be executed as a superuser, or admin. Such a user is the root user. Please do not confuse this with the root of a directory. When the instruction say to run AS root, it means you need to put sudo in front of it. When the instructions mention FROM they mean you have to navigate to whatever the root of the directory refers to before executing them.

To be able to use sudo, you need to do the following:

  1. su - do not miss the "-" there. You will need to enter the root password you setup during installation.
  2. apt-get update
  3. apt-get upgrade
  4. apt-get dist-upgrade
  5. apt-get install sudo
  6. usermod -aG sudo YouVMUsername make sure you spell your vm username correctly
  7. reboot

Now you can prefix a command with sudo to execute it as root. So for example: sudo apt-get update