Course computer environment

In our assignments you will come across a large number of tools. Some of these, you will only use in this course and for those we would like you to spend as little time as possible with setups and configurations of these tools and instead focus on using the tools.  In our assignments we will therefore assume that you are using a Linux Ubuntu 18.04 environment in cases where installation of external software is necessary and this installation is platform dependent. The idea is that we limit the work for both you and us. If you are an experienced computer user, you probably know how to adapt the guidelines we provide to work on your own platform. If not, we suggest that you ensure that you have access to an Ubuntu 18.04 environment.

There is a plethora of tools a few clicks away. Linux is a the platform of choice for many of these tools in the area AI, Autonomous Systems and Software. This is especially true when you get to the lower levels and closer to the implementation of systems. We see it as one of the objectives of the course that all students have at least some basic experience with Linux, as most of you are likely to come across it in your careers sooner or later.  

If your computer is not already running Ubuntu 18.04 and would like to you could, for example,

  • Make use of a Virtual Machine with Linux installed (see instructions below)
  • Install Linux alongside your other operating system to create a dual/multi boot system of your computer (only if you really know what you do).
  • Find another computer that you can play with and install Linux from scratch there.

 

The following sections give some more details for how to install Linux. Skip to the section "Test you Linux machine" when you have installed Linux.

Respect company policies for installing software on certain computers.

 

Native Ubuntu 18.04 installation

This page describes our Linux Ubuntu 18.04 setup if you want to set it up on your own. If you follow it you will have the same setup as we use.

 

Virtual Machine

We have prepared a VirtualBox virtual machine that allows you to run Ubuntu 18.04 inside Windows, Mac or Linux. This is a great way to get access to Linux and it allows you to experiment with things in a very safe environment where you can try lots of stuff and cannot really break anything. Worst thing you just install the virtual machine again and you are back to the same state again. This makes a virtual machine very handy when doing certain type of development work.

The major downside is that you need to assign a certain part of your actual hardware resources to the machine which means that your host computer will suffer and the virtual machine will never be able to use all resources of the host because that would make it not work anymore. So, resources are not used to the max. This means that some more demanding tasks may not really run in the virtual machine, this is especially true if you do not have a very powerful machine.

  1. Ensure that you have a 64-bit OS installed and that that you have more than 4GB of RAM and at least a dual-core processor.
  2. Download VirtualBox Links to an external site.. We used version 6.1.0.
  3. Install VirtualBox
    1. If you use a Mac you might want to look at this Link Links to an external site. if you have problems.
  4. Install the VirtualBox extension package for your OS. You find the file to install at the end of the list of files to download on the download page above.
  5. Download the WASP VM image from box.com Links to an external site.. The image file is called WASP_AS_1804_F35.ova and is about 5GB big, in compressed form. When it is expanded it it will consume almost 35G. If you have problems hosting such a large virtual machine on your computers hard drive, you could put it on an external drive instead.
  6. Open VirtualBox and choose "Import Appliance" from the File menu (see details here)
  7. Start the WASP virtual machine by selecting the newly imported virtual machine and clicking the green arrow marked Start.
    1. If the virtual machine starts in Full screen mode you will get a message about this ("Cancel" to not use full screen and "Switch" to use full screen mode) when you start the machine.
  8. If all goes well you should see a login prompt for the user wasp (password "wasp", i.e same as login). 
  9. Log in and make sure that the machine starts up. 
  10. Make sure that the wasp user is part of the vboxsf group (to be able to write to shared folders). Open a terminal (the Terminal application in the left menu (black icon)) and execute
    sudo adduser wasp vboxsf
    Log out and in (there a hidden menu in the upper right corner, the down arrowhead)
  11. Move the mouse to the top of the desktop to the Virtual VM menu. Select item Devices and "Insert Guest Additions CD image..."
    VM WASP-AS 1804 guest.png
    Press Run. This will open up a window and the guest additions are installed. You probably need to press ENTER to close the window.
  12. Reboot and ensure that you can copy and paste both to and from the VM and the host computer. Ensure that bidirectional is selected under Devices (where you found the entry to insert Guest Additions CD). 

The virtual machine is setup to emulate one processor. Performance is likely going to be much better if you give it at least one more. Go into Settings before starting your virtual machine and select the "System" tab and Processors as the image below shows. If you have plenty of RAM on your machine you might want to increase the amount of RAM that you assign your virtual machine as well. This is done under the  "Motherboard" tab. You might also want to play around with 2D and 3D acceleration if you want to speed things up.

You probably want to set up a Shared Folder between your host and guest OS. When you have booted into the VirtualMachine, move the mouse to the top of the desktop to activate the VirtualBox VM menu. Select Devices menu item and Shared Folders and Shared Folders Settings... Click the add folder icon to the right and specify a folder on your host (the machine running the virtual machine) that you want to share with your virtual machine. Check the box Auto-mount. Click OK and then reboot your virtual machine. You should find the shared folder mounted in Ubuntu under /media/sf_Shared (in the case shown in the image below where the shared Folder Name in our WASP Ubuntu system was named Shared).

