Configure AWS instance for Udacity Self-Driving Car Engineer Nanodegree step by step.
This repository is original from ec2-setup.
List of 4 scripts to prepare a stock Ubuntu AMI on AWS to act as a remote workstation, including 3D acceleration (when used with a GPU instance).
The scripts (located under scripts/
) take care of installing Lubuntu, TurboVNC, VirtualGL, Nvidia drivers, Docker and nvidia-docker plugin to expose the graphics hardware to Docker containers and enable the execution of 3D accelerated apps inside them.
This tutorial is prepared for the final project in term 3 of Udacity Self-Driving Engineering Nanodegree. In this tutorial,
you will learn how to setup a AWS EC2 instance from existing AMI and install the Lubuntu desktop.(https://lubuntu.net/)
Then you will use TigerVNC viewer to connect to the Lubuntu desktop from Windows 7 or 10.
Step1: Run the 1_install.sh
script.
$ source 1_install.sh
The machine will reboot at the end of the process. You'll have to wait a bit and then reconnect to it.
Step2: Run the 2_install-nvidia-drivers-g2.sh
script.
$ source 2_install-nvidia-drivers-g2.sh
This script is written for a G2 instance.
An interactive installer will run, during which you'll have to accept the license and ignore the warnings.
The machine will again reboot at the end of the process.
Step3: Run the 3_install-docker.sh
script.
$ source 3_install-docker.sh
This will install and configure Docker CE and the nvidia-docker plugin.
Step4: Run the 4_startup.sh script.
$ source 4_startup.sh
This will ask you for password at the first time.
Step5: Replace the xstartup.turbovnc
file in /home/ubuntu/.vnc/xstartup
This will launch the default ubuntu 16.04 desktio environment .
To check that the hardware is correctly set up, run:
$ nvidia-smi
To check that GPUs are correctly exposed to Docker containers (it should have the same output as the previous command), run:
$ nvidia-docker run --rm nvidia/cuda:8.0-devel nvidia-smi
Note: The nvidia/cuda
image is relatively big, so you can either choose to remove it afterwards if you don't plan on using it, or to simply test with the Docker image you'll be using later.
I've tested the scripts with a basic Ubuntu 16.04 image on a G2 instance.
Now you can just run the startup.sh
script to initiate the X server and launch VNC on PORT 5901
(the first time, it will ask you to create a password for the VNC server).
If you reboot your instance, or if you decide to save a snapshot of your instance and use it as an
image for future instances, then all you need is to run startup.sh
once the instance is up.
When connecting, I prefer to only open PORT 22
on the instance, and create an SSH tunnel for VNC
like so:
$ ssh -i permission_file.pem -L 5901:localhost:5901 ubuntu@ip_address
Then I can use a VNC client to connect to localhost:5901
.
You can also open PORT 5901
on your instance and directly connect to it, but the connection won't
be encrypted...
Make sure to use a VNC client that supports VirtualGL (TigerVNC, TurboVNC, ...). Once you're in, you'll have a full Lubuntu desktop with hardware acceleration!
If you wish to view your desktop in the browser, you need to uncomment the final line in the startup.sh
script to run a noVNC server and then create an SSH tunnel for PORT 6080
:
$ ssh -i permission_file.pem -L 6080:localhost:6080 ubuntu@ip_address
You can access your desktop in the browser at localhost:6080/vnc.html
.
To take advantage of VirtualGL, launch your 3D applications prepended by vglrun
. For example:
$ vglrun firefox
And visit http://webglreport.com/ to check that you're effectively using the Nvidia hardware :-)
You could save more money by using spot instance and attaching an external volume where you can save your work.
- ec2-setup: Original repository.
- Remote server setup for VNC: TurboVNC and VirtualGL installation.
- Linux Accelerated Computing Instances: Nvidia drivers installation.
- Using Docker to Set Up a Deep Learning Environment on AWS: Nvidia-docker installation.
- HW accelerated GUI apps on Docker: Using Docker and VirtualGL for 3D applications.
- noVNC GitHub page: noVNC installation and usage.
- What does “sudo apt-get update” do?
- Will apt-get dist-upgrade upgrade my system to newer version? [duplicate]
- What is “dist-upgrade” and why does it upgrade more than “upgrade”?
- How To Set Up GUI On Amazon EC2 Ubuntu server.Ubuntu desktop and connect to it from Windows.
- Which Official Ubuntu Flavor Is Best for You?
- How do you run Ubuntu Server with a GUI?
- Ubuntu flavours
- LXDE
- Installing Lubuntu over ubuntu and keep all data [closed]
- Lubuntu
- Completely Remove LXDE/Lubuntu Desktop Environment
- RealVNC
- How to install Lubuntu Desktop Environment and ONLY the desktop environment?