HomeAboutLatest DocsRegisterLogin





Building a Virtual Appliance with Jeos

Posted on 23. Aug, 2009 by joshhrob in Server, Virtualization

Print This Post Print This Post

VN:F [1.6.3_896]
Rating: 8.0/10 (1 vote cast)

Installing VMWare Tools

After reboot, log in using the account created during install.

Note: in our build the network was configured using dhcp. If this is not the case in your environment you will need to set a static ip address. See Ubuntu Configure Static IP Address

The first thing we will do after install is update the system. Enter the following command to update the apt database:

sudo apt-get update

Jeos-2009-08-21-13-13-19

If prompted for sudo password enter your password. Next type the following to upgrade your system:

sudo apt-get upgrade

Jeos-2009-08-21-13-19-27

The following packages are required before installing VMWare Tools:

sudo aptitude install build-essential linux-headers-$(uname -r)

Jeos-2009-08-21-13-24-49

Then enter:

sudo aptitude install psmisc
Jeos-2009-08-21-13-26-46

Now we are ready to install VMWare tools. In Workstation click on VM and click Install VMWare Tools

VM-SCREENSHOT

Next, enter the following command in Jeos to mount the CD

mount /media/cdrom0

Jeos-2009-08-21-13-30-14

Change directories to the /tmp directory

cd /tmp

Enter the following to unzip the VMWare Tools files

tar xvzf /media/cdrom0/VMwareTools*.gz

Jeos-2009-08-21-13-32-17

Enter the following to run the VMWare Tools install script:

sudo vmware-tools-distrib/vmware-install.pl

Jeos-2009-08-21-13-34-00

Press Enter to accept all defaults

When install finishes clean up files

rm -rf *

Jeos-2009-08-21-14-27-40

Install Application(s)

At this point install whatever applications will be included in this virtual appliance. In this build we will be installing Red5.

Please see Building a Red5 Virtual Appliance on Jeos for installing Red5.

Preparing Virtual Appliance For Shipping

Create the following directories:

sudo mkdir /etc/opt/va
sudo chmod 777 /etc/opt/va
sudo mkdir /opt/va/bin

The following script will prompt the user to set new password and ip address. Add the following script to the directory /opt/va/bin

echo "Welcome to your new Appliance"
echo "--------------------------------------------------"
echo "Please Enter a new password:"
passwd
while true; do
 read -p "Do you wish to configure a static ip address Y/N?" yn
 case $yn in
 [Yy]* ) echo "Enter New IP Address:";
 read ip;
 echo "Enter Subnet Mask:"
 read netmask;
 echo "Enter default gateway:";
 read gateway;
 echo "Enter Primary DNS Server:";
 read dns1;
 echo "Enter Secondary DNS Server:";
 read dns2;

sudo cp /etc/opt/va/network_setup /etc/opt/va/new_settings
sudo chmod 777 /etc/opt/va/new_settings
sudo echo "address $ip" >> /etc/opt/va/new_settings
sudo echo "netmask $netmask" >> /etc/opt/va/new_settings
sudo echo "gateway $gateway" >> /etc/opt/va/new_settings
sudo cp /etc/opt/va/new_settings /etc/network/interfaces
sudo cp /etc/opt/va/dns_setup /etc/opt/va/new_dns
sudo chmod 777 /etc/opt/va/new_dns
sudo echo "nameserver $dns1" >> /etc/opt/va/new_dns
sudo echo "nameserver $dns2" >> /etc/opt/va/new_dns
sudo cp /etc/opt/va/new_dns /etc/resolv.conf
sudo /etc/init.d/networking restart
 break;;
 [Nn]* ) exit;;
 * ) echo "Please answer yes or no.";;
 esac
done

 

Next, edit the /etc/bash.bashrc file adding the following to the end

if [ ! -e /etc/opt/va/ran_setup ]; then
/opt/va/bin/initial_config
sudo touch /etc/opt/va/ran_setup
fi

Finally, add the following file to /etc/opt/va

network_setup

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

Create a blank file named dns_setup in /etc/opt/va

Finally, enter the following to clear the history and poweroff the system

history -c

sudo poweroff

VN:F [1.6.3_896]
Rating: 8.0/10 (1 vote cast)

Tags: , , ,

Pages: 1 2 3 4

Print This Post Print This Post

Leave a reply