Guest tools installation Script

Discussions about using Linux guests in VirtualBox.
Post Reply
SexyCeops
Posts: 1
Joined: 28. Nov 2009, 18:39
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu

Guest tools installation Script

Post 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 ""
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Guest tools installation Script

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply