VirtualBox

Ticket #16583: vboxbug.sh

File vboxbug.sh, 1.7 KB (added by Anderson M. Gomes, 8 years ago)

Shell script that reproduces the bug when run on a GNU/Linux host

Line 
1#!/bin/bash
2set -e
3set -x
4vmname='VHDBUG'
5rootdir="${HOME}/VirtualBox VMs/${vmname}"
6
7# The bug doesn't happen when this line is commented.
8wait='true'
9
10# Abort if there is a VBoxSVC process already running
11killall -0 -v VBoxSVC && exit 1 || true
12
13mkdir -pv "${rootdir}"
14
15VBoxManage createmedium disk --filename "${rootdir}/basedisk.vhd" --size 1024 --format VHD
16test -z "${wait}" || killall -0 -w VBoxSVC
17
18VBoxManage internalcommands dumphdinfo "${rootdir}/basedisk.vhd"
19VBoxManage createmedium disk --filename "${rootdir}/diffdisk.vhd" --diffparent "${rootdir}/basedisk.vhd"
20test -z "${wait}" || killall -0 -w VBoxSVC
21
22VBoxManage internalcommands dumphdinfo "${rootdir}/diffdisk.vhd"
23VBoxManage createmedium disk --filename "${rootdir}/diffdiffdisk.vhd" --diffparent "${rootdir}/diffdisk.vhd"
24test -z "${wait}" || killall -0 -w VBoxSVC
25
26VBoxManage internalcommands dumphdinfo "${rootdir}/diffdiffdisk.vhd"
27VBoxManage createvm --name "${vmname}" --basefolder "${rootdir}" --ostype Other_64 --register
28VBoxManage storagectl "${vmname}" --name SATA --add sata --portcount 4
29VBoxManage storageattach "${vmname}" --storagectl SATA --port 0 --type hdd --medium "${rootdir}/diffdiffdisk.vhd"
30test -z "${wait}" || killall -0 -w VBoxSVC
31
32VBoxManage showvminfo "${vmname}"
33test -z "${wait}" || killall -0 -w VBoxSVC
34
35VBoxManage unregistervm "${vmname}" --delete
36test -f "${rootdir}/diffdiffdisk.vhd" && VBoxManage closemedium disk "${rootdir}/diffdiffdisk.vhd" --delete || true
37test -f "${rootdir}/diffdisk.vhd" && VBoxManage closemedium disk "${rootdir}/diffdisk.vhd" --delete || true
38test -f "${rootdir}/basedisk.vhd" && VBoxManage closemedium disk "${rootdir}/basedisk.vhd" --delete || true
39killall -0 -w VBoxSVC || true
40
41echo 'Test ended successfully'

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy