CS3841
VM Setup
**If you are feeling very adventerous**, you can choose to create your own VM image. This will take significantly longer than using the provided image, and you may find that you have to fix things on your own that the instructors have already set up on the default iamge. But you will also have the satisfaction of setting up your own Debian machine for software development. Here are my notes on how I created my own virtual machine to complete Lab 1: * Download debian-9.5.0-i386-netinst.iso (or a similar) * https://www.debian.org/CD/netinst/ * The network install can reduce your total download size by only downloading the packages you need * In virtualbox, create a new Linux virtual machine * Select the .iso image as the optical drive / cd drive contents * Start the virtual machine. * Go through the default install procedure. * This takes some time and requires babysitting! * Name your machine cs3841-foggp, replacing foggp with your own username. * Choose a reasonably secure password * If you don't choose a specific desktop environment, it will choose one for you. * Use your MSOE username for your username * I used ```cs3841``` as the username and ```student``` as the password. * Enable guest additions within your guest OS. This enables useful things like copy-paste between the VM and the OS and mouse integration. * Short route: (Haven't tested this recently) * In the virtual machine window, click on Install Guest Additions... from the Devices menu, then run ```sudo mount /media/cdrom.``` * ```cd /meda/cdrom; sudo runasroot.sh``` * Long route: (Following: https://virtualboxes.org/doc/installing-guest-additions-on-debian/) * Run ```sudo apt-get update``` to update the database * Run ```sudo apt-get upgrade``` to get latest version of the packages on your system * Run ```sudo apt-get install build-essential module-assistant``` to download the packages needed by the script * Run ```sudo m-a prepare``` to enable kernel modification * In the virtual machine window, click on Install Guest Additions... from the Devices menu, then run ```sudo mount /media/cdrom.``` * Run ```sudo sh /media/cdrom/VBoxLinuxAdditions.run``` * Set up the shared folder * Set the shared folder to point to ```C:\lwshare``` * Add the user cs3841 to the vboxsf group: ```sudo usermod -a -G vboxsf cs3841``` * Reboot the virtual machine ## Setting up your development environment ### Eclipse and Git **We provide a virtual machine image that is already configured with Eclipse and Git for you**. However, you may still want to set up ssh keys, as in the next section * Install Eclipse * Run ```sudo apt-get install eclipse``` to install the Eclipse IDE. * Run ```sudo apt-get install eclipse-cdt``` to install the C/C++ development environment within Eclipse * If you install Eclipse a different way, be sure to also install the packages ```gcc-c++``` and ```gdb``` with ```apt-get```. * Install Git * Run ```sudo apt-get install git``` to install this version control system * Run ```sudo apt-get install git-gui``` to install the graphical version of git. ### Git SSH Keys for Automatic Login Follow these instructions if you do not want to type your username and password every time you push to git. * Make a public/private key pair (following https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html) * Create the key by running the command ```ssh-keygen``` * Accept the default location by pressing enter. * Specify no password by pressing enter again twice. * Copy the key. * Print it to the command prompt with ```cat ~/.ssh/id_rsa.pub``` * Then copy it by selecting it, right-clicking, and selecting copy (Control-C means something different in a command prompt -- it means "kill the current program") * Go to your user account settings at github.com, go to the section "SSH and GPG keys," create a new key, and paste the public key into it. Give it a name like "CS3841 VM" * Now, github will automatically offer you the ssh-based git pull command. * If you have not cloned the project yet, go to the project page, select "Clone" and "Use SSH" if it is not already showing the SSH URL:
![Clone or download](vmsetup_res/clone.png)
Copy the SSH URL:
![git@github.com:msoe-schilling/...](vmsetup_res/clone2.png) * If you already pulled it with https, get the new url and reset the url with a command something like ```git remote set-url origin git@github.com:username/repositoryname.git``` * (Following https://confluence.atlassian.com/bitbucket/change-the-remote-url-to-your-repository-794212774.html)