Prerequisites

Thanks to generous support from Google, each of you will receive $50 of Google Cloud credits to use for this course. You will receive an email from the instructor by the end of the second week with instructions on how to request a Google Cloud Platform coupon. Once you have redeemed the coupon, you are ready to create your VM.

Note that if you haven’t tried Google Cloud before, you will get a $300/60-day credit for signing up. In that case, you might consider using your $300 sign-up credit first before your course coupon.

Creating a VM

  1. Head to the Google Cloud Platform Console, authenticate yourself, and create a “project” if you haven’t already.
  2. Click on the top-left corner menu button, and select “Compute Engine” (or go there directly). Click “Create an instance”.
    1. For machine type, even micro (the cheapest option) will probably do for this course, but feel free to explore more expensive options should the need arise for your course project.
    2. For book disk, select Ubuntu 14.04 LTS, and a minimum of 20GB standard persistent disk.
    3. For firewall, you can allow HTTP/HTTPS traffic, which may be useful for your course project.

    The other options can be left at default for now.

  3. Once the VM has been created, you will see it listed as one of your “VM instances”. When it is running, you will see an “SSH” option at the end of the line. Click on that to connect, and you will be inside a shell of your VM. Follow the instructions for Help/Readying VM for the Course.
  4. You now need to reboot your VM. Exit from from your VM shell (using the exit command), go back to the compute engine console, select your running VM, stop it and then start it using the buttons on top of the page.

Managing VMs

You can stop, start, and SSH into your VM all conveniently from the Compute Engine Console. Make a habit of stopping your VM when not in use, because it will cost you credits!

Note that you can click on the “SSH” button multiple times to get multiple shells for multitasking.

When your VM is running, you will see an external IP address assigned to it, which you can use to access a website running on your VM, for example.

You can also delete your VM, but you will lose everything in your VM. Do NOT use this command unless you really want to get rid of the VM and all its data (e.g., when you finish this course).

File Access

When working on your VM, remember that it is a machine separate from your own computer, with its own file system and disk. If want to transfer files between your computer and your VM, follow these instructions. You might also want to check out other options for connecting to your VM.

Network Access

If you had followed the above instructions to create your VM, you should be able to login remotely via ssh and access any website hosted on your VM on its port 80. Access to other network ports on your VM, however, is generally blocked by default. If you want to open up access to a particular port (say 1234), follow these instructions:

  • Go to the compute engine console and click on your VM’s name. You should see a list of information about your VM. Click on the “default” link under “Network.”
  • Under the “Network details” page, find the section on “Firewall rules,” and click on “Add firewall rule.”
  • Under the “Create a firewall rule” page:
    • Under “Name,” enter a short, meaningful name to help you remember what this rule is for.
    • Under “Source IP ranges,” enter 0.0.0.0/0.
    • Under “Allowed protocols and ports,” enter tcp:1234 (replace 1234 with the particular port number you want access to).
    • Other settings can be left at their default values.
    • Click “Create.”
  • You may need to stop and then restart your VM in order for the changes to take effect.