Installing xubuntu in a virtual box from scratch

We will install a lightweight version of the Linux operating system called Xubuntu on your laptops. We will install the operating system within a VirtualBox, which behaves like a completely separate computer on your machine. The advantage of using a VirtualBox is that you can have the Linux operating system running in a window on your Windows machine and switch between Windows and Linux with the mouse. If you are interested in the different ways of running Linux under Windows then you can read more here:

The benefit of having Linux on your Windows machine is that it gives you access to a wide range of Bioinformatics software that is not available for Windows. However, software does tend to run more slowly within a virtual machine so if you want to do any intensive work on Linux then you may need a dedicated machine. The virtual machine will enable you to learn all the basics of linux and run the exercises in this training course. There are several versions of linux available. We are providing Xubuntu which is a lightweight version of Ubuntu which works well within a virtual machine and should not take up too much space on your computer. It is also one of the most widely used versions of Linux for PCs and therefore has plenty of online support. HoweverBiolinux is a version of Ubuntu which comes bundled with over 250 Bioinformatics software packages that you might like to try if you want to explore Linux further

I have provided VirtualBox and Xubuntu for 64bit Windows machines in the course software. If you have a 32bit machine you will need to download the software yourself. Google “Download VirtualBox” to find it.

I obtained VirtualBox for Windows from

Copy the VirtualBox and Xubuntu software from the course software folder to your PC.

Double click the VirtualBox and follow the instructions. You can accept the defaults for all options.

If you are having trouble there are sets of instructions here:

or here:

Once you have installed VirtualBox you will need to Create a new Virtual machine (VM)

Click the Blue sun symbol which says “New”.

In the first dialogue set

Name: xubuntu

Type: Linux (from the drop down list)

Version: Ubuntu (64 bit) (from the drop down list)

Click Next and then set the amount of Memory to 2Gb provided you have at least 4Gb on your machine. If not leave it at 1Gb

Accept all defaults except for the amount of disk space. This will depend on how much you have available but 20Gb would be useful. 10Gb is a minimum.

You can increase the amount of memory available and the disk space depending on how much is available on your machine. The guidance notes above are also relevant here.

Once you have created the new VM you need to install the xubuntu disk image that we provide

I obtained xubuntu from:

Double Click the icon for xubuntu in the left panel of Virtualbox or select it and click Start. You will be asked for the location of the installation disk, click on the file icon at bottom right and navigate to the Xubuntuiso file that you have downloaded to your computer and then follow the instructions using the default settings.

You want to Install Xubuntu, not try it

Check the boxes for installing updates and third party software

Accept the default Installation type. Do not check boxes for encryption or LVM. Do not worry when it says it will delete all files. It means all files within the virtual machine that you have just created, since there are not any yet this is not a problem. It will not delete files from your windows system.

You will need to set an administrator password. Do not forget the password you use, you will be stuck without it.

There will be some longish pauses while things happen but eventually you will be asked to click a button to restart the computer. This will restart xubuntu, not windows. This can be very slow the first time. (15mins?)

Once you have restarted Ubuntu you should create a shared folder for all your course work. If you do not already have a folder for the course work on your windows machine create one now.

To access the folder that is shared between linux and windows you need to install more software:

On the Xubuntu window:

Now we need to install some additional software from to make the folder visible

Devices->Insert Guest Additions CD image

Most work in Linux is done from a terminal window. To continue open a terminal window using Alt-F1 or right click on desktop and select “Open Terminal Here”

Remember that linux is case sensitive so you must use capitals and lower case exactly as shown in these commands. Also Linux does not handle spaces in file names very well so it is best to avoid them. However if you have to have them then you will need to put a “\” before each space. Eg “Course Folder” would have to be entered as “Course\ Folder”. So in this case it would be preferable to call the folder “CourseFolder”.

Commands to type (or copy and paste) into the terminal are shown in Courier font

If you have to change a name for your system it will be shown initalics

Change directory (cd) to the folder where software has been copied

cd /media/VBOXADDITIONS_5.1.14_112924

Install the software. sudo means do as super user or administrator and allows you to install software. It will ask for your password.

sudo ./autorun.sh

Now we have the necessary software you can slect the folder to link to

Devices->Shared Folders->Shared Folder Settings

Click on the “Plus Sign On a Folder” image on the left of the window to create a new shared folder. Click on the drop down box for folder path and navigate to your course folder and select it.

Check the Make-permanent and Auto-Mount boxes.

OK

Go to your Documents folder. “~/” means your “home directory” where you should keep all your files.

cd ~/Documents

mkdir windows

windows is an arbitrary name for the mountpoint where the shared folder will be located. Now we can mount (attach) the folder

sudo mount –t vboxsfSharedFileNamewindows

To check if this has worked list the contents of the “windows” folder:

ls windows

You should get a list of all the files in your course folder on the windows machine

Install fastStructure workflow

We will use “lizards-are-awesome” which provides a very simple set of commands for generating a Plink file from DartSeq output and then a simple set of commands for running fastStructure

Installing Docker

Docker is a a system for distributing complex pipelines for example on the cloud. For example Docker packges are being developed in Cape Town for the H3Africa genetics project. We will be using it to run a pipeline that takes DartSeq data converts it to plink format and then runs fastStructureto generate a Structure plot.

We are going to follow the instructions for installing Docker at

I have bundled all these commands into shellscript installDocker.sh which should run them all at once

Open a linux terminal (Alt-F1 in Xubuntu).

Cd to the course folder. Typing “./” before a file name instructs linux to execute it as a command

./installDocker.sh

Now we need to install some tools for installing Python software

apt install means get the named package from the Ubuntu software repositiory

sudo apt install python-pip

Now install setuptools. Ignore the suggestion to upgrade pip

pip install –U pip setuptools

Now install lizards-are-awesome (LAA) Python interface with

sudopip install lizards-are-awesome

Next, download and prepare the laadocker image. This image contains plink, fastStructure, and the conversion scripts, all built into a light-weight Alpine linux image:

sudolaainit