Oracle VirtualBox installation script - Page 7
FedoraForum.org - Fedora Support Forums and Community
Page 7 of 7 FirstFirst ... 5 6 7
Results 91 to 98 of 98
  1. #91
    Join Date
    Oct 2005
    Location
    British Columbia, Canada
    Posts
    873

    Re: Oracle VirtualBox installation script

    Quote Originally Posted by glennzo
    Is the Fedora machine running the newest available kernel?
    Yes it is running Kernel 4.11.12-100.fc24.x86_64 which I believe is the last for F24.
    Virtual box is 5.1.26 r117224.

    These are the same as are on my Laptop which allowed me to install Win2k
    Robert :)

  2. #92
    Join Date
    Sep 2009
    Posts
    2,184

    Re: Oracle VirtualBox installation script

    If the kernel module isn't present, at least dkms, and maybe kernel-devel aren't installed. You probably need to manually download and install dependencies since this is F24.

    dd_wizard

  3. #93
    Join Date
    Oct 2005
    Location
    British Columbia, Canada
    Posts
    873

    Re: Oracle VirtualBox installation script

    Quote Originally Posted by dd_wizard
    If the kernel module isn't present, at least dkms, and maybe kernel-devel aren't installed. You probably need to manually download and install dependencies since this is F24.

    dd_wizard
    Hi dd_wizard
    When I run one of the lines in the 'F22 and up' script it doesn't find kernel-devel and dkms.

    Code:
    [root@PANTRY ~]# dnf install kernel-devel-$(uname -r) gcc qt qt-x11 libpng15 libXmu libXt libvpx compat-libvpx1 dkms SDL
    
    Last metadata expiration check: 1:29:05 ago on Mon Sep 25 15:43:18 2017.
    No package kernel-devel-4.11.12-100.fc24.x86_64 available.
    Package gcc-6.3.1-1.fc24.x86_64 is already installed, skipping.
    Package qt-1:4.8.7-18.fc24.i686 is already installed, skipping.
    Package qt-1:4.8.7-18.fc24.x86_64 is already installed, skipping.
    Package qt-x11-1:4.8.7-18.fc24.i686 is already installed, skipping.
    Package qt-x11-1:4.8.7-18.fc24.x86_64 is already installed, skipping.
    Package libXmu-1.1.2-4.fc24.x86_64 is already installed, skipping.
    Package libXmu-1.1.2-4.fc24.i686 is already installed, skipping.
    Package libXt-1.1.5-3.fc24.x86_64 is already installed, skipping.
    Package libXt-1.1.5-3.fc24.i686 is already installed, skipping.
    Package libvpx-1.5.0-4.fc24.x86_64 is already installed, skipping.
    Package SDL-1.2.15-21.fc24.x86_64 is already installed, skipping.
    Error: Unable to find a match.
    How can I get those two packages?
    Last edited by robertdaleweir; 26th September 2017 at 01:28 AM.
    Robert :)

  4. #94
    Join Date
    Sep 2009
    Posts
    2,184

    Re: Oracle VirtualBox installation script

    Top right of the forum page, click on "Fedora Project", click on "Fedora Build System (Koji)" near the bottom of the drop down menu. Search for kernel in the Koji window. Use "uname -r" in a terminal to find out which kernel you're using. Pick the kernel version that you got with "uname -r". Scroll down to the the correct archecture, then pick kernel-devel. I have a folder named RPMS that I use for rpms from Koji. Then search for dkms in Koji and download the most recent F24 dkms from Koji to the same directory. Open a terminal window in that directory and run "sudo dnf install ./kernel-devel* ./dkms*". Reboot and a virtualbox kernel module should be built. If your CPU activity runs high for 30 seconds or so, it did.

    dd_wizard

  5. #95
    Join Date
    Oct 2005
    Location
    British Columbia, Canada
    Posts
    873

    Re: Oracle VirtualBox installation script

    Quote Originally Posted by dd_wizard
    Top right of the forum page, click on "Fedora Project", click on "Fedora Build System (Koji)" near the bottom of the drop down menu. Search for kernel in the Koji window. Use "uname -r" in a terminal to find out which kernel you're using. Pick the kernel version that you got with "uname -r". Scroll down to the the correct archecture, then pick kernel-devel. I have a folder named RPMS that I use for rpms from Koji. Then search for dkms in Koji and download the most recent F24 dkms from Koji to the same directory. Open a terminal window in that directory and run "sudo dnf install ./kernel-devel* ./dkms*". Reboot and a virtualbox kernel module should be built. If your CPU activity runs high for 30 seconds or so, it did.

    dd_wizard
    Hi dd_wizard
    Thank you so much. I looked around the Web but I got a lot of 404 errors and had probelms fionding those two packages. Have a great day!
    Robert :)

  6. #96
    Join Date
    Nov 2017
    Location
    Faisalabad
    Posts
    1

    Re: Oracle VirtualBox installation script

    It proceeds Object because of type-erasure which replaces all nonspecific types with Purpose. There is no way to determine at runtime what generic type was on condition that at compile-time.

  7. #97
    Join Date
    Mar 2004
    Location
    In your closet
    Posts
    15,723
    Linux (Fedora) Firefox 61.0

    Re: Oracle VirtualBox installation script

    Still using my script. Updating it as necessary. Works extremely well for systems booted using BIOS. There are a few functions that aren't used. Might be obvious.

    For the adventurous:

    PHP Code:
    #!/bin/bash
    << COMMENT
    28_oracle_virtualbox
    .sh
    This script is 
    for Fedora 25 and up 
    It is a continuation of 25_oracle_virtualbox
    .sh

    Glenn A
    Johnson
    Started January 18
    2015
    Updated August 9
    2018

     still_running
    =$(ps -aux grep [v]irtualbox)
    if [[ ! ${
    still_running} ]] ; then
            printf 
    "VirtualBox is not running.\n"
    else
            
    printf "VirtualBox is still running. Please wait.\n"
    fi

    COMMENT

    # Determine the newest available version of VirtualBox
    curl_installed=$(rpm -qa grep curl)
    if [[ ! 
    $curl_installed ]] ; then
        printf 
    "Installing package curl. Please wait ..."
        
    dnf --q install curl
        
    echo
    fi
    curl 
    -Os http://download.virtualbox.org/virtualbox/LATEST.TXT
    current_version=$(cat LATEST.TXT)
    #echo $current_version 
    rm LATEST.TXT

    # We can easily make changes to the source file versions by changing a few variables below.
    # Most recent is https://download.virtualbox.org/virtualbox/5.2.8/VirtualBox-5.2-5.2.10_122591_fedora26-1.x86_64.rpm
    # Most recent is https://download.virtualbox.org/virtualbox/5.2.12/VirtualBox-5.2-5.2.12_122591_fedora26-1.x86_64.rpm
    # Most recent is https://download.virtualbox.org/virtualbox/5.2.14/VirtualBox-5.2-5.2.14_123301_fedora26-1.x86_64.rpm
    # Most recent is https://download.virtualbox.org/virtualbox/5.2.16/VirtualBox-5.2-5.2.16_123759_fedora26-1.x86_64.rpm

    VB_REL_VER="5.2-"$current_version"_123759"
    VB_EXT_VER="$current_version"-123759
    VB_REL_DIST
    ="fedora26-1"
    VBOX_SRC_FILE="VirtualBox-${VB_REL_VER}_${VB_REL_DIST}."`uname -m`".rpm" 
    VBOX_EXT_SRC="Oracle_VM_VirtualBox_Extension_Pack-${VB_EXT_VER}.vbox-extpack"
    SRC_PATH="http://download.virtualbox.org/virtualbox/$current_version"
    PUB_KEY="oracle_vbox.asc"
    PACKFILES="kernel-devel-$(uname -r) gcc libpng15 libXmu libXt libvpx qt qt-x11 qt5-qtx11extras SDL wget compat-libvpx4 elfutils-libelf-devel"

    # Color definitions; the variables are null if the option NOCOLOR is set.
    # Thanks Skull One!

    if [ -"$NOCOLOR]; then
        OKB
    =$(tput bold;tput setaf 6)
        
    OK=$(tput setaf 6)
        
    ERRB=$(tput bold;tput setaf 1)
        
    ERR=$(tput setaf 1)
        
    RST=$(tput sgr0)
    else
        
    OKB=
        
    OK=
        
    ERRB=
        
    ERR=
        
    RST=
    fi

    # Need elevated permissions at some point, might as well do it now.
    if [[ $EUID -ne 0 ]] ; then
        printf $ERRB
    "You're going to need elevated permissions at some point. Let's get that out of the way now.\nUse "sudo" or "su -c"\n"$RST
           
    exit 0
    fi

    # Make sure we're running Fedora 25 or later
    function get_release()
    {
        if [[ ! -
    /etc/redhat-release ]] ; then
        printf $ERRB
    "This script is for Redhat based distributions only.\n"$RST
        
    exit 0
    else
        
    printf $OK"Checking Fedora release version... "$RST
        RELNUM
    =$(rpm -qa --queryformat '%{version}\n' fedora-release)
        if [[ 
    $RELNUM -lt "25" ]] ; then
            clear
            printf $ERR
    "This script is for Fedora release 25 or newer.\n"$RST
               
    exit 0
        
    else printf $OK"Fedora $RELNUM $OKB✓"$RST
    fi
    fi
    echo
    }

    # Determine if system booted using EFI or BIOS
    function efiorbios()
    {
    if [[ -
    /sys/firmware/efi ]] ; then
        printf $ERR
    "This system is booted using UEFI.\n"$RST
    else
        
    printf $ERR"This system is booted using BIOS.\n"$RST
    fi
    }


    # Clear screen and print a headline.
    function headline()
    {
        
    clear
        printf $OK
    "==>$OKB VirtualBox installation script for Fedora Linux.\n"$RST
        printf $OK
    "==>$OKB Oracle VirtualBox and Oracle VirtualBox Extension Pack will be installed.\n"$RST
        printf $OK
    "==>$OKB VirtualBox release $VB_REL_VER\n"$RST
    }

    # Remove Oracle VirtualBox source files if they exist in the current working directory.
    function remove_source()
    {
        for 
    i in $VBOX_SRC_FILE $VBOX_EXT_SRC $PUB_KEY; do
            
    rm -f $i
        done
    }

    # Remove any installed version of VirtualBox.
    function remove_fed_vbox()
    {
    VBOX_INSTALLED=$(rpm -qa grep VirtualBox)
    if [[ 
    $VBOX_INSTALLED ]] ; then
        printf $OK
    "Removing previously installed instance of VirtualBox. Please wait..."$RST
        dnf 
    --q erase $VBOX_INSTALLED 2>/dev/null
        printf $OKB
    " ✓\n\n"$RST
    fi
    }

    # Download and import the Oracle public key.
    function get_public_key()
    {
    curl_installed=$(rpm -qa grep curl )
    if [[ ! 
    $curl_installed ]] ; then
        printf $OK
    "Installing package curl. Please wait ..."$RST
        dnf 
    --q install curl
        
    echo
    fi

    printf $OK
    "Installing the Oracle public key ... ✓\n"$RST
    curl 
    -Os https://www.virtualbox.org/download/$PUB_KEY
    rpm --import $PUB_KEY
    }

    # Install Oracle VirtualBox from the downloaded source RPM.
    function install_source()
    {
    if [[ -
    f $VBOX_SRC_FILE ]] ; then
        printf $OK
    "Installing Oracle VirtualBox\n"$RST
        rpm 
    -Uvh $VBOX_SRC_FILE --quiet
    else
        
    printf $ERR"The source file missing.\nThere was an error downloading the file.\n"$RST
        
    exit 0
    fi
    }

    # Install the Oracle VirtualBox Extension Pack.
    function install_extpack()
    {
    if [[ -
    f $VBOX_EXT_SRC ]] ; then
        
    echo $OK"Installing Oracle VirtualBox extension pack."$RST
        VBoxManage extpack install 
    --replace --accept-license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb $VBOX_EXT_SRC
    else
        
    printf $ERR"Oracle VirtualBox extension pack source file missing!\n"$RST
    fi
    # License accepted. For batch installaltion add
    # --accept-license=715c7246dc0f779ceab39446812362b2f9bf64a55ed5d3a905f053cfab36da9e to the VBoxManage command line.
    # --accept-license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb
    }

    # Get any Fedora packages typically needed to complete the VirtualBox installation without errors.
    function get_packages()
    {
    printf $OK"Checking for necessary packages..."$RST
    echo
    NEWPKGS=""
    for i in $PACKFILES ; do
        
    printf $OK"==> $i: "
           
    rpm -q $i > /dev/null
        
    if [ $? -eq 0 ] ; then
            printf $OKB
    "✓\n"$RST
        
    else
            
    printf $ERR"✗\n"$RST
            NEWPKGS
    ="${NEWPKGS} $i"
        
    fi
    done
    if [ -"${NEWPKGS}]; then
        
    echo --n $OK"==> Installing necessary packages:$OKB "${NEWPKGS}"... "$RST
        dnf 
    --q install ${NEWPKGS2>/dev/null
           
    echo -e $OKB"\nDone installing packages.\n"$RST
    else
           
    printf $OK"==>$OKB Nothing new to install.\n"$RST
    fi
    }

    # Test retrieval of any Fedora packages typically needed to complete the VirtualBox installation without errors.
    function test_get_packages()
    {
    clear
    printf $ERRB
    "===== TEST ONLY. NO PACKAGES ARE BEING INSTALLED.=====\n"$RST
    printf $OK
    "Checking for necessary packages..."$RST
    echo
    NEWPKGS=""
    for i in $PACKFILES ; do
        
    printf $OK"==> $i: "
           
    rpm -q $i > /dev/null
        
    if [ $? -eq 0 ] ; then
            printf $OKB
    "✓\n"$RST
        
    else
            
    printf $ERR"✗\n"$RST
            NEWPKGS
    ="${NEWPKGS} $i"
        
    fi
    done
    if [ -"${NEWPKGS}]; then
        
    echo --n $OK"==> Packages that need to be installed are: $OKB "${NEWPKGS}"... "$RST
        
    echo
    else
           
    printf $OK"==>$OKB Nothing new to install.\n"$RST
        
    echo
    fi
    }

    # Get the VirtualBox source files from Oracle
    function get_source()
    {
        
    printf $OK"Getting the VirtualBox source RPM from the Oracle download site..."$RST
        remove_source
        curl 
    -Os $SRC_PATH/$VBOX_SRC_FILE
        printf $OKB
    " ✓\n"$RST
        printf $OK
    "Getting the VirtualBox Extension Pack source file..."$RST
        curl 
    -Os $SRC_PATH/$VBOX_EXT_SRC
        printf $OKB
    " ✓\n"$RST
    echo
    }

    # The script run has completed. Print a short message stating same.
    function script_complete()
    {
        
    #remove_source
        
    printf $OKB"Oracle VirtualBox is now installed.\n"
        
    printf $OKB"Script run complete.\n"$RST
    }

    # The test script run has completed.
    function script_test_complete()
    {
        
    remove_source
        printf $OKB
    "This script test is now complete.\n"
        
    #printf $OKB"All necessary Fedora packages are installed.\n"$RST
    }

    # Script execution has been cancelled by the user.
    function script_cancel()
    {
        
    clear
        printf $OK
    "Script execution cancelled.\n"$RST
    }

    # Testing only. Show value of all variables
    function show_vars()
    {
        echo
        
    printf $ERRB"===== DISPLAYING SCRIPT VARIABLES =====\n"$RST
        printf $OK
    "VB_REL_VER is $OKB$VB_REL_VER\n"$RST
        printf $OK
    "VB_EXT_VER is $OKB$VB_EXT_VER\n"$RST
        printf $OK
    "VB_REL_DIST is $OKB$VB_REL_DIST\n"$RST
        printf $OK
    "VBOX_SRC_FILE is $OKB$VBOX_SRC_FILE\n"$RST
        printf $OK
    "VBOX_EXT_SRC is $OKB$VBOX_EXT_SRC\n"$RST
        printf $OK
    "SRC_PATH is $OKB$SRC_PATH\n"$RST
    }

    function 
    runvb()
    {
    printf "Start VirtualBox now [y/n] "
    read sn
    case $sn in
        y
    )     VirtualBox &
            exit 
    0
            
    ;;
        *)     
    printf "Just exit.\n"
            
    exit 0
            
    ;;
    esac
    }

    # Main script flow
    function menu()
    {
    clear
    headline
    printf $OK
    "\nFor this script to succeed you need to be running the newest available and installed kernel.\n\nIf you aren't running the newest available and installed kernel please exit this script\nand update your system. Then boot into the newest installed kernel and run this script again.\n"$RST
    printf $OKB
    "\nShall we continue? <y/n> "$RST
    read yn
    case $yn in
        y
    )    clear
            remove_fed_vbox
               get_packages
            get_public_key
               get_source
               install_source
               install_extpack
            remove_source
               script_complete
            
    #runvb
               
    ;;

        
    n)    script_cancel
               
    exit 0
               
    ;;

    # Test menu entry used for development. End user should ignore this menu option.
    # All this does is test for missing packages and test the download process for VirtualBox and GuestAdditions.
        
    t)     test_get_packages
               get_source
            efiorbios
               script_test_complete
            
    ;;

    # Test menu entry used for development. End user should ignore this menu option.
    # All this does is show the current value of all of the variables.
        
    v)      show_vars
            
    ;;

    # Process to follow when an incorrect response is detected.
        
    *)    script_cancel
               
    exit 0
               
    ;;
    esac
    }
    menu    # Call the main menu. 
    Glenn
    The Bassinator

  8. #98
    Join Date
    Feb 2009
    Location
    The Netherlands
    Posts
    24
    Windows NT 10.0 Firefox 63.0

    Re: Oracle VirtualBox installation script

    WoW, that PHP script certainly looks adventurous. Hats off to you, Glenn or The Bassinator .

Page 7 of 7 FirstFirst ... 5 6 7

Similar Threads

  1. oracle virtualbox not working
    By pythonkr11 in forum Wibble
    Replies: 1
    Last Post: 7th September 2012, 07:48 PM
  2. oracle virtualbox not working
    By pythonkr11 in forum Fedora Focus
    Replies: 1
    Last Post: 7th September 2012, 07:20 PM
  3. Oracle Virtualbox
    By clueless in forum Using Fedora
    Replies: 5
    Last Post: 17th May 2011, 10:39 AM
  4. [SOLVED]
    oracle vm virtualbox
    By postmanpat in forum Using Fedora
    Replies: 5
    Last Post: 24th November 2010, 12:51 PM
  5. Update Oracle VM VirtualBox error
    By JValeck in forum Using Fedora
    Replies: 2
    Last Post: 12th October 2010, 05:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •