p1-insta485-static

Operating System Tutorial

This document will guide you through setting up your computer for local development on OSX, Linux, and Windows 10.

OSX

If you run OSX, install the Homebrew package manager. Then, use Homebrew to install a few packages like Python3 and a Java interpreter.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
$ brew install python3 git tree wget
$ brew cask install java

Then, create a folder.

Linux

These instructions work for Debian-based systems like Ubuntu.

$ sudo apt-get update
$ sudo apt-get install python3-venv python3-wheel python3-setuptools git tree
$ sudo apt-get install default-jre

Then, create a folder.

Windows

On Windows, we will use the Windows 10 Subsystem for Linux version 2 (WSL 2). The Windows Subsytem for Linux runs native Linux command-line tools in a virtual machine. You will need to update to Windows 10 version 1903, Build 18362.1049 or higher in order to use WSL 2. Instructions for how to check your Windows version are here.

Some of the software you’ll use later requires WSL 2 (not WSL 1) to work correctly, for example end-to-end testing of a client-side dynamic pages app using a headless browser.

Follow the instructions from Microsoft to install WSL 2. If you have not set up WSL before, follow all instructions and choose the latest version of Ubuntu for your Linux distribution. If you already have an older version of Ubuntu installed, follow all instructions until the “Install your Linux distribution of choice” section and go to the “Set your distribution version to WSL 1 or WSL 2” section instead.

Start a Windows PowerShell. Verify that you are using WSL 2.

$ wsl -l -v
  NAME                   STATE           VERSION
*  Ubuntu-20.04           Running         2

If you cannot update to WSL 2 and you have confirmed your Windows Version is correct, try downloading the WSL 2 Linux Kernel and updating it manually. You can find instructions from Microsoft here.

Start a Bash shell (not a Windows PowerShell). You can now use Ubuntu Linux tools, including the apt-get package manager.

$ sudo apt-get update
$ sudo apt-get install python3-venv python3-wheel python3-setuptools git tree
$ sudo apt-get install default-jre

Optionally install your favorite editor and make it the default for this login session by setting the $EDITOR environment variable. Vim should be installed already.

$ sudo apt-get install emacs-nox
$ export EDITOR=emacs

Configure WSL to support Linux file permissions. Note that sudoedit uses the default editor specified by the $EDITOR environment variable.

$ sudo touch /etc/wsl.conf # create wsl.conf if it does not exist
$ sudoedit /etc/wsl.conf

Add the following to the config file.

[automount]
enabled = true
options = "metadata"
mountFsTab = false

Restart your computer and verify that metadata appears in the mount options for /mnt/c/.

$ mount -l
...
C:\ on /mnt/c type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=1000;gid=1000;metadata;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)
...

Then, create a folder.

Create a folder

Decide where to store your EECS 485 projects. For reference, here are some common locations. You might want to use your Desktop or Documents.

System Desktop Documents
macOS /Users/awdeorio/Desktop/ /Users/awdeorio/Documents/
Windows/WSL /mnt/c/Users/awdeorio/Desktop/ /mnt/c/Users/awdeorio/Documents/
Linux /home/awdeorio/Desktop/ /home/awdeorio/Documents/

Navigate to a directory where you will store your EECS 485 projects. (awdeorio likes to use a directory called src in his home directory.)

$ cd /Users/awdeorio/src/

WARNING Do not use file or directory names containing spaces. Spaces causes problems with some local tool installations.

List what’s in this directory. It looks like awdeorio has some old files from EECS 280 laying around.

$ ls
eecs280

Create a directory.

$ mkdir eecs485
$ ls
eecs280  eecs485

Change directory and create another directory for this project.

$ cd eecs485
$ mkdir p1-insta485-static
$ cd p1-insta485-static
$ pwd
/Users/awdeorio/src/eecs485/p1-insta485-static