Create the OpenESPI VM
Build VM
The OpenESPI Virtual Machine (VM) is built using the Ubuntu 18.04 LTS Linux distribution running on VMware’s Player (6.0.3) application.
Download Ubuntu 18.04 LTS
[http://www.ubuntu.com/download/desktop] (http://www.ubuntu.com/download/desktop “http://www.ubuntu.com/download/desktop”)
Download the appropriate Ubuntu 14.04 LTS for your computing environment
Download VMware Player
[https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0] (https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0 “https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0”)
Download the appropriate VMware Player for your computing environment
Create VM Development Environment
- Install VMware Player by executing the downloaded file
- Start VMware Player Application
- Select “Create a New Virtual Machine” option
- Select “Installer disc image file (iso): button
- Browse to the downloaded Ubuntu 14.04 LTS file location
- Select Next
- Fill in “Full name:” [optional]
- Fill in “User name:” [enter bitnami]
- Fill in “Password:” [enter password]
- Fill in “Confirm:” [enter password]
- Select Next
- Fill in “Virtual Machine Name:” [optional]
- Fill in “Location:” [use default value]
- Select Next
- Select Next
- Select Customize Hardware button
- Change “Memory for this virtual machine:” to ** – 4096 MB**
- Select Close
- Select Finish
VMware Easy Install will now install the Ubuntu 14.04 LTS operating system. When the installation is complete Ubuntu 14.04 LTS will be loaded and the Ubuntu graphic sign-on screen will appear. To sign-on to the system depress Ctl + g and enter your selected password.
VMware Tools for Linux - version 9.6.2 Upgrade
If a Software Update dialogue box appears during the installation process, do the following to upgrade the Windows VMWare Player:
-
Select Download and Install * **Add VMWare Tools
- From VMWare menus, select reinstall vmware tools
- Extract into your desktop
-
Open a terminal window in that folder
sudo apt-get install linux-headers-$(uname -r)
sudo ./vmware-install.pl -d
rm –rf * to remove folder from desktop -
reboot VM * **VM Installation Customization
The following section describes several customization steps that need to be performed in order to integrate software packages and tools that are required to complete the development environment. * **Add terminal application to Ubuntu LauncherCtl + Alt + t opens up terminal Right click on terminal in Launcher and select “Lock to Launcher” * **Install VMWare Tools
- Select Player on VMware Player Command Bar
- Highlight Manage on Menu
- Select Reinstall VMware Tools…
- Extract to contents of VMwareTools-9.6.2-1688356.tar.gz to the Desktop
-
Open a terminal window
cd Desktop/vmware-tools-distrib sudo ./vmware-install.pl -d cd .. rm –rf * [remove extracted folder from desktop]
- reboot VM
Update apt-get Repositories
Before starting to customize your VM installation, update your apt-get repositories with the following command:
sudo apt-get update
Install Java 7 SDK Runtime
To install the Java 7 SDK enter the following commands:
sudo apt-get install openjdk-7-jdk
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
export PATH=$PATH:/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin
To make the above export commands persistent, enter the following command:
gedit .bashrc
At the bottom of the file enter:
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
export PATH=$PATH:/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin
- Hover the cursor over the Save icon
- Click the left mouse button
Install MySQL Server
To install MySQL Server enter the following commands:
sudo apt-get install mysql-server
During the installation process a dialogue appears:
- Fill in New password for the MySQL “root” user: [enter bitnami]
- Depress the Enter key
- Fill in Repeat password for the MySQL “root” user: [enter bitnami]
- Depress the Enter key
Install MySQL Workbench
- Open Ubuntu Software Center
- Search mysql workbench
- Select MySQL Workbench item
- Select Install
- Enter appropriate user Password:
Configure MySQL Workbench
The following instructions create the Data Custodian database:
- Select MySQL Workbench on Ubuntu Launcher
- Select Plus Sign next to MySQL Connections on MySQL Workbench Desktop
- Enter “datacustodian” in Connection Name:
- Select OK
The following instructions create the Third Party database:
- Select Plus Sign next to MySQL Connections on MySQL Workbench Desktop
- Enter “thirdparty” in Connection Name:
- Select OK
The following instructions create the OAuth2 Token Store database:
- Select Plus Sign next to MySQL Connections on MySQL Workbench Desktop
- Enter “tokenstore” in Connection Name:
- Select OK
TODO: Need to complete this procedure after STS is installed and determine how to start the MySQL Server
- Test Connection: root:bitnami
- Create new schema “datacustodian”
Install Spring STS 3.6.0.RELEASE
- Select the Firefox icon on the Ubuntu Launcher
- Enter https://spring.io/tools/sts/all into the address bar of the browser
- Press the keyboard ENTER key
- Scroll the cursor over Based on Eclipse 4.4 beneath the Linux icon
- Click the left mouse button
- Scroll the cursor over tar.gz beneath the GTK,64BIT column title
- Click the left mouse button
- Select the Save File button when the dialogue box appears
- Open the Downloads folder
- Open the spring-tool-suite-3.6.0.RELEASE-e4.4-linux-gtk-x86_64.tar.gz file
- Click the Extract icon at the top of the window
- Navigate to the bitnami directory
- Select the Create Folder button
- Enter Spring as the name of the folder
- Select the Extract button
- Select the Close button when the extraction completes
The following command creates a symbolic link on the Desktop to simplify starting the STS application:
cd Desktop
ln -s /home/bitnami/Spring/sts-bundle/sts-3.6.0.RELEASE/STS STS-3.6.0.RELEASE
TODO: Verify the following steps are necessary
- Need to add this library to get STS working properly (internal web browser)
- sudo apt-get install libwebkitgtk-1.0-0
Add open in terminal (allows browse folder and open terminal window
- sudo apt-get install nautilus-open-terminal
Install Git
- Select Ubuntu Software Center on Ubuntu Launcher
- Enter git in the search field
- Select the Fast, scalable, distributed revision control system entry
- Select the Install button
Install Gitk
- Select Ubuntu Software Center on Ubuntu Launcher
- Enter gitk in the search field
- Select the Fast, scalable, distributed revision control system (revision tree visualizer) entry
- Select the Install button
Install Maven
- Select Ubuntu Software Center on Ubuntu Launcher
- Enter maven in the search field
- Select the Java software project management and comprehension tool entry
- Select the Install button
Install Wireshark
- Select Ubuntu Software Center on Ubuntu Launcher
- Enter wireshark in the search field
- Select the Wireshark entry
- Select the Install button
Configure Wireshark
Enter the following commands to configure Wireshark for non-root user access:
sudo groupadd wireshark
sudo usermod -a -G wireshark $USER
sudo chgrp wireshark /usr/bin/dumpcap
sudo chmod 755 /usr/bin/dumpcap
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
Install curl Enter the following command to install curl:
sudo apt-get install nautilus-open-terminal
Install SOAPUI We are currently using SOAPUI 5.1.3: Download SOAPUI 5.1.3
- Select the Save File button when the download dialogue appears
- Navigate to the Downloads folder
- Hover over the SoapUI-x64-x.x.x.sh file and click the right mouse button
- Select the Properties menu item
- Click on the Permissions tab
- Click on the Allow executing file as program box at the bottom of the display
- Select the Close button
- Open a terminal window
-
Enter the following command:
./home/bitnami/Downloads/SoapUI-x64-5.x.x.sh
- Select the Next button when the Setup Wizard dialogue appears
- Select the I accept the agreement button
- Select the Next button
- Select the Next button
- Select the Next button
- Select the Next button
- Select the I accept the agreement button
- Select the Next button
- Select the Next button
- Select the Next button
- Select the Next button
- Select the Finish button
- Right click on SoapUI in Launcher and select “Lock to Launcher”
Install external jar files into SOAPUI
- Fetch from GitHub the files in https://github.com/energyos/OpenESPI-GreenButtonCMDTest/tree/master/SOAPUI/projectDependencies
- Place all jar files in the {SOAPUI Install Directory}/bin/ext – note that some files are in the zip file and should be extracted so there is a flat list of jars in the ext folder. ***
Update Installed Software Packages
- Select Software Updater on Ubuntu Launcher
- Select Install Now button in dialogue that appears
To shrink VM before zip and exchange
Use this procedure to shrink the VM for exchange
cd /usr/bin
sudo ./vmware-toolbox-cmd disk shrinkonly
when it finishes, shutdown, zip up folder
Install Stunnel
###Install sftp-server
To install the ssh server functionality:
sudo apt-get install openssh-server
To start / stop server
sudo start ssh
sudo stop ssh
Create sftp file repository
-
add user openespivmssh, no password
-
create a working directory
-
You must add acceptable certificates to this authorized_keys file if they are to be able to connect
.
cd /home/openespivmssh
mkdir .ssh
chmod 700 .ssh
cd .ssh
touch authorized_keys
chmod 600 authorized_keys
cp /etc/stunnel/openespi.pem /home/openespivmssh/authorized_keys
Restart ssh server
sudo restart ssh
Test
ssh openespivmssh@openespivm
ls
exit
- This should result in a directory listing of what is in /home/openespivmssh
Give VM host name over the network
sudo gedit /etc/hostname
enter: openespivm
save and exit
sudo gedit /etc/hosts
add entry:
127.0.1.1 openespivm
save and exit
retboot