LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > catkin
User Name
Password

Notices


Rate this Entry

Upgrading VirtualBox PUEL 2.0.6 to 2.1.2 on ubuntu 8.04.1

Posted 01-26-2009 at 03:53 AM by catkin

Hello

Many people have posted on the 'net, describing VirtualBox PUEL upgrade as straightforward. My experience of several upgrades was very different with quite some breakage, repair and grief Here's the procedure I have evolved by experimentation to make it less painful, more routine. Several of the specifics (paths, virtual machine name WXP, Kaspersky, TweakUI, and my personal user name is c on ubuntu and C on WXP virtual) will be different on other systems but it should be easy to adapt.

The log is in two parts -- ubuntu and WXP virtual (sorry about the less superior formatting, lost in copy-and-paste).

First the ubuntu log:

Media: /home/c/Repository/Hardy/virtualbox-2.1_2.1.2-41885_Ubuntu_hardy_i386.deb

1.As user c, prepared the Repository:
Code:
cd /home/c/Repository/Hardy
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
2.(If doing this again look for the command line equivalent) Used Synaptic Package Manager's Reload button to propagate the new virtualbox-2.1 package
3.Ensured WXP not running
4.Ensured the "Sun xVM VirtualBox" configuration window closed.
5.As root ...
6.Ran /home/c/d/bin/BackupWXP.sh and gave it description "just before VBox 2.1.2".
7.As user c, started WXP
8.On WXP virtual (details in WXP virtual software log), as Administrator, stopped Kaspersky, scheduled C: CHKDSK and removed VirtualBox Guest Additions
9.As root, removed virtualbox-2.0:
Code:
apt-get remove virtualbox-2.0

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following packages will be REMOVED:

  virtualbox-2.0

0 upgraded, 0 newly installed, 1 to remove and 84 not upgraded.

After this operation, 76.7MB disk space will be freed.

Do you want to continue [Y/n]? y

(Reading database ... 123489 files and directories currently installed.)

Removing virtualbox-2.0 ...

 * Stopping VirtualBox kernel module
 *  done.

 * Shutting down VirtualBox host networking
 *  done.
10.As root, installed virtualbox-2.1. During the following procedure, on the character-based full screen window, answered Yes to "Should the vboxdrv kernel module be compiled now?"

Code:
apt-get install virtualbox-2.1

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following NEW packages will be installed:

  virtualbox-2.1

0 upgraded, 1 newly installed, 0 to remove and 84 not upgraded.

Need to get 0B/37.9MB of archives.

After this operation, 77.8MB of additional disk space will be used.

WARNING: The following packages cannot be authenticated!

  virtualbox-2.1

Install these packages without verification [y/N]? y

Preconfiguring packages ...

Selecting previously deselected package virtualbox-2.1.

(Reading database ... 123202 files and directories currently installed.)

Unpacking virtualbox-2.1 (from .../virtualbox-2.1_2.1.2-41885_Ubuntu_hardy_i386.deb) ...

Setting up virtualbox-2.1 (2.1.2-41885_Ubuntu_hardy) ...

Installing new version of config file /etc/init.d/vboxdrv ...

