0% found this document useful (0 votes)
64 views

Installing The Linux Virtual Machine For Labs

This document provides instructions for installing and configuring a Linux virtual machine using Oracle VirtualBox to complete labs. It describes how to: 1. Download and install VirtualBox and import a pre-configured Linux Mint virtual machine image. 2. Configure networking, resources like CPU/memory, and enable 3D acceleration for the virtual machine. 3. Perform basic housekeeping tasks within the virtual machine like installing Python libraries, setting environment variables, and cloning lab materials from a GitHub repository.

Uploaded by

Fuck
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Installing The Linux Virtual Machine For Labs

This document provides instructions for installing and configuring a Linux virtual machine using Oracle VirtualBox to complete labs. It describes how to: 1. Download and install VirtualBox and import a pre-configured Linux Mint virtual machine image. 2. Configure networking, resources like CPU/memory, and enable 3D acceleration for the virtual machine. 3. Perform basic housekeeping tasks within the virtual machine like installing Python libraries, setting environment variables, and cloning lab materials from a GitHub repository.

Uploaded by

Fuck
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Installing the Linux virtual machine for Labs

1. Download and install the latest version of Oracle


Virtualbox. https://www.virtualbox.org/wiki/Downloads
This is one of the leading virtualization platforms, allowing you to have a “guest”
operating system of any kind (e.g. Linux) within your existing “host” OS (Mac,
Windows). The two OS’s do not know about each other, so the file systems are separate,
and Virtualbox makes sure they share hardware properly (CPU, memory, network).
During the installation it will ask you to grant access to make a few driver installations. Click yes to all
questions. It may also briefly disconnect your internet during the installation.

2. Download the virtual machine image.


https://www.dropbox.com/s/rs8y7ahrny165rl/Vmint.ova?dl=0
This is a pre-configured image of a virtual machine running Linux Mint 18.1 with Xfce
desktop. The file is 3.6Gb, so will take a few minutes to download.

3. Start Oracle VritualBox. Click File -> Import Appliance and select the file ‘vmint.ova’ that
you downloaded in step 2. It will ask you about VM details, just click OK. Note: when
imported the virtual machine will take up 10Gb of your disk. At this point you can erase
the ‘vmint.ova’ file you are low on disk space, it is no longer needed.

4. Run the Virtual machine by clicking on it and then the green arrow Start. The first time
you run it will be confused about the new hardware it sees, since it was created on a
different machine. Click “change networking” to get it recognize the new hardware on
your computer.

Note that sometimes laptops have VT-x (Virtualization) disabled in the BIOS settings by
default. In such cases VirtualBox will give you an error when you try to start the VM. To
fix this, go to your BIOS settings (before the machine is booted) and enable
virtualization.

Using Virtualbox

You can ‘suspend’ a VM, so that it will remember its current state and dump the memory to a
file on your disk. That file will depend on the amount of RAM your VM is allocated, so make
sure you have e.g. 2-4 Gb additional space for this.

Please do save your work often, even if you suspend/resume your machine.

When the VM is off (not running or suspended) you can adjust the resources available to it. For
instance, if you have 4 cores on your computer CPU, you can give 2 cores to your VM to make it
faster and allow for parallelization. Likewise you can allocate more memory to it. These and
other options can be changed by selecting the Vmint CM and doing Right-click -> Settings.

For Networking settings you can select NAT (uses the host OS’s current connection, including
any VPN) or Bridged (directly goes to the network card bypassing anything in the host OS). Just
leave it on NAT settings if you don’t have any special security issues.
In the Display-Screen settings make sure both 2D and 3D accelerations are checked off.

Inside the Vmint virtual machine, basic housekeeping

You will be logged in with the username 'bond'. To perform any command as system-level admin (root), in
Ubuntu you need to type 'sudo'.

Run the command below download and install the package needed to plot results in Matplotlib in
Python:

~/> sudo apt-get install python3-tk

Your root password is 'tomato'. (Do not tell anyone!)

You may run into a problem where the library download does not progress. This is because by
default the Vmint uses IPv6 network protocol. To bypass this and force Vmint to use the old
IPv4 protocol instead, convert the line above to the following line:

~/> sudo apt-get -o Acquire::ForceIPv4=true install python3-tk

In the /home/bond/Software directory you will find the computational and visualization codes already compiled
and configured.

LAMMPS (classical potential molecular dynamics)

Quantum ESPRESSO (DFT dynamics)

VESTA (3D structure visualization)

PyCharm (Python development environment)

Symbolic links to the code binaries are in /home/bond/bin

Environment variables

Your home directory contains a useful file /home/bond/.profile which defines shortcuts and paths
for the codes we will use. In particular ‘py’ is a shortcut for Python3.5 which we will be using.
Running 'python' will not work, since that command points to an old Python2.7 version.

Modify the environment variable for the location of LAMMPS potentials:

export LAMMPS_POTENTIALS=$HOME'/Software/lammps-17Nov16/potentials'

Set the temporary location for your results, for instance:


export WORKDIR=$HOME'/3320/Lab1/work/'

Now let's change the PYTHONPATH to include the location of the helper libraries for the labs.
This is where we will put the scripting utilities

export PYTHONPATH=$PYTHONPATH:$HOME'/3320'

after you change the .profile file you need to restart the Xterm window to refresh your
environment

Lab materials

To get the lab libraries and samples go to the ~/3320 directory and type:

bond@vmint ~/3320 $ git clone https://github.com/bkoz37/labutil.git

To get the latest updates to the scripts and libraries in the future go into the ‘labutil’ director and
type:

bond@vmint ~/3320/labutil $ git pull

You might also like