Mint 19.1: Initial Setup Script

Initial install script for mint 19.1 post deploy

 

function apt-init(){
    #======================================================================================
    # APT UPDATE/UPGRADE
    # apt update, dpkg, upgrade
    #----------------------------------------
    sudo dpkg --configure -a
    sudo apt update -y
    sudo apt upgrade -y
    #----------------------------------------
    #sudo apt-get install -f
    #----------------------------------------
    #----------------------------------------
    sudo apt-get install -y openssh-server && sudo systemctl is-enabled ssh && sudo systemctl is-active ssh
    #sudo apt-get install openssh-server
    #sudo systemctl is-enabled ssh
    #sudo systemctl is-active ssh
    #----------------------------------------
    sudo apt-get clean
}

function vbox-install(){
    #======================================================================================
    # VBOX INSTALL
    #----------------------------------------
    
    #remove prior vbox version
    sudo apt remove -y virtualbox
    sudo apt purge -y virtualbox
    
        #Update apt sources - ubuntu
        #sudo sh -c 'echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list.d/virtualbox.list'
    #----------------------------------------
    #for mint 19.1 source - ubuntu
    sudo sh -c 'echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib" >> /etc/apt/sources.list.d/virtualbox.list'
    #Get repo key
    wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
    read -p "press any key to continue..." paused
    #----------------------------------------    
    #??no valid OOpenPGP data found??
    #??refresh system package cache??
    #----------------------------------------
    sudo apt update -y
    #Install vbox-6.0.14
    sudo apt install -y virtualbox-6.0
    #----------------------------------------
    #UnInstall
    #sudo apt remove --autoremove virtualbox-6.0
    #----------------------------------------
}

function vbox-ext-host(){
    sudo apt-get -y virtualbox-ext-pack               
    sudo apt-get -y virtualbox-guest-additions-iso
}

function vbox-ext-guest(){
    #======================================================================================
    # VBOX EXTENSIONS
    #----------------------------------------
    # Install VBox Guest Additions
    
    # GET BUILD TOOLS
    sudo apt update -y && sudo apt install -y build-essential dkms linux-headers-$(uname -r)
    # SHOW LINUX KERNEL VERSION
    # $(uname -r) will print the running Kernel version.
    #     4.15.0-70-generic
    

    
    
    # Open the Ubuntu guest terminal, create a new directory as the mount point for the CD drive and mount the ISO file:
    sudo mkdir -p /mnt/cdrom
    
    # INSERT GUEST ADDTIONS CD
    
    sudo mount /dev/cdrom /mnt/cdrom
    #    setup@jira:~$ sudo mount /dev/cdrom /mnt/cdrom
    #    mount: /mnt/cdrom: WARNING: device write-protected, mounted read-only.
    #======================================================================================
    # RUN from ISO
    cd /mnt/cdrom
    sudo sh ./VBoxLinuxAdditions.run --nox11
    #    Verifying archive integrity... All good.
    #    Uncompressing VirtualBox 5.2.32 Guest Additions for Linux........
    #    ...
    #    VirtualBox Guest Additions: Starting.
    
    sudo umount -l /mnt/cdrom
    sudo umount /mnt/cdrom
    
    #REBOOT
    sudo shutdown -r now
    
    #VERIFY kernel module loaded
    lsmod | grep vboxguest
    #vboxguest             303104  2 vboxsf
    
    #CLEAN CACHE
    apt clean
    
    #SHUTDOWN
    sudo shutdown now
    
    #ENABLE VM OPTIONS
    #Now that VirtualBox Guest Additions are installed on the Ubuntu guest machine you can enable:
    #Storage
    #Shared clipboard
    #Drag'n Drop
    #
    #Display
    #3D acceleration
    #Shared folders
    #
    #..and more
    #
}

function htop-install(){
    sudo apt install -y htop
}

#    read -p "press any key to continue..." paused

function menu(){

    echo "----------------------"
    echo "1-apt-init"
    echo "2-vbox-install"
    echo "3-vbox-ext-host"
    echo "4-vbox-ext-guest"
    echo "5-htop"
    echo "0-"
    echo "----------------------"
    read -p "enter option: " opt
    echo "----------------------"

    case $opt in
    "1")apt-init;;
    "2")vbox-install;;
    "3")vbox-ext-host;;
    "4")vbox-ext-guest;;
    "5")htop-install;;
    "0")exit 0;;
    "*")exit 0;;
    esac
}

#----------------------------------------
#
#----------------------------------------
menu

 

 

 

 

Tags