addgroup: The group `vboxusers' already exists as a system group. Exiting.

Messages emitted during module compilation will be logged to /var/log/vbox-install.log.

Success!

 * Starting VirtualBox kernel module                                                                                                                                                 *  done.
11.As user c ...
12.Started WXP:
/usr/bin/VBoxManage -convertSettingsBackup startvm WXP
(Applications, System Tools, Sun xVM VirtualBox is not present until after reboot)
13.Devices, Mount CD/DVD-ROM, CD/DVD ROM image
Browsed to the Guest Additions.iso
14.On WXP virtual (details in WXP virtual software log), as Administrator, cancelled "Video Controller (VGA compatible)" installation, "Base system" installation, installed VirtualBox Guest Additions, started Kaspersky, configured autologon.
15.Devices>Unmount CD/DVD-ROM
16.Set WXP VirtualBox window to resizeable and stretched to full screen (giving maximum size but leaving Gnome window management frame visible).
17.On WXP virtual, shut down WXP virtual.
18.Ran /home/c/d/bin/BackupWXP.sh and gave it description "just after VBox 2.1.2".


Now the WXP virtual log:

1.After backing up WXPSystemDrive.vdi (details in ubuntu log), as Administrator ...
2.Used TweakUI to configure Administrator autologon.
3.Stopped Kaspersky.
4.CHKDSK /F /V C: and scheduled "this volume to be checked next time the system restarts".
5.Removed VirtualBox Guest Additions and accepted restart offer.
6.After restart and Administrator autologon ...
7.Declined all new hardware installation
8.Shutdown WXP.
9.On ubuntu (see ubuntu log for details) installed VirtualBox 2.1.2-41885, started WXP, configured CD drive.
10.As Administrator ...
11.Using Windows Explorer, browsed to the CD and simulated autorun (ran VBoxWindowsAdditions.exe). Took all the defaults including the restart (Reboot now) offer.
12.After restart and aoutologon as Administrator ...
13.Accepted Windows offer of changing the colour depth.
14.Started Kaspersky.
15.Used TweakUI to configure user C autologon.
16.Shutdown WXP.
17.On ubuntu (see ubuntu log for details) backed up C: drive


For what it's worth, here's the quick-and-dirty backup script (it does not check that the virtual machine is not running or that the VirtualBox configuration window is not open).
Code:
#! /bin/bash

prod_vdi_afn='/srv/VirtualBox/WXPsystemdrive/WXPsystemdrive.vdi'
backup_dir='/var/opt/VirtualBox/Manual .vdi backups/'

ls -lrt --human-readable "$prod_vdi_afn"
echo "$backup_dir contents:"
ls -lrt --human-readable "$backup_dir"
echo "space on volume containing $backup_dir:"
df --human-readable "$backup_dir"

if [[ "$USER" != root ]]; then
	echo 'This script needs to be run as root to control the VirtualBox daemons'
	\exit 1
fi

echo 'Enter a description of this backup, for example "before applying SP3" or Ctl+C to abort'
read annotation

/etc/init.d/vbesave stop
/etc/init.d/vboxdrv stop
/etc/init.d/vboxnet stop

echo "Copying '$prod_vdi_afn' to '${backup_dir}WXPsystemdrive ($annotation).vdi'
(this will take a while)"
cp -p "$prod_vdi_afn" "${backup_dir}WXPsystemdrive ($annotation).vdi" 
echo "$backup_dir now contains:"
ls -lrt --human-readable "$backup_dir"

/etc/init.d/vbesave start
/etc/init.d/vboxdrv start
/etc/init.d/vboxnet start

sleep 2
and the associated restore script (tested!):
Code:
#! /bin/bash

prod_vdi_afn='/srv/VirtualBox/WXPsystemdrive/WXPsystemdrive.vdi'
backup_dir='/var/opt/VirtualBox/Manual .vdi backups/'

buf="$(ls -1 "$backup_dir")" 
i=0
while [[ "$buf" != '' ]]
do
	line="${buf%%
*}"
	if [[ "$line" = "$buf" ]]; then
		buf=''
	else
		buf="${buf#$line
}"
	fi
	file[$i]="$line"
	(( i=i+1 ))
done
imax=$i
if [[ $imax -eq 0 ]]; then
	echo 'No backup files found'
	\exit 1
fi

echo 'Files available to restore are:'
i=0
while [[ $i -lt $imax ]]
do
	echo "	$i ${file[ $i ]}"
	(( i=i+1 ))
done
echo "WARNING: existing $prod_vdi_afn will be overwritten"
echo 'Ensure Virtual Box configuration window is not open'
echo 'Enter number of file to restore (not error trapped) or Ctl+C to abort'
read

/etc/init.d/vbesave stop
/etc/init.d/vboxdrv stop
/etc/init.d/vboxnet stop

echo 'Copying virtual disk image file (this will take a while)'
cp -p "$backup_dir${file[ $REPLY ]}" "$prod_vdi_afn"

/etc/init.d/vbesave start
/etc/init.d/vboxdrv start
/etc/init.d/vboxnet start

\exit 0
Best

Charles
Posted in Uncategorized
Views 4504 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 01:48 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration