Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Update VirtualBox-4.0 Extension Pack.

  1. #1

    Default Update VirtualBox-4.0 Extension Pack.

    Looks like all my scripts start with update something or end with something upgrade.

    It might not be necessary to update the VirtualBox Extension Pack. However I noticed that the files are different between versions. You can not install the Extension Pack if there is already one installed. You have to delete it first. This script checks if the Extension Pack version matches the installed VirtualBox version and if not, delete the Extension Pack, downloads and installs the new one.

    Code:
    #! /bin/bash
    #
    #: Title       : updateVboxExt
    #: Date Created: Fri May 13 13:54:26 PDT 2011 
    #: Last Edit   : Fri May 13 14:34:37 PDT 201
    #: Author      : please_try_again 
    #: Version     : 1.0
    #: Description : Install or update VirtualBox Extension pack
    
    pkg_sit="http://download.virtualbox.org/virtualbox/"
    ext_nam="Oracle VM VirtualBox Extension Pack"
    pkg_ext="vbox-extpack"
    #
    
    which vboxmanage > /dev/null 2>&1 || exec echo "vboxmanage not found"
    ver=$(vboxmanage -v)
    
    pkg_nam="${ext_nam// /_}"
    pkg_tgz="${pkg_nam}.tgz"
    pkg_ver="${ver%%r*}"
    pkg_blt="${ver##*r}"
    pkg_url="${pkg_sit}${pkg_ver}/${pkg_nam}-${pkg_ver}-${pkg_blt}.${pkg_ext}"
    
    # check if ExtensionPack for current VirtualBox version already install
    N=$(vboxmanage list extpacks | grep -c -e "$pkg_ver" -e "$pkg_blt")
    [ $N -ge 2 ] && exec echo "Extension Pack already installed"
    
    # Deinstall older versions ExtensionPack if any
    vboxmanage list extpacks | grep -q "$ext_nam" && { 
    	oldver=$(vboxmanage list extpacks | awk 'BEGIN {ORS="r"} ; /Version:|Revision/ { print $2 }' | sed 's|r$||')
    	echo "- uninstalling $ext_nam $oldver"
    	vboxmanage extpack uninstall "$ext_nam"
    }
    
    # download VirtualBox Extension Pack
    echo "- Downloading $pkg_url ..."
    wget $pkg_url -O $pkg_tgz
    
    # Install newer ExtensionPack version
    if [ -f ./$pkg_tgz ] ; then
    	echo "- installing $ext_nam $ver"
    	vboxmanage extpack install $pkg_tgz
    else
    	echo "No extension pack found"
    fi

  2. #2

    Default Re: Update VirtualBox-4.0 Extension Pack.

    Thanks!
    This worked great for me - VirtualBox should include it as an option in their installer.

  3. #3
    Join Date
    Dec 2008
    Location
    London - UK
    Posts
    53

    Default Re: Update VirtualBox-4.0 Extension Pack.

    Cool..!! I shall give this a go when I get in tonight

    Thanks please_try_again

  4. #4
    Join Date
    Jun 2008
    Location
    Mexico
    Posts
    205

    Default Re: Update VirtualBox-4.0 Extension Pack.

    @please_try_again

    Thanks so much. This works great
    La Humildad no es "Status"..
    ... es un �"Don"!

  5. #5

    Default Re: Update VirtualBox-4.0 Extension Pack.

    Revision numbers didn't match with version 4.0-4.0.10:

    Code:
    # rpm -qa | grep VirtualBox
    VirtualBox-4.0-4.0.10_72479_openSUSE114-1.x86_64
    
    # vboxmanage list extpacks
    Extension Packs: 1
    Pack no. 0:   Oracle VM VirtualBox Extension Pack
    Version:      4.0.10
    Revision:     72436
    Description:  USB 2.0 Host Controller, VirtualBox RDP, PXE ROM with E1000 support.
    VRDE Module:  VBoxVRDP
    Usable:       true 
    Why unusable:
    So I modified the script to also parse VirtualBox download page. Here's the new version (Don't use the previous version!):

    Code:
    #! /bin/bash
    #
    #: Title       : updateVboxExt
    #: Date Created: Fri May 13 13:54:26 PDT 2011 
    #: Last Edit   : Tue Jun 28 09:42:29 PDT 2011 
    #: Author      : please_try_again 
    #: Version     : 1.1
    #: Description : Install or update VirtualBox Extension pack
    
    pkg_sit="http://download.virtualbox.org/virtualbox/"
    pkg_dwl="http://www.virtualbox.org/wiki/Downloads"
    ext_nam="Oracle VM VirtualBox Extension Pack"
    pkg_ext="vbox-extpack"
    #
    
    which vboxmanage > /dev/null 2>&1 || exec echo "vboxmanage not found"
    ver=$(vboxmanage -v)
    
    pkg_nam="${ext_nam// /_}"
    pkg_tgz="${pkg_nam}.tgz"
    pkg_ver="${ver%%r*}"
    pkg_blt="${ver##*r}"
    pkg_url="${pkg_sit}${pkg_ver}/${pkg_nam}-${pkg_ver}-${pkg_blt}.${pkg_ext}"
    
    # check if ExtensionPack for current VirtualBox version already install
    N=$(vboxmanage list extpacks | grep -c -e "$pkg_ver" -e "$pkg_blt")
    [ $N -ge 2 ] && exec echo "Extension Pack already installed"
    
    # download VirtualBox Extension Pack
    echo "- Downloading $pkg_url ..."
    wget $pkg_url -O $pkg_tgz
    
    # Not Extension Pack found for this version, try latest version on the download page.
    [ -s $pkg_tgz ] || {
    	rpm -qa | grep -q curl || exec echo "Please install curl"
    	p=$(echo $pkg_sit | sed 's|^.*//\([^/]*\).*|\1|')
    	pkg_url=$(curl $pkg_dwl | grep $p | sed -n "/$p/s|^.*\(${pkg_sit}${pkg_ver}.*${pkg_ext}\).*|\1|p" | sort -u)
    	wget $pkg_url -O $pkg_tgz
    }
    	
    if [ -s $pkg_tgz ] ; then 
    # Deinstall older versions ExtensionPack if any
    vboxmanage list extpacks | grep -q "$ext_nam" && { 
    	oldver=$(vboxmanage list extpacks | awk 'BEGIN {ORS="r"} ; /Version:|Revision/ { print $2 }' | sed 's|r$||')
    	echo "- uninstalling $ext_nam $oldver"
    	vboxmanage extpack uninstall "$ext_nam"
    }
    
    echo "- installing $ext_nam $ver"
    vboxmanage extpack install $pkg_tgz
    else
    	echo "No extension pack found"
    fi

  6. #6

    Default Re: Update VirtualBox-4.0 Extension Pack.

    If the vboxdrv kernel module is not loaded (for some reason), updating the Extension Pack would work, but getting the VirtualBox version from vboxmanage -v output will fail because of the warning displayed. Appending | tail -1 to the command fixes the problem.

    The patch below illustrates this change :

    Code:
    --- updateVboxExt.orig      2011-07-14 00:01:19.918858508 -0700
    +++ updateVboxExt   2011-07-13 23:56:52.028762173 -0700
    @@ -14,7 +14,7 @@
     #
     
     which vboxmanage > /dev/null 2>&1 || exec echo "vboxmanage not found"
    -ver=$(vboxmanage -v)
    +ver=$(vboxmanage -v | tail -1)
     
     pkg_nam="${ext_nam// /_}"
     pkg_tgz="${pkg_nam}.tgz"
    You can apply the change either by using the patch or by editing the file manually, or copy/paste the patched version (1.2) below:

    Code:
    #! /bin/bash
    #
    #: Title       : updateVboxExt
    #: Date Created: Fri May 13 13:54:26 PDT 2011 
    #: Last Edit   : Thu Jul 14 00:08:43 PDT 2011
    #: Author      : please_try_again 
    #: Version     : 1.2
    #: Description : Install or update VirtualBox Extension pack
    
    pkg_sit="http://download.virtualbox.org/virtualbox/"
    pkg_dwl="http://www.virtualbox.org/wiki/Downloads"
    ext_nam="Oracle VM VirtualBox Extension Pack"
    pkg_ext="vbox-extpack"
    #
    
    which vboxmanage > /dev/null 2>&1 || exec echo "vboxmanage not found"
    ver=$(vboxmanage -v | tail -1)
    
    pkg_nam="${ext_nam// /_}"
    pkg_tgz="${pkg_nam}.tgz"
    pkg_ver="${ver%%r*}"
    pkg_blt="${ver##*r}"
    pkg_url="${pkg_sit}${pkg_ver}/${pkg_nam}-${pkg_ver}-${pkg_blt}.${pkg_ext}"
    
    # check if ExtensionPack for current VirtualBox version already install
    N=$(vboxmanage list extpacks | grep -c -e "$pkg_ver" -e "$pkg_blt")
    [ $N -ge 2 ] && exec echo "Extension Pack already installed"
    
    # download VirtualBox Extension Pack
    echo "- Downloading $pkg_url ..."
    wget $pkg_url -O $pkg_tgz
    
    # Not Extension Pack found for this version, try latest version on the download page.
    [ -s $pkg_tgz ] || {
    	rpm -qa | grep -q curl || exec echo "Please install curl"
    	p=$(echo $pkg_sit | sed 's|^.*//\([^/]*\).*|\1|')
    	pkg_url=$(curl $pkg_dwl | grep $p | sed -n "/$p/s|^.*\(${pkg_sit}${pkg_ver}.*${pkg_ext}\).*|\1|p" | sort -u)
    	wget $pkg_url -O $pkg_tgz
    }
    	
    if [ -s $pkg_tgz ] ; then 
    # Deinstall older versions ExtensionPack if any
    vboxmanage list extpacks | grep -q "$ext_nam" && { 
    	oldver=$(vboxmanage list extpacks | awk 'BEGIN {ORS="r"} ; /Version:|Revision/ { print $2 }' | sed 's|r$||')
    	echo "- uninstalling $ext_nam $oldver"
    	vboxmanage extpack uninstall "$ext_nam"
    }
    
    echo "- installing $ext_nam $ver"
    vboxmanage extpack install $pkg_tgz
    else
    	echo "No extension pack found"
    fi

  7. #7

    Default Re: Update VirtualBox-4.0 Extension Pack.

    This script has been renamed VBoxExtensionPack and is included in the vmscripts package. You can install this package from my repo:

    Code:
    su -l
    zypper ar http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_11.4/ PTA
    zypper refresh
    zypper in vmscripts
    Other scripts in this package include:

  8. #8

    Default Re: Update VirtualBox-4.0 Extension Pack.

    Also available in the 12.1 repo:

    Code:
    su -l
    zypper ar http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_12.1/  PTA
    zypper refresh
    zypper in vmscripts

  9. #9

    Default Re: Update VirtualBox-4.0 Extension Pack.

    I made this script compatible with the OSE version of VirtualBox by replacing vboxmanage (which exists only in the Oracle version) with VBoxManage (which exists in both the PUEL and the OSE version). (See this post: http://forums.opensuse.org/english/g...ml#post2478003 ).

    Here's the new code:


    Code:
    #! /bin/bash
    #
    #: Title       : VBoxExtensionPack
    #: Date Created: Fri May 13 13:54:26 PDT 2011 
    #: Last Edit   : Sat Aug  4 01:39:53 PDT 2012
    #: Author      : please_try_again 
    #: Version     : 1.3
    #: Description : Install or update VirtualBox Extension pack
    
    pkg_sit="http://download.virtualbox.org/virtualbox/"
    pkg_dwl="http://www.virtualbox.org/wiki/Downloads"
    ext_nam="Oracle VM VirtualBox Extension Pack"
    pkg_ext="vbox-extpack"
    #
    
    which VBoxManage > /dev/null 2>&1 || exec echo "VBoxManage not found"
    ver=$(VBoxManage -v | tail -1)
    
    pkg_nam="${ext_nam// /_}"
    pkg_tgz="${pkg_nam}.tgz"
    pkg_ver="${ver%%r*}"
    pkg_blt="${ver##*r}"
    pkg_url="${pkg_sit}${pkg_ver}/${pkg_nam}-${pkg_ver}-${pkg_blt}.${pkg_ext}"
    
    # check if ExtensionPack for current VirtualBox version already install
    N=$(VBoxManage list extpacks | grep -c -e "$pkg_ver" -e "$pkg_blt")
    [ $N -ge 2 ] && exec echo "Extension Pack already installed"
    
    # download VirtualBox Extension Pack
    echo "- Downloading $pkg_url ..."
    wget $pkg_url -O $pkg_tgz
    
    # Not Extension Pack found for this version, try latest version on the download page.
    [ -s $pkg_tgz ] || {
    	rpm -qa | grep -q curl || exec echo "Please install curl"
    	p=$(echo $pkg_sit | sed 's|^.*//\([^/]*\).*|\1|')
    	pkg_url=$(curl $pkg_dwl | grep $p | sed -n "/$p/s|^.*\(${pkg_sit}${pkg_ver}.*${pkg_ext}\).*|\1|p" | sort -u)
    	wget $pkg_url -O $pkg_tgz
    }
    	
    if [ -s $pkg_tgz ] ; then 
    # Deinstall older versions ExtensionPack if any
    VBoxManage list extpacks | grep -q "$ext_nam" && { 
    	oldver=$(VBoxManage list extpacks | awk 'BEGIN {ORS="r"} ; /Version:|Revision/ { print $2 }' | sed 's|r$||')
    	echo "- uninstalling $ext_nam $oldver"
    	VBoxManage extpack uninstall "$ext_nam"
    }
    
    echo "- installing $ext_nam $ver"
    VBoxManage extpack install $pkg_tgz
    else
    	echo "No extension pack found"
    fi
    I also updated this script in the package vmscripts (see post above) - among other changes.

  10. #10
    Join Date
    Mar 2013
    Location
    Bari (Italy)
    Posts
    58

    Default Update VirtualBox-4.0 (now 5.x) Extension Pack.

    Hi please_try_again and thanks for you scripts!


    Here's an updated VBoxExtensionPack for the latest OpenSuse Leap and Virtual Box 5.x version (i just set "cut -c -5" for "ver" and removed the "pkg_bit" lines):


    Code:
    pkg_sit="http://download.virtualbox.org/virtualbox/"
    pkg_dwl="http://www.virtualbox.org/wiki/Downloads"
    ext_nam="Oracle VM VirtualBox Extension Pack"
    pkg_ext="vbox-extpack"
    #
    
    
    which VBoxManage > /dev/null 2>&1 || exec echo "VBoxManage not found"
    ver=$(VBoxManage -v | cut -c -5)
    
    
    pkg_nam="${ext_nam// /_}"
    pkg_tgz="${pkg_nam}.tgz"
    pkg_ver="${ver%%r*}"
    pkg_url="${pkg_sit}${pkg_ver}/${pkg_nam}-${pkg_ver}.${pkg_ext}"
    
    
    # check if ExtensionPack for current VirtualBox version already install
    N=$(VBoxManage list extpacks | grep -c -e "$pkg_ver" -e "$pkg_blt")
    [ $N -ge 2 ] && exec echo "Extension Pack already installed"
    
    
    # download VirtualBox Extension Pack
    echo "- Downloading $pkg_url ..."
    wget $pkg_url -O $pkg_tgz
    
    
    # Not Extension Pack found for this version, try latest version on the download page.
    [ -s $pkg_tgz ] || {
        rpm -qa | grep -q curl || exec echo "Please install curl"
        p=$(echo $pkg_sit | sed 's|^.*//\([^/]*\).*|\1|')
        pkg_url=$(curl $pkg_dwl | grep $p | sed -n "/$p/s|^.*\(${pkg_sit}${pkg_ver}.*${pkg_ext}\).*|\1|p" | sort -u)
        wget $pkg_url -O $pkg_tgz
    }
        
    if [ -s $pkg_tgz ] ; then 
    # Deinstall older versions ExtensionPack if any
    VBoxManage list extpacks | grep -q "$ext_nam" && { 
        oldver=$(VBoxManage list extpacks | awk 'BEGIN {ORS="r"} ; /Version:|Revision/ { print $2 }' | sed 's|r$||')
        echo "- uninstalling $ext_nam $oldver"
        VBoxManage extpack uninstall "$ext_nam"
    }
    
    
    echo "- installing $ext_nam $ver"
    VBoxManage extpack install $pkg_tgz
    else
        echo "No extension pack found"
    fi

Page 1 of 2 12 LastLast

Posting Permissions

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