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

Configuring Linux VirtualMachine Windows

This document provides instructions on installing and configuring OCSSW in SeaDAS on a Linux virtual machine. It details setting up the virtual machine, installing Ubuntu, and then installing various packages like Java, Git, cURL, Python 3.6, Requests, SeaDAS and OCSSW. The process requires configuring the default Python version and installing packages via the terminal before being able to process OCSSW data.

Uploaded by

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

Configuring Linux VirtualMachine Windows

This document provides instructions on installing and configuring OCSSW in SeaDAS on a Linux virtual machine. It details setting up the virtual machine, installing Ubuntu, and then installing various packages like Java, Git, cURL, Python 3.6, Requests, SeaDAS and OCSSW. The process requires configuring the default Python version and installing packages via the terminal before being able to process OCSSW data.

Uploaded by

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

Introduction:

This document serves as a guide on how to install and configure OCSSW in SeaDAS on a
Linux based virtual machine running on a Windows computer. While the process itself is not
very complicated from a technical standpoint, there are a few parameters that need to be set up
and configured before OCSSW can work properly.

Installing and Configuring the Virtual Machine & Operating System:

The first process that needs to be undertaken is setting up the virtual machine. The software
that we will be using to configure the virtual machine is Oracle’s VirtualBox, a free software that
can run virtual machines with many types of operating systems and can be found here:
https://www.virtualbox.org/wiki/Downloads. For the exercise, we will use the latest version of
VirtualBox (version 6.1.30).

We will be installing Linux within our virtual environment and the version of Linux we will be
utilizing is Ubuntu. You will need to download the .iso file for Ubuntu, in this case version 16.04,
on Ubuntu’s website: https://releases.ubuntu.com/16.04.7/. The version of Ubuntu you will be
running is dependent on whether your computer is a 32- or 64-bit machine (that can be found
under Control Panel -> System on Windows).
After installing VirtualBox, the interface will look like this and we are ready to load Ubuntu into
VirtualBox.

We will begin by creating a new virtual machine. Click New, then you will be redirected to a new
window. Give your virtual machine a name and choose the folder where you want the virtual
machine to be saved. Having the name of the operating system in the name of the virtual
machine will automatically change the type and version fields to match the operating system
you want to use. Click Next to move to the next window.

You will select the amount of memory you want to allot to the virtual machine. The
recommended amount of memory is 1024 megabytes and we will be sticking to that. Click Next
to move to the next window.

We will now create a hard disk for the virtual machine. “Create a virtual hard disk now” is
selected by default and makes a dedicated virtual hard drive for the machine. Click Create to
make the hard drive.
The hard disk file type we are going to leave VDI as the default option. Click Next to move to the
next window.

We will use the “Dynamically Allocated” hard disk file, since fixed storage uses dedicated space
on your computer’s real hard drive and we want to avoid any complications with space
allocation. Click Next to move to the next window.
Select where you want your virtual hard disk to live on your computer and the amount of space
to allocate to the drive. Since OCSSW and SeaDAS take up sizable space in addition to all of
the packages we will need to install, it is recommended that you allot at least 25 gigabytes of
space for everything to work properly. We have now configured our virtual machine.
Our virtual machine has been created and we are now ready to mount our operating system to
it. Click Settings then go to Storage. Under the IDE controller, it will say empty as there is now
operating system currently installed. Go to Attributes, click the disk and load your Ubuntu .iso
file. Then click OK.
We can now install Ubuntu onto our virtual machine. Click Start and the Virtual Machine will now
start in a new window. Click Install Ubuntu to begin the installation process.

We will not be installing updates since we are using an older version of Ubuntu for the purposes
of this exercise. Click Continue. It will then ask you to erase the hard drive and perform a clean
install of Ubuntu. Since our hard drive is dedicated to this virtual machine, we will go through
with this process.
During the installation process, it will prompt you to create a username and password. Be sure
to remember your password as this is how you will log in to your virtual machine as well as to
provide verification when installing a package using root privledges.
After the system reboots, the last step we need to take is to install Guest Additions. Guest
Additions allow the user to utilize PC-like functions with the virtual machine such as copy and
pasting and full screen capabilities. Ubuntu already comes with a Guest Additions disk image
that can be accessed by clicking Devices, then “Insert Guest Additions CD image”. Follow the
steps to install the Guest Additions and be sure to reboot your system afterwards.

Installing Packages in Ubuntu:

