I thought, and don't ask me why, that upgrading in Virtualbox and copying that to a directory on my hard drive would solve that issue...well, it worked but didn't solve that particular problem.
However, the script I made is perhaps something that might help somebody in the future so I'm going to share it here:
Code: Select all
#!/bin/bash
# ===================================================================
# Mount VirtualBox VDI and copy contents to directory
# Run as su
# Usage: copyvdi /path_to_vdi /path_to_destination_directory mounted_partition_nr
# mounted_partition_nr: default = 1
# ===================================================================
VDI1=/mnt/vdi1
VDI2=/mnt/vdi2
if [ `id -u` != "0" ]; then
echo "This script must be run as root." 1>&2
exit 1
fi
if [ -z $1 ]; then
echo "Image file argument is missing." 1>&2
exit 1
fi
if [ -z $2 ]; then
echo "Destination directory argument is missing." 1>&2
exit 1
fi
if [ -z $3 ]; then
$3=1
fi
if [ -e $1 ]; then
echo > /dev/null
else
echo "Passed image file does not exist." 1>&2
exit 1
fi
if [ -d $2 ]; then
echo > /dev/null
else
mkdir -p $2
fi
# First install virtualbox-fuse
FCHK=$(apt search virtualbox-fuse | grep ^i)
if [ "$FCHK" = "" ]; then
apt-get install virtualbox-fuse
fi
# Create mount directories
if [ -d $VDI1 ]; then
echo > /dev/null
else
mkdir -p $VDI1
fi
if [ -d $VDI2 ]; then
echo > /dev/null
else
mkdir -p $VDI2
fi
# Mount the vdi
vdfuse -r -f $1 $VDI1
echo "Check if $VDI1 is mounted (ENTER to continue)"
read
#Mount the partition
# If you get a mount error here, try one of the other Partitions
mount $VDI1/Partition$3 $VDI2
echo "Check if $VDI2 is mounted (ENTER to continue)"
read
# Copy with rsync
rsync -avx $VDI2/ $2 --exclude={/tmp/*,/mnt/*,/lost+found/*,/home/*/.gvfs}
# When done
umount $VDI2 && umount $VDI1
rm -r $VDI2 && rm -r $VDI1
echo ""
echo "Done: $1 copied to $2"
echo "Press ENTER to quit"
read