Page 1 of 1

Guest tools installation Script

Posted: 16. May 2010, 11:56
by SexyCeops
Hi,

As i am new to Virtual Box and Linux, i thought of contributing my first touches to the Linux world :idea: , I am attaching my 'first ever script' to install the VBox guest tools, as i am a beginner so the script might not be written in a very professional way, but it is working :mrgreen:

I have got it tested on Ubuntu 9.x and Backtrack 4

Please provide any comments to make it better or suitable for the other Linux distros, if they are not compliant.

Cheers!

Code: Select all

#!/bin/bash
clear
echo "Please make sure that you have mounted the VirtualBox"
echo "guest tools CD image from the Devices menu"
echo ""
echo ""
echo "     ========================="
echo -e "\033[31m     starting the installation \033[0m"
# echo "starting the installation"
echo "     ========================="
echo ""
echo ""
echo -n "Please press Enter or CTRL+C to cancel ..."
read -n 1
echo "Mounting the Virtualbox installation tools CD image ...."
mkdir /mnt/cdrom
echo "---> /mnt/cdrom created/checked"
mount /dev/hdc /mnt/cdrom
echo -e "---> \033[33m /mnt/cdrom \033[0m \033[5m \033[34m mounted \033[0m"
df -k |grep mnt
# echo "You can use the command mount /dev/hdc alone,"
# echo "however that will cause the CD image to be mounted to the"
# echo "folder /media/cdrom0 as default and in read only mode"
echo -n "Please press Enter to start or CTRL+C to cancel ..."
read -n 1
/mnt/cdrom/VBoxLinuxAdditions-x86.run
echo -e "\033[5m \033[31m un-Mounting \033[0m the Virtualbox installation tools CD image ...."
umount /dev/hdc /mnt/cdrom
echo ""
echo ""
echo -e "\033[5m \033[31m     VBox tools Installation Complete!  \033[0m"
echo ""
echo ""

Re: Guest tools installation Script

Posted: 16. May 2010, 15:46
by Sasquatch
Why make all this trouble if the script already exists? It's in the .run file, all you do is execute that .run file from the GA ISO (shipped with the PUEL version) and you're done.