*Note: the “$” symbol is for reference only and denotes the beginning of a new
command. You do not need to retype this symbol when working within the Ubuntu
Terminal as it is already shown in the command line interface.*

After Installation of Ubuntu and VirtualBox is complete, we need to install programs and
applications in our Ubuntu environment via the Terminal (Ubuntu’s version of a Command Line
Interface, similar to Command Prompt on Windows). Terminal can be accessed by searching for
the application in the Ubuntu app manager or through the Ctrl+Alt+T key binding.

Before we can start entering commands, make sure you have root privileges on your virtual
machine by typing in the following command:
$ sudo adduser <user> sudo

We are now ready to install packages to our Virtual Machine. We need to install and configure
the following programs and packages:

● Java 17 (the version from Oracle)


○ $ sudo add-apt-repository ppa:linuxuprising/java
○ $ sudo apt update
○ $ sudo apt install oracle-java17-installer --install-
recommends
○ # A prompt will appear asking you to accept the terms and
conditions. Confirm by pressing <OK>. The licensing
agreement will also need to be accepted as well in order to
use Java. Confirm by pressing <Yes>.
● Git
○ # Git is needed to install Requests
○ $ sudo apt install git
○ $ sudo apt update
● cURL
○ # cURL is needed to install OCSSW
○ $ sudo apt instal curl
○ $ sudo apt update

Configuring and Installing Python 3.6:

By default, Ubuntu 16.04 comes preconfigured with Python 2.7 and Python 3.5. However,
OCSSW requires Python 3.6 and there are some steps that need to be undertaken in order to
ensure everything runs smoothly. The first step is to install Python 3.6 itself by using the
following commands:

# This adds Python 3.6 to your Linux Environment


$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt update
$ sudo apt install python3.6

We will then install pip, a package manager needed to install Python programs (Requests is the
one we will be using for OCSSW):
#This will install pip in addition to updating it (necessary to
install Requests)
$ sudo apt install python3-pip
$ python3.6 -m pip install --upgrade pip

Since Python 2.7 is preconfigured as the default, we will need to change this by using the
following commands:

# This will change the default Python 3 installation to Python 3.6


$ sudo update-alternatives --install /usr/bin/python3 python3
/usr/bin/python3.5 1
$ sudo update-alternatives --install /usr/bin/python3 python3
/usr/bin/python3.6 2

#This will change the default Python installation to Python 3.6


$ sudo update-alternatives --install /usr/bin/python python
/usr/bin/python3.5 1
$ sudo update-alternatives --install /usr/bin/python python
/usr/bin/python3.6 2

After configuring the default Python installations, we will now move on to installing Requests, a
program needed for configuring and installing OCSSW. Requests are installed with the following
commands:

# This will install Python pip


$ python -m pip install requests
$ git clone git://github.com/psf/requests.git
$ cd requests
$ python -m pip install .
$ cd

Now we need to configure requests in Python itself:

# This will take us into the python editor


$ python
>>> import requests
# This step requires you to input your NASA Earthdata user account
information
>>> r = requests.get('https://urs.earthdata.nasa.gov',
auth=('username', 'password'))
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
'{"type":"User"...'
>>> r.json()
{'private_gists': 419, 'total_private_repos': 77, ...}
>>> exit()

Installing SeaDAS and OCSSW:

We are now ready to install SeaDAS and OCSSW. As with all of the packages we installed on
Ubuntu, we will install SeaDAS via the terminal. Go to the SeaDAS website within Ubuntu
(https://seadas.gsfc.nasa.gov/downloads) and download the Linux version of SeaDAS.

Then move the SeaDAS installation file from your downloads folder to your home folder. Then
go back to the terminal and type the following command:

# This is dependent on what version of SeaDAS you are using, in this


case we will be using 8.1.0. Below is the sample template for a
program name
$ sh seadas_{version}_linux_installer.sh

# Example for SeaDAS 8.1.0


$ sh seadas_8.1.0_linux64_installer.sh
The SeaDAS installation program will appear and guide you through the process of installing the
program. Refer to our PowerPoint presentation on how to install SeaDAS on your computer, the
steps are similar for Linux. After SeaDAS has been loaded, we can now move on to configuring
OCSSW. Refer to our presentation on how to configure OCSSW for SeaDAS for MacOS. The
process is the same.

Now you are ready to process OCSSW data for our exercise! If you are facing any difficulties
during this process, make sure to verify all of your programs are installed correctly and make
sure all of the programs are up to date using the commands specified.

You might also like