VM shared folder.png

 

Troubleshooting

If the virtual machine is not behaving well there are a few things that you can try

  • If you have an external monitor connected, try to remove that
  • If the virtual machine locks the screen you need to "drag" from the bottom of the screen up towards the top to get to the page where you enter your password to login.

 

Testing your Linux machine

If you are completely new to Linux you might want to take a look at the following page first.

You probably also wants to take a look at this page for some Linux good to know things

If you are using a Mac you might also want to take a peak at Linux Mac

Boot your Linux machine and log in with password "wasp" (which you should change immediately as shown below) or with the password you picked in the installation.

 

Terminal

Open the terminator terminal program. If you have a full WASP Ubuntu 18.04 installation you should be abe to click on the red/black icon under the Settings icon on the left hand side taskbar. Test the following commands

ls
ls -l
ls -a
less SOME_FILE
more SOME_FILE
cd SOME_RELATIVE_PATH
cd SOME_ABSOLUTE_PATH
cd
top
ps auxww
locate *.png

and make sure you understand what they do. For "top" you press the key q to exit. For "locate" to work you might need to first execute

sudo updatedb

sudo is a command used to perform another command as superuser, i.e., with higher privileges. You will be promoted for your password again. This will update the database of where files are stored. 

Open a web browser and make sure that you can copy text in both directions between the browser and the terminal. Remember the browser requires you to press ctrl+c/v for copy/paste and the terminal wants shift+ctrl+c/v for the same effect. 

 

Change your password

One of the first things you want to do is to change your password so that logging in to your computer is not so easy. Remember that it is not only what is on your computer that is at risk. Getting into your computer means someone has gained access into your network as well.

Open a terminal and type (followed by ENTER)

passwd

This will prompt you for a password and ask you to repeat it. The password has to fulfill some minimum safety requirements. "wasp" clearly does not cut it for example.

 

Text editor

We have installed a few different text editors for you. Use the terminal window to try the following and see if one of them suits you

  • gedit
  • subl
  • xemacs
  • gvim 

The latter three of them can be set up to do various degrees of spell checking, code completion, etc.

If you want, you can have a look in the Ubuntu Software folder, the orange icon to the left, for alternative applications to install. 

Octave ("Matlab")

There is Matlab for Linux and if you have access to it to install it that is great but you can do many of the things also in the open source version called Octave. You should be able to figure out how to start it by now. If you not, go back up and make sure you actually understood what you did.

Play around with octave for a bit. If you have used matlab before you should see that it behaves quite similar. The graphics is not so fancy and all the toolboxes that you probably have access to under Matlab are not there.

If you have not used octave before try the following

x=1:10
y = rand(1,10)
plot(x,y)
plot(x,y,'.')
plot(x,y,x,y,'.')

 

Screenshot

Now make a screenshot: Click on the Ubuntu icon in the top left corner. This brings up a search window where you can type parts of program names and the system will look for them. Type screenshot and click the icon. Note that when you order the program to take the screenshot you will be prompted to give the file a name. The file will end up on the Pictures directory which you find in the home directory.

You can navigate there graphically by clicking the icon that looks like a file drawer under the Ubuntu icon in the top left corner. This will start the file handler / explorer / finder program.

Save a screenshot of your entire desktop and be ready to upload it in the Quiz belonging to this material.

 

Image editing

Navigate to the screenshot you just took. Right-click on the file and select Open with "Gimp image editor". Select the "selection rectangle in gimp's Toolbox window and mark a section of the image. Go to the Image menu in the top left corner (will only appear when you move the mouse there) and then select "crop to selection". Then go into the File menu and select "Export as" and export the file as a png file with a name you find good for what you cropped out. Exit Gimp.

 

Video format editing

Start the program handbrake.

Click the Source button and find the video file you created in the previous step. Click the Start button and you will have converted your file which was in webm format to m4v. You have a large number of presets available in the Presets List in the upper right corner if you want to use some other fileformat. Exit handbrake.

 

Screen capture video

Sometimes it is good to be able to capture what goes on on the screen. Run the program vokoscreen. Make a screen capture of you opening the text editor of you choice and then closing it again. Produce an m4v file from it and be ready to upload it in the Quiz belonging to this material. Exit vokoscreen.

 

Camera input

  • Run the program "cheese" (Cheese Webcam Booth)
    • To start it
      • Open terminal and type cheese and ENTER, or
      • Click the ubuntu icon in the top left corner and search for cheese and then click the cheese icon
    • If you have more than one camera connected you select which one to use under Preferences (upper left corner in the menu bar (not visible until you move the mouse there)
    • If you run this in a VM you need to make sure that the Virtual machine has access to the camera. You do this via the "Devices" menu and the item "Webcams" and then select the camera from the host that you want to have access in the virtual machine.