[Pkg-virtualbox-commits] [virtualbox] 01/03: Imported Upstream version 5.0.0~RC3-dfsg

Gianfranco Costamagna locutusofborg-guest at moszumanska.debian.org
Fri Jul 3 19:06:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

locutusofborg-guest pushed a commit to branch experimental
in repository virtualbox.

commit f552048aa56a78a7f41b582ff943612201cd68a1
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Fri Jul 3 19:03:42 2015 +0200

    Imported Upstream version 5.0.0~RC3-dfsg
---
 Config.kmk                                         |   21 +-
 doc/manual/en_US/images/clone-vm.png               |  Bin 87747 -> 27242 bytes
 doc/manual/en_US/images/create-vdi-1.png           |  Bin 134442 -> 34961 bytes
 doc/manual/en_US/images/create-vm-1.png            |  Bin 141652 -> 39447 bytes
 doc/manual/en_US/images/create-vm-2.png            |  Bin 157453 -> 43915 bytes
 doc/manual/en_US/images/dnd-modes.png              |  Bin 149172 -> 36457 bytes
 doc/manual/en_US/images/ovf-import.png             |  Bin 200797 -> 51253 bytes
 doc/manual/en_US/images/seamless.png               |  Bin 2499275 -> 603665 bytes
 doc/manual/en_US/images/snapshots-1.png            |  Bin 152166 -> 50267 bytes
 doc/manual/en_US/images/vbox-components.png        |  Bin 178225 -> 61668 bytes
 doc/manual/en_US/images/vbox-sdl.png               |  Bin 955880 -> 287450 bytes
 doc/manual/en_US/images/vboxlogo.png               |  Bin 206625 -> 57874 bytes
 doc/manual/en_US/images/virtual-disk-manager.png   |  Bin 94196 -> 24362 bytes
 doc/manual/en_US/images/virtual-disk-manager2.png  |  Bin 107755 -> 27222 bytes
 doc/manual/en_US/images/virtualbox-main-empty.png  |  Bin 108117 -> 26800 bytes
 doc/manual/en_US/images/virtualbox-main.png        |  Bin 656931 -> 236759 bytes
 doc/manual/en_US/images/vm-close.png               |  Bin 27509 -> 6360 bytes
 doc/manual/en_US/images/vm-groups.png              |  Bin 248830 -> 67765 bytes
 doc/manual/en_US/images/vm-hostkey.png             |  Bin 10655 -> 1977 bytes
 doc/manual/en_US/images/vm-settings-harddisk.png   |  Bin 67423 -> 17982 bytes
 doc/manual/en_US/images/vm-vista-running.png       |  Bin 300956 -> 76644 bytes
 doc/manual/user_ChangeLogImpl.xml                  |    7 +-
 include/VBox/log.h                                 |   30 +-
 include/VBox/sup.h                                 |    8 +
 include/iprt/timer.h                               |    4 +
 .../VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp     |   14 +-
 .../common/VBoxService/VBoxServiceAutoMount.cpp    |    1 +
 .../common/VBoxService/VBoxServiceToolBox.cpp      |  178 +--
 .../Additions/linux/installer/vboxadd-service.sh   |    2 +-
 src/VBox/Additions/linux/installer/vboxadd-x11.sh  |   29 +-
 src/VBox/Additions/linux/installer/vboxadd.sh      |    4 +-
 .../Additions/linux/sharedfolders/mount.vboxsf.c   |   11 +-
 src/VBox/Additions/linux/sharedfolders/vbsfmount.h |    1 +
 src/VBox/Additions/x11/VBoxClient/draganddrop.cpp  | 1556 +++++++++++++-------
 src/VBox/Additions/x11/vboxvideo/vboxvideo.c       |   16 +-
 src/VBox/Devices/Audio/AudioMixBuffer.cpp          |    8 +-
 src/VBox/Devices/Audio/AudioMixer.cpp              |   26 +-
 src/VBox/Devices/Audio/AudioMixer.h                |    1 +
 src/VBox/Devices/Audio/DevIchAc97.cpp              |   15 +-
 src/VBox/Devices/Audio/DevIchHda.cpp               |   31 +-
 src/VBox/Devices/Audio/DevIchHdaCodec.cpp          |  915 ++++++++----
 src/VBox/Devices/Audio/DevIchHdaCodec.h            |   10 +-
 src/VBox/Devices/Audio/DevSB16.cpp                 |    9 +-
 src/VBox/Devices/Audio/DrvAudio.cpp                |    9 +-
 src/VBox/Devices/Audio/DrvAudioCommon.cpp          |    9 +-
 src/VBox/Devices/Audio/DrvHostALSAAudio.cpp        |   26 +-
 src/VBox/Devices/Audio/DrvHostCoreAudio.cpp        |   14 +-
 src/VBox/Devices/Audio/DrvHostDSound.cpp           |    9 +-
 src/VBox/Devices/Audio/DrvHostNullAudio.cpp        |    8 +-
 src/VBox/Devices/Audio/DrvHostOSSAudio.cpp         |   13 +-
 src/VBox/Devices/Audio/DrvHostPulseAudio.cpp       |   10 +-
 src/VBox/Devices/Audio/alsa_stubs.c                |    3 +-
 src/VBox/Devices/Audio/pulse_stubs.c               |    3 +-
 src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd      |  Bin 1048576 -> 1048576 bytes
 src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd      |  Bin 1048576 -> 1048576 bytes
 .../Graphics/BIOS/VBoxVgaBiosAlternative.asm       |    6 +-
 .../Graphics/BIOS/VBoxVgaBiosAlternative.md5sum    |    2 +-
 src/VBox/Devices/Graphics/DevVGA_VBVA.cpp          |   21 +-
 src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp      |    6 +-
 src/VBox/Devices/Input/PS2K.cpp                    |    2 +-
 src/VBox/Devices/Makefile.kmk                      |    4 +-
 src/VBox/Devices/Network/DevE1000.cpp              |    8 +-
 src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm   |    4 +-
 .../Devices/PC/BIOS/VBoxBiosAlternative.md5sum     |    2 +-
 src/VBox/Devices/Storage/DevAHCI.cpp               |   89 +-
 src/VBox/Devices/Storage/DevATA.cpp                |    6 +-
 .../onnv/lib/libdtrace/common/dt_printf.c          |    2 +-
 .../Frontends/VBoxManage/VBoxManageGuestCtrl.cpp   |    6 +-
 .../Frontends/VirtualBox/nls/ApprovedLanguages.kmk |    1 -
 src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts |    6 +-
 src/VBox/Frontends/VirtualBox/nls/VirtualBox_eu.ts |    6 +-
 src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts | 1250 ++++++++--------
 .../Frontends/VirtualBox/src/VBoxFBOverlay.cpp     |    2 +
 .../VirtualBox/src/extradata/UIExtraDataDefs.cpp   |    1 +
 .../VirtualBox/src/extradata/UIExtraDataDefs.h     |    3 +
 .../src/extradata/UIExtraDataManager.cpp           |   30 +-
 .../VirtualBox/src/extradata/UIExtraDataManager.h  |    9 +-
 .../VirtualBox/src/runtime/UIDnDDataObject_win.cpp |  458 +++---
 .../VirtualBox/src/runtime/UIDnDDataObject_win.h   |   16 +-
 .../VirtualBox/src/runtime/UIDnDDropSource_win.cpp |    8 +
 .../VirtualBox/src/runtime/UIDnDHandler.cpp        |   99 +-
 .../VirtualBox/src/runtime/UIMachineView.cpp       |   56 +-
 .../VirtualBox/src/runtime/UIMachineView.h         |   16 +-
 .../src/runtime/UIMenuBarEditorWindow.cpp          |  791 +++++-----
 .../VirtualBox/src/runtime/UIMenuBarEditorWindow.h |  111 +-
 .../Frontends/VirtualBox/src/runtime/UISession.cpp |   17 +-
 .../src/runtime/UIStatusBarEditorWindow.cpp        |  177 +--
 .../src/runtime/UIStatusBarEditorWindow.h          |   19 +-
 .../src/runtime/normal/UIMachineViewNormal.cpp     |   18 +-
 .../src/runtime/scale/UIMachineViewScale.cpp       |   10 +-
 .../machine/UIMachineSettingsInterface.cpp         |   84 +-
 .../settings/machine/UIMachineSettingsInterface.h  |   65 +-
 src/VBox/GuestHost/OpenGL/util/vboxhgcm.c          |    2 +-
 src/VBox/HostDrivers/Support/SUPDrv.cpp            |   14 +
 src/VBox/HostDrivers/Support/SUPDrvIOC.h           |    2 +-
 src/VBox/HostDrivers/Support/SUPLibInternal.h      |   17 +-
 src/VBox/HostDrivers/Support/SUPR0-def-lx.sed      |    9 +
 src/VBox/HostDrivers/Support/SUPR0-def-pe.sed      |    8 +
 src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp |    4 +-
 src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp |   88 +-
 .../Support/SUPR3HardenedMainTemplateTestcase.cpp  |   34 +
 .../HostDrivers/Support/SUPR3HardenedVerify.cpp    |   65 +-
 .../HostDrivers/Support/darwin/SUPDrv-darwin.cpp   |    8 +
 .../Support/testcase/tstSupTscDelta.cpp            |    2 +-
 .../Support/win/SUPHardenedVerify-win.h            |    2 +-
 .../Support/win/SUPHardenedVerifyImage-win.cpp     |    4 +-
 .../Support/win/SUPR3HardenedMain-win.cpp          |  195 ++-
 .../Support/win/SUPR3HardenedMainA-win.asm         |    7 +-
 .../Support/win/SUPR3HardenedMainImports-win.cpp   |    8 +-
 src/VBox/HostDrivers/Support/win/winstub.com       |  Bin 128 -> 0 bytes
 .../VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp        |    2 +-
 .../VBoxNetFlt/linux/VBoxNetFlt-linux.c            |    2 +-
 src/VBox/Installer/linux/Makefile.kmk              |   15 +
 src/VBox/Installer/linux/install.sh                |   29 +-
 src/VBox/Installer/linux/routines.sh               |  627 +++-----
 src/VBox/Installer/linux/run-inst.sh               |    7 +-
 src/VBox/Installer/linux/vboxautostart-service.sh  |    2 +-
 .../Installer/linux/vboxballoonctrl-service.sh     |    2 +-
 src/VBox/Installer/linux/vboxdrv.sh.in             |    2 +-
 src/VBox/Installer/linux/vboxweb-service.sh        |    2 +-
 src/VBox/Installer/win/Makefile.kmk                |   12 +-
 src/VBox/Installer/win/VirtualBox.wxs              |    2 +
 src/VBox/Main/cbinding/capiidl.xsl                 |   54 +-
 src/VBox/Main/cbinding/tstCAPIGlue.c               |    2 +-
 src/VBox/Main/glue/vboxapi.py                      |   29 +-
 src/VBox/Main/include/GuestCtrlImplPrivate.h       |   15 +-
 src/VBox/Main/include/GuestDnDPrivate.h            |   24 +-
 src/VBox/Main/src-client/DrvAudioVRDE.cpp          |    7 +-
 src/VBox/Main/src-client/GuestDirectoryImpl.cpp    |    3 +-
 src/VBox/Main/src-client/GuestDnDPrivate.cpp       |   80 +-
 src/VBox/Main/src-client/GuestDnDSourceImpl.cpp    |    8 +-
 src/VBox/Main/src-client/GuestDnDTargetImpl.cpp    |  139 +-
 src/VBox/Main/src-client/GuestProcessImpl.cpp      |    4 +-
 src/VBox/Main/src-client/GuestSessionImpl.cpp      |   16 +-
 src/VBox/Main/src-client/SessionImpl.cpp           |   16 +-
 src/VBox/Main/src-server/AudioAdapterImpl.cpp      |   26 +-
 src/VBox/Runtime/VBox/log-vbox.cpp                 |   10 +-
 src/VBox/Runtime/common/misc/getopt.cpp            |    2 +-
 src/VBox/Runtime/common/path/RTPathRmCmd.cpp       |    2 +-
 src/VBox/Runtime/generic/env-generic.cpp           |    4 +-
 .../r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp      |    4 +-
 src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp       |    4 +-
 src/VBox/Runtime/r3/isofs.cpp                      |    8 +-
 src/VBox/Runtime/testcase/Makefile.kmk             |   24 +-
 src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp   |   12 +-
 src/VBox/Runtime/testcase/tstRTR0Timer.cpp         |   26 +-
 src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp   |    4 -
 src/VBox/Storage/Debug/VDDbgIoLog.cpp              |    3 +
 src/VBox/Storage/VCICache.cpp                      |    2 +
 src/VBox/Storage/VD.cpp                            |   10 +-
 src/VBox/Storage/VMDK.cpp                          |   10 +
 src/VBox/Storage/testcase/tstVDIo.cpp              |    6 +
 src/VBox/Storage/testcase/tstVDSnap.cpp            |   11 +
 src/VBox/VMM/VMMAll/IEMAllAImplC.cpp               |    6 +-
 src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h       |    4 +-
 src/VBox/VMM/VMMAll/IOMAllMMIO.cpp                 |   23 +-
 src/VBox/VMM/VMMR0/GIMR0Hv.cpp                     |   11 +-
 src/VBox/VMM/VMMR0/HMR0.cpp                        |   16 +-
 src/VBox/VMM/VMMR0/HMSVMR0.cpp                     |   28 +-
 src/VBox/VMM/VMMR0/HMVMXR0.cpp                     |    6 -
 src/VBox/VMM/VMMR0/VMMR0.cpp                       |    1 +
 src/VBox/VMM/VMMR3/CFGM.cpp                        |   13 +
 src/VBox/VMM/VMMR3/GIMHv.cpp                       |  133 +-
 src/VBox/VMM/VMMR3/GIMKvm.cpp                      |   15 +-
 src/VBox/VMM/include/GIMHvInternal.h               |    2 +
 src/VBox/VMM/include/GIMKvmInternal.h              |    4 +-
 src/VBox/VMM/include/HMInternal.h                  |    4 +-
 src/VBox/VMM/testcase/Makefile.kmk                 |   16 +-
 src/VBox/VMM/testcase/tstVMREQ.cpp                 |   12 +-
 src/VBox/ValidationKit/common/webutils.py          |    6 +-
 src/VBox/ValidationKit/testdriver/reporter.py      |   34 +-
 src/VBox/ValidationKit/testdriver/vbox.py          |   24 +-
 src/VBox/ValidationKit/testdriver/vboxinstaller.py |   21 +-
 src/VBox/ValidationKit/testmanager/core/base.py    |    5 +-
 src/VBox/ValidationKit/testmanager/core/report.py  |    7 +-
 .../ValidationKit/testmanager/core/testresults.py  |  235 +--
 .../ValidationKit/testmanager/webui/wuimain.py     |    4 +-
 .../tests/additions/tdAddGuestCtrl.py              |  994 ++++++++-----
 .../ValidationKit/tests/unittests/tdUnitTest1.py   |    5 +-
 src/VBox/ValidationKit/utils/network/NetPerf.cpp   |    5 +-
 180 files changed, 5919 insertions(+), 3865 deletions(-)

diff --git a/Config.kmk b/Config.kmk
index 922b48d..e9f110f 100644
--- a/Config.kmk
+++ b/Config.kmk
@@ -220,9 +220,9 @@ VBOX_BUILD_PUBLISHER =
 # Note! The BETA[n],ALPHA[n],RC[n] indicators should be inserted before the
 #       publisher so that RTStrVersionCompare have a chance of comparing
 #       prerelease from different publishers correctly.
-VBOX_VERSION_STRING = $(VBOX_VERSION_STRING_RAW)_RC2$(VBOX_BUILD_PUBLISHER)
+VBOX_VERSION_STRING = $(VBOX_VERSION_STRING_RAW)_RC3$(VBOX_BUILD_PUBLISHER)
 # Just the BETA[n],ALPHA[n],RC[n] indicators. Set to empty string for release.
-VBOX_VERSION_PRERELEASE = RC2
+VBOX_VERSION_PRERELEASE = RC3
 
 # Force the additions.sh script to get an exact additions build when we're doing the release.
 ifeq ($(int-mod $(VBOX_VERSION_BUILD),2),0)
@@ -4319,14 +4319,25 @@ TEMPLATE_VBOXR3HARDENEDLIB_LIBS = $(NO_SUCH_VARIABLE)
 
 
 #
-# Template for building hardened Ring-3 executables.
-# These shall have no extra runpaths, esp. not origin ones.
+# Template for building hardened Ring-3 testcase executables.
 #
 TEMPLATE_VBoxR3HardenedTstExe = VBox Ring-3 Hardened Testcase Exe (currently windows only!)
 TEMPLATE_VBoxR3HardenedTstExe_EXTENDS = VBOXR3HARDENEDEXE
 TEMPLATE_VBoxR3HardenedTstExe_INST = $(INST_TESTCASE)
 
 #
+# Template for building hardened Ring-3 testcase DLLs (pairs with VBoxR3HardenedTstExe).
+#
+TEMPLATE_VBoxR3HardenedTstDll = VBox Ring-3 Hardened Testcase Dll (currently windows only!)
+TEMPLATE_VBoxR3HardenedTstDll_EXTENDS = VBoxR3TstDll
+TEMPLATE_VBoxR3HardenedTstDll_INST = $(INST_TESTCASE)
+ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.win = $(TEMPLATE_VBoxR3TstDll_LDFLAGS.win) -IntegrityCheck
+ifn1of ($(KBUILD_TARGET), win os2)
+ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS       = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3TstDll_LDFLAGS))
+ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.linux))
+endif
+
+#
 # Template for building set-uid-to-root helper programs.
 # In hardened builds, these may only contain absolute runpaths!
 #
@@ -6078,7 +6089,7 @@ endif
 SVN                    ?= svn$(HOSTSUFF_EXE)
 VBOX_SVN_REV_KMK        = $(PATH_OUT)/revision.kmk
 ifndef VBOX_SVN_REV
- VBOX_SVN_REV_FALLBACK := $(patsubst %:,,  $Rev: 101271 $  )
+ VBOX_SVN_REV_FALLBACK := $(patsubst %:,,  $Rev: 101436 $  )
  VBOX_SVN_DEP          := $(firstword $(wildcard $(PATH_ROOT)/.svn/wc.db $(abspath $(PATH_ROOT)/../.svn/wc.db) $(abspath $(PATH_ROOT)/../../.svn/wc.db) $(PATH_ROOT)/.svn/entries))
  ifeq ($(which $(SVN)),)
   VBOX_SVN_DEP         :=
diff --git a/doc/manual/en_US/images/clone-vm.png b/doc/manual/en_US/images/clone-vm.png
index 28ec8a5..60b99d7 100644
Binary files a/doc/manual/en_US/images/clone-vm.png and b/doc/manual/en_US/images/clone-vm.png differ
diff --git a/doc/manual/en_US/images/create-vdi-1.png b/doc/manual/en_US/images/create-vdi-1.png
index c38ffe0..f7c0ba9 100644
Binary files a/doc/manual/en_US/images/create-vdi-1.png and b/doc/manual/en_US/images/create-vdi-1.png differ
diff --git a/doc/manual/en_US/images/create-vm-1.png b/doc/manual/en_US/images/create-vm-1.png
index 1fc5728..52f5c25 100644
Binary files a/doc/manual/en_US/images/create-vm-1.png and b/doc/manual/en_US/images/create-vm-1.png differ
diff --git a/doc/manual/en_US/images/create-vm-2.png b/doc/manual/en_US/images/create-vm-2.png
index 25de93f..91c0e9c 100644
Binary files a/doc/manual/en_US/images/create-vm-2.png and b/doc/manual/en_US/images/create-vm-2.png differ
diff --git a/doc/manual/en_US/images/dnd-modes.png b/doc/manual/en_US/images/dnd-modes.png
index f922ca9..be0a2f5 100644
Binary files a/doc/manual/en_US/images/dnd-modes.png and b/doc/manual/en_US/images/dnd-modes.png differ
diff --git a/doc/manual/en_US/images/ovf-import.png b/doc/manual/en_US/images/ovf-import.png
index fc31cab..9851785 100644
Binary files a/doc/manual/en_US/images/ovf-import.png and b/doc/manual/en_US/images/ovf-import.png differ
diff --git a/doc/manual/en_US/images/seamless.png b/doc/manual/en_US/images/seamless.png
index d59b706..7239300 100644
Binary files a/doc/manual/en_US/images/seamless.png and b/doc/manual/en_US/images/seamless.png differ
diff --git a/doc/manual/en_US/images/snapshots-1.png b/doc/manual/en_US/images/snapshots-1.png
index fd8198d..ddd7e28 100644
Binary files a/doc/manual/en_US/images/snapshots-1.png and b/doc/manual/en_US/images/snapshots-1.png differ
diff --git a/doc/manual/en_US/images/vbox-components.png b/doc/manual/en_US/images/vbox-components.png
index 45ad6e5..ed1326d 100644
Binary files a/doc/manual/en_US/images/vbox-components.png and b/doc/manual/en_US/images/vbox-components.png differ
diff --git a/doc/manual/en_US/images/vbox-sdl.png b/doc/manual/en_US/images/vbox-sdl.png
index bae1f9f..87e036d 100644
Binary files a/doc/manual/en_US/images/vbox-sdl.png and b/doc/manual/en_US/images/vbox-sdl.png differ
diff --git a/doc/manual/en_US/images/vboxlogo.png b/doc/manual/en_US/images/vboxlogo.png
index 1fcdd79..1394b44 100644
Binary files a/doc/manual/en_US/images/vboxlogo.png and b/doc/manual/en_US/images/vboxlogo.png differ
diff --git a/doc/manual/en_US/images/virtual-disk-manager.png b/doc/manual/en_US/images/virtual-disk-manager.png
index 202d7d1..faa12cd 100644
Binary files a/doc/manual/en_US/images/virtual-disk-manager.png and b/doc/manual/en_US/images/virtual-disk-manager.png differ
diff --git a/doc/manual/en_US/images/virtual-disk-manager2.png b/doc/manual/en_US/images/virtual-disk-manager2.png
index 11a7271..2cf2ba0 100644
Binary files a/doc/manual/en_US/images/virtual-disk-manager2.png and b/doc/manual/en_US/images/virtual-disk-manager2.png differ
diff --git a/doc/manual/en_US/images/virtualbox-main-empty.png b/doc/manual/en_US/images/virtualbox-main-empty.png
index fcf748f..a8bac9e 100644
Binary files a/doc/manual/en_US/images/virtualbox-main-empty.png and b/doc/manual/en_US/images/virtualbox-main-empty.png differ
diff --git a/doc/manual/en_US/images/virtualbox-main.png b/doc/manual/en_US/images/virtualbox-main.png
index de0dacb..8ab243a 100644
Binary files a/doc/manual/en_US/images/virtualbox-main.png and b/doc/manual/en_US/images/virtualbox-main.png differ
diff --git a/doc/manual/en_US/images/vm-close.png b/doc/manual/en_US/images/vm-close.png
index 359de35..f74150a 100644
Binary files a/doc/manual/en_US/images/vm-close.png and b/doc/manual/en_US/images/vm-close.png differ
diff --git a/doc/manual/en_US/images/vm-groups.png b/doc/manual/en_US/images/vm-groups.png
index 5c72d4b..ca7d1f6 100644
Binary files a/doc/manual/en_US/images/vm-groups.png and b/doc/manual/en_US/images/vm-groups.png differ
diff --git a/doc/manual/en_US/images/vm-hostkey.png b/doc/manual/en_US/images/vm-hostkey.png
index da09d62..7c36c0c 100644
Binary files a/doc/manual/en_US/images/vm-hostkey.png and b/doc/manual/en_US/images/vm-hostkey.png differ
diff --git a/doc/manual/en_US/images/vm-settings-harddisk.png b/doc/manual/en_US/images/vm-settings-harddisk.png
index 4f6a2c1..58ff37b 100644
Binary files a/doc/manual/en_US/images/vm-settings-harddisk.png and b/doc/manual/en_US/images/vm-settings-harddisk.png differ
diff --git a/doc/manual/en_US/images/vm-vista-running.png b/doc/manual/en_US/images/vm-vista-running.png
index 4032438..32a1424 100644
Binary files a/doc/manual/en_US/images/vm-vista-running.png and b/doc/manual/en_US/images/vm-vista-running.png differ
diff --git a/doc/manual/user_ChangeLogImpl.xml b/doc/manual/user_ChangeLogImpl.xml
index 56d1aff..622f703 100644
--- a/doc/manual/user_ChangeLogImpl.xml
+++ b/doc/manual/user_ChangeLogImpl.xml
@@ -3,7 +3,7 @@
 <chapter> <!-- HACK ALERT! Seems we must have a single top level element for xi:include to work.
                            So, we use chapter and xpointer="xpointer(/chapter/)" with xi:include. -->
   <sect1>
-    <title>Version 5.0.0 Release Candidate 2 (2015-06-25)</title>
+    <title>Version 5.0.0 Release Candidate 3 (2015-07-03)</title>
 
     <para>This is a major update. The following major new features
       were added:</para>
@@ -193,6 +193,11 @@
       </listitem>
 
       <listitem>
+        <para>Storage: fixed crash as a result of I/O errors in certain conditions
+          (bug #13105)</para>
+      </listitem>
+
+      <listitem>
         <para>ICH9: fixed the interrupt disable logic for MSI interrupts; should
           fix old Linux guests with AHCI</para>
       </listitem>
diff --git a/include/VBox/log.h b/include/VBox/log.h
index c9978cd..97ccc57 100644
--- a/include/VBox/log.h
+++ b/include/VBox/log.h
@@ -59,6 +59,10 @@ typedef enum LOGGROUP
 {
     /** The default VBox group. */
     LOG_GROUP_DEFAULT = RTLOGGROUP_FIRST_USER,
+    /** Audio mixer group. */
+    LOG_GROUP_AUDIO_MIXER,
+    /** Audio mixer buffer group. */
+    LOG_GROUP_AUDIO_MIXER_BUFFER,
     /** Auto-logon group. */
     LOG_GROUP_AUTOLOGON,
     /** CFGM group. */
@@ -77,14 +81,14 @@ typedef enum LOGGROUP
     LOG_GROUP_DBGG,
     /** Generic Device group. */
     LOG_GROUP_DEV,
+    /** AC97 Device group. */
+    LOG_GROUP_DEV_AC97,
     /** ACPI Device group. */
     LOG_GROUP_DEV_ACPI,
     /** AHCI Device group. */
     LOG_GROUP_DEV_AHCI,
     /** APIC Device group. */
     LOG_GROUP_DEV_APIC,
-    /** Audio Device group. */
-    LOG_GROUP_DEV_AUDIO,
     /** BusLogic SCSI host adapter group. */
     LOG_GROUP_DEV_BUSLOGIC,
     /** DMA Controller group. */
@@ -99,6 +103,10 @@ typedef enum LOGGROUP
     LOG_GROUP_DEV_FDC,
     /** Guest Interface Manager Device group. */
     LOG_GROUP_DEV_GIM,
+    /** HDA Device group. */
+    LOG_GROUP_DEV_HDA,
+    /** HDA Codec Device group. */
+    LOG_GROUP_DEV_HDA_CODEC,
     /** High Precision Event Timer Device group. */
     LOG_GROUP_DEV_HPET,
     /** IDE Device group. */
@@ -135,6 +143,8 @@ typedef enum LOGGROUP
     LOG_GROUP_DEV_PIT,
     /** RTC Device group. */
     LOG_GROUP_DEV_RTC,
+    /** SB16 Device group. */
+    LOG_GROUP_DEV_SB16,
     /** Serial Device group */
     LOG_GROUP_DEV_SERIAL,
     /** System Management Controller Device group. */
@@ -161,6 +171,8 @@ typedef enum LOGGROUP
     LOG_GROUP_DRV,
     /** ACPI driver group */
     LOG_GROUP_DRV_ACPI,
+    /** Audio driver group */
+    LOG_GROUP_DRV_AUDIO,
     /** Block driver group. */
     LOG_GROUP_DRV_BLOCK,
     /** Char driver group. */
@@ -171,6 +183,8 @@ typedef enum LOGGROUP
     LOG_GROUP_DRV_DISPLAY,
     /** Floppy media driver group. */
     LOG_GROUP_DRV_FLOPPY,
+    /** Host Audio driver group. */
+    LOG_GROUP_DRV_HOST_AUDIO,
     /** Host Base block driver group. */
     LOG_GROUP_DRV_HOST_BASE,
     /** Host DVD block driver group. */
@@ -219,6 +233,8 @@ typedef enum LOGGROUP
     LOG_GROUP_DRV_VBOXHDD,
     /** VBox HDD container media driver group. */
     LOG_GROUP_DRV_VD,
+    /** VRDE audio driver group. */
+    LOG_GROUP_DRV_VRDE_AUDIO,
     /** Virtual Switch transport driver group */
     LOG_GROUP_DRV_VSWITCH,
     /** VUSB driver group */
@@ -782,6 +798,8 @@ typedef enum LOGGROUP
 {                   \
     RT_LOGGROUP_NAMES, \
     "DEFAULT",      \
+    "AUDIO_MIXER",  \
+    "AUDIO_MIXER_BUFFER", \
     "AUTOLOGON",    \
     "CFGM",         \
     "CPUM",         \
@@ -791,10 +809,10 @@ typedef enum LOGGROUP
     "DBGF_INFO",    \
     "DBGG",         \
     "DEV",          \
+    "DEV_AC97",     \
     "DEV_ACPI",     \
     "DEV_AHCI",     \
     "DEV_APIC",     \
-    "DEV_AUDIO",    \
     "DEV_BUSLOGIC", \
     "DEV_DMA",      \
     "DEV_E1000",    \
@@ -802,6 +820,8 @@ typedef enum LOGGROUP
     "DEV_EHCI",     \
     "DEV_FDC",      \
     "DEV_GIM",      \
+    "DEV_HDA",      \
+    "DEV_HDA_CODEC", \
     "DEV_HPET",     \
     "DEV_IDE",      \
     "DEV_INIP",     \
@@ -820,6 +840,7 @@ typedef enum LOGGROUP
     "DEV_PIC",      \
     "DEV_PIT",      \
     "DEV_RTC",      \
+    "DEV_SB16",     \
     "DEV_SERIAL",   \
     "DEV_SMC",      \
     "DEV_VGA",      \
@@ -833,11 +854,13 @@ typedef enum LOGGROUP
     "DIS",          \
     "DRV",          \
     "DRV_ACPI",     \
+    "DRV_AUDIO",    \
     "DRV_BLOCK",    \
     "DRV_CHAR",     \
     "DRV_DISK_INTEGRITY", \
     "DRV_DISPLAY",  \
     "DRV_FLOPPY",   \
+    "DRV_HOST_AUDIO", \
     "DRV_HOST_BASE", \
     "DRV_HOST_DVD", \
     "DRV_HOST_FLOPPY", \
@@ -862,6 +885,7 @@ typedef enum LOGGROUP
     "DRV_USBPROXY", \
     "DRV_VBOXHDD",  \
     "DRV_VD",       \
+    "DRV_VRDE_AUDIO", \
     "DRV_VSWITCH",  \
     "DRV_VUSB",     \
     "EM",           \
diff --git a/include/VBox/sup.h b/include/VBox/sup.h
index 136e3f2..644b169 100644
--- a/include/VBox/sup.h
+++ b/include/VBox/sup.h
@@ -1050,6 +1050,14 @@ DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int
 #define SUPSECMAIN_FLAGS_DONT_OPEN_DEV      RT_BIT_32(0)
 /** The hardened DLL has a "TrustedError" function (see FNSUPTRUSTEDERROR). */
 #define SUPSECMAIN_FLAGS_TRUSTED_ERROR      RT_BIT_32(1)
+/** Program binary location mask. */
+#define SUPSECMAIN_FLAGS_LOC_MASK           UINT32_C(0x00000010)
+/** Default binary location is the application binary directory.  Does
+ * not need to be given explicitly (it's 0).  */
+#define SUPSECMAIN_FLAGS_LOC_APP_BIN        UINT32_C(0x00000000)
+/** The binary is located in the testcase directory instead of the
+ * default application binary directory. */
+#define SUPSECMAIN_FLAGS_LOC_TESTCASE       UINT32_C(0x00000010)
 /** @} */
 
 /**
diff --git a/include/iprt/timer.h b/include/iprt/timer.h
index 106a645..e748339 100644
--- a/include/iprt/timer.h
+++ b/include/iprt/timer.h
@@ -174,6 +174,10 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First);
 /**
  * Stops an active timer.
  *
+ * @todo    May return while the timer callback function is being services on
+ *          some platforms (ring-0 Windows, ring-0 linux).  This needs to be
+ *          addressed at some point...
+ *
  * @returns IPRT status code.
  * @retval  VERR_INVALID_HANDLE if pTimer isn't valid.
  * @retval  VERR_TIMER_SUSPENDED if the timer isn't active.
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp
index 62a0eac..e3de3fd 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp
@@ -781,6 +781,7 @@ static int vbglR3DnDHGProcessSendDataMessageLoop(PVBGLR3GUESTDNDCMDCTX pCtx,
             *pcbDataRecv = cbDataTotal;
     }
 
+    LogFlowFuncLeaveRC(rc);
     return rc;
 }
 
@@ -817,25 +818,18 @@ static int vbglR3DnDHGProcessSendDataMessage(PVBGLR3GUESTDNDCMDCTX pCtx,
          * VBoxTray) small by not having too much redundant code. */
         AssertPtr(pcbFormatRecv);
         if (DnDMIMEHasFileURLs(pszFormat, *pcbFormatRecv))
-        {
             rc = vbglR3DnDHGProcessURIMessages(pCtx,
                                                ppvData,
                                                cbData,
                                                pcbDataRecv);
-        }
-        else
-            rc = VERR_NOT_SUPPORTED;
-
         if (RT_FAILURE(rc))
         {
-            if (RT_FAILURE(rc))
-            {
-                int rc2 = VbglR3DnDHGSetProgress(pCtx, DragAndDropSvc::DND_PROGRESS_ERROR, 100 /* Percent */, rc);
-                AssertRC(rc2);
-            }
+            int rc2 = VbglR3DnDHGSetProgress(pCtx, DragAndDropSvc::DND_PROGRESS_ERROR, 100 /* Percent */, rc);
+            AssertRC(rc2);
         }
     }
 
+    LogFlowFuncLeaveRC(rc);
     return rc;
 }
 
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
index 9a7720b..d9be3e0 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
@@ -440,6 +440,7 @@ static int VBoxServiceAutoMountProcessMappings(PVBGLR3SHAREDFOLDERMAPPING paMapp
                             0,                     /* dmask */
                             0,                     /* fmask */
                             0,                     /* ronly */
+                            0,                     /* sloppy */
                             0,                     /* noexec */
                             0,                     /* nodev */
                             0,                     /* nosuid */
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
index e2234b6..53a74c6 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
@@ -956,184 +956,10 @@ static RTEXITCODE VBoxServiceToolboxLs(int argc, char **argv)
 }
 
 
-static char g_paszRmHelp[] =
-    "  VBoxService [--use-toolbox] vbox_rm [<general options>] [<options>] <file>...\n\n"
-    "Delete files and optionally directories if the '-R' or '-r' option is specified.\n"
-    "If a file or directory cannot be deleted, an error message is printed if the\n"
-    "'--machine-readable' option is not specified and the next file will be\n"
-    "processed. The root directory is always ignored.\n\n"
-    "Options:\n\n"
-    "  [-R|-r]                    Recursively delete directories too.\n"
-    "\n";
-
-
-/**
- * Report the result of a vbox_rm operation - either errors to stderr (not
- * machine-readable) or everything to stdout as <name>\0<rc>\0 (machine-
- * readable format).  The message may optionally contain a '%s' for the file
- * name and an %Rrc for the result code in that order.  In future a "verbose"
- * flag may be added, without which nothing will be output in non-machine-
- * readable mode.  Sets prc if rc is a non-success code.
- */
-static void toolboxRmReport(const char *pcszMessage, const char *pcszFile,
-                            bool fActive, int rc, uint32_t fOutputFlags,
-                            int *prc)
-{
-    if (!fActive)
-        return;
-    if (!(fOutputFlags & VBOXSERVICETOOLBOXOUTPUTFLAG_PARSEABLE))
-    {
-        if (RT_SUCCESS(rc))
-            RTPrintf(pcszMessage, pcszFile, rc);
-        else
-            RTMsgError(pcszMessage, pcszFile, rc);
-    }
-    else
-        RTPrintf("fname=%s%crc=%d%c", pcszFile, 0, rc, 0);
-    if (prc && RT_FAILURE(rc))
-        *prc = rc;
-}
-
-
-/**
- * Main function for tool "vbox_rm".
- *
- * @return  RTEXITCODE.
- * @param   argc                    Number of arguments.
- * @param   argv                    Pointer to argument array.
- */
+/* Try using RTPathRmCmd. */
 static RTEXITCODE VBoxServiceToolboxRm(int argc, char **argv)
 {
-    static const RTGETOPTDEF s_aOptions[] =
-    {
-        { "--machinereadable", VBOXSERVICETOOLBOXOPT_MACHINE_READABLE,
-          RTGETOPT_REQ_NOTHING },
-        /* Be like POSIX, which has both 'r' and 'R'. */
-        { NULL,                'r',
-          RTGETOPT_REQ_NOTHING },
-        { NULL,                'R',
-          RTGETOPT_REQ_NOTHING },
-    };
-
-    enum
-    {
-        VBOXSERVICETOOLBOXRMFLAG_RECURSIVE = RT_BIT_32(0)
-    };
-
-    int ch, rc;
-    RTGETOPTUNION ValueUnion;
-    RTGETOPTSTATE GetState;
-    rc = RTGetOptInit(&GetState, argc, argv, s_aOptions,
-                      RT_ELEMENTS(s_aOptions), 1 /*iFirst*/,
-                      RTGETOPTINIT_FLAGS_OPTS_FIRST);
-    AssertRCReturn(rc, RTEXITCODE_INIT);
-
-    bool     fVerbose     = false;
-    uint32_t fFlags       = 0;
-    uint32_t fOutputFlags = 0;
-    int      cNonOptions  = 0;
-
-    while (   (ch = RTGetOpt(&GetState, &ValueUnion))
-              && RT_SUCCESS(rc))
-    {
-        /* For options that require an argument, ValueUnion has received the value. */
-        switch (ch)
-        {
-            case 'h':
-                VBoxServiceToolboxShowUsageHeader();
-                RTPrintf("%s", g_paszRmHelp);
-                return RTEXITCODE_SUCCESS;
-
-            case 'V':
-                VBoxServiceToolboxShowVersion();
-                return RTEXITCODE_SUCCESS;
-
-            case VBOXSERVICETOOLBOXOPT_MACHINE_READABLE:
-                fOutputFlags |= VBOXSERVICETOOLBOXOUTPUTFLAG_PARSEABLE;
-                break;
-
-            case 'r':
-            case 'R': /* Allow directories too. */
-                fFlags |= VBOXSERVICETOOLBOXRMFLAG_RECURSIVE;
-                break;
-
-            case VINF_GETOPT_NOT_OPTION:
-                /* RTGetOpt will sort these to the end of the argv vector so
-                 * that we will deal with them afterwards. */
-                ++cNonOptions;
-                break;
-
-            default:
-                return RTGetOptPrintError(ch, &ValueUnion);
-        }
-    }
-    if (RT_SUCCESS(rc))
-    {
-        /* Print magic/version. */
-        if (fOutputFlags & VBOXSERVICETOOLBOXOUTPUTFLAG_PARSEABLE)
-        {
-            rc = VBoxServiceToolboxStrmInit();
-            if (RT_FAILURE(rc))
-                RTMsgError("Error while initializing parseable streams, rc=%Rrc\n", rc);
-            VBoxServiceToolboxPrintStrmHeader("vbt_rm", 1 /* Stream version */);
-        }
-    }
-
-    /* We need at least one file. */
-    if (RT_SUCCESS(rc) && cNonOptions == 0)
-    {
-        toolboxRmReport("No files or directories specified.\n", NULL, true, 0,
-                        fOutputFlags, NULL);
-        return RTEXITCODE_FAILURE;
-    }
-    if (RT_SUCCESS(rc))
-    {
-        for (int i = argc - cNonOptions; i < argc; ++i)
-        {
-            RTFSOBJINFO Info;
-            int rc2 = RTPathQueryInfoEx(argv[i], &Info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
-            if (RT_SUCCESS(rc))
-            {
-                if (RTFS_IS_SYMLINK(Info.Attr.fMode))
-                {
-                    rc2 = RTSymlinkDelete(argv[i], 0 /*fFlags*/);
-                    toolboxRmReport("", argv[i], RT_SUCCESS(rc2), rc2, fOutputFlags, NULL);
-                    toolboxRmReport("The following error occurred while removing symlink '%s': %Rrc.\n",
-                                    argv[i], RT_FAILURE(rc2), rc2, fOutputFlags, &rc);
-                }
-                else if (RTFS_IS_DIRECTORY(Info.Attr.fMode))
-                {
-                    if (!(fFlags & VBOXSERVICETOOLBOXRMFLAG_RECURSIVE))
-                        toolboxRmReport("Cannot remove directory '%s' as the '-R' option was not specified.\n",
-                                        argv[i], true, VERR_INVALID_PARAMETER, fOutputFlags, &rc);
-                    else
-                    {
-                        rc2 = RTDirRemoveRecursive(argv[i], RTDIRRMREC_F_CONTENT_AND_DIR);
-                        toolboxRmReport("", argv[i], RT_SUCCESS(rc2), rc2, fOutputFlags, NULL);
-                        toolboxRmReport("The following error occurred while removing directory '%s': %Rrc.\n",
-                                        argv[i], RT_FAILURE(rc2), rc2, fOutputFlags, &rc);
-                    }
-                }
-                else
-                {
-                    rc2 = RTFileDelete(argv[i]);
-                    toolboxRmReport("", argv[i], RT_SUCCESS(rc2), rc2, fOutputFlags, NULL);
-                    toolboxRmReport("The following error occurred while removing file '%s': %Rrc.\n",
-                                    argv[i], RT_FAILURE(rc2), rc2, fOutputFlags, &rc);
-                }
-            }
-            else if (   rc2 == VERR_FILE_NOT_FOUND
-                     || rc2 == VERR_PATH_NOT_FOUND)
-                toolboxRmReport("File '%s' does not exist (%Rrc).\n", argv[i], true, rc2, fOutputFlags, &rc);
-            else
-                toolboxRmReport("The following error occurred while checkin '%s' before removal: %Rrc.\n",
-                                argv[i], true, rc2, fOutputFlags, &rc);
-        }
-
-        if (fOutputFlags & VBOXSERVICETOOLBOXOUTPUTFLAG_PARSEABLE) /* Output termination. */
-            VBoxServiceToolboxPrintStrmTermination();
-    }
-    return RT_SUCCESS(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
+    return RTPathRmCmd(argc, argv);
 }
 
 
diff --git a/src/VBox/Additions/linux/installer/vboxadd-service.sh b/src/VBox/Additions/linux/installer/vboxadd-service.sh
index cf30b9e..4c7b656 100755
--- a/src/VBox/Additions/linux/installer/vboxadd-service.sh
+++ b/src/VBox/Additions/linux/installer/vboxadd-service.sh
@@ -13,7 +13,7 @@
 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 #
 
-# chkconfig: 35 35 65
+# chkconfig: 345 35 65
 # description: VirtualBox Additions service
 #
 ### BEGIN INIT INFO
diff --git a/src/VBox/Additions/linux/installer/vboxadd-x11.sh b/src/VBox/Additions/linux/installer/vboxadd-x11.sh
index a5ba75a..efb4d4d 100755
--- a/src/VBox/Additions/linux/installer/vboxadd-x11.sh
+++ b/src/VBox/Additions/linux/installer/vboxadd-x11.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Linux Additions X11 setup init script ($Revision: 97014 $)
+# Linux Additions X11 setup init script ($Revision: 101426 $)
 #
 
 #
@@ -593,7 +593,7 @@ cleanup()
             nobak="true"
         fi
     done
-    if test -n "${nobak}"; then
+    if test -z "${nobak}"; then
         for i in $x11conf_files; do
             if test -r "$i.vbox"; then
                 if test ! "$i" -nt "$i.vbox" -o -n "$legacy"; then
@@ -628,14 +628,27 @@ $failed
 EOF
 
     # Remove X.Org drivers
-    find "$x11_modules_dir" /usr/lib64/xorg/modules /usr/lib/xorg/modules \
-        /usr/X11R6/lib64/modules /usr/X11R6/lib/modules \
-        /usr/X11R6/lib/X11/modules \
-        '(' -name 'vboxvideo_drv*' -o -name 'vboxmouse_drv*' ')' \
-        -exec rm -f '{}' ';' 2>/dev/null
+    modules_dir=`X -showDefaultModulePath 2>&1` || modules_dir=
+    if [ -z "$modules_dir" ]; then
+        for dir in /usr/lib64/xorg/modules /usr/lib/xorg/modules /usr/X11R6/lib64/modules /usr/X11R6/lib/modules /usr/X11R6/lib/X11/modules; do
+            if [ -d $dir ]; then
+                modules_dir=$dir
+                break
+            fi
+        done
+    fi
+    rm -f "$modules_dir/drivers/vboxvideo_drv"* 2>/dev/null
+    rm -f "$modules_dir/input/vboxmouse_drv"* 2>/dev/null
 
     # Remove the link to vboxvideo_dri.so
-    rm -f /usr/lib/dri/vboxvideo_dri.so /usr/lib64/dri/vboxvideo_dri.so 2>/dev/null
+    for dir in /usr/lib/dri /usr/lib32/dri /usr/lib64/dri \
+        /usr/lib/xorg/modules/dri /usr/lib32/xorg/modules/dri \
+        /usr/lib64/xorg/modules/dri /usr/lib/i386-linux-gnu/dri \
+        /usr/lib/x86_64-linux-gnu/dri; do
+        if [ -d $dir ]; then
+            rm -f "$dir/vboxvideo_dri.so" 2>/dev/null
+        fi
+    done
 
     # Remove VBoxClient autostart files
     rm /etc/X11/Xsession.d/98vboxadd-xclient 2>/dev/null
diff --git a/src/VBox/Additions/linux/installer/vboxadd.sh b/src/VBox/Additions/linux/installer/vboxadd.sh
index 4601084..a6ccc51 100755
--- a/src/VBox/Additions/linux/installer/vboxadd.sh
+++ b/src/VBox/Additions/linux/installer/vboxadd.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Linux Additions kernel module init script ($Revision: 99216 $)
+# Linux Additions kernel module init script ($Revision: 101396 $)
 #
 
 #
@@ -16,7 +16,7 @@
 #
 
 
-# chkconfig: 357 30 70
+# chkconfig: 3457 30 70
 # description: VirtualBox Linux Additions kernel modules
 #
 ### BEGIN INIT INFO
diff --git a/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c b/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
index fd3097a..b95f474 100644
--- a/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
+++ b/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
@@ -287,7 +287,8 @@ process_mount_opts(const char *s, struct vbsf_mount_opts *opts)
             continue;
         }
 
-        if (!handler->name)
+        if (   !handler->name
+            && !opts->sloppy)
         {
             fprintf(stderr, "unknown mount option `%.*s'\n", (int)len, s);
             fprintf(stderr, "valid options:\n");
@@ -345,6 +346,7 @@ static void __attribute ((noreturn)) usage(char *name)
            "  -w                    mount the shared folder writable (the default)\n"
            "  -r                    mount the shared folder read-only\n"
            "  -n                    do not create an mtab entry\n"
+           "  -s                    sloppy parsing, ignore unrecognized mount options\n"
            "  -o OPTION[,OPTION...] use the mount options specified\n"
            "\n", name);
     printf("Available mount options are:\n"
@@ -387,6 +389,7 @@ main (int argc, char **argv)
         0,     /* dmask */
         0,     /* fmask */
         0,     /* ronly */
+        0,     /* sloppy */
         0,     /* noexec */
         0,     /* nodev */
         0,     /* nosuid */
@@ -411,7 +414,7 @@ main (int argc, char **argv)
     CT_ASSERT(sizeof(uid_t) == sizeof(int));
     CT_ASSERT(sizeof(gid_t) == sizeof(int));
 
-    while ((c = getopt(argc, argv, "rwno:h")) != -1)
+    while ((c = getopt(argc, argv, "rwsno:h")) != -1)
     {
         switch (c)
         {
@@ -428,6 +431,10 @@ main (int argc, char **argv)
             case 'w':
                 opts.ronly = 0;
 
+            case 's':
+                opts.sloppy = 1;
+                break;
+
             case 'o':
                 process_mount_opts(optarg, &opts);
                 break;
diff --git a/src/VBox/Additions/linux/sharedfolders/vbsfmount.h b/src/VBox/Additions/linux/sharedfolders/vbsfmount.h
index 3fe52f9..35e7f8e 100644
--- a/src/VBox/Additions/linux/sharedfolders/vbsfmount.h
+++ b/src/VBox/Additions/linux/sharedfolders/vbsfmount.h
@@ -62,6 +62,7 @@ struct vbsf_mount_opts
     int  dmask;
     int  fmask;
     int  ronly;
+    int  sloppy;
     int  noexec;
     int  nodev;
     int  nosuid;
diff --git a/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp b/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
index 48435bf..4e80f78 100644
--- a/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
@@ -23,6 +23,7 @@
 #endif
 
 #include <iprt/asm.h>
+#include <iprt/buildconfig.h>
 #include <iprt/critsect.h>
 #include <iprt/thread.h>
 #include <iprt/time.h>
@@ -32,15 +33,14 @@
 
 #include <limits.h>
 
-# ifdef LOG_GROUP
- # undef LOG_GROUP
-# endif
+#ifdef LOG_GROUP
+# undef LOG_GROUP
+#endif
 #define LOG_GROUP LOG_GROUP_GUEST_DND
 #include <VBox/log.h>
 #include <VBox/VBoxGuestLib.h>
 
 #include "VBox/HostServices/DragAndDropSvc.h"
-
 #include "VBoxClient.h"
 
 /* Enable this define to see the proxy window(s) when debugging
@@ -50,7 +50,7 @@
 #endif
 
 /**
- * For X11 guest xDnD is used. See http://www.acc.umu.se/~vatten/XDND.html for
+ * For X11 guest Xdnd is used. See http://www.acc.umu.se/~vatten/XDND.html for
  * a walk trough.
  *
  * Host -> Guest:
@@ -124,7 +124,7 @@ enum XA_Type
     XA_text_uri,
     XA_text_plain,
     XA_TEXT,
-    /* xDnD */
+    /* Xdnd */
     XA_XdndSelection,
     XA_XdndAware,
     XA_XdndEnter,
@@ -144,6 +144,64 @@ enum XA_Type
     XA_End
 };
 
+/**
+ * Xdnd message value indexes, sorted by message type.
+ */
+typedef enum XdndMsg
+{
+    /** XdndEnter. */
+    XdndEnterTypeCount = 3,         /* Maximum number of types in XdndEnter message. */
+
+    XdndEnterWindow = 0,            /* Source window (sender). */
+    XdndEnterFlags,                 /* Version in high byte, bit 0 => more data types. */
+    XdndEnterType1,                 /* First available data type. */
+    XdndEnterType2,                 /* Second available data type. */
+    XdndEnterType3,                 /* Third available data type. */
+
+    XdndEnterMoreTypesFlag = 1,     /* Set if there are more than XdndEnterTypeCount. */
+    XdndEnterVersionRShift = 24,    /* Right shift to position version number. */
+    XdndEnterVersionMask   = 0xFF,  /* Mask to get version after shifting. */
+
+    /** XdndHere. */
+    XdndHereWindow = 0,             /* Source window (sender). */
+    XdndHereFlags,                  /* Reserved. */
+    XdndHerePt,                     /* X + Y coordinates of mouse (root window coords). */
+    XdndHereTimeStamp,              /* Timestamp for requesting data. */
+    XdndHereAction,                 /* Action requested by user. */
+
+    /** XdndPosition. */
+    XdndPositionWindow = 0,         /* Source window (sender). */
+    XdndPositionFlags,              /* Flags. */
+    XdndPositionXY,                 /* X/Y coordinates of the mouse position relative to the root window. */
+    XdndPositionTimeStamp,          /* Time stamp for retrieving the data. */
+    XdndPositionAction,             /* Action requested by the user. */
+
+    /** XdndStatus. */
+    XdndStatusWindow = 0,           /* Target window (sender).*/
+    XdndStatusFlags,                /* Flags returned by target. */
+    XdndStatusNoMsgXY,              /* X + Y of "no msg" rectangle (root window coords). */
+    XdndStatusNoMsgWH,              /* Width + height of "no msg" rectangle. */
+    XdndStatusAction,               /* Action accepted by target. */
+
+    XdndStatusAcceptDropFlag = 1,   /* Set if target will accept the drop. */
+    XdndStatusSendHereFlag   = 2,   /* Set if target wants a stream of XdndPosition. */
+
+    /** XdndLeave. */
+    XdndLeaveWindow = 0,            /* Source window (sender). */
+    XdndLeaveFlags,                 /* Reserved. */
+
+    /** XdndDrop. */
+    XdndDropWindow = 0,             /* Source window (sender). */
+    XdndDropFlags,                  /* Reserved. */
+    XdndDropTimeStamp,              /* Timestamp for requesting data. */
+
+    /** XdndFinished. */
+    XdndFinishedWindow = 0,         /* Target window (sender). */
+    XdndFinishedFlags,              /* Version 5: Bit 0 is set if the current target accepted the drop. */
+    XdndFinishedAction              /* Version 5: Contains the action performed by the target. */
+
+} XdndMsg;
+
 class DragAndDropService;
 
 /** List of Atoms. */
@@ -248,7 +306,7 @@ const char *xHelpers::m_xAtomNames[] =
     "text/uri",
     "text/plain",
     "TEXT",
-    /* xDnD */
+    /* Xdnd */
     "XdndSelection",
     "XdndAware",
     "XdndEnter",
@@ -301,18 +359,22 @@ Window xHelpers::applicationWindowBelowCursor(Window wndParent) const
 
     Window wndApp = 0;
     int cProps = -1;
+
     /* Fetch all x11 window properties of the parent window. */
     Atom *pProps = XListProperties(m_pDisplay, wndParent, &cProps);
     if (cProps > 0)
     {
         /* We check the window for the WM_STATE property. */
         for (int i = 0; i < cProps; ++i)
+        {
             if (pProps[i] == xAtom(XA_WM_STATE))
             {
                 /* Found it. */
                 wndApp = wndParent;
                 break;
             }
+        }
+
         /* Cleanup */
         XFree(pProps);
     }
@@ -346,6 +408,34 @@ Window xHelpers::applicationWindowBelowCursor(Window wndParent) const
 # define VBOX_DND_FN_DECL_LOG(x) x
 #endif
 
+/** @todo Move all proxy window-related stuff into this class! Clean up this mess. */
+class VBoxDnDProxyWnd
+{
+
+public:
+
+    VBoxDnDProxyWnd(void);
+
+    virtual ~VBoxDnDProxyWnd(void);
+
+public:
+
+    int init(Display *pDisplay);
+    void destroy();
+
+    int sendFinished(Window hWndSource, uint32_t uAction);
+
+public:
+
+    Display *pDisp;
+    /** Proxy window handle. */
+    Window   hWnd;
+    int      iX;
+    int      iY;
+    int      iWidth;
+    int      iHeight;
+};
+
 /**
  * Class for handling a single drag and drop operation, that is,
  * one source and one target at a time.
@@ -382,21 +472,25 @@ public:
     void reset(void);
 
     /* Logging. */
+    VBOX_DND_FN_DECL_LOG(void) logInfo(const char *pszFormat, ...);
     VBOX_DND_FN_DECL_LOG(void) logError(const char *pszFormat, ...);
 
     /* X11 message processing. */
     int onX11ClientMessage(const XEvent &e);
+    int onX11MotionNotify(const XEvent &e);
+    int onX11SelectionClear(const XEvent &e);
     int onX11SelectionNotify(const XEvent &e);
     int onX11SelectionRequest(const XEvent &e);
     int onX11Event(const XEvent &e);
+    int  waitForStatusChange(uint32_t enmState, RTMSINTERVAL uTimeoutMS = 30000);
     bool waitForX11Msg(XEvent &evX, int iType, RTMSINTERVAL uTimeoutMS = 100);
     bool waitForX11ClientMsg(XClientMessageEvent &evMsg, Atom aType, RTMSINTERVAL uTimeoutMS = 100);
 
     /* Host -> Guest handling. */
     int hgEnter(const RTCList<RTCString> &formats, uint32_t actions);
     int hgLeave(void);
-    int hgMove(uint32_t u32xPos, uint32_t u32yPos, uint32_t action);
-    int hgDrop(void);
+    int hgMove(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAction);
+    int hgDrop(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAction);
     int hgDataReceived(const void *pvData, uint32_t cData);
 
 #ifdef VBOX_WITH_DRAG_AND_DROP_GH
@@ -406,11 +500,16 @@ public:
 #endif
 
     /* X11 helpers. */
+    int  mouseCursorFakeMove(void) const;
     int  mouseCursorMove(int iPosX, int iPosY) const;
     void mouseButtonSet(Window wndDest, int rx, int ry, int iButton, bool fPress);
-    int proxyWinShow(int *piRootX = NULL, int *piRootY = NULL, bool fMouseMove = false) const;
+    int proxyWinShow(int *piRootX = NULL, int *piRootY = NULL) const;
     int proxyWinHide(void);
 
+    /* X11 window helpers. */
+    char *wndX11GetNameA(Window wndThis) const;
+
+    /* Xdnd protocol helpers. */
     void wndXDnDClearActionList(Window wndThis) const;
     void wndXDnDClearFormatList(Window wndThis) const;
     int wndXDnDGetActionList(Window wndThis, VBoxDnDAtomList &lstActions) const;
@@ -418,6 +517,7 @@ public:
     int wndXDnDSetActionList(Window wndThis, const VBoxDnDAtomList &lstActions) const;
     int wndXDnDSetFormatList(Window wndThis, Atom atmProp, const VBoxDnDAtomList &lstFormats) const;
 
+    /* Atom / HGCM formatting helpers. */
     int             toAtomList(const RTCList<RTCString> &lstFormats, VBoxDnDAtomList &lstAtoms) const;
     int             toAtomList(const void *pvData, uint32_t cbData, VBoxDnDAtomList &lstAtoms) const;
     static Atom     toAtomAction(uint32_t uAction);
@@ -439,8 +539,8 @@ protected:
     Screen                     *m_pScreen;
     /** Root window handle. */
     Window                      m_wndRoot;
-    /** Proxy window handle. */
-    Window                      m_wndProxy;
+    /** Proxy window. */
+    VBoxDnDProxyWnd             m_wndProxy;
     /** Current source/target window handle. */
     Window                      m_wndCur;
     /** The XDnD protocol version the current
@@ -450,21 +550,24 @@ protected:
     VBoxDnDAtomList             m_lstFormats;
     /** List of (Atom) actions the source window supports. */
     VBoxDnDAtomList             m_lstActions;
-    /** Deferred host to guest selection event for sending to the
-     *  target window as soon as data from the host arrived. */
-    XEvent                      m_eventHgSelection;
+    /** Buffer for answering the target window's selection request. */
+    void                       *m_pvSelReqData;
+    /** Size (in bytes) of selection request data buffer. */
+    uint32_t                    m_cbSelReqData;
     /** Current operation mode. */
-    Mode                        m_enmMode;
+    volatile uint32_t           m_enmMode;
     /** Current state of operation mode. */
-    State                       m_enmState;
+    volatile uint32_t           m_enmState;
     /** The instance's own X event queue. */
-    RTCMTList<XEvent>           m_eventQueue;
+    RTCMTList<XEvent>           m_eventQueueList;
     /** Critical section for providing serialized access to list
      *  event queue's contents. */
     RTCRITSECT                  m_eventQueueCS;
     /** Event for notifying this instance in case of a new
      *  event. */
-    RTSEMEVENT                  m_hEventSem;
+    RTSEMEVENT                  m_eventQueueEvent;
+    /** Critical section for data access. */
+    RTCRITSECT                  m_dataCS;
     /** List of allowed formats. */
     RTCList<RTCString>          m_lstAllowedFormats;
 };
@@ -524,13 +627,13 @@ DragInstance::DragInstance(Display *pDisplay, DragAndDropService *pParent)
     , m_pDisplay(pDisplay)
     , m_pScreen(0)
     , m_wndRoot(0)
-    , m_wndProxy(0)
     , m_wndCur(0)
     , m_curVer(-1)
+    , m_pvSelReqData(NULL)
+    , m_cbSelReqData(0)
     , m_enmMode(Unknown)
     , m_enmState(Uninitialized)
 {
-    uninit();
 }
 
 /**
@@ -538,17 +641,24 @@ DragInstance::DragInstance(Display *pDisplay, DragAndDropService *pParent)
  */
 void DragInstance::uninit(void)
 {
-    reset();
-    if (m_wndProxy != 0)
-        XDestroyWindow(m_pDisplay, m_wndProxy);
+    LogFlowFuncEnter();
 
-    VbglR3DnDDisconnect(&m_dndCtx);
+    if (m_wndProxy.hWnd != 0)
+        XDestroyWindow(m_pDisplay, m_wndProxy.hWnd);
 
-    m_enmState    = Uninitialized;
-    m_screenId = -1;
-    m_pScreen  = 0;
-    m_wndRoot  = 0;
-    m_wndProxy = 0;
+    int rc2 = VbglR3DnDDisconnect(&m_dndCtx);
+
+    if (m_pvSelReqData)
+        RTMemFree(m_pvSelReqData);
+
+    rc2 = RTSemEventDestroy(m_eventQueueEvent);
+    AssertRC(rc2);
+
+    rc2 = RTCritSectDelete(&m_eventQueueCS);
+    AssertRC(rc2);
+
+    rc2 = RTCritSectDelete(&m_dataCS);
+    AssertRC(rc2);
 }
 
 /**
@@ -561,23 +671,39 @@ void DragInstance::reset(void)
     /* Hide the proxy win. */
     proxyWinHide();
 
-    /* If we are currently the Xdnd selection owner, clear that. */
-    Window w = XGetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection));
-    if (w == m_wndProxy)
-        XSetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection), None, CurrentTime);
-
-    /* Clear any other DnD specific data on the proxy window. */
-    wndXDnDClearFormatList(m_wndProxy);
-    wndXDnDClearActionList(m_wndProxy);
-
-    /* Reset the internal state. */
-    m_lstActions.clear();
-    m_lstFormats.clear();
-    m_wndCur    = 0;
-    m_curVer    = -1;
-    m_enmState  = Initialized;
-    m_enmMode   = Unknown;
-    m_eventQueue.clear();
+    int rc2 = RTCritSectEnter(&m_dataCS);
+    if (RT_SUCCESS(rc2))
+    {
+        /* If we are currently the Xdnd selection owner, clear that. */
+        Window pWnd = XGetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection));
+        if (pWnd == m_wndProxy.hWnd)
+            XSetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection), None, CurrentTime);
+
+        /* Clear any other DnD specific data on the proxy window. */
+        wndXDnDClearFormatList(m_wndProxy.hWnd);
+        wndXDnDClearActionList(m_wndProxy.hWnd);
+
+        /* Reset the internal state. */
+        m_lstActions.clear();
+        m_lstFormats.clear();
+        m_wndCur    = 0;
+        m_curVer    = -1;
+        m_enmState  = Initialized;
+        m_enmMode   = Unknown;
+        m_eventQueueList.clear();
+
+        /* Reset the selection request buffer. */
+        if (m_pvSelReqData)
+        {
+            RTMemFree(m_pvSelReqData);
+            m_pvSelReqData = NULL;
+
+            Assert(m_cbSelReqData);
+            m_cbSelReqData = 0;
+        }
+
+        RTCritSectLeave(&m_dataCS);
+    }
 }
 
 /**
@@ -592,13 +718,11 @@ int DragInstance::init(uint32_t u32ScreenID)
 
     do
     {
-        uninit();
-
         rc = VbglR3DnDConnect(&m_dndCtx);
         if (RT_FAILURE(rc))
             break;
 
-        rc = RTSemEventCreate(&m_hEventSem);
+        rc = RTSemEventCreate(&m_eventQueueEvent);
         if (RT_FAILURE(rc))
             break;
 
@@ -606,6 +730,10 @@ int DragInstance::init(uint32_t u32ScreenID)
         if (RT_FAILURE(rc))
             break;
 
+        rc = RTCritSectInit(&m_dataCS);
+        if (RT_FAILURE(rc))
+            break;
+
         /*
          * Enough screens configured in the x11 server?
          */
@@ -647,7 +775,7 @@ int DragInstance::init(uint32_t u32ScreenID)
 #ifdef VBOX_DND_DEBUG_WND
         attr.background_pixel      = XWhitePixel(m_pDisplay, m_screenId);
         attr.border_pixel          = XBlackPixel(m_pDisplay, m_screenId);
-        m_wndProxy = XCreateWindow(m_pDisplay, m_wndRoot                     /* Parent */,
+        m_wndProxy.hWnd = XCreateWindow(m_pDisplay, m_wndRoot                /* Parent */,
                                    100, 100,                                 /* Position */
                                    100, 100,                                 /* Width + height */
                                    2,                                        /* Border width */
@@ -660,7 +788,7 @@ int DragInstance::init(uint32_t u32ScreenID)
                                    | CWDontPropagate,                        /* Value mask */
                                    &attr);                                   /* Attributes for value mask */
 #else
-        m_wndProxy = XCreateWindow(m_pDisplay, m_wndRoot                 /* Parent */,
+        m_wndProxy.hWnd = XCreateWindow(m_pDisplay, m_wndRoot            /* Parent */,
                                    0, 0,                                 /* Position */
                                    1, 1,                                 /* Width + height */
                                    0,                                    /* Border width */
@@ -670,37 +798,43 @@ int DragInstance::init(uint32_t u32ScreenID)
                                    CWOverrideRedirect | CWDontPropagate, /* Value mask */
                                    &attr);                               /* Attributes for value mask */
 #endif
-        if (!m_wndProxy)
+        if (!m_wndProxy.hWnd)
         {
             LogRel(("DnD: Error creating proxy window\n"));
             rc = VERR_GENERAL_FAILURE;
             break;
         }
 
+        rc = m_wndProxy.init(m_pDisplay);
+        if (RT_FAILURE(rc))
+        {
+            LogRel(("DnD: Error initializing proxy window, rc=%Rrc\n", rc));
+            break;
+        }
+
 #ifdef VBOX_DND_DEBUG_WND
         XFlush(m_pDisplay);
-        XMapWindow(m_pDisplay, m_wndProxy);
-        XRaiseWindow(m_pDisplay, m_wndProxy);
+        XMapWindow(m_pDisplay, m_wndProxy.hWnd);
+        XRaiseWindow(m_pDisplay, m_wndProxy.hWnd);
         XFlush(m_pDisplay);
 #endif
-        LogFlowThisFunc(("Created proxy window 0x%x at m_wndRoot=0x%x ...\n", m_wndProxy, m_wndRoot));
+        logInfo("Proxy window=0x%x, root window=0x%x ...\n", m_wndProxy.hWnd, m_wndRoot);
 
         /* Set the window's name for easier lookup. */
-        XStoreName(m_pDisplay, m_wndProxy, "VBoxClientWndDnD");
+        XStoreName(m_pDisplay, m_wndProxy.hWnd, "VBoxClientWndDnD");
 
         /* Make the new window Xdnd aware. */
         Atom ver = VBOX_XDND_VERSION;
-        XChangeProperty(m_pDisplay, m_wndProxy, xAtom(XA_XdndAware), XA_ATOM, 32, PropModeReplace,
+        XChangeProperty(m_pDisplay, m_wndProxy.hWnd, xAtom(XA_XdndAware), XA_ATOM, 32, PropModeReplace,
                         reinterpret_cast<unsigned char*>(&ver), 1);
     } while (0);
 
     if (RT_SUCCESS(rc))
     {
-        m_enmState = Initialized;
+        reset();
     }
     else
-        LogRel(("DnD: Initializing drag instance for screen %RU32 failed with rc=%Rrc\n",
-                u32ScreenID, rc));
+        logError("Initializing drag instance for screen %RU32 failed with rc=%Rrc\n", u32ScreenID, rc);
 
     LogFlowFuncLeaveRC(rc);
     return rc;
@@ -721,6 +855,26 @@ VBOX_DND_FN_DECL_LOG(void) DragInstance::logError(const char *pszFormat, ...)
 
     AssertPtr(psz);
     LogFlowFunc(("%s", psz));
+    LogRel(("DnD: %s", psz));
+
+    RTStrFree(psz);
+}
+
+/**
+ * Logs an info message to the (release) logging instance.
+ *
+ * @param   pszFormat               Format string to log.
+ */
+VBOX_DND_FN_DECL_LOG(void) DragInstance::logInfo(const char *pszFormat, ...)
+{
+    va_list args;
+    va_start(args, pszFormat);
+    char *psz = NULL;
+    RTStrAPrintfV(&psz, pszFormat, args);
+    va_end(args);
+
+    AssertPtr(psz);
+    LogFlowFunc(("%s", psz));
     LogRel2(("DnD: %s", psz));
 
     RTStrFree(psz);
@@ -736,10 +890,10 @@ int DragInstance::onX11ClientMessage(const XEvent &e)
 {
     AssertReturn(e.type == ClientMessage, VERR_INVALID_PARAMETER);
 
-    LogFlowThisFunc(("mode=%d, state=%d\n", m_enmMode, m_enmState));
+    LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
     LogFlowThisFunc(("Event wnd=%#x, msg=%s\n", e.xclient.window, xAtomToString(e.xclient.message_type).c_str()));
 
-    int rc;
+    int rc = VINF_SUCCESS;
 
     switch (m_enmMode)
     {
@@ -750,52 +904,225 @@ int DragInstance::onX11ClientMessage(const XEvent &e)
              * window, in response of some events we send to them.
              */
             if (   e.xclient.message_type == xAtom(XA_XdndStatus)
-                && m_wndCur               == static_cast<Window>(e.xclient.data.l[0]))
+                && m_wndCur               == static_cast<Window>(e.xclient.data.l[XdndStatusWindow]))
             {
+                bool fAcceptDrop     = ASMBitTest   (&e.xclient.data.l[XdndStatusFlags], 0); /* Does the target accept the drop? */
+                bool fWantsPosition  = ASMBitTest   (&e.xclient.data.l[XdndStatusFlags], 1); /* Does the target want XdndPosition messages? */
+                RTCString strActions = xAtomToString( e.xclient.data.l[XdndStatusAction]);
+
+                char *pszWndName = wndX11GetNameA(e.xclient.data.l[XdndStatusWindow]);
+                AssertPtr(pszWndName);
+
                 /*
                  * The XdndStatus message tell us if the window will accept the DnD
                  * event and with which action. We immediately send this info down to
                  * the host as a response of a previous DnD message.
                  */
-                LogFlowThisFunc(("XA_XdndStatus: wnd=%#x, accept=%RTbool, action=%s\n",
-                                 e.xclient.data.l[0],
-                                 ASMBitTest(&e.xclient.data.l[1], 0),
-                                 xAtomToString(e.xclient.data.l[4]).c_str()));
+                LogFlowThisFunc(("XA_XdndStatus: wnd=%#x ('%s'), fAcceptDrop=%RTbool, fWantsPosition=%RTbool, strActions=%s\n",
+                                 e.xclient.data.l[XdndStatusWindow], pszWndName, fAcceptDrop, fWantsPosition, strActions.c_str()));
+
+                RTStrFree(pszWndName);
+
+                uint16_t x = RT_HI_U16((uint32_t)e.xclient.data.l[XdndStatusNoMsgXY]);
+                uint16_t y = RT_LO_U16((uint32_t)e.xclient.data.l[XdndStatusNoMsgXY]);
+                uint16_t w = RT_HI_U16((uint32_t)e.xclient.data.l[XdndStatusNoMsgWH]);
+                uint16_t h = RT_LO_U16((uint32_t)e.xclient.data.l[XdndStatusNoMsgWH]);
+                LogFlowThisFunc(("\tReported dead area: x=%RU16, y=%RU16, w=%RU16, h=%RU16\n", x, y, w, h));
 
-                uint32_t uAction = DND_IGNORE_ACTION;
+                uint32_t uAction = DND_IGNORE_ACTION; /* Default is ignoring. */
                 /** @todo Compare this with the allowed actions. */
-                if (ASMBitTest(&e.xclient.data.l[1], 0))
-                    uAction = toHGCMAction(static_cast<Atom>(e.xclient.data.l[4]));
+                if (fAcceptDrop)
+                    uAction = toHGCMAction(static_cast<Atom>(e.xclient.data.l[XdndStatusAction]));
 
                 rc = VbglR3DnDHGAcknowledgeOperation(&m_dndCtx, uAction);
             }
             else if (e.xclient.message_type == xAtom(XA_XdndFinished))
             {
-                rc = VINF_SUCCESS;
+                bool fSucceeded = ASMBitTest(&e.xclient.data.l[XdndFinishedFlags], 0);
+
+                char *pszWndName = wndX11GetNameA(e.xclient.data.l[XdndFinishedWindow]);
+                AssertPtr(pszWndName);
 
                 /* This message is sent on an un/successful DnD drop request. */
-                LogFlowThisFunc(("XA_XdndFinished: wnd=%#x, success=%RTbool, action=%s\n",
-                                 e.xclient.data.l[0],
-                                 ASMBitTest(&e.xclient.data.l[1], 0),
-                                 xAtomToString(e.xclient.data.l[2]).c_str()));
+                LogFlowThisFunc(("XA_XdndFinished: wnd=%#x ('%s'), success=%RTbool, action=%s\n",
+                                 e.xclient.data.l[XdndFinishedWindow], pszWndName, fSucceeded,
+                                 xAtomToString(e.xclient.data.l[XdndFinishedAction]).c_str()));
+
+                RTStrFree(pszWndName);
 
-                proxyWinHide();
+                reset();
             }
             else
             {
-                LogFlowThisFunc(("Unhandled: wnd=%#x, msg=%s\n",
-                                 e.xclient.data.l[0], xAtomToString(e.xclient.message_type).c_str()));
+                char *pszWndName = wndX11GetNameA(e.xclient.data.l[0]);
+                AssertPtr(pszWndName);
+                LogFlowThisFunc(("Unhandled: wnd=%#x ('%s'), msg=%s\n",
+                                 e.xclient.data.l[0], pszWndName, xAtomToString(e.xclient.message_type).c_str()));
+                RTStrFree(pszWndName);
+
                 rc = VERR_NOT_SUPPORTED;
             }
 
             break;
         }
 
+        case Unknown: /* Mode not set (yet). */
         case GH:
-        case Unknown: /* Mode not set (yet), just add what we got. */
         {
-            m_eventQueue.append(e);
-            rc = RTSemEventSignal(m_hEventSem);
+            /*
+             * This message marks the beginning of a new drag and drop
+             * operation on the guest.
+             */
+            if (e.xclient.message_type == xAtom(XA_XdndEnter))
+            {
+                LogFlowFunc(("XA_XdndEnter\n"));
+
+                /*
+                 * Get the window which currently has the XA_XdndSelection
+                 * bit set.
+                 */
+                Window wndSelection = XGetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection));
+
+                char *pszWndName = wndX11GetNameA(wndSelection);
+                AssertPtr(pszWndName);
+                LogFlowThisFunc(("wndSelection=%#x ('%s'), wndProxy=%#x\n", wndSelection, pszWndName, m_wndProxy.hWnd));
+                RTStrFree(pszWndName);
+
+                mouseButtonSet(m_wndProxy.hWnd, -1, -1, 1, true /* fPress */);
+
+                /*
+                 * Update our state and the window handle to process.
+                 */
+                int rc2 = RTCritSectEnter(&m_dataCS);
+                if (RT_SUCCESS(rc2))
+                {
+                    m_wndCur = wndSelection;
+                    m_curVer = e.xclient.data.l[XdndEnterFlags] >> XdndEnterVersionRShift;
+                    Assert(m_wndCur == (Window)e.xclient.data.l[XdndEnterWindow]); /* Source window. */
+#ifdef DEBUG
+                    XWindowAttributes xwa;
+                    XGetWindowAttributes(m_pDisplay, m_wndCur, &xwa);
+                    LogFlowThisFunc(("wndCur=%#x, x=%d, y=%d, width=%d, height=%d\n", m_wndCur, xwa.x, xwa.y, xwa.width, xwa.height));
+#endif
+                    /*
+                     * Retrieve supported formats.
+                     */
+
+                    /* Check if the MIME types are in the message itself or if we need
+                     * to fetch the XdndTypeList property from the window. */
+                    bool fMoreTypes = e.xclient.data.l[XdndEnterFlags] & XdndEnterMoreTypesFlag;
+                    LogFlowThisFunc(("XdndVer=%d, fMoreTypes=%RTbool\n", m_curVer, fMoreTypes));
+                    if (!fMoreTypes)
+                    {
+                        /* Only up to 3 format types supported. */
+                        /* Start with index 2 (first item). */
+                        for (int i = 2; i < 5; i++)
+                        {
+                            LogFlowThisFunc(("\t%s\n", gX11->xAtomToString(e.xclient.data.l[i]).c_str()));
+                            m_lstFormats.append(e.xclient.data.l[i]);
+                        }
+                    }
+                    else
+                    {
+                        /* More than 3 format types supported. */
+                        rc = wndXDnDGetFormatList(wndSelection, m_lstFormats);
+                    }
+
+                    /*
+                     * Retrieve supported actions.
+                     */
+                    if (RT_SUCCESS(rc))
+                    {
+                        if (m_curVer >= 2) /* More than one action allowed since protocol version 2. */
+                        {
+                            rc = wndXDnDGetActionList(wndSelection, m_lstActions);
+                        }
+                        else /* Only "copy" action allowed on legacy applications. */
+                            m_lstActions.append(XA_XdndActionCopy);
+                    }
+
+                    if (RT_SUCCESS(rc))
+                    {
+                        m_enmMode  = GH;
+                        m_enmState = Dragging;
+                    }
+
+                    RTCritSectLeave(&m_dataCS);
+                }
+            }
+            else if (   e.xclient.message_type == xAtom(XA_XdndPosition)
+                     && m_wndCur               == static_cast<Window>(e.xclient.data.l[XdndPositionWindow]))
+            {
+                int32_t lPos      = e.xclient.data.l[XdndPositionXY];
+                Atom    atmAction = m_curVer >= 2 /* Actions other than "copy" or only supported since protocol version 2. */
+                                  ? e.xclient.data.l[XdndPositionAction] : xAtom(XA_XdndActionCopy);
+
+                LogFlowThisFunc(("XA_XdndPosition: wndProxy=%#x, wndCur=%#x, x=%RI32, y=%RI32, strAction=%s\n",
+                                 m_wndProxy.hWnd, m_wndCur, RT_HIWORD(lPos), RT_LOWORD(lPos),
+                                 xAtomToString(atmAction).c_str()));
+
+                bool fAcceptDrop = true;
+
+                /* Reply with a XdndStatus message to tell the source whether
+                 * the data can be dropped or not. */
+                XClientMessageEvent m;
+                RT_ZERO(m);
+                m.type         = ClientMessage;
+                m.display      = m_pDisplay;
+                m.window       = e.xclient.data.l[XdndPositionWindow];
+                m.message_type = xAtom(XA_XdndStatus);
+                m.format       = 32;
+                m.data.l[XdndStatusWindow]  = m_wndProxy.hWnd;
+                m.data.l[XdndStatusFlags]   = fAcceptDrop ? RT_BIT(0) : 0; /* Whether to accept the drop or not. */
+
+                /* We don't want any new XA_XdndPosition messages while being
+                 * in our proxy window. */
+                m.data.l[XdndStatusNoMsgXY] = RT_MAKE_U32(m_wndProxy.iY, m_wndProxy.iX);
+                m.data.l[XdndStatusNoMsgWH] = RT_MAKE_U32(m_wndProxy.iHeight, m_wndProxy.iWidth);
+
+                /** @todo Handle default action! */
+                m.data.l[XdndStatusAction]  = fAcceptDrop ? toAtomAction(DND_COPY_ACTION) : None;
+
+                int xRc = XSendEvent(m_pDisplay, e.xclient.data.l[XdndPositionWindow],
+                                     False /* Propagate */, NoEventMask, reinterpret_cast<XEvent *>(&m));
+                if (xRc == 0)
+                    logError("Error sending position XA_XdndStatus event to current window=%#x: %s\n",
+                              m_wndCur, gX11->xErrorToString(xRc).c_str());
+            }
+            else if (   e.xclient.message_type == xAtom(XA_XdndLeave)
+                     && m_wndCur               == static_cast<Window>(e.xclient.data.l[XdndLeaveWindow]))
+            {
+                LogFlowThisFunc(("XA_XdndLeave\n"));
+                logInfo("Guest to host transfer canceled by the guest source window\n");
+
+                /* Start over. */
+                reset();
+            }
+            else if (   e.xclient.message_type == xAtom(XA_XdndDrop)
+                     && m_wndCur               == static_cast<Window>(e.xclient.data.l[XdndDropWindow]))
+            {
+                LogFlowThisFunc(("XA_XdndDrop\n"));
+                /* Can occur when dragging from guest->host, but then back in to the guest again. */
+                logInfo("Could not drop on own proxy window\n"); /* Not fatal. */
+
+                /* Let the source know. */
+                rc = m_wndProxy.sendFinished(m_wndCur, DND_IGNORE_ACTION);
+
+                /* Start over. */
+                reset();
+            }
+            else if (   e.xclient.message_type == xAtom(XA_XdndFinished)
+                     && m_wndCur               == static_cast<Window>(e.xclient.data.l[XdndFinishedWindow]))
+            {
+                LogFlowThisFunc(("XA_XdndFinished\n"));
+                logInfo("Finished drop on own proxy window\n"); /* Not fatal. */
+
+                /* Let the source know. */
+                rc = m_wndProxy.sendFinished(m_wndCur, DND_IGNORE_ACTION);
+
+                /* Start over. */
+                reset();
+            }
             break;
         }
 
@@ -811,6 +1138,29 @@ int DragInstance::onX11ClientMessage(const XEvent &e)
     return rc;
 }
 
+int DragInstance::onX11MotionNotify(const XEvent &e)
+{
+    LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
+
+    return VINF_SUCCESS;
+}
+
+/**
+ * Callback handler for being notified if some other window now
+ * is the owner of the current selection.
+ *
+ * @return  IPRT status code.
+ * @param   e                       X11 event to handle.
+ *
+ * @remark
+ */
+int DragInstance::onX11SelectionClear(const XEvent &e)
+{
+    LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
+
+    return VINF_SUCCESS;
+}
+
 /**
  * Callback handler for a XDnD selection notify from a window. This is needed
  * to let the us know if a certain window has drag'n drop data to share with us,
@@ -823,7 +1173,7 @@ int DragInstance::onX11SelectionNotify(const XEvent &e)
 {
     AssertReturn(e.type == SelectionNotify, VERR_INVALID_PARAMETER);
 
-    LogFlowThisFunc(("m_mode=%d, m_state=%d\n", m_enmMode, m_enmState));
+    LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
 
     int rc;
 
@@ -833,9 +1183,11 @@ int DragInstance::onX11SelectionNotify(const XEvent &e)
         {
             if (m_enmState == Dropped)
             {
-                m_eventQueue.append(e);
-                rc = RTSemEventSignal(m_hEventSem);
+                m_eventQueueList.append(e);
+                rc = RTSemEventSignal(m_eventQueueEvent);
             }
+            else
+                rc = VERR_WRONG_ORDER;
             break;
         }
 
@@ -863,7 +1215,7 @@ int DragInstance::onX11SelectionRequest(const XEvent &e)
 {
     AssertReturn(e.type == SelectionRequest, VERR_INVALID_PARAMETER);
 
-    LogFlowThisFunc(("m_mode=%d, m_state=%d\n", m_enmMode, m_enmState));
+    LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
     LogFlowThisFunc(("Event owner=%#x, requestor=%#x, selection=%s, target=%s, prop=%s, time=%u\n",
                      e.xselectionrequest.owner,
                      e.xselectionrequest.requestor,
@@ -873,121 +1225,115 @@ int DragInstance::onX11SelectionRequest(const XEvent &e)
                      e.xselectionrequest.time));
     int rc;
 
-    bool fSendEvent  = false;
-    Atom atmTarget   = None;
-    Atom atmProperty = None;
-
     switch (m_enmMode)
     {
         case HG:
         {
             rc = VINF_SUCCESS;
 
-#ifdef DEBUG
-            XTextProperty propName;
-            XGetWMName(m_pDisplay, e.xselectionrequest.requestor, &propName);
-#endif
+            char *pszWndName = wndX11GetNameA(e.xselectionrequest.requestor);
+            AssertPtr(pszWndName);
+
             /*
-             * A window is asking for some data. Normally here the data would be copied
-             * into the selection buffer and send to the requestor. Obviously we can't
-             * do that, because we first need to ask the host for the data of the
-             * requested MIME type. This is done and later answered with the correct
-             * data -- see DragInstance::hgDataReceived().
+             * Start by creating a refusal selection notify message.
+             * That way we only need to care for the success case.
              */
 
+            XEvent s;
+            RT_ZERO(s);
+            s.xselection.type      = SelectionNotify;
+            s.xselection.display   = e.xselectionrequest.display;
+            s.xselection.requestor = e.xselectionrequest.requestor;
+            s.xselection.selection = e.xselectionrequest.selection;
+            s.xselection.target    = e.xselectionrequest.target;
+            s.xselection.property  = None;                          /* "None" means refusal. */
+            s.xselection.time      = e.xselectionrequest.time;
+
+            const XSelectionRequestEvent *pReq = &e.xselectionrequest;
+
+#ifdef DEBUG
+            LogFlowFunc(("Supported formats:\n"));
+            for (size_t i = 0; i < m_lstFormats.size(); i++)
+                LogFlowFunc(("\t%s\n", xAtomToString(m_lstFormats.at(i)).c_str()));
+#endif
             /* Is the requestor asking for the possible MIME types? */
-            if (e.xselectionrequest.target == xAtom(XA_TARGETS))
+            if (pReq->target == xAtom(XA_TARGETS))
             {
-                LogFlowThisFunc(("wnd=%#x ('%s') asking for target list\n",
-                                 e.xselectionrequest.requestor, propName.value ? (const char *)propName.value : "<No name>"));
+                logInfo("Target window %#x ('%s') asking for target list\n", e.xselectionrequest.requestor, pszWndName);
 
                 /* If so, set the window property with the formats on the requestor
                  * window. */
-                rc = wndXDnDSetFormatList(e.xselectionrequest.requestor, e.xselectionrequest.property, m_lstFormats);
+                rc = wndXDnDSetFormatList(pReq->requestor, pReq->property, m_lstFormats);
                 if (RT_SUCCESS(rc))
-                {
-                    atmTarget   = e.xselectionrequest.target;
-                    atmProperty = e.xselectionrequest.property;
-
-                    fSendEvent  = true;
-                }
+                    s.xselection.property = pReq->property;
             }
             /* Is the requestor asking for a specific MIME type (we support)? */
-            else if (m_lstFormats.contains(e.xselectionrequest.target))
+            else if (m_lstFormats.contains(pReq->target))
             {
-                LogFlowThisFunc(("wnd=%#x ('%s') asking for data, format=%s\n",
-                                 e.xselectionrequest.requestor, propName.value ? (const char *)propName.value : "<No name>",
-                                 xAtomToString(e.xselectionrequest.target).c_str()));
+                logInfo("Target window %#x ('%s') is asking for data as '%s'\n",
+                         pReq->requestor, pszWndName, xAtomToString(pReq->target).c_str());
 
-                /* If so, we need to inform the host about this request. Save the
-                 * selection request event for later use. */
+                /* Did we not drop our stuff to the guest yet? Bail out. */
                 if (m_enmState != Dropped)
                 {
                     LogFlowThisFunc(("Wrong state (%RU32), refusing request\n", m_enmState));
-
-                    atmTarget   = None;
-                    atmProperty = e.xselectionrequest.property;
-
-                    fSendEvent  = true;
                 }
+                /* Did we not store the requestor's initial selection request yet? Then do so now. */
                 else
                 {
-                    LogFlowThisFunc(("Saving selection notify message of wnd=%#x ('%s')\n",
-                                     e.xselectionrequest.requestor, propName.value ? (const char *)propName.value : "<No name>"));
-
-                    memcpy(&m_eventHgSelection, &e, sizeof(XEvent));
-
-                    RTCString strFormat = xAtomToString(e.xselectionrequest.target);
+                    /* Get the data format the requestor wants from us. */
+                    RTCString strFormat = xAtomToString(pReq->target);
                     Assert(strFormat.isNotEmpty());
-
-                    rc = VbglR3DnDHGRequestData(&m_dndCtx, strFormat.c_str());
-                    LogFlowThisFunc(("Requested data from host as \"%s\", rc=%Rrc\n", strFormat.c_str(), rc));
+                    logInfo("Target window=%#x requested data from host as '%s', rc=%Rrc\n",
+                            pReq->requestor, strFormat.c_str(), rc);
+
+                    /* Make a copy of the MIME data to be passed back. The X server will be become
+                     * the new owner of that data, so no deletion needed. */
+                    /** @todo Do we need to do some more conversion here? XConvertSelection? */
+                    void *pvData = RTMemDup(m_pvSelReqData, m_cbSelReqData);
+                    uint32_t cbData = m_cbSelReqData;
+
+                    /* Always return the requested property. */
+                    s.xselection.property = pReq->property;
+
+                    /* Note: Always seems to return BadRequest. Seems fine. */
+                    int xRc = XChangeProperty(s.xselection.display, s.xselection.requestor, s.xselection.property,
+                                              s.xselection.target, 8, PropModeReplace,
+                                              reinterpret_cast<const unsigned char*>(pvData), cbData);
+
+                    LogFlowFunc(("Changing property '%s' (target '%s') of window=0x%x: %s\n",
+                                 xAtomToString(pReq->property).c_str(),
+                                 xAtomToString(pReq->target).c_str(),
+                                 pReq->requestor,
+                                 gX11->xErrorToString(xRc).c_str()));
                 }
             }
             /* Anything else. */
             else
             {
-                LogFlowThisFunc(("Refusing unknown command of wnd=%#x ('%s')\n", e.xselectionrequest.requestor,
-                                 propName.value ? (const char *)propName.value : "<No name>"));
-
-                /* We don't understand this request message and therefore answer with an
-                 * refusal messages. */
-                fSendEvent = true;
+                logError("Refusing unknown command/format '%s' of wnd=%#x ('%s')\n",
+                         xAtomToString(e.xselectionrequest.target).c_str(), pReq->requestor, pszWndName);
+                rc = VERR_NOT_SUPPORTED;
             }
 
-            if (   RT_SUCCESS(rc)
-                && fSendEvent)
-            {
-                XEvent s;
-                RT_ZERO(s);
-                s.xselection.type      = SelectionNotify;
-                s.xselection.display   = e.xselection.display;
-                s.xselection.time      = e.xselectionrequest.time;
-                s.xselection.selection = e.xselectionrequest.selection;
-                s.xselection.requestor = e.xselectionrequest.requestor;
-                s.xselection.target    = atmTarget;
-                s.xselection.property  = atmProperty;
-
-                int xRc = XSendEvent(e.xselection.display, e.xselectionrequest.requestor, False, 0, &s);
-                if (RT_UNLIKELY(xRc == 0))
-                    logError("Error sending SelectionNotify(1) event to wnd=%#x: %s\n", e.xselectionrequest.requestor,
-                             gX11->xErrorToString(xRc).c_str());
-            }
+            LogFlowThisFunc(("Offering type '%s', property '%s' to wnd=%#x ...\n",
+                             xAtomToString(pReq->target).c_str(),
+                             xAtomToString(pReq->property).c_str(), pReq->requestor));
 
-#ifdef DEBUG
-            if (propName.value)
-                XFree(propName.value);
-#endif
+            int xRc = XSendEvent(pReq->display, pReq->requestor, True /* Propagate */, 0, &s);
+            if (xRc == 0)
+                logError("Error sending SelectionNotify(1) event to wnd=%#x: %s\n", pReq->requestor,
+                         gX11->xErrorToString(xRc).c_str());
+            XFlush(pReq->display);
+
+            if (pszWndName)
+                RTStrFree(pszWndName);
             break;
         }
 
         default:
-        {
-            LogFlowThisFunc(("Unhandled message for wnd=%#x: %s\n",
-                             e.xclient.data.l[0], xAtomToString(e.xclient.message_type).c_str()));
             rc = VERR_INVALID_STATE;
             break;
-        }
     }
 
     LogFlowThisFunc(("Returning rc=%Rrc\n", rc));
@@ -1022,10 +1368,8 @@ int DragInstance::onX11Event(const XEvent &e)
             break;
 
         case SelectionClear:
-           LogFlowThisFunc(("SelectionClear\n"));
-           reset();
-           rc = VINF_SUCCESS;
-           break;
+            rc = onX11SelectionClear(e);
+            break;
 
         case SelectionNotify:
             rc = onX11SelectionNotify(e);
@@ -1035,9 +1379,9 @@ int DragInstance::onX11Event(const XEvent &e)
             rc = onX11SelectionRequest(e);
             break;
 
-        /*case MotionNotify:
-          hide();
-          break;*/
+        case MotionNotify:
+            rc = onX11MotionNotify(e);
+            break;
 
         default:
             rc = VERR_NOT_IMPLEMENTED;
@@ -1048,6 +1392,30 @@ int DragInstance::onX11Event(const XEvent &e)
     return rc;
 }
 
+int DragInstance::waitForStatusChange(uint32_t enmState, RTMSINTERVAL uTimeoutMS /* = 30000 */)
+{
+    const uint64_t uiStart = RTTimeMilliTS();
+    volatile uint32_t enmCurState;
+
+    int rc = VERR_TIMEOUT;
+
+    LogFlowFunc(("enmState=%RU32, uTimeoutMS=%RU32\n", enmState, uTimeoutMS));
+
+    do
+    {
+        enmCurState = ASMAtomicReadU32(&m_enmState);
+        if (enmCurState == enmState)
+        {
+            rc = VINF_SUCCESS;
+            break;
+        }
+    }
+    while (RTTimeMilliTS() - uiStart < uTimeoutMS);
+
+    LogFlowThisFunc(("Returning %Rrc\n", rc));
+    return rc;
+}
+
 #ifdef VBOX_WITH_DRAG_AND_DROP_GH
 /**
  * Waits for an X11 event of a specific type.
@@ -1059,7 +1427,7 @@ int DragInstance::onX11Event(const XEvent &e)
  */
 bool DragInstance::waitForX11Msg(XEvent &evX, int iType, RTMSINTERVAL uTimeoutMS /* = 100 */)
 {
-    LogFlowThisFunc(("iType=%d, uTimeoutMS=%RU32, cEventQueue=%zu\n", iType, uTimeoutMS, m_eventQueue.size()));
+    LogFlowThisFunc(("iType=%d, uTimeoutMS=%RU32, cEventQueue=%zu\n", iType, uTimeoutMS, m_eventQueueList.size()));
 
     bool fFound = false;
     const uint64_t uiStart = RTTimeMilliTS();
@@ -1067,17 +1435,17 @@ bool DragInstance::waitForX11Msg(XEvent &evX, int iType, RTMSINTERVAL uTimeoutMS
     do
     {
         /* Check if there is a client message in the queue. */
-        for (size_t i = 0; i < m_eventQueue.size(); i++)
+        for (size_t i = 0; i < m_eventQueueList.size(); i++)
         {
             int rc2 = RTCritSectEnter(&m_eventQueueCS);
             if (RT_SUCCESS(rc2))
             {
-                XEvent e = m_eventQueue.at(i);
+                XEvent e = m_eventQueueList.at(i);
 
                 fFound = e.type == iType;
                 if (fFound)
                 {
-                    m_eventQueue.removeAt(i);
+                    m_eventQueueList.removeAt(i);
                     evX = e;
                 }
 
@@ -1092,7 +1460,7 @@ bool DragInstance::waitForX11Msg(XEvent &evX, int iType, RTMSINTERVAL uTimeoutMS
         if (fFound)
             break;
 
-        int rc2 = RTSemEventWait(m_hEventSem, 25 /* ms */);
+        int rc2 = RTSemEventWait(m_eventQueueEvent, 25 /* ms */);
         if (   RT_FAILURE(rc2)
             && rc2 != VERR_TIMEOUT)
         {
@@ -1115,32 +1483,39 @@ bool DragInstance::waitForX11Msg(XEvent &evX, int iType, RTMSINTERVAL uTimeoutMS
  * @param   uTimeoutMS              Timeout (in ms) to wait for the event.
  */
 bool DragInstance::waitForX11ClientMsg(XClientMessageEvent &evMsg, Atom aType,
-                                       RTMSINTERVAL uTimeoutMS /*= 100 */)
+                                       RTMSINTERVAL uTimeoutMS /* = 100 */)
 {
     LogFlowThisFunc(("aType=%s, uTimeoutMS=%RU32, cEventQueue=%zu\n",
-                     xAtomToString(aType).c_str(), uTimeoutMS, m_eventQueue.size()));
+                     xAtomToString(aType).c_str(), uTimeoutMS, m_eventQueueList.size()));
 
     bool fFound = false;
     const uint64_t uiStart = RTTimeMilliTS();
     do
     {
         /* Check if there is a client message in the queue. */
-        for (size_t i = 0; i < m_eventQueue.size(); i++)
+        for (size_t i = 0; i < m_eventQueueList.size(); i++)
         {
             int rc2 = RTCritSectEnter(&m_eventQueueCS);
             if (RT_SUCCESS(rc2))
             {
-                XEvent e = m_eventQueue.at(i);
-                if (e.type == ClientMessage)
+                XEvent e = m_eventQueueList.at(i);
+                if (   e.type                 == ClientMessage
+                    && e.xclient.message_type == aType)
                 {
-                    /** @todo Check is aType matches the event's type! */
-
-                    m_eventQueue.removeAt(i);
+                    m_eventQueueList.removeAt(i);
                     evMsg = e.xclient;
 
                     fFound = true;
                 }
 
+                if (e.type == ClientMessage)
+                {
+                    LogFlowThisFunc(("Client message: Type=%ld (%s)\n",
+                                     e.xclient.message_type, xAtomToString(e.xclient.message_type).c_str()));
+                }
+                else
+                    LogFlowThisFunc(("X message: Type=%d\n", e.type));
+
                 rc2 = RTCritSectLeave(&m_eventQueueCS);
                 AssertRC(rc2);
 
@@ -1152,7 +1527,7 @@ bool DragInstance::waitForX11ClientMsg(XClientMessageEvent &evMsg, Atom aType,
         if (fFound)
             break;
 
-        int rc2 = RTSemEventWait(m_hEventSem, 25 /* ms */);
+        int rc2 = RTSemEventWait(m_eventQueueEvent, 25 /* ms */);
         if (   RT_FAILURE(rc2)
             && rc2 != VERR_TIMEOUT)
         {
@@ -1206,7 +1581,7 @@ int DragInstance::hgEnter(const RTCList<RTCString> &lstFormats, uint32_t uAction
         /* If we have more than 3 formats we have to use the type list extension. */
         if (m_lstFormats.size() > 3)
         {
-            rc = wndXDnDSetFormatList(m_wndProxy, xAtom(XA_XdndTypeList), m_lstFormats);
+            rc = wndXDnDSetFormatList(m_wndProxy.hWnd, xAtom(XA_XdndTypeList), m_lstFormats);
             if (RT_FAILURE(rc))
                 break;
         }
@@ -1216,10 +1591,11 @@ int DragInstance::hgEnter(const RTCList<RTCString> &lstFormats, uint32_t uAction
         rc = toAtomActions(uActions, lstActions);
         if (RT_FAILURE(rc))
             break;
-        rc = wndXDnDSetActionList(m_wndProxy, lstActions);
+        rc = wndXDnDSetActionList(m_wndProxy.hWnd, lstActions);
 
         /* Set the DnD selection owner to our window. */
-        XSetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection), m_wndProxy, CurrentTime);
+        /** @todo Don't use CurrentTime -- according to ICCCM section 2.1. */
+        XSetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection), m_wndProxy.hWnd, CurrentTime);
 
         m_enmMode  = HG;
         m_enmState = Dragging;
@@ -1286,62 +1662,83 @@ int DragInstance::hgMove(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAc
         xRc = XGetWindowProperty(m_pDisplay, wndCursor, xAtom(XA_XdndAware),
                                  0, 2, False, AnyPropertyType,
                                  &atmp, &fmt, &cItems, &cbRemaining, &pcData);
-
-        if (RT_UNLIKELY(xRc != Success))
+        if (xRc != Success)
+        {
             logError("Error getting properties of cursor window=%#x: %s\n", wndCursor, gX11->xErrorToString(xRc).c_str());
+        }
         else
         {
-            if (RT_UNLIKELY(pcData == NULL || fmt != 32 || cItems != 1))
-                LogFlowThisFunc(("Wrong properties: pcData=%#x, iFmt=%d, cItems=%ul\n", pcData, fmt, cItems));
+            if (pcData == NULL || fmt != 32 || cItems != 1)
+            {
+                /** @todo Do we need to deal with this? */
+                logError("Wrong window properties for window %#x: pcData=%#x, iFmt=%d, cItems=%ul\n",
+                         wndCursor, pcData, fmt, cItems);
+            }
             else
             {
-                newVer = reinterpret_cast<long*>(pcData)[0];
-#ifdef DEBUG
-                XTextProperty propName;
-                if (XGetWMName(m_pDisplay, wndCursor, &propName))
-                {
-                    LogFlowThisFunc(("Current: wndCursor=%#x '%s', XdndAware=%ld\n", wndCursor, propName.value, newVer));
-                    XFree(propName.value);
-                }
-#endif
+                /* Get the current window's Xdnd version. */
+                newVer = reinterpret_cast<long *>(pcData)[0];
             }
 
             XFree(pcData);
         }
     }
 
-    /*
-     * Is the window under the cursor another one than our current one?
-     * Cancel the current drop.
-     */
+#ifdef DEBUG
+    char *pszNameCursor = wndX11GetNameA(wndCursor);
+    AssertPtr(pszNameCursor);
+    char *pszNameCur = wndX11GetNameA(m_wndCur);
+    AssertPtr(pszNameCur);
+
+    LogFlowThisFunc(("wndCursor=%x ('%s', Xdnd version %ld), wndCur=%x ('%s', Xdnd version %ld)\n",
+                     wndCursor, pszNameCursor, newVer, m_wndCur, pszNameCur, m_curVer));
+
+    RTStrFree(pszNameCursor);
+    RTStrFree(pszNameCur);
+#endif
+
     if (   wndCursor != m_wndCur
         && m_curVer  != -1)
     {
         LogFlowThisFunc(("XA_XdndLeave: window=%#x\n", m_wndCur));
 
+        char *pszWndName = wndX11GetNameA(m_wndCur);
+        AssertPtr(pszWndName);
+        logInfo("Left old window %#x ('%s'), Xdnd version=%ld\n", m_wndCur, pszWndName, newVer);
+        RTStrFree(pszWndName);
+
         /* We left the current XdndAware window. Announce this to the current indow. */
         XClientMessageEvent m;
         RT_ZERO(m);
-        m.type         = ClientMessage;
-        m.display      = m_pDisplay;
-        m.window       = m_wndCur;
-        m.message_type = xAtom(XA_XdndLeave);
-        m.format       = 32;
-        m.data.l[0]    = m_wndProxy;                    /* Source window. */
+        m.type                    = ClientMessage;
+        m.display                 = m_pDisplay;
+        m.window                  = m_wndCur;
+        m.message_type            = xAtom(XA_XdndLeave);
+        m.format                  = 32;
+        m.data.l[XdndLeaveWindow] = m_wndProxy.hWnd;
 
         xRc = XSendEvent(m_pDisplay, m_wndCur, False, NoEventMask, reinterpret_cast<XEvent*>(&m));
-        if (RT_UNLIKELY(xRc == 0))
+        if (xRc == 0)
             logError("Error sending XA_XdndLeave event to old window=%#x: %s\n", m_wndCur, gX11->xErrorToString(xRc).c_str());
+
+        /* Reset our current window. */
+        m_wndCur = 0;
+        m_curVer = -1;
     }
 
     /*
-     * Do we have a new window which now is under the cursor?
+     * Do we have a new Xdnd-aware window which now is under the cursor?
      */
     if (   wndCursor != m_wndCur
         && newVer    != -1)
     {
         LogFlowThisFunc(("XA_XdndEnter: window=%#x\n", wndCursor));
 
+        char *pszWndName = wndX11GetNameA(wndCursor);
+        AssertPtr(pszWndName);
+        logInfo("Entered new window %#x ('%s'), supports Xdnd version=%ld\n", wndCursor, pszWndName, newVer);
+        RTStrFree(pszWndName);
+
         /*
          * We enter a new window. Announce the XdndEnter event to the new
          * window. The first three mime types are attached to the event (the
@@ -1355,25 +1752,27 @@ int DragInstance::hgMove(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAc
         m.window       = wndCursor;
         m.message_type = xAtom(XA_XdndEnter);
         m.format       = 32;
-        m.data.l[0]    = m_wndProxy;                    /* Source window. */
-        m.data.l[1]    = RT_MAKE_U32_FROM_U8(
-                         /* Bit 0 is set if the source supports more than three data types. */
-                         m_lstFormats.size() > 3 ? 1 : 0,
-                         /* Reserved for future use. */
-                         0, 0,
-                         /* Protocol version to use. */
-                         RT_MIN(VBOX_XDND_VERSION, newVer));
-        m.data.l[2]    = m_lstFormats.value(0, None);   /* First data type to use. */
-        m.data.l[3]    = m_lstFormats.value(1, None);   /* Second data type to use. */
-        m.data.l[4]    = m_lstFormats.value(2, None);   /* Third data type to use. */
+        m.data.l[XdndEnterWindow] = m_wndProxy.hWnd;
+        m.data.l[XdndEnterFlags]  = RT_MAKE_U32_FROM_U8(
+                                    /* Bit 0 is set if the source supports more than three data types. */
+                                    m_lstFormats.size() > 3 ? RT_BIT(0) : 0,
+                                    /* Reserved for future use. */
+                                    0, 0,
+                                    /* Protocol version to use. */
+                                    RT_MIN(VBOX_XDND_VERSION, newVer));
+        m.data.l[XdndEnterType1]  = m_lstFormats.value(0, None); /* First data type to use. */
+        m.data.l[XdndEnterType2]  = m_lstFormats.value(1, None); /* Second data type to use. */
+        m.data.l[XdndEnterType3]  = m_lstFormats.value(2, None); /* Third data type to use. */
 
         xRc = XSendEvent(m_pDisplay, wndCursor, False, NoEventMask, reinterpret_cast<XEvent*>(&m));
-        if (RT_UNLIKELY(xRc == 0))
+        if (xRc == 0)
             logError("Error sending XA_XdndEnter event to window=%#x: %s\n", wndCursor, gX11->xErrorToString(xRc).c_str());
     }
 
     if (newVer != -1)
     {
+        Assert(wndCursor != None);
+
         LogFlowThisFunc(("XA_XdndPosition: xPos=%RU32, yPos=%RU32 to window=%#x\n", u32xPos, u32yPos, wndCursor));
 
         /*
@@ -1389,26 +1788,27 @@ int DragInstance::hgMove(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAc
         m.window       = wndCursor;
         m.message_type = xAtom(XA_XdndPosition);
         m.format       = 32;
-        m.data.l[0]    = m_wndProxy;                    /* X window ID of source window. */
-        m.data.l[2]    = RT_MAKE_U32(u32yPos, u32xPos); /* Cursor coordinates relative to the root window. */
-        m.data.l[3]    = CurrentTime;                   /* Timestamp for retrieving data. */
-        m.data.l[4]    = pa;                            /* Actions requested by the user. */
+        m.data.l[XdndPositionWindow]    = m_wndProxy.hWnd;               /* X window ID of source window. */
+        m.data.l[XdndPositionXY]        = RT_MAKE_U32(u32yPos, u32xPos); /* Cursor coordinates relative to the root window. */
+        m.data.l[XdndPositionTimeStamp] = CurrentTime;                   /* Timestamp for retrieving data. */
+        m.data.l[XdndPositionAction]    = pa;                            /* Actions requested by the user. */
 
         xRc = XSendEvent(m_pDisplay, wndCursor, False, NoEventMask, reinterpret_cast<XEvent*>(&m));
-        if (RT_UNLIKELY(xRc == 0))
+        if (xRc == 0)
             logError("Error sending XA_XdndPosition event to current window=%#x: %s\n", wndCursor, gX11->xErrorToString(xRc).c_str());
     }
 
-    if (   wndCursor == None
-        && newVer    == -1)
+    if (newVer == -1)
     {
         /* No window to process, so send a ignore ack event to the host. */
         rc = VbglR3DnDHGAcknowledgeOperation(&m_dndCtx, DND_IGNORE_ACTION);
     }
     else
     {
+        Assert(wndCursor != None);
+
         m_wndCur = wndCursor;
-        m_curVer = RT_MIN(VBOX_XDND_VERSION, newVer);
+        m_curVer = newVer;
     }
 
     LogFlowFuncLeaveRC(rc);
@@ -1419,10 +1819,15 @@ int DragInstance::hgMove(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAc
  * Host -> Guest: Event signalling that the host has dropped the data over the VM (guest) window.
  *
  * @returns IPRT status code.
+ * @param   u32xPos                 Relative X position within the guest's display area.
+ * @param   u32yPos                 Relative Y position within the guest's display area.
+ * @param   uDefaultAction          Default action the host wants to perform on the guest
+ *                                  as soon as the operation successfully finishes.
  */
-int DragInstance::hgDrop(void)
+int DragInstance::hgDrop(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAction)
 {
-    LogFlowThisFunc(("wndCur=%#x, wndProxy=%#x, mode=%RU32, state=%RU32\n", m_wndCur, m_wndProxy, m_enmMode, m_enmState));
+    LogFlowThisFunc(("wndCur=%#x, wndProxy=%#x, mode=%RU32, state=%RU32\n", m_wndCur, m_wndProxy.hWnd, m_enmMode, m_enmState));
+    LogFlowThisFunc(("u32xPos=%RU32, u32yPos=%RU32, uAction=%RU32\n", u32xPos, u32yPos, uDefaultAction));
 
     if (   m_enmMode  != HG
         || m_enmState != Dragging)
@@ -1430,37 +1835,27 @@ int DragInstance::hgDrop(void)
         return VERR_INVALID_STATE;
     }
 
-    int rc = VINF_SUCCESS;
+    /* Set the state accordingly. */
+    m_enmState = Dropped;
 
     /*
-     * Send a drop event to the current window and reset our DnD status.
+     * Ask the host to send the raw data, as we don't (yet) know which format
+     * the guest exactly expects. As blocking in a SelectionRequest message turned
+     * out to be very unreliable (e.g. with KDE apps) we request to start transferring
+     * file/directory data (if any) here.
      */
-    XClientMessageEvent m;
-    RT_ZERO(m);
-    m.type         = ClientMessage;
-    m.display      = m_pDisplay;
-    m.window       = m_wndCur;
-    m.message_type = xAtom(XA_XdndDrop);
-    m.format       = 32;
-    m.data.l[0]    = m_wndProxy;                        /* Source window. */
-    m.data.l[2]    = CurrentTime;                       /* Timestamp. */
-
-    int xRc = XSendEvent(m_pDisplay, m_wndCur, False, NoEventMask, reinterpret_cast<XEvent*>(&m));
-    if (RT_UNLIKELY(xRc == 0))
-        logError("Error sending XA_XdndDrop event to wndCur=%#x: %s\n", m_wndCur, gX11->xErrorToString(xRc).c_str());
+    char szFormat[] = { "text/uri-list" };
 
-    m_wndCur = None;
-    m_curVer = -1;
-
-    m_enmState = Dropped;
+    int rc = VbglR3DnDHGRequestData(&m_dndCtx, szFormat);
+    logInfo("Drop event from host resuled in: %Rrc\n", rc);
 
     LogFlowFuncLeaveRC(rc);
     return rc;
 }
 
 /**
- * Host -> Guest: Event signalling that the host has sent drag'n drop (MIME) data
- *                to the guest for further processing.
+ * Host -> Guest: Event signalling that the host has finished sending drag'n drop
+ *                data to the guest for further processing.
  *
  * @returns IPRT status code.
  * @param   pvData                  Pointer to (MIME) data from host.
@@ -1469,6 +1864,7 @@ int DragInstance::hgDrop(void)
 int DragInstance::hgDataReceived(const void *pvData, uint32_t cbData)
 {
     LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
+    LogFlowThisFunc(("pvData=%p, cbData=%RU32\n", pvData, cbData));
 
     if (   m_enmMode  != HG
         || m_enmState != Dropped)
@@ -1476,55 +1872,68 @@ int DragInstance::hgDataReceived(const void *pvData, uint32_t cbData)
         return VERR_INVALID_STATE;
     }
 
-    if (RT_UNLIKELY(   pvData == NULL
-                    || cbData  == 0))
+    if (   pvData == NULL
+        || cbData == 0)
     {
         return VERR_INVALID_PARAMETER;
     }
 
-    /* Make a copy of the data. The X server will become the new owner. */
-    void *pvNewData = RTMemAlloc(cbData);
-    if (RT_UNLIKELY(!pvNewData))
-        return VERR_NO_MEMORY;
+    int rc = VINF_SUCCESS;
+
+    /*
+     * At this point all data needed (including sent files/directories) should
+     * be on the guest, so proceed working on communicating with the target window.
+     */
+    logInfo("Received %RU32 bytes MIME data from host\n", cbData);
+
+    /* Destroy any old data. */
+    if (m_pvSelReqData)
+    {
+        Assert(m_cbSelReqData);
 
-    memcpy(pvNewData, pvData, cbData);
+        RTMemFree(m_pvSelReqData); /** @todo RTMemRealloc? */
+        m_cbSelReqData = 0;
+    }
+
+    /** @todo Handle incremental transfers. */
+
+    /* Make a copy of the data. This data later then will be used to fill into
+     * the selection request. */
+    if (cbData)
+    {
+        m_pvSelReqData = RTMemAlloc(cbData);
+        if (!m_pvSelReqData)
+            return VERR_NO_MEMORY;
+
+        memcpy(m_pvSelReqData, pvData, cbData);
+        m_cbSelReqData = cbData;
+    }
 
     /*
-     * The host has sent us the DnD data in the requested MIME type. This allows us
-     * to fill the XdndSelection property of the requestor window with the data
-     * and afterwards inform the host about the new status.
+     * Send a drop event to the current window (target).
+     * This window in turn then will raise a SelectionRequest message to our proxy window,
+     * which we will handle in our onX11SelectionRequest handler.
+     *
+     * The SelectionRequest will tell us in which format the target wants the data from the host.
      */
-    XEvent s;
-    RT_ZERO(s);
-    s.xselection.type      = SelectionNotify;
-    s.xselection.display   = m_eventHgSelection.xselection.display;
-//    s.xselection.owner     = m_selEvent.xselectionrequest.owner;
-    s.xselection.time      = m_eventHgSelection.xselectionrequest.time;
-    s.xselection.selection = m_eventHgSelection.xselectionrequest.selection;
-    s.xselection.requestor = m_eventHgSelection.xselectionrequest.requestor;
-    s.xselection.target    = m_eventHgSelection.xselectionrequest.target;
-    s.xselection.property  = m_eventHgSelection.xselectionrequest.property;
-
-    LogFlowThisFunc(("owner=%#x, requestor=%#x, sel_atom=%s, target_atom=%s, prop_atom=%s, time=%u\n",
-                     m_eventHgSelection.xselectionrequest.owner,
-                     s.xselection.requestor,
-                     xAtomToString(s.xselection.selection).c_str(),
-                     xAtomToString(s.xselection.target).c_str(),
-                     xAtomToString(s.xselection.property).c_str(),
-                     s.xselection.time));
-
-    /* Fill up the property with the data. */
-    XChangeProperty(s.xselection.display, s.xselection.requestor, s.xselection.property, s.xselection.target, 8, PropModeReplace,
-                    reinterpret_cast<const unsigned char*>(pvNewData), cbData);
-    int xRc = XSendEvent(s.xselection.display, s.xselection.requestor, True, 0, &s);
-    if (RT_UNLIKELY(xRc == 0))
-        logError("Error sending SelectionNotify(2) event to window=%#x: %s\n",
-                 s.xselection.requestor, gX11->xErrorToString(xRc).c_str());
-
-    /* We're finally done, reset. */
-    reset();
+    XClientMessageEvent m;
+    RT_ZERO(m);
+    m.type         = ClientMessage;
+    m.display      = m_pDisplay;
+    m.window       = m_wndCur;
+    m.message_type = xAtom(XA_XdndDrop);
+    m.format       = 32;
+    m.data.l[XdndDropWindow]    = m_wndProxy.hWnd;  /* Source window. */
+    m.data.l[XdndDropFlags]     = 0;                /* Reserved for future use. */
+    m.data.l[XdndDropTimeStamp] = CurrentTime;      /* Our DnD data does not rely on any timing, so just use the current time. */
 
-    return VINF_SUCCESS;
+    int xRc = XSendEvent(m_pDisplay, m_wndCur, False /* Propagate */, NoEventMask, reinterpret_cast<XEvent*>(&m));
+    if (xRc == 0)
+        logError("Error sending XA_XdndDrop event to window=%#x: %s\n", m_wndCur, gX11->xErrorToString(xRc).c_str());
+    XFlush(m_pDisplay);
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
 }
 
 #ifdef VBOX_WITH_DRAG_AND_DROP_GH
@@ -1538,126 +1947,92 @@ int DragInstance::ghIsDnDPending(void)
 {
     LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
 
-    if (m_enmMode == HG)
-        return VERR_INVALID_STATE;
+    int rc;
 
-    int rc = VINF_SUCCESS;
-    Window wndSelection = XGetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection));
-    LogFlowThisFunc(("Checking pending wndSelection=%#x, wndProxy=%#x\n", wndSelection, m_wndProxy));
+    RTCString strFormats = "\r\n"; /** @todo If empty, IOCTL fails with VERR_ACCESS_DENIED. */
+    uint32_t uDefAction  = DND_IGNORE_ACTION;
+    uint32_t uAllActions = DND_IGNORE_ACTION;
 
-    /* Is this another window which has a Xdnd selection than our current one? */
-    if (   wndSelection
-        && wndSelection != m_wndProxy)
+    /* Currently in wrong mode? Bail out. */
+    if (m_enmMode == HG)
+        rc = VERR_INVALID_STATE;
+    /* Message already processed successfully? */
+    else if (   m_enmMode  == GH
+             && (   m_enmState == Dragging
+                 || m_enmState == Dropped)
+            )
+    {
+        rc = VERR_INVALID_STATE;
+    }
+    else
     {
-        /* Map the window on the current cursor position, which should provoke
-         * an XdndEnter event. */
-        proxyWinShow(NULL, NULL, true);
+        /* Determine the current window which currently has the XdndSelection set. */
+        Window wndSelection = XGetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection));
+        LogFlowThisFunc(("wndSelection=%#x, wndProxy=%#x, wndCur=%#x\n", wndSelection, m_wndProxy.hWnd, m_wndCur));
 
-        XEvent e;
-        if (waitForX11Msg(e, ClientMessage))
+        /* Is this another window which has a Xdnd selection and not our proxy window? */
+        if (   wndSelection
+            && wndSelection != m_wndCur)
         {
-            bool fAcceptDrop = false;
-
-            int xRc;
-            XClientMessageEvent *pEventClient = reinterpret_cast<XClientMessageEvent*>(&e);
-            AssertPtr(pEventClient);
+            char *pszWndName = wndX11GetNameA(wndSelection);
+            AssertPtr(pszWndName);
+            logInfo("New guest source window %#x ('%s')\n", wndSelection, pszWndName);
 
-            LogFlowThisFunc(("Received event=%s\n",
-                             gX11->xAtomToString(pEventClient->message_type).c_str()));
+            /* Start over. */
+            reset();
 
-            if (pEventClient->message_type == xAtom(XA_XdndEnter))
+            /* Map the window on the current cursor position, which should provoke
+             * an XdndEnter event. */
+            rc = proxyWinShow(NULL, NULL);
+            if (RT_SUCCESS(rc))
             {
-                LogFlowThisFunc(("XA_XdndEnter\n"));
-
-                /*
-                 * Prepare everything for our new window.
-                 */
-                reset();
-
-                /*
-                 * Update our state and the window handle to process.
-                 */
-                m_enmMode   = GH;
-                m_enmState  = Dragging;
-                m_wndCur    = wndSelection;
-                Assert(m_wndCur == (Window)pEventClient->data.l[0]);
-#ifdef DEBUG
-                XWindowAttributes xwa;
-                XGetWindowAttributes(m_pDisplay, m_wndCur, &xwa);
-                LogFlowThisFunc(("m_wndCur=%#x, x=%d, y=%d, width=%d, height=%d\n",
-                                 m_wndCur, xwa.x, xwa.y, xwa.width, xwa.height));
-#endif
-                /* Check if the MIME types are in the message itself or if we need
-                 * to fetch the XdndTypeList property from the window. */
-                if (!ASMBitTest(&pEventClient->data.l[1], 0))
+                rc = mouseCursorFakeMove();
+                if (RT_SUCCESS(rc))
                 {
-                    for (int i = 2; i < 5; ++i)
-                    {
-                        LogFlowThisFunc(("Received format via message: %s\n",
-                                         gX11->xAtomToString(pEventClient->data.l[i]).c_str()));
-
-                        m_lstFormats.append(pEventClient->data.l[i]);
-                    }
+                    /* Wait until we're in "Dragging" state. */
+                    rc = waitForStatusChange(Dragging, 1000 /* 1s timeout */);
                 }
-                else
+                if (RT_SUCCESS(rc))
                 {
-                    rc = wndXDnDGetFormatList(wndSelection, m_lstFormats);
+                    m_enmMode = GH;
                 }
-
-                /*
-                 * Fetch the actions.
-                 */
-                rc = wndXDnDGetActionList(wndSelection, m_lstActions);
-
-                fAcceptDrop = true;
-            }
-            /* Did the source tell us where the cursor currently is? */
-            else if (pEventClient->message_type == xAtom(XA_XdndPosition))
-            {
-                LogFlowThisFunc(("XA_XdndPosition\n"));
-                fAcceptDrop = true;
-            }
-            else if (pEventClient->message_type == xAtom(XA_XdndLeave))
-            {
-                LogFlowThisFunc(("XA_XdndLeave\n"));
+                else
+                    logError("Error mapping proxy window to guest source window %#x ('%s'), rc=%Rrc\n",
+                             wndSelection, pszWndName, rc);
             }
 
-            if (fAcceptDrop)
-            {
-                /* Reply with a XdndStatus message to tell the source whether
-                 * the data can be dropped or not. */
-                XClientMessageEvent m;
-                RT_ZERO(m);
-                m.type         = ClientMessage;
-                m.display      = m_pDisplay;
-                m.window       = m_wndCur;
-                m.message_type = xAtom(XA_XdndStatus);
-                m.format       = 32;
-                m.data.l[0]    = m_wndProxy;
-                m.data.l[1]    = RT_BIT(0); /* Accept the drop. */
-                m.data.l[4]    = xAtom(XA_XdndActionCopy); /** @todo Make the accepted action configurable. */
-
-                xRc = XSendEvent(m_pDisplay, m_wndCur,
-                                 False, 0, reinterpret_cast<XEvent*>(&m));
-                if (RT_UNLIKELY(xRc == 0))
-                {
-                    logError("Error sending position XA_XdndStatus event to current window=%#x: %s\n",
-                              m_wndCur, gX11->xErrorToString(xRc).c_str());
-                }
-            }
+            RTStrFree(pszWndName);
         }
+    }
 
-        /* Do we need to acknowledge at least one format to the host? */
-        if (!m_lstFormats.isEmpty())
-        {
-            RTCString strFormats = gX11->xAtomListToString(m_lstFormats);
-            uint32_t uDefAction = DND_COPY_ACTION; /** @todo Handle default action! */
-            uint32_t uAllActions = toHGCMActions(m_lstActions);
+    /*
+     * Acknowledge to the host in any case, regardless
+     * if something failed here or not. Be responsive.
+     */
 
-            rc = VbglR3DnDGHAcknowledgePending(&m_dndCtx, uDefAction, uAllActions, strFormats.c_str());
-            LogFlowThisFunc(("Acknowledging m_uClientID=%RU32, allActions=0x%x, strFormats=%s, rc=%Rrc\n",
-                             m_dndCtx.uClientID, uAllActions, strFormats.c_str(), rc));
+    int rc2 = RTCritSectEnter(&m_dataCS);
+    if (RT_SUCCESS(rc2))
+    {
+        RTCString strFormatsCur = gX11->xAtomListToString(m_lstFormats);
+        if (!strFormatsCur.isEmpty())
+        {
+            strFormats   = strFormatsCur;
+            uDefAction   = DND_COPY_ACTION; /** @todo Handle default action! */
+            uAllActions  = DND_COPY_ACTION; /** @todo Ditto. */
+            uAllActions |= toHGCMActions(m_lstActions);
         }
+
+        RTCritSectLeave(&m_dataCS);
+    }
+
+    rc2 = VbglR3DnDGHAcknowledgePending(&m_dndCtx, uDefAction, uAllActions, strFormats.c_str());
+    LogFlowThisFunc(("uClientID=%RU32, uDefAction=0x%x, allActions=0x%x, strFormats=%s, rc=%Rrc\n",
+                     m_dndCtx.uClientID, uDefAction, uAllActions, strFormats.c_str(), rc2));
+    if (RT_FAILURE(rc2))
+    {
+        logError("Error reporting pending drag and drop operation status to host: %Rrc\n", rc2);
+        if (RT_SUCCESS(rc))
+            rc = rc2;
     }
 
     LogFlowFuncLeaveRC(rc);
@@ -1677,8 +2052,15 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
     LogFlowThisFunc(("mode=%RU32, state=%RU32, strFormat=%s, uAction=%RU32\n",
                      m_enmMode, m_enmState, strFormat.c_str(), uAction));
 
-    if (   m_enmMode  != GH
-        || m_enmState != Dragging)
+    /* Currently in wrong mode? Bail out. */
+    if (   m_enmMode == Unknown
+        || m_enmMode == HG)
+    {
+        return VERR_INVALID_STATE;
+    }
+
+    if (   m_enmMode  == GH
+        && m_enmState != Dragging)
     {
         return VERR_INVALID_STATE;
     }
@@ -1687,48 +2069,60 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
 
     m_enmState = Dropped;
 
-    /* Show the proxy window, so that the source will find it. */
+    /* Show the proxy window, so that the current source window will find it. */
     int iRootX, iRootY;
     proxyWinShow(&iRootX, &iRootY);
-    XFlush(m_pDisplay);
 
 #ifdef DEBUG
     XWindowAttributes xwa;
     XGetWindowAttributes(m_pDisplay, m_wndCur, &xwa);
-    LogFlowThisFunc(("wndCur=%#x, x=%d, y=%d, width=%d, height=%d\n", m_wndCur, xwa.x, xwa.y, xwa.width, xwa.height));
+    LogFlowThisFunc(("wndProxy=%#x, wndCur=%#x, x=%d, y=%d, width=%d, height=%d\n",
+                     m_wndProxy.hWnd, m_wndCur, xwa.x, xwa.y, xwa.width, xwa.height));
 #endif
 
     /* We send a fake release event to the current window, cause
      * this should have the grab. */
-    mouseButtonSet(m_wndCur /* Destination window */, iRootX, iRootY,
-                   1 /* Button */, false /* fPress */);
+#if 0
+    //mouseButtonSet(m_wndCur /* Destination window */, xwa.x + (xwa.width / 2), xwa.y + (xwa.height / 2), 1 /* Button */, false /* fPress */);
+#else
+    mouseButtonSet(m_wndCur /* Destination window */, -1 /* Root X */, -1 /* Root Y */, 1 /* Button */, false /* fPress */);
+#endif
 
     /**
      * The fake button release event above should lead to a XdndDrop event from the
-     * source. Because of showing our proxy window, other Xdnd events can
+     * source window. Because of showing our proxy window, other Xdnd events can
      * occur before, e.g. a XdndPosition event. We are not interested
      * in those, so just try to get the right one.
      */
 
     XClientMessageEvent evDnDDrop;
-    bool fDrop = waitForX11ClientMsg(evDnDDrop, xAtom(XA_XdndDrop), 5 * 1000 /* Timeout in ms */);
+    bool fDrop = waitForX11ClientMsg(evDnDDrop, xAtom(XA_XdndDrop), 5 * 1000 /* 5s timeout */);
     if (fDrop)
     {
         LogFlowThisFunc(("XA_XdndDrop\n"));
 
         /* Request to convert the selection in the specific format and
          * place it to our proxy window as property. */
-        Window wndSource = evDnDDrop.data.l[0]; /* Source window which has sent the message. */
+        Assert(evDnDDrop.message_type == xAtom(XA_XdndDrop));
+
+        Window wndSource = evDnDDrop.data.l[XdndDropWindow]; /* Source window which has sent the message. */
         Assert(wndSource == m_wndCur);
-        Atom aFormat  = gX11->stringToxAtom(strFormat.c_str());
+
+        Atom aFormat     = gX11->stringToxAtom(strFormat.c_str());
+
+        Time tsDrop;
+        if (m_curVer >= 1)
+            tsDrop = evDnDDrop.data.l[XdndDropTimeStamp];
+        else
+            tsDrop = CurrentTime;
 
         XConvertSelection(m_pDisplay, xAtom(XA_XdndSelection), aFormat, xAtom(XA_XdndSelection),
-                          m_wndProxy, evDnDDrop.data.l[2]);
+                          m_wndProxy.hWnd, tsDrop);
 
         /* Wait for the selection notify event. */
         XEvent evSelNotify;
         RT_ZERO(evSelNotify);
-        if (waitForX11Msg(evSelNotify, SelectionNotify))
+        if (waitForX11Msg(evSelNotify, SelectionNotify, 5 * 1000 /* 5s timeout */))
         {
             bool fCancel = false;
 
@@ -1736,7 +2130,7 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
             if (   evSelNotify.xselection.type      == SelectionNotify
                 && evSelNotify.xselection.display   == m_pDisplay
                 && evSelNotify.xselection.selection == xAtom(XA_XdndSelection)
-                && evSelNotify.xselection.requestor == m_wndProxy
+                && evSelNotify.xselection.requestor == m_wndProxy.hWnd
                 && evSelNotify.xselection.target    == aFormat)
             {
                 LogFlowThisFunc(("Selection notfiy (from wnd=%#x)\n", m_wndCur));
@@ -1745,16 +2139,16 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
                 int iPropFormat;
                 unsigned long cItems, cbRemaining;
                 unsigned char *pcData = NULL;
-                int xRc = XGetWindowProperty(m_pDisplay, m_wndProxy,
+                int xRc = XGetWindowProperty(m_pDisplay, m_wndProxy.hWnd,
                                              xAtom(XA_XdndSelection)  /* Property */,
                                              0                        /* Offset */,
                                              VBOX_MAX_XPROPERTIES     /* Length of 32-bit multiples */,
                                              True                     /* Delete property? */,
                                              AnyPropertyType,         /* Property type */
                                              &aPropType, &iPropFormat, &cItems, &cbRemaining, &pcData);
-                if (RT_UNLIKELY(xRc != Success))
-                    LogFlowThisFunc(("Error getting XA_XdndSelection property of proxy window=%#x: %s\n",
-                                     m_wndProxy, gX11->xErrorToString(xRc).c_str()));
+                if (xRc != Success)
+                    logError("Error getting XA_XdndSelection property of proxy window=%#x: %s\n",
+                             m_wndProxy.hWnd, gX11->xErrorToString(xRc).c_str());
 
                 LogFlowThisFunc(("strType=%s, iPropFormat=%d, cItems=%RU32, cbRemaining=%RU32\n",
                                  gX11->xAtomToString(aPropType).c_str(), iPropFormat, cItems, cbRemaining));
@@ -1790,29 +2184,12 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
                     {
                         /* Send the raw data to the host. */
                         rc = VbglR3DnDGHSendData(&m_dndCtx, strFormat.c_str(), pcData, cbData);
+                        LogFlowThisFunc(("Sent strFormat=%s, rc=%Rrc\n", strFormat.c_str(), rc));
                     }
 
-                    LogFlowThisFunc(("Sent strFormat=%s, rc=%Rrc\n", strFormat.c_str(), rc));
-
                     if (RT_SUCCESS(rc))
                     {
-                        /* Confirm the result of the transfer to the target window. */
-                        XClientMessageEvent m;
-                        RT_ZERO(m);
-                        m.type         = ClientMessage;
-                        m.display      = m_pDisplay;
-                        m.window       = wndSource;
-                        m.message_type = xAtom(XA_XdndFinished);
-                        m.format       = 32;
-                        m.data.l[0]    = m_wndProxy;                   /* Target window. */
-                        m.data.l[1]    = 0;                            /* Don't accept the drop to not make the guest stuck. */
-                        m.data.l[2]    = RT_SUCCESS(rc)
-                                       ? toAtomAction(uAction) : None; /* Action used on success */
-
-                        xRc = XSendEvent(m_pDisplay, wndSource, True, NoEventMask, reinterpret_cast<XEvent*>(&m));
-                        if (RT_UNLIKELY(xRc == 0))
-                            LogFlowThisFunc(("Error sending XA_XdndFinished event to proxy window=%#x: %s\n",
-                                             m_wndProxy, gX11->xErrorToString(xRc).c_str()));
+                        rc = m_wndProxy.sendFinished(wndSource, uAction);
                     }
                     else
                         fCancel = true;
@@ -1822,12 +2199,14 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
                     if (aPropType == xAtom(XA_INCR))
                     {
                         /** @todo Support incremental transfers. */
-                        AssertMsgFailed(("Incrementally transfers are not supported yet\n"));
+                        AssertMsgFailed(("Incremental transfers are not supported yet\n"));
+
+                        logError("Incremental transfers are not supported yet\n");
                         rc = VERR_NOT_IMPLEMENTED;
                     }
                     else
                     {
-                        LogFlowFunc(("Not supported data type: %s\n", gX11->xAtomToString(aPropType).c_str()));
+                        logError("Not supported data type: %s\n", gX11->xAtomToString(aPropType).c_str());
                         rc = VERR_NOT_SUPPORTED;
                     }
 
@@ -1836,24 +2215,11 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
 
                 if (fCancel)
                 {
-                    LogFlowFunc(("Cancelling drop ...\n"));
-
-                    /* Cancel the operation -- inform the source window. */
-                    XClientMessageEvent m;
-                    RT_ZERO(m);
-                    m.type         = ClientMessage;
-                    m.display      = m_pDisplay;
-                    m.window       = m_wndProxy;
-                    m.message_type = xAtom(XA_XdndLeave);
-                    m.format       = 32;
-                    m.data.l[0]    = wndSource;         /* Source window. */
-
-                    xRc = XSendEvent(m_pDisplay, wndSource, False, NoEventMask, reinterpret_cast<XEvent*>(&m));
-                    if (RT_UNLIKELY(xRc == 0))
-                    {
-                        logError("Error sending XA_XdndLeave event to proxy window=%#x: %s\n",
-                                  m_wndProxy, gX11->xErrorToString(xRc).c_str());
-                    }
+                    logInfo("Cancelling dropping to host\n");
+
+                    /* Cancel the operation -- inform the source window by
+                     * sending a XdndFinished message so that the source can toss the required data. */
+                    rc = m_wndProxy.sendFinished(wndSource, DND_IGNORE_ACTION);
                 }
 
                 /* Cleanup. */
@@ -1873,11 +2239,13 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
     if (RT_FAILURE(rc))
     {
         int rc2 = VbglR3DnDGHSendError(&m_dndCtx, rc);
-        AssertRC(rc2);
+        LogFlowThisFunc(("Sending error to host resulted in %Rrc\n", rc2));
+        /* This is not fatal for us, just ignore. */
     }
 
     /* At this point, we have either successfully transfered any data or not.
-     * So reset our internal state because we are done here for this transaction. */
+     * So reset our internal state because we are done here for the current (ongoing)
+     * drag and drop operation. */
     reset();
 
     LogFlowFuncLeaveRC(rc);
@@ -1890,6 +2258,57 @@ int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction)
  */
 
 /**
+ * Fakes moving the mouse cursor to provoke various drag and drop
+ * events such as entering a target window or moving within a
+ * source window.
+ *
+ * Not the most elegant and probably correct function, but does
+ * the work for now.
+ *
+ * @returns IPRT status code.
+ */
+int DragInstance::mouseCursorFakeMove(void) const
+{
+    int iScreenID = XDefaultScreen(m_pDisplay);
+    /** @todo What about multiple screens? Test this! */
+
+    const int iScrX = XDisplayWidth(m_pDisplay, iScreenID);
+    const int iScrY = XDisplayHeight(m_pDisplay, iScreenID);
+
+    int fx, fy, rx, ry;
+    Window wndTemp, wndChild;
+    int wx, wy; unsigned int mask;
+    XQueryPointer(m_pDisplay, m_wndRoot, &wndTemp, &wndChild, &rx, &ry, &wx, &wy, &mask);
+
+    /*
+     * Apply some simple clipping and change the position slightly.
+     */
+
+    /* FakeX */
+    if      (rx == 0)     fx = 1;
+    else if (rx == iScrX) fx = iScrX - 1;
+    else                  fx = rx + 1;
+
+    /* FakeY */
+    if      (ry == 0)     fy = 1;
+    else if (ry == iScrY) fy = iScrY - 1;
+    else                  fy = ry + 1;
+
+    /*
+     * Move the cursor to trigger the wanted events.
+     */
+    LogFlowThisFunc(("cursorRootX=%d, cursorRootY=%d\n", fx, fy));
+    int rc = mouseCursorMove(fx, fy);
+    if (RT_SUCCESS(rc))
+    {
+        /* Move the cursor back to its original position. */
+        rc = mouseCursorMove(rx, ry);
+    }
+
+    return rc;
+}
+
+/**
  * Moves the mouse pointer to a specific position.
  *
  * @returns IPRT status code.
@@ -1901,7 +2320,7 @@ int DragInstance::mouseCursorMove(int iPosX, int iPosY) const
     int iScreenID = XDefaultScreen(m_pDisplay);
     /** @todo What about multiple screens? Test this! */
 
-    const int iScrX = DisplayWidth(m_pDisplay, iScreenID);
+    const int iScrX = XDisplayWidth(m_pDisplay, iScreenID);
     const int iScrY = XDisplayHeight(m_pDisplay, iScreenID);
 
     iPosX = RT_CLAMP(iPosX, 0, iScrX);
@@ -1937,14 +2356,23 @@ void DragInstance::mouseButtonSet(Window wndDest, int rx, int ry, int iButton, b
         LogFlowThisFunc(("XText extension available\n"));
 
         int xRc = XTestFakeButtonEvent(m_pDisplay, 1, fPress ? True : False, CurrentTime);
-        if (RT_UNLIKELY(xRc == 0))
+        if (Rc == 0)
             logError("Error sending XTestFakeButtonEvent event: %s\n", gX11->xErrorToString(xRc).c_str());
         XFlush(m_pDisplay);
     }
     else
     {
 #endif
-        LogFlowThisFunc(("XText extension not available or disabled\n"));
+        LogFlowThisFunc(("Note: XText extension not available or disabled\n"));
+
+        if (   rx == -1
+            && ry == -1)
+        {
+            Window wndTemp, wndChild;
+            int wx, wy; unsigned int mask;
+            XQueryPointer(m_pDisplay, m_wndRoot, &wndTemp, &wndChild, &rx, &ry, &wx, &wy, &mask);
+            LogFlowThisFunc(("cursorRootX=%d, cursorRootY=%d\n", rx, ry));
+        }
 
         XButtonEvent eBtn;
         RT_ZERO(eBtn);
@@ -1966,26 +2394,22 @@ void DragInstance::mouseButtonSet(Window wndDest, int rx, int ry, int iButton, b
         eBtn.x_root       = rx;
         eBtn.y_root       = ry;
 
-        //XTranslateCoordinates(m_pDisplay, eBtn.root, eBtn.window, eBtn.x_root, eBtn.y_root, &eBtn.x, &eBtn.y, &eBtn.subwindow);
-#if 0
-        int xRc = XSendEvent(m_pDisplay, eBtn.window, True /* fPropagate */,
+        XTranslateCoordinates(m_pDisplay, eBtn.root, eBtn.window, eBtn.x_root, eBtn.y_root, &eBtn.x, &eBtn.y, &eBtn.subwindow);
+        LogFlowThisFunc(("x=%d, y=%d\n", eBtn.x, eBtn.y));
+#if 1
+        int xRc = XSendEvent(m_pDisplay, wndDest, True /* fPropagate */,
                                fPress
                              ? ButtonPressMask : ButtonReleaseMask,
                              reinterpret_cast<XEvent*>(&eBtn));
+        if (xRc == 0)
+            logError("Error sending XButtonEvent event to window=%#x: %s\n", wndDest, gX11->xErrorToString(xRc).c_str());
 #else
         int xRc = XSendEvent(m_pDisplay, eBtn.window, False /* fPropagate */,
                              0 /* Mask */, reinterpret_cast<XEvent*>(&eBtn));
-        if (RT_UNLIKELY(xRc == 0))
+        if (xRc == 0)
             logError("Error sending XButtonEvent event to window=%#x: %s\n", wndDest, gX11->xErrorToString(xRc).c_str());
 #endif
 
-#ifdef DEBUG
-        Window wndTemp, wndChild;
-        int wx, wy; unsigned int mask;
-        XQueryPointer(m_pDisplay, m_wndRoot, &wndTemp, &wndChild, &rx, &ry, &wx, &wy, &mask);
-        LogFlowThisFunc(("cursorRootX=%d, cursorRootY=%d\n", rx, ry));
-#endif
-
 #ifdef VBOX_DND_WITH_XTEST
     }
 #endif
@@ -2003,11 +2427,8 @@ void DragInstance::mouseButtonSet(Window wndDest, int rx, int ry, int iButton, b
  * @returns IPRT status code.
  * @param   piRootX                 X coordinate relative to the root window's origin. Optional.
  * @param   piRootY                 Y coordinate relative to the root window's origin. Optional.
- * @param   fMouseMove              Whether to move the mouse cursor to the root window's origin or not.
  */
-int DragInstance::proxyWinShow(int *piRootX /*= NULL*/,
-                               int *piRootY /*= NULL*/,
-                               bool fMouseMove /*= false */) const
+int DragInstance::proxyWinShow(int *piRootX /* = NULL */, int *piRootY /* = NULL */) const
 {
     /* piRootX is optional. */
     /* piRootY is optional. */
@@ -2017,7 +2438,9 @@ int DragInstance::proxyWinShow(int *piRootX /*= NULL*/,
     int rc = VINF_SUCCESS;
 
 #if 0
+# ifdef VBOX_DND_WITH_XTEST
     XTestGrabControl(m_pDisplay, False);
+# endif
 #endif
 
     /* Get the mouse pointer position and determine if we're on the same screen as the root window
@@ -2027,8 +2450,7 @@ int DragInstance::proxyWinShow(int *piRootX /*= NULL*/,
     unsigned int iMask;
     Window wndRoot, wndChild;
     Bool fInRootWnd = XQueryPointer(m_pDisplay, m_wndRoot, &wndRoot, &wndChild,
-                                    &iRootX, &iRootY,
-                                    &iChildX, &iChildY, &iMask);
+                                    &iRootX, &iRootY, &iChildX, &iChildY, &iMask);
 
     LogFlowThisFunc(("fInRootWnd=%RTbool, wndRoot=0x%x, wndChild=0x%x, iRootX=%d, iRootY=%d\n",
                      RT_BOOL(fInRootWnd), wndRoot, wndChild, iRootX, iRootY));
@@ -2041,23 +2463,25 @@ int DragInstance::proxyWinShow(int *piRootX /*= NULL*/,
     XSynchronize(m_pDisplay, True /* Enable sync */);
 
     /* Bring our proxy window into foreground. */
-    XMapWindow(m_pDisplay, m_wndProxy);
-    XRaiseWindow(m_pDisplay, m_wndProxy);
+    XMapWindow(m_pDisplay, m_wndProxy.hWnd);
+    XRaiseWindow(m_pDisplay, m_wndProxy.hWnd);
 
     /* Spawn our proxy window over the entire screen, making it an easy drop target for the host's cursor. */
-    int iScreenID = XDefaultScreen(m_pDisplay);
-    XMoveResizeWindow(m_pDisplay, m_wndProxy, 0, 0, XDisplayWidth(m_pDisplay, iScreenID), XDisplayHeight(m_pDisplay, iScreenID));
-    /** @todo What about multiple screens? Test this! */
+    LogFlowThisFunc(("Proxy window x=%d, y=%d, width=%d, height=%d\n",
+                     m_wndProxy.iX, m_wndProxy.iY, m_wndProxy.iWidth, m_wndProxy.iHeight));
+    XMoveResizeWindow(m_pDisplay, m_wndProxy.hWnd, m_wndProxy.iX, m_wndProxy.iY, m_wndProxy.iWidth, m_wndProxy.iHeight);
 
-    if (fMouseMove)
-        rc = mouseCursorMove(iRootX, iRootY);
+    XFlush(m_pDisplay);
 
     XSynchronize(m_pDisplay, False /* Disable sync */);
 
 #if 0
+# ifdef VBOX_DND_WITH_XTEST
     XTestGrabControl(m_pDisplay, True);
+# endif
 #endif
 
+    LogFlowFuncLeaveRC(rc);
     return rc;
 }
 
@@ -2068,15 +2492,43 @@ int DragInstance::proxyWinHide(void)
 {
     LogFlowFuncEnter();
 
-#ifndef VBOX_DND_DEBUG_WND
-    XUnmapWindow(m_pDisplay, m_wndProxy);
-#endif
-    m_eventQueue.clear();
+    XUnmapWindow(m_pDisplay, m_wndProxy.hWnd);
+    XFlush(m_pDisplay);
+
+    m_eventQueueList.clear();
 
     return VINF_SUCCESS; /** @todo Add error checking. */
 }
 
 /**
+ * Allocates the name (title) of an X window.
+ * The returned pointer must be freed using RTStrFree().
+ *
+ * @returns Pointer to the allocated window name.
+ * @param   wndThis                 Window to retrieve name for.
+ *
+ * @remark If the window title is not available, the text
+ *         "<No name>" will be returned.
+ */
+char *DragInstance::wndX11GetNameA(Window wndThis) const
+{
+    char *pszName = NULL;
+
+    XTextProperty propName;
+    if (XGetWMName(m_pDisplay, wndThis, &propName))
+    {
+        if (propName.value)
+            pszName = RTStrDup((char *)propName.value); /** @todo UTF8? */
+        XFree(propName.value);
+    }
+
+    if (!pszName) /* No window name found? */
+        pszName = RTStrDup("<No name>");
+
+    return pszName;
+}
+
+/**
  * Clear a window's supported/accepted actions list.
  *
  * @param   wndThis                 Window to clear the list for.
@@ -2122,16 +2574,16 @@ int DragInstance::wndXDnDGetActionList(Window wndThis, VBoxDnDAtomList &lstActio
         return VERR_NOT_FOUND;
     }
 
-    if (   cItems > 0
-        && pcbData)
+    LogFlowThisFunc(("wndThis=%#x, cItems=%RU32, pcbData=%p\n", wndThis, cItems, pcbData));
+
+    if (cItems > 0)
     {
+        AssertPtr(pcbData);
         Atom *paData = reinterpret_cast<Atom *>(pcbData);
 
         for (unsigned i = 0; i < RT_MIN(VBOX_MAX_XPROPERTIES, cItems); i++)
         {
-            LogFlowThisFunc(("Received action: %s\n",
-                             gX11->xAtomToString(paData[i]).c_str()));
-
+            LogFlowThisFunc(("\t%s\n", gX11->xAtomToString(paData[i]).c_str()));
             lstActions.append(paData[i]);
         }
 
@@ -2166,16 +2618,16 @@ int DragInstance::wndXDnDGetFormatList(Window wndThis, VBoxDnDAtomList &lstTypes
         return VERR_NOT_FOUND;
     }
 
-    if (   cItems > 0
-        && pcbData)
+    LogFlowThisFunc(("wndThis=%#x, cItems=%RU32, pcbData=%p\n", wndThis, cItems, pcbData));
+
+    if (cItems > 0)
     {
-        Atom *paData = reinterpret_cast<Atom*>(pcbData);
+        AssertPtr(pcbData);
+        Atom *paData = reinterpret_cast<Atom *>(pcbData);
 
         for (unsigned i = 0; i < RT_MIN(VBOX_MAX_XPROPERTIES, cItems); i++)
         {
-            LogFlowThisFunc(("Received format via XdndTypeList: %s\n",
-                             gX11->xAtomToString(paData[i]).c_str()));
-
+            LogFlowThisFunc(("\t%s\n", gX11->xAtomToString(paData[i]).c_str()));
             lstTypes.append(paData[i]);
         }
 
@@ -2219,7 +2671,7 @@ int DragInstance::wndXDnDSetActionList(Window wndThis, const VBoxDnDAtomList &ls
 int DragInstance::wndXDnDSetFormatList(Window wndThis, Atom atmProp, const VBoxDnDAtomList &lstFormats) const
 {
     if (lstFormats.isEmpty())
-        return VINF_SUCCESS;
+        return VERR_INVALID_PARAMETER;
 
     /* We support TARGETS and the data types. */
     VBoxDnDAtomList lstFormatsExt(lstFormats.size() + 1);
@@ -2360,13 +2812,79 @@ uint32_t DragInstance::toHGCMActions(const VBoxDnDAtomList &lstActions)
 {
     uint32_t uActions = DND_IGNORE_ACTION;
 
-    for (size_t i = 0; i < lstActions.size(); ++i)
+    for (size_t i = 0; i < lstActions.size(); i++)
         uActions |= toHGCMAction(lstActions.at(i));
 
     return uActions;
 }
 
 /*******************************************************************************
+ * VBoxDnDProxyWnd implementation.
+ ******************************************************************************/
+
+VBoxDnDProxyWnd::VBoxDnDProxyWnd(void)
+    : pDisp(NULL)
+    , hWnd(0)
+    , iX(0)
+    , iY(0)
+    , iWidth(0)
+    , iHeight(0)
+{
+
+}
+
+VBoxDnDProxyWnd::~VBoxDnDProxyWnd(void)
+{
+    destroy();
+}
+
+int VBoxDnDProxyWnd::init(Display *pDisplay)
+{
+    /** @todo What about multiple screens? Test this! */
+    int iScreenID = XDefaultScreen(pDisplay);
+
+    iWidth   = XDisplayWidth(pDisplay, iScreenID);
+    iHeight  = XDisplayHeight(pDisplay, iScreenID);
+    pDisp    = pDisplay;
+
+    return VINF_SUCCESS;
+}
+
+void VBoxDnDProxyWnd::destroy(void)
+{
+
+}
+
+int VBoxDnDProxyWnd::sendFinished(Window hWndSource, uint32_t uAction)
+{
+    /* Was the drop accepted by the host? That is, anything than ignoring. */
+    bool fDropAccepted = uAction > DND_IGNORE_ACTION;
+
+    /* Confirm the result of the transfer to the target window. */
+    XClientMessageEvent m;
+    RT_ZERO(m);
+    m.type         = ClientMessage;
+    m.display      = pDisp;
+    m.window       = hWnd;
+    m.message_type = xAtom(XA_XdndFinished);
+    m.format       = 32;
+    m.data.l[XdndFinishedWindow] = hWnd;                                                       /* Target window. */
+    m.data.l[XdndFinishedFlags]  = fDropAccepted ? RT_BIT(0) : 0;                              /* Was the drop accepted? */
+    m.data.l[XdndFinishedAction] = fDropAccepted ? DragInstance::toAtomAction(uAction) : None; /* Action used on accept. */
+
+    int xRc = XSendEvent(pDisp, hWndSource, True, NoEventMask, reinterpret_cast<XEvent*>(&m));
+    if (xRc == 0)
+    {
+        LogRel(("DnD: Error sending XA_XdndFinished event to source window=%#x: %s\n",
+               hWndSource, gX11->xErrorToString(xRc).c_str()));
+
+        return VERR_GENERAL_FAILURE; /** @todo Fudge. */
+    }
+
+    return VINF_SUCCESS;
+}
+
+/*******************************************************************************
  * DragAndDropService implementation.
  ******************************************************************************/
 
@@ -2405,6 +2923,7 @@ int DragAndDropService::run(bool fDaemonised /* = false */)
             break;
 
         LogRel(("DnD: Started\n"));
+        LogRel2(("DnD: %sr%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()));
 
         /* Enter the main event processing loop. */
         do
@@ -2455,7 +2974,7 @@ int DragAndDropService::run(bool fDaemonised /* = false */)
                     }
                     case DragAndDropSvc::HOST_DND_HG_EVT_DROPPED:
                     {
-                        rc = m_pCurDnD->hgDrop();
+                        rc = m_pCurDnD->hgDrop(e.hgcm.u.a.uXpos, e.hgcm.u.a.uYpos, e.hgcm.u.a.uDefAction);
                         break;
                     }
                     case DragAndDropSvc::HOST_DND_HG_SND_DATA:
@@ -2477,24 +2996,17 @@ int DragAndDropService::run(bool fDaemonised /* = false */)
 #endif
                     default:
                     {
-                        LogFlowThisFunc(("Unsupported message: %RU32\n", e.hgcm.uType));
+                        m_pCurDnD->logError("Received unsupported message: %RU32\n", e.hgcm.uType);
                         rc = VERR_NOT_SUPPORTED;
                         break;
                     }
                 }
 
                 LogFlowFunc(("Message %RU32 processed with %Rrc\n", e.hgcm.uType, rc));
-                if (   RT_FAILURE(rc)
-                    /*
-                     * Note: The hgXXX and ghXXX functions of the DnD instance above may return
-                     *       VERR_INVALID_STATE in case we're not in the expected state they want
-                     *       to operate in. As the user might drag content back and forth to/from
-                     *       the host/guest we don't want to reset the overall state here in case
-                     *       a VERR_INVALID_STATE occurs. Just continue in our initially set mode.
-                     */
-                    && rc != VERR_INVALID_STATE)
+                if (RT_FAILURE(rc))
                 {
-                    m_pCurDnD->logError("Error: Processing message %RU32 failed with %Rrc\n", e.hgcm.uType, rc);
+                    /* Tell the user. */
+                    m_pCurDnD->logError("Error processing message %RU32, failed with %Rrc, resetting all\n", e.hgcm.uType, rc);
 
                     /* If anything went wrong, do a reset and start over. */
                     m_pCurDnD->reset();
@@ -2565,8 +3077,10 @@ int DragAndDropService::dragAndDropInit(void)
     /* Connect to the x11 server. */
     m_pDisplay = XOpenDisplay(NULL);
     if (!m_pDisplay)
-        /** @todo Correct errors. */
+    {
+        VBClFatalError(("DnD: Unable to connect to X server -- running in a terminal session?\n"));
         return VERR_NOT_FOUND;
+    }
 
     xHelpers *pHelpers = xHelpers::getInstance(m_pDisplay);
     if (!pHelpers)
@@ -2652,7 +3166,7 @@ int DragAndDropService::hgcmEventThread(RTTHREAD hThread, void *pvUser)
         }
         else
         {
-            LogFlowFunc(("Processing next message failed with rc=%Rrc\n", rc));
+            LogRel(("DnD: Processing next message failed with rc=%Rrc\n", rc));
 
             /* Old(er) hosts either are broken regarding DnD support or otherwise
              * don't support the stuff we do on the guest side, so make sure we
@@ -2718,22 +3232,7 @@ int DragAndDropService::x11EventThread(RTTHREAD hThread, void *pvUser)
                         AssertPtr(pEvent);
 
                         RTCString strType = xAtomToString(pEvent->message_type);
-                        LogFlowFunc(("ClientMessage: %s (%RU32), serial=%RU32, wnd=%#x\n", strType.c_str(),
-                                     pEvent->message_type, pEvent->serial, pEvent->window));
-
-                        if (pEvent->message_type == xAtom(XA_XdndPosition))
-                        {
-                            int32_t dwPos = pEvent->data.l[2];
-                            int32_t dwAction = pEvent->data.l[4];
-
-                            LogFlowFunc(("XA_XdndPosition x=%RI32, y=%RI32, dwAction=%RI32\n",
-                                         RT_HIWORD(dwPos), RT_LOWORD(dwPos), dwAction));
-                        }
-                        else if (pEvent->message_type == xAtom(XA_XdndDrop))
-                        {
-                            LogFlowFunc(("XA_XdndDrop\n"));
-                        }
-
+                        LogFlowFunc(("ClientMessage: %s from wnd=%#x\n", strType.c_str(), pEvent->window));
                         break;
                     }
 
@@ -2817,4 +3316,3 @@ struct VBCLSERVICE **VBClGetDragAndDropService(void)
     new(&pService->mDragAndDrop) DragAndDropService();
     return &pService->pInterface;
 }
-
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo.c b/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
index e34c9f5..594c138 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
@@ -558,16 +558,22 @@ static DisplayModePtr
 vbox_output_get_modes (xf86OutputPtr output)
 {
     unsigned cIndex = 0;
-    DisplayModePtr pModes = NULL, pMode;
+    DisplayModePtr pModes = NULL;
     ScrnInfoPtr pScrn = output->scrn;
     VBOXPtr pVBox = VBOXGetRec(pScrn);
 
     TRACE_ENTRY();
     uint32_t iScreen = (uintptr_t)output->driver_private;
-    pMode = vbox_output_add_mode(pVBox, &pModes, NULL,
-                                 RT_CLAMP(pVBox->pScreens[iScreen].aPreferredSize.cx, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL),
-                                 RT_CLAMP(pVBox->pScreens[iScreen].aPreferredSize.cy, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL),
-                                 TRUE, FALSE);
+    vbox_output_add_mode(pVBox, &pModes, NULL,
+                         RT_CLAMP(pVBox->pScreens[iScreen].aPreferredSize.cx, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL),
+                         RT_CLAMP(pVBox->pScreens[iScreen].aPreferredSize.cy, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL),
+                         TRUE, FALSE);
+    vbox_output_add_mode(pVBox, &pModes, NULL, 1600, 1200, FALSE, FALSE);
+    vbox_output_add_mode(pVBox, &pModes, NULL, 1440, 1050, FALSE, FALSE);
+    vbox_output_add_mode(pVBox, &pModes, NULL, 1280, 960,  FALSE, FALSE);
+    vbox_output_add_mode(pVBox, &pModes, NULL, 1024, 768,  FALSE, FALSE);
+    vbox_output_add_mode(pVBox, &pModes, NULL, 800,  600,  FALSE, FALSE);
+    vbox_output_add_mode(pVBox, &pModes, NULL, 640,  480,  FALSE, FALSE);
     TRACE_EXIT();
     return pModes;
 }
diff --git a/src/VBox/Devices/Audio/AudioMixBuffer.cpp b/src/VBox/Devices/Audio/AudioMixBuffer.cpp
index 6ef7eb4..fb141da 100644
--- a/src/VBox/Devices/Audio/AudioMixBuffer.cpp
+++ b/src/VBox/Devices/Audio/AudioMixBuffer.cpp
@@ -15,6 +15,8 @@
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
+#define LOG_GROUP LOG_GROUP_AUDIO_MIXER_BUFFER
+#include <VBox/log.h>
 
 /*
  * DEBUG_DUMP_PCM_DATA enables dumping the raw PCM data
@@ -33,12 +35,6 @@
 #include <iprt/mem.h>
 #include <iprt/string.h> /* For RT_BZERO. */
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 #ifdef TESTCASE
 # define LOG_ENABLED
 # include <iprt/stream.h>
diff --git a/src/VBox/Devices/Audio/AudioMixer.cpp b/src/VBox/Devices/Audio/AudioMixer.cpp
index 6264ed8..4370176 100644
--- a/src/VBox/Devices/Audio/AudioMixer.cpp
+++ b/src/VBox/Devices/Audio/AudioMixer.cpp
@@ -16,7 +16,8 @@
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
-
+#define LOG_GROUP LOG_GROUP_AUDIO_MIXER
+#include <VBox/log.h>
 #include "AudioMixer.h"
 #include "AudioMixBuffer.h"
 
@@ -30,13 +31,6 @@
 #include <iprt/assert.h>
 #include <iprt/string.h>
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
-
 static int audioMixerUpdateSinkVolume(PAUDMIXSINK pSink, const PPDMAUDIOVOLUME pVolMaster);
 
 
@@ -474,3 +468,19 @@ int AudioMixerSetSinkVolume(PAUDMIXSINK pSink, PPDMAUDIOVOLUME pVol)
 
     return audioMixerUpdateSinkVolume(pSink, &pSink->pParent->VolMaster);
 }
+
+void AudioMixerDebug(PAUDIOMIXER pMixer, PCDBGFINFOHLP pHlp, const char *pszArgs)
+{
+    PAUDMIXSINK pSink;
+    unsigned    iSink = 0;
+
+    pHlp->pfnPrintf(pHlp, "[Master] %s: lVol=%u, rVol=%u, fMuted=%RTbool\n", pMixer->pszName,
+                    pMixer->VolMaster.uLeft, pMixer->VolMaster.uRight, pMixer->VolMaster.fMuted);
+
+    RTListForEach(&pMixer->lstSinks, pSink, AUDMIXSINK, Node)
+    {
+        pHlp->pfnPrintf(pHlp, "[Sink %u] %s: lVol=%u, rVol=%u, fMuted=%RTbool\n", iSink, pSink->pszName,
+                        pSink->Volume.uLeft, pSink->Volume.uRight, pSink->Volume.fMuted);
+        ++iSink;
+    }
+}
diff --git a/src/VBox/Devices/Audio/AudioMixer.h b/src/VBox/Devices/Audio/AudioMixer.h
index 5a3cfdc..357b678 100644
--- a/src/VBox/Devices/Audio/AudioMixer.h
+++ b/src/VBox/Devices/Audio/AudioMixer.h
@@ -106,6 +106,7 @@ void AudioMixerRemoveStream(PAUDMIXSINK pSink, PAUDMIXSTREAM pStream);
 int AudioMixerSetDeviceFormat(PAUDIOMIXER pMixer, PPDMAUDIOSTREAMCFG pCfg);
 int AudioMixerSetMasterVolume(PAUDIOMIXER pMixer, PPDMAUDIOVOLUME pVol);
 int AudioMixerSetSinkVolume(PAUDMIXSINK pSink, PPDMAUDIOVOLUME pVol);
+void AudioMixerDebug(PAUDIOMIXER pMixer, PCDBGFINFOHLP pHlp, const char *pszArgs);
 
 #endif /* AUDIO_MIXER_H */
 
diff --git a/src/VBox/Devices/Audio/DevIchAc97.cpp b/src/VBox/Devices/Audio/DevIchAc97.cpp
index 6fc56d5..4ef9cd6 100644
--- a/src/VBox/Devices/Audio/DevIchAc97.cpp
+++ b/src/VBox/Devices/Audio/DevIchAc97.cpp
@@ -18,6 +18,8 @@
 /*******************************************************************************
 *   Header Files                                                               *
 *******************************************************************************/
+#define LOG_GROUP LOG_GROUP_DEV_AC97
+#include <VBox/log.h>
 #include <VBox/vmm/pdmdev.h>
 #include <VBox/vmm/pdmaudioifs.h>
 
@@ -31,12 +33,6 @@
 #include "VBoxDD.h"
 #include "AudioMixer.h"
 
-#ifdef LOG_GROUP
- #undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 /*******************************************************************************
 *   Defined Constants And Macros                                               *
 *******************************************************************************/
@@ -272,6 +268,9 @@ typedef struct AC97STATE
     /** Timer ticks for handling the LUN drivers. */
     uint64_t                uTicks;
 #ifdef VBOX_WITH_STATISTICS
+# if HC_ARCH_BITS == 32
+    uint32_t                u32Alignment0;
+# endif
     STAMPROFILE             StatTimer;
     STAMCOUNTER             StatBytesRead;
     STAMCOUNTER             StatBytesWritten;
@@ -304,6 +303,10 @@ typedef struct AC97STATE
 /** Pointer to the AC97 device state. */
 typedef AC97STATE *PAC97STATE;
 
+#ifdef VBOX_WITH_STATISTICS
+AssertCompileMemberAlignment(AC97STATE, StatTimer, 8);
+#endif
+
 #ifndef VBOX_DEVICE_STRUCT_TESTCASE
 
 #define ICHAC97STATE_2_DEVINS(a_pAC97)   ((a_pAC97)->pDevIns)
diff --git a/src/VBox/Devices/Audio/DevIchHda.cpp b/src/VBox/Devices/Audio/DevIchHda.cpp
index d3f378a..fef5ac8 100644
--- a/src/VBox/Devices/Audio/DevIchHda.cpp
+++ b/src/VBox/Devices/Audio/DevIchHda.cpp
@@ -22,6 +22,8 @@
 /*******************************************************************************
 *   Header Files                                                               *
 *******************************************************************************/
+#define LOG_GROUP LOG_GROUP_DEV_HDA
+#include <VBox/log.h>
 #include <VBox/vmm/pdmdev.h>
 #include <VBox/vmm/pdmaudioifs.h>
 #include <VBox/version.h>
@@ -36,12 +38,6 @@
 #endif
 #include <iprt/list.h>
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 #include "VBoxDD.h"
 
 #include "AudioMixer.h"
@@ -3303,8 +3299,8 @@ static DECLCALLBACK(void) hdaInfoCodecNodes(PPDMDEVINS pDevIns, PCDBGFINFOHLP pH
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
 
-    if (pThis->pCodec->pfnCodecDbgListNodes)
-        pThis->pCodec->pfnCodecDbgListNodes(pThis->pCodec, pHlp, pszArgs);
+    if (pThis->pCodec->pfnDbgListNodes)
+        pThis->pCodec->pfnDbgListNodes(pThis->pCodec, pHlp, pszArgs);
     else
         pHlp->pfnPrintf(pHlp, "Codec implementation doesn't provide corresponding callback\n");
 }
@@ -3317,13 +3313,27 @@ static DECLCALLBACK(void) hdaInfoCodecSelector(PPDMDEVINS pDevIns, PCDBGFINFOHLP
 {
     PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
 
-    if (pThis->pCodec->pfnCodecDbgSelector)
-        pThis->pCodec->pfnCodecDbgSelector(pThis->pCodec, pHlp, pszArgs);
+    if (pThis->pCodec->pfnDbgSelector)
+        pThis->pCodec->pfnDbgSelector(pThis->pCodec, pHlp, pszArgs);
     else
         pHlp->pfnPrintf(pHlp, "Codec implementation doesn't provide corresponding callback\n");
 }
 
 
+/**
+ * @callback_method_impl{FNDBGFHANDLERDEV}
+ */
+static DECLCALLBACK(void) hdaInfoMixer(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
+{
+    PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE);
+
+    if (pThis->pMixer)
+        AudioMixerDebug(pThis->pMixer, pHlp, pszArgs);
+    else
+        pHlp->pfnPrintf(pHlp, "Mixer not available\n");
+}
+
+
 /* PDMIBASE */
 
 /**
@@ -3788,6 +3798,7 @@ static DECLCALLBACK(int) hdaConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNO
         PDMDevHlpDBGFInfoRegister(pDevIns, "hdastrm",     "HDA stream info. (hdastrm [stream number])",     hdaInfoStream);
         PDMDevHlpDBGFInfoRegister(pDevIns, "hdcnodes",    "HDA codec nodes.",                               hdaInfoCodecNodes);
         PDMDevHlpDBGFInfoRegister(pDevIns, "hdcselector", "HDA codec's selector states [node number].",     hdaInfoCodecSelector);
+        PDMDevHlpDBGFInfoRegister(pDevIns, "hdamixer",    "HDA mixer state.",                               hdaInfoMixer);
 
         rc = RTStrFormatTypeRegister("sdctl",   hdaFormatStrmCtl,   NULL);
         AssertRC(rc);
diff --git a/src/VBox/Devices/Audio/DevIchHdaCodec.cpp b/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
index 10ed37b..1f1dc99 100644
--- a/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
+++ b/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
@@ -23,7 +23,7 @@
 /*******************************************************************************
 *   Header Files                                                               *
 *******************************************************************************/
-//#define LOG_GROUP LOG_GROUP_DEV_AUDIO
+#define LOG_GROUP LOG_GROUP_DEV_HDA_CODEC
 #include <VBox/vmm/pdmdev.h>
 #include <VBox/vmm/pdmaudioifs.h>
 #include <iprt/assert.h>
@@ -42,81 +42,86 @@
 *******************************************************************************/
 /* PRM 5.3.1 */
 /** Codec address mask. */
-#define CODEC_CAD_MASK              0xF0000000
+#define CODEC_CAD_MASK                                     0xF0000000
 /** Codec address shift. */
-#define CODEC_CAD_SHIFT             28
-#define CODEC_DIRECT_MASK           RT_BIT(27)
+#define CODEC_CAD_SHIFT                                    28
+#define CODEC_DIRECT_MASK                                  RT_BIT(27)
 /** Node ID mask. */
-#define CODEC_NID_MASK              0x07F00000
+#define CODEC_NID_MASK                                     0x07F00000
 /** Node ID shift. */
-#define CODEC_NID_SHIFT             20
-#define CODEC_VERBDATA_MASK         0x000FFFFF
-#define CODEC_VERB_4BIT_CMD         0x000FFFF0
-#define CODEC_VERB_4BIT_DATA        0x0000000F
-#define CODEC_VERB_8BIT_CMD         0x000FFF00
-#define CODEC_VERB_8BIT_DATA        0x000000FF
-#define CODEC_VERB_16BIT_CMD        0x000F0000
-#define CODEC_VERB_16BIT_DATA       0x0000FFFF
-
-#define CODEC_CAD(cmd) (((cmd) & CODEC_CAD_MASK) >> CODEC_CAD_SHIFT)
-#define CODEC_DIRECT(cmd) ((cmd) & CODEC_DIRECT_MASK)
-#define CODEC_NID(cmd) ((((cmd) & CODEC_NID_MASK)) >> CODEC_NID_SHIFT)
-#define CODEC_VERBDATA(cmd) ((cmd) & CODEC_VERBDATA_MASK)
-#define CODEC_VERB_CMD(cmd, mask, x) (((cmd) & (mask)) >> (x))
-#define CODEC_VERB_CMD4(cmd) (CODEC_VERB_CMD((cmd), CODEC_VERB_4BIT_CMD, 4))
-#define CODEC_VERB_CMD8(cmd) (CODEC_VERB_CMD((cmd), CODEC_VERB_8BIT_CMD, 8))
-#define CODEC_VERB_CMD16(cmd) (CODEC_VERB_CMD((cmd), CODEC_VERB_16BIT_CMD, 16))
-#define CODEC_VERB_PAYLOAD4(cmd) ((cmd) & CODEC_VERB_4BIT_DATA)
-#define CODEC_VERB_PAYLOAD8(cmd) ((cmd) & CODEC_VERB_8BIT_DATA)
-#define CODEC_VERB_PAYLOAD16(cmd) ((cmd) & CODEC_VERB_16BIT_DATA)
-
-#define CODEC_VERB_GET_AMP_DIRECTION  RT_BIT(15)
-#define CODEC_VERB_GET_AMP_SIDE       RT_BIT(13)
-#define CODEC_VERB_GET_AMP_INDEX      0x7
+#define CODEC_NID_SHIFT                                    20
+#define CODEC_VERBDATA_MASK                                0x000FFFFF
+#define CODEC_VERB_4BIT_CMD                                0x000FFFF0
+#define CODEC_VERB_4BIT_DATA                               0x0000000F
+#define CODEC_VERB_8BIT_CMD                                0x000FFF00
+#define CODEC_VERB_8BIT_DATA                               0x000000FF
+#define CODEC_VERB_16BIT_CMD                               0x000F0000
+#define CODEC_VERB_16BIT_DATA                              0x0000FFFF
+
+#define CODEC_CAD(cmd)                                     (((cmd) & CODEC_CAD_MASK) >> CODEC_CAD_SHIFT)
+#define CODEC_DIRECT(cmd)                                  ((cmd) & CODEC_DIRECT_MASK)
+#define CODEC_NID(cmd)                                     ((((cmd) & CODEC_NID_MASK)) >> CODEC_NID_SHIFT)
+#define CODEC_VERBDATA(cmd)                                ((cmd) & CODEC_VERBDATA_MASK)
+#define CODEC_VERB_CMD(cmd, mask, x)                       (((cmd) & (mask)) >> (x))
+#define CODEC_VERB_CMD4(cmd)                               (CODEC_VERB_CMD((cmd), CODEC_VERB_4BIT_CMD, 4))
+#define CODEC_VERB_CMD8(cmd)                               (CODEC_VERB_CMD((cmd), CODEC_VERB_8BIT_CMD, 8))
+#define CODEC_VERB_CMD16(cmd)                              (CODEC_VERB_CMD((cmd), CODEC_VERB_16BIT_CMD, 16))
+#define CODEC_VERB_PAYLOAD4(cmd)                           ((cmd) & CODEC_VERB_4BIT_DATA)
+#define CODEC_VERB_PAYLOAD8(cmd)                           ((cmd) & CODEC_VERB_8BIT_DATA)
+#define CODEC_VERB_PAYLOAD16(cmd)                          ((cmd) & CODEC_VERB_16BIT_DATA)
+
+#define CODEC_VERB_GET_AMP_DIRECTION                       RT_BIT(15)
+#define CODEC_VERB_GET_AMP_SIDE                            RT_BIT(13)
+#define CODEC_VERB_GET_AMP_INDEX                           0x7
 
 /* HDA spec 7.3.3.7 NoteA */
-#define CODEC_GET_AMP_DIRECTION(cmd)  (((cmd) & CODEC_VERB_GET_AMP_DIRECTION) >> 15)
-#define CODEC_GET_AMP_SIDE(cmd)       (((cmd) & CODEC_VERB_GET_AMP_SIDE) >> 13)
-#define CODEC_GET_AMP_INDEX(cmd)      (CODEC_GET_AMP_DIRECTION(cmd) ? 0 : ((cmd) & CODEC_VERB_GET_AMP_INDEX))
+#define CODEC_GET_AMP_DIRECTION(cmd)                       (((cmd) & CODEC_VERB_GET_AMP_DIRECTION) >> 15)
+#define CODEC_GET_AMP_SIDE(cmd)                            (((cmd) & CODEC_VERB_GET_AMP_SIDE) >> 13)
+#define CODEC_GET_AMP_INDEX(cmd)                           (CODEC_GET_AMP_DIRECTION(cmd) ? 0 : ((cmd) & CODEC_VERB_GET_AMP_INDEX))
 
 /* HDA spec 7.3.3.7 NoteC */
-#define CODEC_VERB_SET_AMP_OUT_DIRECTION  RT_BIT(15)
-#define CODEC_VERB_SET_AMP_IN_DIRECTION   RT_BIT(14)
-#define CODEC_VERB_SET_AMP_LEFT_SIDE      RT_BIT(13)
-#define CODEC_VERB_SET_AMP_RIGHT_SIDE     RT_BIT(12)
-#define CODEC_VERB_SET_AMP_INDEX          (0x7 << 8)
-
-#define CODEC_SET_AMP_IS_OUT_DIRECTION(cmd)  (((cmd) & CODEC_VERB_SET_AMP_OUT_DIRECTION) != 0)
-#define CODEC_SET_AMP_IS_IN_DIRECTION(cmd)   (((cmd) & CODEC_VERB_SET_AMP_IN_DIRECTION) != 0)
-#define CODEC_SET_AMP_IS_LEFT_SIDE(cmd)      (((cmd) & CODEC_VERB_SET_AMP_LEFT_SIDE) != 0)
-#define CODEC_SET_AMP_IS_RIGHT_SIDE(cmd)     (((cmd) & CODEC_VERB_SET_AMP_RIGHT_SIDE) != 0)
-#define CODEC_SET_AMP_INDEX(cmd)             (((cmd) & CODEC_VERB_SET_AMP_INDEX) >> 7)
+#define CODEC_VERB_SET_AMP_OUT_DIRECTION                   RT_BIT(15)
+#define CODEC_VERB_SET_AMP_IN_DIRECTION                    RT_BIT(14)
+#define CODEC_VERB_SET_AMP_LEFT_SIDE                       RT_BIT(13)
+#define CODEC_VERB_SET_AMP_RIGHT_SIDE                      RT_BIT(12)
+#define CODEC_VERB_SET_AMP_INDEX                           (0x7 << 8)
+#define CODEC_VERB_SET_AMP_MUTE                            RT_BIT(7)
+/** Note: 7-bit value [6:0]. */
+#define CODEC_VERB_SET_AMP_GAIN                            0x7F
+
+#define CODEC_SET_AMP_IS_OUT_DIRECTION(cmd)                (((cmd) & CODEC_VERB_SET_AMP_OUT_DIRECTION) != 0)
+#define CODEC_SET_AMP_IS_IN_DIRECTION(cmd)                 (((cmd) & CODEC_VERB_SET_AMP_IN_DIRECTION) != 0)
+#define CODEC_SET_AMP_IS_LEFT_SIDE(cmd)                    (((cmd) & CODEC_VERB_SET_AMP_LEFT_SIDE) != 0)
+#define CODEC_SET_AMP_IS_RIGHT_SIDE(cmd)                   (((cmd) & CODEC_VERB_SET_AMP_RIGHT_SIDE) != 0)
+#define CODEC_SET_AMP_INDEX(cmd)                           (((cmd) & CODEC_VERB_SET_AMP_INDEX) >> 7)
+#define CODEC_SET_AMP_MUTE(cmd)                            ((cmd) & CODEC_VERB_SET_AMP_MUTE)
+#define CODEC_SET_AMP_GAIN(cmd)                            ((cmd) & CODEC_VERB_SET_AMP_GAIN)
 
 /* HDA spec 7.3.3.1 defines layout of configuration registers/verbs (0xF00) */
 /* VendorID (7.3.4.1) */
-#define CODEC_MAKE_F00_00(vendorID, deviceID) (((vendorID) << 16) | (deviceID))
-#define CODEC_F00_00_VENDORID(f00_00) (((f00_00) >> 16) & 0xFFFF)
-#define CODEC_F00_00_DEVICEID(f00_00) ((f00_00) & 0xFFFF)
+#define CODEC_MAKE_F00_00(vendorID, deviceID)              (((vendorID) << 16) | (deviceID))
+#define CODEC_F00_00_VENDORID(f00_00)                      (((f00_00) >> 16) & 0xFFFF)
+#define CODEC_F00_00_DEVICEID(f00_00)                      ((f00_00) & 0xFFFF)
 /* RevisionID (7.3.4.2)*/
 #define CODEC_MAKE_F00_02(MajRev, MinRev, RevisionID, SteppingID) (((MajRev) << 20)|((MinRev) << 16)|((RevisionID) << 8)|(SteppingID))
 /* Subordinate node count (7.3.4.3)*/
 #define CODEC_MAKE_F00_04(startNodeNumber, totalNodeNumber) ((((startNodeNumber) & 0xFF) << 16)|((totalNodeNumber) & 0xFF))
-#define CODEC_F00_04_TO_START_NODE_NUMBER(f00_04) (((f00_04) >> 16) & 0xFF)
-#define CODEC_F00_04_TO_NODE_COUNT(f00_04) ((f00_04) & 0xFF)
+#define CODEC_F00_04_TO_START_NODE_NUMBER(f00_04)          (((f00_04) >> 16) & 0xFF)
+#define CODEC_F00_04_TO_NODE_COUNT(f00_04)                 ((f00_04) & 0xFF)
 /*
  * Function Group Type  (7.3.4.4)
  * 0 & [0x3-0x7f] are reserved types
  * [0x80 - 0xff] are vendor defined function groups
  */
-#define CODEC_MAKE_F00_05(UnSol, NodeType) (((UnSol) << 8)|(NodeType))
-#define CODEC_F00_05_UNSOL  RT_BIT(8)
-#define CODEC_F00_05_AFG    (0x1)
-#define CODEC_F00_05_MFG    (0x2)
-#define CODEC_F00_05_IS_UNSOL(f00_05) RT_BOOL((f00_05) & RT_BIT(8))
-#define CODEC_F00_05_GROUP(f00_05) ((f00_05) & 0xff)
+#define CODEC_MAKE_F00_05(UnSol, NodeType)                 (((UnSol) << 8)|(NodeType))
+#define CODEC_F00_05_UNSOL                                 RT_BIT(8)
+#define CODEC_F00_05_AFG                                   (0x1)
+#define CODEC_F00_05_MFG                                   (0x2)
+#define CODEC_F00_05_IS_UNSOL(f00_05)                      RT_BOOL((f00_05) & RT_BIT(8))
+#define CODEC_F00_05_GROUP(f00_05)                         ((f00_05) & 0xff)
 /*  Audio Function Group capabilities (7.3.4.5) */
 #define CODEC_MAKE_F00_08(BeepGen, InputDelay, OutputDelay) ((((BeepGen) & 0x1) << 16)| (((InputDelay) & 0xF) << 8) | ((OutputDelay) & 0xF))
-#define CODEC_F00_08_BEEP_GEN(f00_08) ((f00_08) & RT_BIT(16)
+#define CODEC_F00_08_BEEP_GEN(f00_08)                      ((f00_08) & RT_BIT(16)
 
 /* Widget Capabilities (7.3.4.6) */
 #define CODEC_MAKE_F00_09(type, delay, chanel_count) \
@@ -124,88 +129,88 @@
     | (((delay) & 0xF) << 16)           \
     | (((chanel_count) & 0xF) << 13))
 /* note: types 0x8-0xe are reserved */
-#define CODEC_F00_09_TYPE_AUDIO_OUTPUT      (0x0)
-#define CODEC_F00_09_TYPE_AUDIO_INPUT       (0x1)
-#define CODEC_F00_09_TYPE_AUDIO_MIXER       (0x2)
-#define CODEC_F00_09_TYPE_AUDIO_SELECTOR    (0x3)
-#define CODEC_F00_09_TYPE_PIN_COMPLEX       (0x4)
-#define CODEC_F00_09_TYPE_POWER_WIDGET      (0x5)
-#define CODEC_F00_09_TYPE_VOLUME_KNOB       (0x6)
-#define CODEC_F00_09_TYPE_BEEP_GEN          (0x7)
-#define CODEC_F00_09_TYPE_VENDOR_DEFINED    (0xF)
-
-#define CODEC_F00_09_CAP_CP                 RT_BIT(12)
-#define CODEC_F00_09_CAP_L_R_SWAP           RT_BIT(11)
-#define CODEC_F00_09_CAP_POWER_CTRL         RT_BIT(10)
-#define CODEC_F00_09_CAP_DIGITAL            RT_BIT(9)
-#define CODEC_F00_09_CAP_CONNECTION_LIST    RT_BIT(8)
-#define CODEC_F00_09_CAP_UNSOL              RT_BIT(7)
-#define CODEC_F00_09_CAP_PROC_WIDGET        RT_BIT(6)
-#define CODEC_F00_09_CAP_STRIPE             RT_BIT(5)
-#define CODEC_F00_09_CAP_FMT_OVERRIDE       RT_BIT(4)
-#define CODEC_F00_09_CAP_AMP_FMT_OVERRIDE   RT_BIT(3)
-#define CODEC_F00_09_CAP_OUT_AMP_PRESENT    RT_BIT(2)
-#define CODEC_F00_09_CAP_IN_AMP_PRESENT     RT_BIT(1)
-#define CODEC_F00_09_CAP_LSB                RT_BIT(0)
-
-#define CODEC_F00_09_TYPE(f00_09) (((f00_09) >> 20) & 0xF)
-
-#define CODEC_F00_09_IS_CAP_CP(f00_09)              RT_BOOL((f00_09) & RT_BIT(12))
-#define CODEC_F00_09_IS_CAP_L_R_SWAP(f00_09)        RT_BOOL((f00_09) & RT_BIT(11))
-#define CODEC_F00_09_IS_CAP_POWER_CTRL(f00_09)      RT_BOOL((f00_09) & RT_BIT(10))
-#define CODEC_F00_09_IS_CAP_DIGITAL(f00_09)         RT_BOOL((f00_09) & RT_BIT(9))
-#define CODEC_F00_09_IS_CAP_CONNECTION_LIST(f00_09) RT_BOOL((f00_09) & RT_BIT(8))
-#define CODEC_F00_09_IS_CAP_UNSOL(f00_09)           RT_BOOL((f00_09) & RT_BIT(7))
-#define CODEC_F00_09_IS_CAP_PROC_WIDGET(f00_09)     RT_BOOL((f00_09) & RT_BIT(6))
-#define CODEC_F00_09_IS_CAP_STRIPE(f00_09)          RT_BOOL((f00_09) & RT_BIT(5))
-#define CODEC_F00_09_IS_CAP_FMT_OVERRIDE(f00_09)    RT_BOOL((f00_09) & RT_BIT(4))
-#define CODEC_F00_09_IS_CAP_AMP_OVERRIDE(f00_09)    RT_BOOL((f00_09) & RT_BIT(3))
-#define CODEC_F00_09_IS_CAP_OUT_AMP_PRESENT(f00_09) RT_BOOL((f00_09) & RT_BIT(2))
-#define CODEC_F00_09_IS_CAP_IN_AMP_PRESENT(f00_09)  RT_BOOL((f00_09) & RT_BIT(1))
-#define CODEC_F00_09_IS_CAP_LSB(f00_09)             RT_BOOL((f00_09) & RT_BIT(0))
+#define CODEC_F00_09_TYPE_AUDIO_OUTPUT                     (0x0)
+#define CODEC_F00_09_TYPE_AUDIO_INPUT                      (0x1)
+#define CODEC_F00_09_TYPE_AUDIO_MIXER                      (0x2)
+#define CODEC_F00_09_TYPE_AUDIO_SELECTOR                   (0x3)
+#define CODEC_F00_09_TYPE_PIN_COMPLEX                      (0x4)
+#define CODEC_F00_09_TYPE_POWER_WIDGET                     (0x5)
+#define CODEC_F00_09_TYPE_VOLUME_KNOB                      (0x6)
+#define CODEC_F00_09_TYPE_BEEP_GEN                         (0x7)
+#define CODEC_F00_09_TYPE_VENDOR_DEFINED                   (0xF)
+
+#define CODEC_F00_09_CAP_CP                                RT_BIT(12)
+#define CODEC_F00_09_CAP_L_R_SWAP                          RT_BIT(11)
+#define CODEC_F00_09_CAP_POWER_CTRL                        RT_BIT(10)
+#define CODEC_F00_09_CAP_DIGITAL                           RT_BIT(9)
+#define CODEC_F00_09_CAP_CONNECTION_LIST                   RT_BIT(8)
+#define CODEC_F00_09_CAP_UNSOL                             RT_BIT(7)
+#define CODEC_F00_09_CAP_PROC_WIDGET                       RT_BIT(6)
+#define CODEC_F00_09_CAP_STRIPE                            RT_BIT(5)
+#define CODEC_F00_09_CAP_FMT_OVERRIDE                      RT_BIT(4)
+#define CODEC_F00_09_CAP_AMP_FMT_OVERRIDE                  RT_BIT(3)
+#define CODEC_F00_09_CAP_OUT_AMP_PRESENT                   RT_BIT(2)
+#define CODEC_F00_09_CAP_IN_AMP_PRESENT                    RT_BIT(1)
+#define CODEC_F00_09_CAP_LSB                               RT_BIT(0)
+
+#define CODEC_F00_09_TYPE(f00_09)                          (((f00_09) >> 20) & 0xF)
+
+#define CODEC_F00_09_IS_CAP_CP(f00_09)                     RT_BOOL((f00_09) & RT_BIT(12))
+#define CODEC_F00_09_IS_CAP_L_R_SWAP(f00_09)               RT_BOOL((f00_09) & RT_BIT(11))
+#define CODEC_F00_09_IS_CAP_POWER_CTRL(f00_09)             RT_BOOL((f00_09) & RT_BIT(10))
+#define CODEC_F00_09_IS_CAP_DIGITAL(f00_09)                RT_BOOL((f00_09) & RT_BIT(9))
+#define CODEC_F00_09_IS_CAP_CONNECTION_LIST(f00_09)        RT_BOOL((f00_09) & RT_BIT(8))
+#define CODEC_F00_09_IS_CAP_UNSOL(f00_09)                  RT_BOOL((f00_09) & RT_BIT(7))
+#define CODEC_F00_09_IS_CAP_PROC_WIDGET(f00_09)            RT_BOOL((f00_09) & RT_BIT(6))
+#define CODEC_F00_09_IS_CAP_STRIPE(f00_09)                 RT_BOOL((f00_09) & RT_BIT(5))
+#define CODEC_F00_09_IS_CAP_FMT_OVERRIDE(f00_09)           RT_BOOL((f00_09) & RT_BIT(4))
+#define CODEC_F00_09_IS_CAP_AMP_OVERRIDE(f00_09)           RT_BOOL((f00_09) & RT_BIT(3))
+#define CODEC_F00_09_IS_CAP_OUT_AMP_PRESENT(f00_09)        RT_BOOL((f00_09) & RT_BIT(2))
+#define CODEC_F00_09_IS_CAP_IN_AMP_PRESENT(f00_09)         RT_BOOL((f00_09) & RT_BIT(1))
+#define CODEC_F00_09_IS_CAP_LSB(f00_09)                    RT_BOOL((f00_09) & RT_BIT(0))
 
 /* Supported PCM size, rates (7.3.4.7) */
-#define CODEC_F00_0A_32_BIT             RT_BIT(19)
-#define CODEC_F00_0A_24_BIT             RT_BIT(18)
-#define CODEC_F00_0A_16_BIT             RT_BIT(17)
-#define CODEC_F00_0A_8_BIT              RT_BIT(16)
-
-#define CODEC_F00_0A_48KHZ_MULT_8X      RT_BIT(11)
-#define CODEC_F00_0A_48KHZ_MULT_4X      RT_BIT(10)
-#define CODEC_F00_0A_44_1KHZ_MULT_4X    RT_BIT(9)
-#define CODEC_F00_0A_48KHZ_MULT_2X      RT_BIT(8)
-#define CODEC_F00_0A_44_1KHZ_MULT_2X    RT_BIT(7)
-#define CODEC_F00_0A_48KHZ              RT_BIT(6)
-#define CODEC_F00_0A_44_1KHZ            RT_BIT(5)
+#define CODEC_F00_0A_32_BIT                                RT_BIT(19)
+#define CODEC_F00_0A_24_BIT                                RT_BIT(18)
+#define CODEC_F00_0A_16_BIT                                RT_BIT(17)
+#define CODEC_F00_0A_8_BIT                                 RT_BIT(16)
+
+#define CODEC_F00_0A_48KHZ_MULT_8X                         RT_BIT(11)
+#define CODEC_F00_0A_48KHZ_MULT_4X                         RT_BIT(10)
+#define CODEC_F00_0A_44_1KHZ_MULT_4X                       RT_BIT(9)
+#define CODEC_F00_0A_48KHZ_MULT_2X                         RT_BIT(8)
+#define CODEC_F00_0A_44_1KHZ_MULT_2X                       RT_BIT(7)
+#define CODEC_F00_0A_48KHZ                                 RT_BIT(6)
+#define CODEC_F00_0A_44_1KHZ                               RT_BIT(5)
 /* 2/3 * 48kHz */
-#define CODEC_F00_0A_48KHZ_2_3X         RT_BIT(4)
+#define CODEC_F00_0A_48KHZ_2_3X                            RT_BIT(4)
 /* 1/2 * 44.1kHz */
-#define CODEC_F00_0A_44_1KHZ_1_2X       RT_BIT(3)
+#define CODEC_F00_0A_44_1KHZ_1_2X                          RT_BIT(3)
 /* 1/3 * 48kHz */
-#define CODEC_F00_0A_48KHZ_1_3X         RT_BIT(2)
+#define CODEC_F00_0A_48KHZ_1_3X                            RT_BIT(2)
 /* 1/4 * 44.1kHz */
-#define CODEC_F00_0A_44_1KHZ_1_4X       RT_BIT(1)
+#define CODEC_F00_0A_44_1KHZ_1_4X                          RT_BIT(1)
 /* 1/6 * 48kHz */
-#define CODEC_F00_0A_48KHZ_1_6X         RT_BIT(0)
+#define CODEC_F00_0A_48KHZ_1_6X                            RT_BIT(0)
 
 /* Supported streams formats (7.3.4.8) */
-#define CODEC_F00_0B_AC3                RT_BIT(2)
-#define CODEC_F00_0B_FLOAT32            RT_BIT(1)
-#define CODEC_F00_0B_PCM                RT_BIT(0)
+#define CODEC_F00_0B_AC3                                   RT_BIT(2)
+#define CODEC_F00_0B_FLOAT32                               RT_BIT(1)
+#define CODEC_F00_0B_PCM                                   RT_BIT(0)
 
 /* Pin Capabilities (7.3.4.9)*/
 #define CODEC_MAKE_F00_0C(vref_ctrl) (((vref_ctrl) & 0xFF) << 8)
-#define CODEC_F00_0C_CAP_HBR                    RT_BIT(27)
-#define CODEC_F00_0C_CAP_DP                     RT_BIT(24)
-#define CODEC_F00_0C_CAP_EAPD                   RT_BIT(16)
-#define CODEC_F00_0C_CAP_HDMI                   RT_BIT(7)
-#define CODEC_F00_0C_CAP_BALANCED_IO            RT_BIT(6)
-#define CODEC_F00_0C_CAP_INPUT                  RT_BIT(5)
-#define CODEC_F00_0C_CAP_OUTPUT                 RT_BIT(4)
-#define CODEC_F00_0C_CAP_HP                     RT_BIT(3)
-#define CODEC_F00_0C_CAP_PRESENSE_DETECT        RT_BIT(2)
-#define CODEC_F00_0C_CAP_TRIGGER_REQUIRED       RT_BIT(1)
-#define CODEC_F00_0C_CAP_IMPENDANCE_SENSE       RT_BIT(0)
+#define CODEC_F00_0C_CAP_HBR                               RT_BIT(27)
+#define CODEC_F00_0C_CAP_DP                                RT_BIT(24)
+#define CODEC_F00_0C_CAP_EAPD                              RT_BIT(16)
+#define CODEC_F00_0C_CAP_HDMI                              RT_BIT(7)
+#define CODEC_F00_0C_CAP_BALANCED_IO                       RT_BIT(6)
+#define CODEC_F00_0C_CAP_INPUT                             RT_BIT(5)
+#define CODEC_F00_0C_CAP_OUTPUT                            RT_BIT(4)
+#define CODEC_F00_0C_CAP_HP                                RT_BIT(3)
+#define CODEC_F00_0C_CAP_PRESENSE_DETECT                   RT_BIT(2)
+#define CODEC_F00_0C_CAP_TRIGGER_REQUIRED                  RT_BIT(1)
+#define CODEC_F00_0C_CAP_IMPENDANCE_SENSE                  RT_BIT(0)
 
 #define CODEC_F00_0C_IS_CAP_HBR(f00_0c)                    ((f00_0c) & RT_BIT(27))
 #define CODEC_F00_0C_IS_CAP_DP(f00_0c)                     ((f00_0c) & RT_BIT(24))
@@ -226,29 +231,45 @@
          | (((num_steps) & 0xFF) << 8)                            \
          | ((offset) & 0xFF))
 
+#define CODEC_F00_0D_CAP_MUTE                              RT_BIT(7)
+
+#define CODEC_F00_0D_IS_CAP_MUTE(f00_0d)                   ( ( f00_0d) & RT_BIT(31))
+#define CODEC_F00_0D_STEP_SIZE(f00_0d)                     ((( f00_0d) & (0x7F << 16)) >> 16)
+#define CODEC_F00_0D_NUM_STEPS(f00_0d)                     ((((f00_0d) & (0x7F << 8)) >> 8) + 1)
+#define CODEC_F00_0D_OFFSET(f00_0d)                        (  (f00_0d) & 0x7F)
+
 /* Output Amplifier capabilities (7.3.4.10) */
-#define CODEC_MAKE_F00_12 CODEC_MAKE_F00_0D
+#define CODEC_MAKE_F00_12                                  CODEC_MAKE_F00_0D
+
+#define CODEC_F00_12_IS_CAP_MUTE(f00_12)                   CODEC_F00_0D_IS_CAP_MUTE(f00_12)
+#define CODEC_F00_12_STEP_SIZE(f00_12)                     CODEC_F00_0D_STEP_SIZE(f00_12)
+#define CODEC_F00_12_NUM_STEPS(f00_12)                     CODEC_F00_0D_NUM_STEPS(f00_12)
+#define CODEC_F00_12_OFFSET(f00_12)                        CODEC_F00_0D_OFFSET(f00_12)
 
 /* Connection list lenght (7.3.4.11) */
 #define CODEC_MAKE_F00_0E(long_form, length)    \
     (  (((long_form) & 0x1) << 7)               \
      | ((length) & 0x7F))
-#define CODEC_F00_0E_IS_LONG(f00_0e) RT_BOOL((f00_0e) & RT_BIT(7))
-#define CODEC_F00_0E_COUNT(f00_0e) ((f00_0e) & 0x7F)
+/* Indicates short-form NIDs. */
+#define CODEC_F00_0E_LIST_NID_SHORT                        0
+/* Indicates long-form NIDs. */
+#define CODEC_F00_0E_LIST_NID_LONG                         1
+#define CODEC_F00_0E_IS_LONG(f00_0e)                       RT_BOOL((f00_0e) & RT_BIT(7))
+#define CODEC_F00_0E_COUNT(f00_0e)                         ((f00_0e) & 0x7F)
 /* Supported Power States (7.3.4.12) */
-#define CODEC_F00_0F_EPSS       RT_BIT(31)
-#define CODEC_F00_0F_CLKSTOP    RT_BIT(30)
-#define CODEC_F00_0F_S3D3       RT_BIT(29)
-#define CODEC_F00_0F_D3COLD     RT_BIT(4)
-#define CODEC_F00_0F_D3         RT_BIT(3)
-#define CODEC_F00_0F_D2         RT_BIT(2)
-#define CODEC_F00_0F_D1         RT_BIT(1)
-#define CODEC_F00_0F_D0         RT_BIT(0)
+#define CODEC_F00_0F_EPSS                                  RT_BIT(31)
+#define CODEC_F00_0F_CLKSTOP                               RT_BIT(30)
+#define CODEC_F00_0F_S3D3                                  RT_BIT(29)
+#define CODEC_F00_0F_D3COLD                                RT_BIT(4)
+#define CODEC_F00_0F_D3                                    RT_BIT(3)
+#define CODEC_F00_0F_D2                                    RT_BIT(2)
+#define CODEC_F00_0F_D1                                    RT_BIT(1)
+#define CODEC_F00_0F_D0                                    RT_BIT(0)
 
 /* Processing capabilities 7.3.4.13 */
-#define CODEC_MAKE_F00_10(num, benign) ((((num) & 0xFF) << 8) | ((benign) & 0x1))
-#define CODEC_F00_10_NUM(f00_10) (((f00_10) & (0xFF << 8)) >> 8)
-#define CODEC_F00_10_BENING(f00_10) ((f00_10) & 0x1)
+#define CODEC_MAKE_F00_10(num, benign)                     ((((num) & 0xFF) << 8) | ((benign) & 0x1))
+#define CODEC_F00_10_NUM(f00_10)                           (((f00_10) & (0xFF << 8)) >> 8)
+#define CODEC_F00_10_BENING(f00_10)                        ((f00_10) & 0x1)
 
 /* CP/IO Count (7.3.4.14) */
 #define CODEC_MAKE_F00_11(wake, unsol, numgpi, numgpo, numgpio) \
@@ -259,9 +280,9 @@
      | ((numgpio) & 0xFF))
 
 /* Processing States (7.3.3.4) */
-#define CODEC_F03_OFF    (0)
-#define CODEC_F03_ON     RT_BIT(0)
-#define CODEC_F03_BENING RT_BIT(1)
+#define CODEC_F03_OFF                                      (0)
+#define CODEC_F03_ON                                       RT_BIT(0)
+#define CODEC_F03_BENING                                   RT_BIT(1)
 /* Power States (7.3.3.10) */
 #define CODEC_MAKE_F05(reset, stopok, error, act, set)          \
     (   (((reset) & 0x1) << 10)                                 \
@@ -269,30 +290,30 @@
       | (((error) & 0x1) << 8)                                  \
       | (((act) & 0x7) << 4)                                    \
       | ((set) & 0x7))
-#define CODEC_F05_D3COLD    (4)
-#define CODEC_F05_D3        (3)
-#define CODEC_F05_D2        (2)
-#define CODEC_F05_D1        (1)
-#define CODEC_F05_D0        (0)
+#define CODEC_F05_D3COLD                                   (4)
+#define CODEC_F05_D3                                       (3)
+#define CODEC_F05_D2                                       (2)
+#define CODEC_F05_D1                                       (1)
+#define CODEC_F05_D0                                       (0)
 
-#define CODEC_F05_IS_RESET(value)   (((value) & RT_BIT(10)) != 0)
-#define CODEC_F05_IS_STOPOK(value)  (((value) & RT_BIT(9)) != 0)
-#define CODEC_F05_IS_ERROR(value)   (((value) & RT_BIT(8)) != 0)
-#define CODEC_F05_ACT(value)        (((value) & 0x7) >> 4)
-#define CODEC_F05_SET(value)        (((value) & 0x7))
+#define CODEC_F05_IS_RESET(value)                          (((value) & RT_BIT(10)) != 0)
+#define CODEC_F05_IS_STOPOK(value)                         (((value) & RT_BIT(9)) != 0)
+#define CODEC_F05_IS_ERROR(value)                          (((value) & RT_BIT(8)) != 0)
+#define CODEC_F05_ACT(value)                               (((value) & 0x7) >> 4)
+#define CODEC_F05_SET(value)                               (((value) & 0x7))
 
-#define CODEC_F05_GE(p0, p1) ((p0) <= (p1))
-#define CODEC_F05_LE(p0, p1) ((p0) >= (p1))
+#define CODEC_F05_GE(p0, p1)                               ((p0) <= (p1))
+#define CODEC_F05_LE(p0, p1)                               ((p0) >= (p1))
 
 /* Pin Widged Control (7.3.3.13) */
-#define CODEC_F07_VREF_HIZ      (0)
-#define CODEC_F07_VREF_50       (0x1)
-#define CODEC_F07_VREF_GROUND   (0x2)
-#define CODEC_F07_VREF_80       (0x4)
-#define CODEC_F07_VREF_100      (0x5)
-#define CODEC_F07_IN_ENABLE     RT_BIT(5)
-#define CODEC_F07_OUT_ENABLE    RT_BIT(6)
-#define CODEC_F07_OUT_H_ENABLE  RT_BIT(7)
+#define CODEC_F07_VREF_HIZ                                 (0)
+#define CODEC_F07_VREF_50                                  (0x1)
+#define CODEC_F07_VREF_GROUND                              (0x2)
+#define CODEC_F07_VREF_80                                  (0x4)
+#define CODEC_F07_VREF_100                                 (0x5)
+#define CODEC_F07_IN_ENABLE                                RT_BIT(5)
+#define CODEC_F07_OUT_ENABLE                               RT_BIT(6)
+#define CODEC_F07_OUT_H_ENABLE                             RT_BIT(7)
 
 /* Unsolicited enabled (7.3.3.14) */
 #define CODEC_MAKE_F08(enable, tag) ((((enable) & 1) << 7) | ((tag) & 0x3F))
@@ -306,25 +327,36 @@
      | (((bits) & 0x7) << 4)                                        \
      | ((chan) & 0xF))
 
-#define CODEC_A_MULT_1X     (0)
-#define CODEC_A_MULT_2X     (1)
-#define CODEC_A_MULT_3X     (2)
-#define CODEC_A_MULT_4X     (3)
-
-#define CODEC_A_DIV_1X      (0)
-#define CODEC_A_DIV_2X      (1)
-#define CODEC_A_DIV_3X      (2)
-#define CODEC_A_DIV_4X      (3)
-#define CODEC_A_DIV_5X      (4)
-#define CODEC_A_DIV_6X      (5)
-#define CODEC_A_DIV_7X      (6)
-#define CODEC_A_DIV_8X      (7)
-
-#define CODEC_A_8_BIT       (0)
-#define CODEC_A_16_BIT      (1)
-#define CODEC_A_20_BIT      (2)
-#define CODEC_A_24_BIT      (3)
-#define CODEC_A_32_BIT      (4)
+#define CODEC_A_TYPE                                       RT_BIT(15)
+#define CODEC_A_TYPE_PCM                                   (0)
+#define CODEC_A_TYPE_NON_PCM                               (1)
+
+#define CODEC_A_BASE                                       RT_BIT(14)
+#define CODEC_A_BASE_48KHZ                                 (0)
+#define CODEC_A_BASE_44KHZ                                 (1)
+
+#define CODEC_A_MULT_1X                                    (0)
+#define CODEC_A_MULT_2X                                    (1)
+#define CODEC_A_MULT_3X                                    (2)
+#define CODEC_A_MULT_4X                                    (3)
+
+#define CODEC_A_DIV_1X                                     (0)
+#define CODEC_A_DIV_2X                                     (1)
+#define CODEC_A_DIV_3X                                     (2)
+#define CODEC_A_DIV_4X                                     (3)
+#define CODEC_A_DIV_5X                                     (4)
+#define CODEC_A_DIV_6X                                     (5)
+#define CODEC_A_DIV_7X                                     (6)
+#define CODEC_A_DIV_8X                                     (7)
+
+#define CODEC_A_8_BIT                                      (0)
+#define CODEC_A_16_BIT                                     (1)
+#define CODEC_A_20_BIT                                     (2)
+#define CODEC_A_24_BIT                                     (3)
+#define CODEC_A_32_BIT                                     (4)
+
+#define CODEC_A_CHAN_MONO                                  (0)
+#define CODEC_A_CHAN_STEREO                                (1)
 
 /* Pin Sense (7.3.3.15) */
 #define CODEC_MAKE_F09_ANALOG(fPresent, impedance)  \
@@ -336,111 +368,138 @@
   | (((fELDValid) & 0x1) << 30))
 
 #define CODEC_MAKE_F0C(lrswap, eapd, btl) ((((lrswap) & 1) << 2) | (((eapd) & 1) << 1) | ((btl) & 1))
-#define CODEC_FOC_IS_LRSWAP(f0c)    RT_BOOL((f0c) & RT_BIT(2))
-#define CODEC_FOC_IS_EAPD(f0c)      RT_BOOL((f0c) & RT_BIT(1))
-#define CODEC_FOC_IS_BTL(f0c)       RT_BOOL((f0c) & RT_BIT(0))
+#define CODEC_FOC_IS_LRSWAP(f0c)                           RT_BOOL((f0c) & RT_BIT(2))
+#define CODEC_FOC_IS_EAPD(f0c)                             RT_BOOL((f0c) & RT_BIT(1))
+#define CODEC_FOC_IS_BTL(f0c)                              RT_BOOL((f0c) & RT_BIT(0))
 /* HDA spec 7.3.3.31 defines layout of configuration registers/verbs (0xF1C) */
 /* Configuration's port connection */
-#define CODEC_F1C_PORT_MASK    (0x3)
-#define CODEC_F1C_PORT_SHIFT   (30)
-
-#define CODEC_F1C_PORT_COMPLEX (0x0)
-#define CODEC_F1C_PORT_NO_PHYS (0x1)
-#define CODEC_F1C_PORT_FIXED   (0x2)
-#define CODEC_F1C_BOTH         (0x3)
+#define CODEC_F1C_PORT_MASK                                (0x3)
+#define CODEC_F1C_PORT_SHIFT                               (30)
+
+#define CODEC_F1C_PORT_COMPLEX                             (0x0)
+#define CODEC_F1C_PORT_NO_PHYS                             (0x1)
+#define CODEC_F1C_PORT_FIXED                               (0x2)
+#define CODEC_F1C_BOTH                                     (0x3)
+
+/* Configuration default: connection */
+#define CODEC_F1C_PORT_MASK                                (0x3)
+#define CODEC_F1C_PORT_SHIFT                               (30)
+
+/* Connected to a jack (1/8", ATAPI, ...). */
+#define CODEC_F1C_PORT_COMPLEX                             (0x0)
+/* No physical connection. */
+#define CODEC_F1C_PORT_NO_PHYS                             (0x1)
+/* Fixed function device (integrated speaker, integrated mic, ...). */
+#define CODEC_F1C_PORT_FIXED                               (0x2)
+/* Both, a jack and an internal device are attached. */
+#define CODEC_F1C_BOTH                                     (0x3)
+
+/* Configuration default: Location */
+#define CODEC_F1C_LOCATION_MASK                            (0x3F)
+#define CODEC_F1C_LOCATION_SHIFT                           (24)
 
-/* Configuration's location */
-#define CODEC_F1C_LOCATION_MASK  (0x3F)
-#define CODEC_F1C_LOCATION_SHIFT (24)
 /* [4:5] bits of location region means chassis attachment */
-#define CODEC_F1C_LOCATION_PRIMARY_CHASSIS     (0)
-#define CODEC_F1C_LOCATION_INTERNAL            RT_BIT(4)
-#define CODEC_F1C_LOCATION_SECONDRARY_CHASSIS  RT_BIT(5)
-#define CODEC_F1C_LOCATION_OTHER               (RT_BIT(5))
+#define CODEC_F1C_LOCATION_PRIMARY_CHASSIS                 (0)
+#define CODEC_F1C_LOCATION_INTERNAL                        RT_BIT(4)
+#define CODEC_F1C_LOCATION_SECONDRARY_CHASSIS              RT_BIT(5)
+#define CODEC_F1C_LOCATION_OTHER                           RT_BIT(5)
 
 /* [0:3] bits of location region means geometry location attachment */
-#define CODEC_F1C_LOCATION_NA                  (0)
-#define CODEC_F1C_LOCATION_REAR                (0x1)
-#define CODEC_F1C_LOCATION_FRONT               (0x2)
-#define CODEC_F1C_LOCATION_LEFT                (0x3)
-#define CODEC_F1C_LOCATION_RIGTH               (0x4)
-#define CODEC_F1C_LOCATION_TOP                 (0x5)
-#define CODEC_F1C_LOCATION_BOTTOM              (0x6)
-#define CODEC_F1C_LOCATION_SPECIAL_0           (0x7)
-#define CODEC_F1C_LOCATION_SPECIAL_1           (0x8)
-#define CODEC_F1C_LOCATION_SPECIAL_2           (0x9)
-
-/* Configuration's devices */
-#define CODEC_F1C_DEVICE_MASK                  (0xF)
-#define CODEC_F1C_DEVICE_SHIFT                 (20)
-#define CODEC_F1C_DEVICE_LINE_OUT              (0)
-#define CODEC_F1C_DEVICE_SPEAKER               (0x1)
-#define CODEC_F1C_DEVICE_HP                    (0x2)
-#define CODEC_F1C_DEVICE_CD                    (0x3)
-#define CODEC_F1C_DEVICE_SPDIF_OUT             (0x4)
-#define CODEC_F1C_DEVICE_DIGITAL_OTHER_OUT     (0x5)
-#define CODEC_F1C_DEVICE_MODEM_LINE_SIDE       (0x6)
-#define CODEC_F1C_DEVICE_MODEM_HANDSET_SIDE    (0x7)
-#define CODEC_F1C_DEVICE_LINE_IN               (0x8)
-#define CODEC_F1C_DEVICE_AUX                   (0x9)
-#define CODEC_F1C_DEVICE_MIC                   (0xA)
-#define CODEC_F1C_DEVICE_PHONE                 (0xB)
-#define CODEC_F1C_DEVICE_SPDIF_IN              (0xC)
-#define CODEC_F1C_DEVICE_RESERVED              (0xE)
-#define CODEC_F1C_DEVICE_OTHER                 (0xF)
-
-/* Configuration's Connection type */
-#define CODEC_F1C_CONNECTION_TYPE_MASK         (0xF)
-#define CODEC_F1C_CONNECTION_TYPE_SHIFT        (16)
-
-#define CODEC_F1C_CONNECTION_TYPE_UNKNOWN               (0)
-#define CODEC_F1C_CONNECTION_TYPE_1_8INCHES             (0x1)
-#define CODEC_F1C_CONNECTION_TYPE_1_4INCHES             (0x2)
-#define CODEC_F1C_CONNECTION_TYPE_ATAPI                 (0x3)
-#define CODEC_F1C_CONNECTION_TYPE_RCA                   (0x4)
-#define CODEC_F1C_CONNECTION_TYPE_OPTICAL               (0x5)
-#define CODEC_F1C_CONNECTION_TYPE_OTHER_DIGITAL         (0x6)
-#define CODEC_F1C_CONNECTION_TYPE_ANALOG                (0x7)
-#define CODEC_F1C_CONNECTION_TYPE_DIN                   (0x8)
-#define CODEC_F1C_CONNECTION_TYPE_XLR                   (0x9)
-#define CODEC_F1C_CONNECTION_TYPE_RJ_11                 (0xA)
-#define CODEC_F1C_CONNECTION_TYPE_COMBO                 (0xB)
-#define CODEC_F1C_CONNECTION_TYPE_OTHER                 (0xF)
+#define CODEC_F1C_LOCATION_NA                              (0)
+#define CODEC_F1C_LOCATION_REAR                            (0x1)
+#define CODEC_F1C_LOCATION_FRONT                           (0x2)
+#define CODEC_F1C_LOCATION_LEFT                            (0x3)
+#define CODEC_F1C_LOCATION_RIGTH                           (0x4)
+#define CODEC_F1C_LOCATION_TOP                             (0x5)
+#define CODEC_F1C_LOCATION_BOTTOM                          (0x6)
+#define CODEC_F1C_LOCATION_SPECIAL_0                       (0x7)
+#define CODEC_F1C_LOCATION_SPECIAL_1                       (0x8)
+#define CODEC_F1C_LOCATION_SPECIAL_2                       (0x9)
+
+/* Configuration default: Device type */
+#define CODEC_F1C_DEVICE_MASK                              (0xF)
+#define CODEC_F1C_DEVICE_SHIFT                             (20)
+#define CODEC_F1C_DEVICE_LINE_OUT                          (0)
+#define CODEC_F1C_DEVICE_SPEAKER                           (0x1)
+#define CODEC_F1C_DEVICE_HP                                (0x2)
+#define CODEC_F1C_DEVICE_CD                                (0x3)
+#define CODEC_F1C_DEVICE_SPDIF_OUT                         (0x4)
+#define CODEC_F1C_DEVICE_DIGITAL_OTHER_OUT                 (0x5)
+#define CODEC_F1C_DEVICE_MODEM_LINE_SIDE                   (0x6)
+#define CODEC_F1C_DEVICE_MODEM_HANDSET_SIDE                (0x7)
+#define CODEC_F1C_DEVICE_LINE_IN                           (0x8)
+#define CODEC_F1C_DEVICE_AUX                               (0x9)
+#define CODEC_F1C_DEVICE_MIC                               (0xA)
+#define CODEC_F1C_DEVICE_PHONE                             (0xB)
+#define CODEC_F1C_DEVICE_SPDIF_IN                          (0xC)
+#define CODEC_F1C_DEVICE_RESERVED                          (0xE)
+#define CODEC_F1C_DEVICE_OTHER                             (0xF)
+
+/* Configuration default: Connection type */
+#define CODEC_F1C_CONNECTION_TYPE_MASK                     (0xF)
+#define CODEC_F1C_CONNECTION_TYPE_SHIFT                    (16)
+
+#define CODEC_F1C_CONNECTION_TYPE_UNKNOWN                  (0)
+#define CODEC_F1C_CONNECTION_TYPE_1_8INCHES                (0x1)
+#define CODEC_F1C_CONNECTION_TYPE_1_4INCHES                (0x2)
+#define CODEC_F1C_CONNECTION_TYPE_ATAPI                    (0x3)
+#define CODEC_F1C_CONNECTION_TYPE_RCA                      (0x4)
+#define CODEC_F1C_CONNECTION_TYPE_OPTICAL                  (0x5)
+#define CODEC_F1C_CONNECTION_TYPE_OTHER_DIGITAL            (0x6)
+#define CODEC_F1C_CONNECTION_TYPE_ANALOG                   (0x7)
+#define CODEC_F1C_CONNECTION_TYPE_DIN                      (0x8)
+#define CODEC_F1C_CONNECTION_TYPE_XLR                      (0x9)
+#define CODEC_F1C_CONNECTION_TYPE_RJ_11                    (0xA)
+#define CODEC_F1C_CONNECTION_TYPE_COMBO                    (0xB)
+#define CODEC_F1C_CONNECTION_TYPE_OTHER                    (0xF)
 
 /* Configuration's color */
-#define CODEC_F1C_COLOR_MASK                  (0xF)
-#define CODEC_F1C_COLOR_SHIFT                 (12)
-#define CODEC_F1C_COLOR_UNKNOWN               (0)
-#define CODEC_F1C_COLOR_BLACK                 (0x1)
-#define CODEC_F1C_COLOR_GREY                  (0x2)
-#define CODEC_F1C_COLOR_BLUE                  (0x3)
-#define CODEC_F1C_COLOR_GREEN                 (0x4)
-#define CODEC_F1C_COLOR_RED                   (0x5)
-#define CODEC_F1C_COLOR_ORANGE                (0x6)
-#define CODEC_F1C_COLOR_YELLOW                (0x7)
-#define CODEC_F1C_COLOR_PURPLE                (0x8)
-#define CODEC_F1C_COLOR_PINK                  (0x9)
-#define CODEC_F1C_COLOR_RESERVED_0            (0xA)
-#define CODEC_F1C_COLOR_RESERVED_1            (0xB)
-#define CODEC_F1C_COLOR_RESERVED_2            (0xC)
-#define CODEC_F1C_COLOR_RESERVED_3            (0xD)
-#define CODEC_F1C_COLOR_WHITE                 (0xE)
-#define CODEC_F1C_COLOR_OTHER                 (0xF)
+#define CODEC_F1C_COLOR_MASK                               (0xF)
+#define CODEC_F1C_COLOR_SHIFT                              (12)
+#define CODEC_F1C_COLOR_UNKNOWN                            (0)
+#define CODEC_F1C_COLOR_BLACK                              (0x1)
+#define CODEC_F1C_COLOR_GREY                               (0x2)
+#define CODEC_F1C_COLOR_BLUE                               (0x3)
+#define CODEC_F1C_COLOR_GREEN                              (0x4)
+#define CODEC_F1C_COLOR_RED                                (0x5)
+#define CODEC_F1C_COLOR_ORANGE                             (0x6)
+#define CODEC_F1C_COLOR_YELLOW                             (0x7)
+#define CODEC_F1C_COLOR_PURPLE                             (0x8)
+#define CODEC_F1C_COLOR_PINK                               (0x9)
+#define CODEC_F1C_COLOR_RESERVED_0                         (0xA)
+#define CODEC_F1C_COLOR_RESERVED_1                         (0xB)
+#define CODEC_F1C_COLOR_RESERVED_2                         (0xC)
+#define CODEC_F1C_COLOR_RESERVED_3                         (0xD)
+#define CODEC_F1C_COLOR_WHITE                              (0xE)
+#define CODEC_F1C_COLOR_OTHER                              (0xF)
 
 /* Configuration's misc */
-#define CODEC_F1C_MISC_MASK                  (0xF)
-#define CODEC_F1C_MISC_SHIFT                 (8)
-#define CODEC_F1C_MISC_JACK_DETECT           (0)
-#define CODEC_F1C_MISC_RESERVED_0            (1)
-#define CODEC_F1C_MISC_RESERVED_1            (2)
-#define CODEC_F1C_MISC_RESERVED_2            (3)
-
-/* Configuration's association */
-#define CODEC_F1C_ASSOCIATION_MASK                  (0xF)
-#define CODEC_F1C_ASSOCIATION_SHIFT                 (4)
-/* Connection's sequence */
-#define CODEC_F1C_SEQ_MASK                  (0xF)
-#define CODEC_F1C_SEQ_SHIFT                 (0)
+#define CODEC_F1C_MISC_MASK                                (0xF)
+#define CODEC_F1C_MISC_SHIFT                               (8)
+#define CODEC_F1C_MISC_JACK_DETECT                         (0)
+#define CODEC_F1C_MISC_RESERVED_0                          (1)
+#define CODEC_F1C_MISC_RESERVED_1                          (2)
+#define CODEC_F1C_MISC_RESERVED_2                          (3)
+
+/* Configuration default: Association */
+#define CODEC_F1C_ASSOCIATION_MASK                         (0xF)
+#define CODEC_F1C_ASSOCIATION_SHIFT                        (4)
+
+/* Reserved; don't use. */
+#define CODEC_F1C_ASSOCIATION_INVALID                      0x0
+#define CODEC_F1C_ASSOCIATION_GROUP_0                      0x1
+#define CODEC_F1C_ASSOCIATION_GROUP_1                      0x2
+#define CODEC_F1C_ASSOCIATION_GROUP_2                      0x3
+#define CODEC_F1C_ASSOCIATION_GROUP_3                      0x4
+#define CODEC_F1C_ASSOCIATION_GROUP_4                      0x5
+#define CODEC_F1C_ASSOCIATION_GROUP_5                      0x6
+#define CODEC_F1C_ASSOCIATION_GROUP_6                      0x7
+#define CODEC_F1C_ASSOCIATION_GROUP_7                      0x8
+#define CODEC_F1C_ASSOCIATION_GROUP_15                     0xF
+
+/* Configuration default: Association Sequence */
+#define CODEC_F1C_SEQ_MASK                                 (0xF)
+#define CODEC_F1C_SEQ_SHIFT                                (0)
 
 /* Implementation identification (7.3.3.30) */
 #define CODEC_MAKE_F20(bmid, bsku, aid)     \
@@ -700,6 +759,38 @@ AssertNodeSize(CODECNODE, 60 + 6);
 /*******************************************************************************
 *   Global Variables                                                           *
 *******************************************************************************/
+/* STAC9220 - Nodes IDs / names. */
+#define STAC9220_NID_ROOT                                  0x0  /* Root node */
+#define STAC9220_NID_AFG                                   0x1  /* Audio Configuration Group */
+#define STAC9220_NID_DAC0                                  0x2  /* Out */
+#define STAC9220_NID_DAC1                                  0x3  /* Out */
+#define STAC9220_NID_DAC2                                  0x4  /* Out */
+#define STAC9220_NID_DAC3                                  0x5  /* Out */
+#define STAC9220_NID_ADC0                                  0x6  /* In */
+#define STAC9220_NID_ADC1                                  0x7  /* In */
+#define STAC9220_NID_SPDIF_OUT                             0x8  /* Out */
+#define STAC9220_NID_SPDIF_IN                              0x9  /* In */
+#define STAC9220_NID_PIN_HEADPHONE0                        0xA  /* In, Out */
+#define STAC9220_NID_PIN_B                                 0xB  /* In, Out */
+#define STAC9220_NID_PIN_C                                 0xC  /* In, Out */
+#define STAC9220_NID_PIN_HEADPHONE1                        0xD  /* In, Out */
+#define STAC9220_NID_PIN_E                                 0xE  /* In */
+#define STAC9220_NID_PIN_F                                 0xF  /* In, Out */
+#define STAC9220_NID_PIN_SPDIF_OUT                         0x10 /* Out */
+#define STAC9220_NID_PIN_SPDIF_IN                          0x11 /* In */
+#define STAC9220_NID_ADC0_MUX                              0x12 /* In */
+#define STAC9220_NID_ADC1_MUX                              0x13 /* In */
+#define STAC9220_NID_PCBEEP                                0x14 /* Out */
+#define STAC9220_NID_PIN_CD                                0x15 /* In */
+#define STAC9220_NID_VOL_KNOB                              0x16
+#define STAC9220_NID_AMP_ADC0                              0x17 /* In */
+#define STAC9220_NID_AMP_ADC1                              0x18 /* In */
+/* STAC9221. */
+#define STAC9221_NID_ADAT_OUT                              0x19 /* Out */
+#define STAC9221_NID_I2S_OUT                               0x1A /* Out */
+#define STAC9221_NID_PIN_I2S_OUT                           0x1B /* Out */
+
+#if 1
 /* STAC9220 - Referenced thru STAC9220WIDGET in the constructor below. */
 static uint8_t const g_abStac9220Ports[]      = { 0x0A, 0xB, 0xC, 0xD, 0xE, 0xF, 0};
 static uint8_t const g_abStac9220Dacs[]       = { 0x02, 0x3, 0x4, 0x5, 0};
@@ -714,7 +805,23 @@ static uint8_t const g_abStac9220Pcbeeps[]    = { 0x14, 0 };
 static uint8_t const g_abStac9220Cds[]        = { 0x15, 0 };
 static uint8_t const g_abStac9220VolKnobs[]   = { 0x16, 0 };
 static uint8_t const g_abStac9220Reserveds[]  = { 0x09, 0x19, 0x1a, 0x1b, 0 };
-
+#else /** @todo Enable this after 5.0 -- needs more testing first. */
+static uint8_t const g_abStac9220Ports[]      = { STAC9220_NID_PIN_HEADPHONE0, STAC9220_NID_PIN_B, STAC9220_NID_PIN_C, STAC9220_NID_PIN_HEADPHONE1, STAC9220_NID_PIN_E, STAC9220_NID_PIN_F, 0};
+static uint8_t const g_abStac9220Dacs[]       = { STAC9220_NID_DAC0, STAC9220_NID_DAC1, STAC9220_NID_DAC2, STAC9220_NID_DAC3, 0};
+static uint8_t const g_abStac9220Adcs[]       = { STAC9220_NID_ADC0, STAC9220_NID_ADC1, 0};
+static uint8_t const g_abStac9220SpdifOuts[]  = { STAC9220_NID_SPDIF_OUT, 0 };
+static uint8_t const g_abStac9220SpdifIns[]   = { STAC9220_NID_SPDIF_IN, 0 };
+static uint8_t const g_abStac9220DigOutPins[] = { STAC9220_NID_PIN_SPDIF_OUT, 0 };
+static uint8_t const g_abStac9220DigInPins[]  = { STAC9220_NID_PIN_SPDIF_IN, 0 };
+static uint8_t const g_abStac9220AdcVols[]    = { STAC9220_NID_AMP_ADC0, STAC9220_NID_AMP_ADC1, 0};
+static uint8_t const g_abStac9220AdcMuxs[]    = { STAC9220_NID_ADC0_MUX, STAC9220_NID_ADC1_MUX, 0};
+static uint8_t const g_abStac9220Pcbeeps[]    = { STAC9220_NID_PCBEEP, 0 };
+static uint8_t const g_abStac9220Cds[]        = { STAC9220_NID_PIN_CD, 0 };
+static uint8_t const g_abStac9220VolKnobs[]   = { STAC9220_NID_VOL_KNOB, 0 };
+/* STAC 9221. */
+/** @todo Is STAC9220_NID_SPDIF_IN really correct for reserved nodes? */
+static uint8_t const g_abStac9220Reserveds[]  = { STAC9220_NID_SPDIF_IN, STAC9221_NID_ADAT_OUT, STAC9221_NID_I2S_OUT, STAC9221_NID_PIN_I2S_OUT, 0 };
+#endif
 
 /** SSM description of a CODECNODE. */
 static SSMFIELD const g_aCodecNodeFields[] =
@@ -742,6 +849,21 @@ static SSMFIELD const g_aCodecNodeFieldsV1[] =
 
 
 
+static DECLCALLBACK(void) stac9220DbgNodes(PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs)
+{
+    for (int i = 1; i < 12; i++)
+    {
+        PCODECNODE pNode = &pThis->paNodes[i];
+        AMPLIFIER *pAmp = &pNode->dac.B_params;
+
+        uint8_t lVol = AMPLIFIER_REGISTER(*pAmp, AMPLIFIER_OUT, AMPLIFIER_LEFT, 0) & 0x7f;
+        uint8_t rVol = AMPLIFIER_REGISTER(*pAmp, AMPLIFIER_OUT, AMPLIFIER_RIGHT, 0) & 0x7f;
+
+        pHlp->pfnPrintf(pHlp, "0x%x: lVol=%RU8, rVol=%RU8\n", i, lVol, rVol);
+    }
+}
+
+
 static int stac9220ResetNode(PHDACODEC pThis, uint8_t nodenum, PCODECNODE pNode)
 {
     pNode->node.id = nodenum;
@@ -849,6 +971,7 @@ static int stac9220ResetNode(PHDACODEC pThis, uint8_t nodenum, PCODECNODE pNode)
                                                           CODEC_F1C_COLOR_GREEN,
                                                           CODEC_F1C_MISC_JACK_DETECT,
                                                           0x2, 0);//RT_MAKE_U32_FROM_U8(0x20, 0x40, 0x21, 0x02);
+            pNode->port.u32F09_param = CODEC_MAKE_F09_ANALOG(0, CODEC_F09_ANALOG_NA);//0x7fffffff;
             goto port_init;
         case 0xB:
             pNode->node.au32F00_param[0xC] = CODEC_MAKE_F00_0C(0x17)
@@ -867,6 +990,7 @@ static int stac9220ResetNode(PHDACODEC pThis, uint8_t nodenum, PCODECNODE pNode)
                                                           CODEC_F1C_COLOR_BLACK,
                                                           CODEC_F1C_MISC_JACK_DETECT,
                                                           0x1, 0x1);//RT_MAKE_U32_FROM_U8(0x11, 0x60, 0x11, 0x01);
+            pNode->port.u32F09_param = CODEC_MAKE_F09_ANALOG(1, CODEC_F09_ANALOG_NA);//RT_BIT(31)|0x7fffffff;
             goto port_init;
         case 0xC:
             pNode->node.au32F02_param[0] = 0x3;
@@ -884,6 +1008,7 @@ static int stac9220ResetNode(PHDACODEC pThis, uint8_t nodenum, PCODECNODE pNode)
                                                           CODEC_F1C_CONNECTION_TYPE_1_8INCHES,
                                                           CODEC_F1C_COLOR_GREEN,
                                                           0x0, 0x1, 0x0);//RT_MAKE_U32_FROM_U8(0x10, 0x40, 0x11, 0x01);
+            pNode->port.u32F09_param = CODEC_MAKE_F09_ANALOG(1, CODEC_F09_ANALOG_NA);//RT_BIT(31)|0x7fffffff;
             goto port_init;
         case 0xD:
             pNode->node.au32F00_param[0xC] = CODEC_MAKE_F00_0C(0x17)
@@ -901,8 +1026,8 @@ static int stac9220ResetNode(PHDACODEC pThis, uint8_t nodenum, PCODECNODE pNode)
                                                           CODEC_F1C_CONNECTION_TYPE_1_8INCHES,
                                                           CODEC_F1C_COLOR_PINK,
                                                           0x0, 0x5, 0x0);//RT_MAKE_U32_FROM_U8(0x50, 0x90, 0xA1, 0x02); /* Microphone */
-        port_init:
             pNode->port.u32F09_param = CODEC_MAKE_F09_ANALOG(1, CODEC_F09_ANALOG_NA);//RT_BIT(31)|0x7fffffff;
+        port_init:
             pNode->port.u32F08_param = 0;
             pNode->node.au32F00_param[9] = CODEC_MAKE_F00_09(CODEC_F00_09_TYPE_PIN_COMPLEX, 0x0, 0)
                                          | CODEC_F00_09_CAP_CONNECTION_LIST
@@ -977,7 +1102,7 @@ static int stac9220ResetNode(PHDACODEC pThis, uint8_t nodenum, PCODECNODE pNode)
             pNode->digin.u32F05_param = CODEC_MAKE_F05(0, 0, 0, CODEC_F05_D3, CODEC_F05_D3);//0x3 << 4 | 0x3; /* PS-Act: D3 -> D3 */
             pNode->digin.u32F07_param = 0;
             pNode->digin.u32F08_param = 0;
-            pNode->digin.u32F09_param = 0;
+            pNode->digin.u32F09_param = CODEC_MAKE_F09_DIGITAL(0, 0);
             pNode->digin.u32F0c_param = 0;
             if (!pThis->fInReset)
                 pNode->digin.u32F1c_param = CODEC_MAKE_F1C(CODEC_F1C_PORT_COMPLEX,
@@ -1087,6 +1212,7 @@ static int stac9220Construct(PHDACODEC pThis)
 {
     unconst(pThis->cTotalNodes) = 0x1C;
     pThis->pfnCodecNodeReset = stac9220ResetNode;
+    pThis->pfnDbgListNodes   = stac9220DbgNodes;
     pThis->u16VendorId = 0x8384;
     pThis->u16DeviceId = 0x7680;
     pThis->u8BSKU = 0x76;
@@ -1111,7 +1237,7 @@ static int stac9220Construct(PHDACODEC pThis)
     STAC9220WIDGET(Reserved);
 #undef STAC9220WIDGET
     unconst(pThis->u8AdcVolsLineIn) = 0x17;
-    unconst(pThis->u8DacLineOut) = 0x2;
+    unconst(pThis->u8DacLineOut) = 0x3;
 
     return VINF_SUCCESS;
 }
@@ -1344,8 +1470,8 @@ static DECLCALLBACK(int) vrbProcSetAmplifier(PHDACODEC pThis, uint32_t cmd, uint
         if (fIsRight)
             hdaCodecSetRegisterU8(&AMPLIFIER_REGISTER(*pAmplifier, AMPLIFIER_OUT, AMPLIFIER_RIGHT, u8Index), cmd, 0);
 
-        /** @todo Fix ID of u8DacLineOut! */
-        hdaCodecToAudVolume(pThis, pAmplifier, PDMAUDIOMIXERCTL_PCM);
+        if (CODEC_NID(cmd) == pThis->u8DacLineOut)
+            hdaCodecToAudVolume(pThis, pAmplifier, PDMAUDIOMIXERCTL_PCM);
     }
 
     return VINF_SUCCESS;
@@ -2213,6 +2339,225 @@ static const CODECVERB g_aCodecVerbs[] =
     { 0x00030000, CODEC_VERB_16BIT_CMD, vrbProcSetAmplifier           },
 };
 
+#ifdef DEBUG
+typedef struct CODECDBGINFO
+{
+    /** DBGF info helpers. */
+    PCDBGFINFOHLP pHlp;
+    /** Current recursion level. */
+    uint8_t uLevel;
+    /** Pointer to codec state. */
+    PHDACODEC pThis;
+
+} CODECDBGINFO, *PCODECDBGINFO;
+
+#define CODECDBG_INDENT   pInfo->uLevel++;
+#define CODECDBG_UNINDENT if (pInfo->uLevel) pInfo->uLevel--;
+
+#define CODECDBG_PRINT(x, ...)  pInfo->pHlp->pfnPrintf(pInfo->pHlp, x);
+#define CODECDBG_PRINTI(x, ...) codecDbgPrintf(pInfo, x);
+
+static void codecDbgPrintfIndentV(PCODECDBGINFO pInfo, uint16_t uIndent, const char *pszFormat, va_list va)
+{
+    char *pszValueFormat;
+    if (RTStrAPrintfV(&pszValueFormat, pszFormat, va))
+    {
+        pInfo->pHlp->pfnPrintf(pInfo->pHlp, "%*s%s", uIndent, "", pszValueFormat);
+        RTStrFree(pszValueFormat);
+    }
+}
+
+static void codecDbgPrintf(PCODECDBGINFO pInfo, const char *pszFormat, ...)
+{
+    va_list va;
+    va_start(va, pszFormat);
+    codecDbgPrintfIndentV(pInfo, pInfo->uLevel * 4, pszFormat, va);
+    va_end(va);
+}
+
+/* Power state */
+static void codecDbgPrintNodeRegF05(PCODECDBGINFO pInfo, uint32_t u32Reg)
+{
+    codecDbgPrintf(pInfo, "Power (F05): fReset=%RTbool, fStopOk=%RTbool, Set=%RU8, Act=%RU8\n",
+                   CODEC_F05_IS_RESET(u32Reg), CODEC_F05_IS_STOPOK(u32Reg), CODEC_F05_SET(u32Reg), CODEC_F05_ACT(u32Reg));
+}
+
+static void codecDbgPrintNodeRegA(PCODECDBGINFO pInfo, uint32_t u32Reg)
+{
+    codecDbgPrintf(pInfo, "RegA: %x\n", u32Reg);
+}
+
+static void codecDbgPrintNodeRegF00(PCODECDBGINFO pInfo, uint32_t *paReg00)
+{
+    codecDbgPrintf(pInfo, "Parameters (F00):\n");
+
+    CODECDBG_INDENT
+        codecDbgPrintf(pInfo, "Amplifier Caps:\n");
+        uint32_t uReg = paReg00[0xD];
+        CODECDBG_INDENT
+            codecDbgPrintf(pInfo, "Input Steps=%02RU8, StepSize=%02RU8, StepOff=%02RU8, fCanMute=%RTbool\n",
+                           CODEC_F00_0D_NUM_STEPS(uReg),
+                           CODEC_F00_0D_STEP_SIZE(uReg),
+                           CODEC_F00_0D_OFFSET(uReg),
+                           RT_BOOL(CODEC_F00_0D_IS_CAP_MUTE(uReg)));
+
+            uReg = paReg00[0x12];
+            codecDbgPrintf(pInfo, "Output Steps=%02RU8, StepSize=%02RU8, StepOff=%02RU8, fCanMute=%RTbool\n",
+                           CODEC_F00_12_NUM_STEPS(uReg),
+                           CODEC_F00_12_STEP_SIZE(uReg),
+                           CODEC_F00_12_OFFSET(uReg),
+                           RT_BOOL(CODEC_F00_0D_IS_CAP_MUTE(uReg)));
+        CODECDBG_UNINDENT
+    CODECDBG_UNINDENT
+}
+
+static void codecDbgPrintNodeAmp(PCODECDBGINFO pInfo, uint32_t *paReg, uint8_t uIdx, uint8_t uDir)
+{
+#define CODECDBG_AMP(reg, chan) \
+    codecDbgPrintf(pInfo, "Amp %RU8 %s %s: In=%RTbool, Out=%RTbool, Left=%RTbool, Right=%RTbool, Idx=%RU8, fMute=%RTbool, uGain=%RU8\n", \
+                   uIdx, chan, uDir == AMPLIFIER_IN ? "In" : "Out", \
+                   RT_BOOL(CODEC_SET_AMP_IS_IN_DIRECTION(reg)), RT_BOOL(CODEC_SET_AMP_IS_OUT_DIRECTION(reg)), \
+                   RT_BOOL(CODEC_SET_AMP_IS_LEFT_SIDE(reg)), RT_BOOL(CODEC_SET_AMP_IS_RIGHT_SIDE(reg)), \
+                   CODEC_SET_AMP_INDEX(reg), RT_BOOL(CODEC_SET_AMP_MUTE(reg)), CODEC_SET_AMP_GAIN(reg));
+
+    uint32_t regAmp = AMPLIFIER_REGISTER(paReg, uDir, AMPLIFIER_LEFT, uIdx);
+    CODECDBG_AMP(regAmp, "Left");
+    regAmp = AMPLIFIER_REGISTER(paReg, uDir, AMPLIFIER_RIGHT, uIdx);
+    CODECDBG_AMP(regAmp, "Right");
+
+#undef CODECDBG_AMP
+}
+
+static void codecDbgPrintNodeConnections(PCODECDBGINFO pInfo, PCODECNODE pNode)
+{
+    if (pNode->node.au32F00_param[0xE] == 0) /* Directly connected to HDA link. */
+    {
+         codecDbgPrintf(pInfo, "[HDA LINK]\n");
+         return;
+    }
+}
+
+static void codecDbgPrintNode(PCODECDBGINFO pInfo, PCODECNODE pNode)
+{
+    codecDbgPrintf(pInfo, "Node 0x%02x (%02RU8): ", pNode->node.id, pNode->node.id);
+
+    if (pNode->node.id == STAC9220_NID_ROOT)
+    {
+        CODECDBG_PRINT("ROOT\n")
+    }
+    else if (pNode->node.id == STAC9220_NID_AFG)
+    {
+        CODECDBG_PRINT("AFG\n")
+        CODECDBG_INDENT
+            codecDbgPrintNodeRegF00(pInfo, pNode->node.au32F00_param);
+            codecDbgPrintNodeRegF05(pInfo, pNode->afg.u32F05_param);
+        CODECDBG_UNINDENT
+    }
+    else if (hdaCodecIsPortNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("PORT\n")
+    }
+    else if (hdaCodecIsDacNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("DAC\n")
+        CODECDBG_INDENT
+            codecDbgPrintNodeRegF00(pInfo, pNode->node.au32F00_param);
+            codecDbgPrintNodeRegF05(pInfo, pNode->dac.u32F05_param);
+            codecDbgPrintNodeRegA  (pInfo, pNode->dac.u32A_param);
+            codecDbgPrintNodeAmp   (pInfo, pNode->dac.B_params, 0, AMPLIFIER_OUT);
+        CODECDBG_UNINDENT
+    }
+    else if (hdaCodecIsAdcVolNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("ADC VOLUME\n")
+        CODECDBG_INDENT
+            codecDbgPrintNodeRegF00(pInfo, pNode->node.au32F00_param);
+            codecDbgPrintNodeRegA  (pInfo, pNode->adcvol.u32A_params);
+            codecDbgPrintNodeAmp   (pInfo, pNode->adcvol.B_params, 0, AMPLIFIER_IN);
+        CODECDBG_UNINDENT
+    }
+    else if (hdaCodecIsAdcNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("ADC\n")
+        CODECDBG_INDENT
+            codecDbgPrintNodeRegF00(pInfo, pNode->node.au32F00_param);
+            codecDbgPrintNodeRegF05(pInfo, pNode->adc.u32F05_param);
+            codecDbgPrintNodeRegA  (pInfo, pNode->adc.u32A_param);
+            codecDbgPrintNodeAmp   (pInfo, pNode->adc.B_params, 0, AMPLIFIER_IN);
+        CODECDBG_UNINDENT
+    }
+    else if (hdaCodecIsAdcMuxNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("ADC MUX\n")
+        CODECDBG_INDENT
+            codecDbgPrintNodeRegF00(pInfo, pNode->node.au32F00_param);
+            codecDbgPrintNodeRegA  (pInfo, pNode->adcmux.u32A_param);
+            codecDbgPrintNodeAmp   (pInfo, pNode->adcmux.B_params, 0, AMPLIFIER_IN);
+        CODECDBG_UNINDENT
+    }
+    else if (hdaCodecIsPcbeepNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("PC BEEP\n")
+    }
+    else if (hdaCodecIsSpdifOutNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("SPDIF OUT\n")
+    }
+    else if (hdaCodecIsSpdifInNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("SPDIF IN\n")
+    }
+    else if (hdaCodecIsDigInPinNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("DIGITAL IN PIN\n")
+    }
+    else if (hdaCodecIsDigOutPinNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("DIGITAL OUT PIN\n")
+    }
+    else if (hdaCodecIsCdNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("CD\n")
+    }
+    else if (hdaCodecIsVolKnobNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("VOLUME KNOB\n")
+    }
+    else if (hdaCodecIsReservedNode(pInfo->pThis, pNode->node.id))
+    {
+        CODECDBG_PRINT("RESERVED\n")
+    }
+    else
+        CODECDBG_PRINT("UNKNOWN TYPE 0x%x\n", pNode->node.id);
+}
+
+static DECLCALLBACK(void) codecDbgListNodes(PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs)
+{
+    pHlp->pfnPrintf(pHlp, "HDA LINK\n");
+
+    CODECDBGINFO dbgInfo;
+    dbgInfo.pHlp   = pHlp;
+    dbgInfo.pThis  = pThis;
+    dbgInfo.uLevel = 0;
+
+    PCODECDBGINFO pInfo = &dbgInfo;
+
+    CODECDBG_INDENT
+        for (uint8_t i = 0; i < pThis->cTotalNodes; i++)
+        {
+            PCODECNODE pNode = &pThis->paNodes[i];
+            if (pNode->node.au32F00_param[0xE] == 0) /* Start with all nodes connected directly to the HDA (Azalia) link. */
+                codecDbgPrintNode(&dbgInfo, pNode);
+        }
+    CODECDBG_UNINDENT
+}
+
+static DECLCALLBACK(void) codecDbgSelector(PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs)
+{
+
+}
+#endif
+
 static int codecLookup(PHDACODEC pThis, uint32_t cmd, PPFNHDACODECVERBPROCESSOR pfn)
 {
     Assert(CODEC_CAD(cmd) == pThis->id);
@@ -2380,7 +2725,11 @@ int hdaCodecConstruct(PPDMDEVINS pDevIns, PHDACODEC pThis,
     pThis->id        = uLUN;
     pThis->paVerbs   = &g_aCodecVerbs[0];
     pThis->cVerbs    = RT_ELEMENTS(g_aCodecVerbs);
-    pThis->pfnLookup = codecLookup;
+    pThis->pfnLookup       = codecLookup;
+#ifdef DEBUG
+    pThis->pfnDbgSelector  = codecDbgSelector;
+    pThis->pfnDbgListNodes = codecDbgListNodes;
+#endif
     int rc = stac9220Construct(pThis);
     AssertRC(rc);
 
diff --git a/src/VBox/Devices/Audio/DevIchHdaCodec.h b/src/VBox/Devices/Audio/DevIchHdaCodec.h
index 0fcccb5..c75041a 100644
--- a/src/VBox/Devices/Audio/DevIchHdaCodec.h
+++ b/src/VBox/Devices/Audio/DevIchHdaCodec.h
@@ -109,19 +109,19 @@ typedef struct HDACODEC
     const uint8_t           u8AdcVolsLineIn;
     const uint8_t           u8DacLineOut;
 #endif
-    /* Callbacks to the HDA controller, mostly used for multiplexing to the various host backends. */
+    /** Callbacks to the HDA controller, mostly used for multiplexing to the various host backends. */
     DECLR3CALLBACKMEMBER(void, pfnCloseIn, (PHDASTATE pThis, PDMAUDIORECSOURCE enmRecSource));
     DECLR3CALLBACKMEMBER(void, pfnCloseOut, (PHDASTATE pThis));
     DECLR3CALLBACKMEMBER(int, pfnOpenIn, (PHDASTATE pThis, const char *pszName, PDMAUDIORECSOURCE enmRecSource, PPDMAUDIOSTREAMCFG pCfg));
     DECLR3CALLBACKMEMBER(int, pfnOpenOut, (PHDASTATE pThis, const char *pszName, PPDMAUDIOSTREAMCFG pCfg));
     DECLR3CALLBACKMEMBER(int, pfnSetVolume, (PHDASTATE pThis, ENMSOUNDSOURCE enmSource, bool fMute, uint8_t uVolLeft, uint8_t uVolRight));
-    /* Callbacks by codec implementation. */
+    /** Callbacks by codec implementation. */
     DECLR3CALLBACKMEMBER(int, pfnLookup, (PHDACODEC pThis, uint32_t verb, PPFNHDACODECVERBPROCESSOR));
     DECLR3CALLBACKMEMBER(int, pfnReset, (PHDACODEC pThis));
     DECLR3CALLBACKMEMBER(int, pfnCodecNodeReset, (PHDACODEC pThis, uint8_t, PCODECNODE));
-    /* Callbacks by codec implementation to answer debugger requests. */
-    DECLR3CALLBACKMEMBER(void, pfnCodecDbgListNodes, (PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs));
-    DECLR3CALLBACKMEMBER(void, pfnCodecDbgSelector, (PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs));
+    /** These callbacks are set by codec implementation to answer debugger requests. */
+    DECLR3CALLBACKMEMBER(void, pfnDbgListNodes, (PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs));
+    DECLR3CALLBACKMEMBER(void, pfnDbgSelector, (PHDACODEC pThis, PCDBGFINFOHLP pHlp, const char *pszArgs));
 } CODECState;
 
 int hdaCodecConstruct(PPDMDEVINS pDevIns, PHDACODEC pThis, uint16_t uLUN, PCFGMNODE pCfg);
diff --git a/src/VBox/Devices/Audio/DevSB16.cpp b/src/VBox/Devices/Audio/DevSB16.cpp
index ccef8dc..d1814b3 100644
--- a/src/VBox/Devices/Audio/DevSB16.cpp
+++ b/src/VBox/Devices/Audio/DevSB16.cpp
@@ -40,7 +40,8 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-
+#define LOG_GROUP LOG_GROUP_DEV_SB16
+#include <VBox/log.h>
 #include <iprt/assert.h>
 #ifdef IN_RING3
 # include <iprt/mem.h>
@@ -53,12 +54,6 @@
 
 #include "VBoxDD.h"
 
-#ifdef LOG_GROUP
- #undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 #include "AudioMixer.h"
 
 /** Current saved state version. */
diff --git a/src/VBox/Devices/Audio/DrvAudio.cpp b/src/VBox/Devices/Audio/DrvAudio.cpp
index d5543b7..d4df61c 100644
--- a/src/VBox/Devices/Audio/DrvAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvAudio.cpp
@@ -42,7 +42,8 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-
+#define LOG_GROUP LOG_GROUP_DRV_AUDIO
+#include <VBox/log.h>
 #include <VBox/vmm/pdm.h>
 #include <VBox/err.h>
 #include <VBox/vmm/mm.h>
@@ -55,12 +56,6 @@
 #include <iprt/string.h>
 #include <iprt/uuid.h>
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 #include "VBoxDD.h"
 
 #include <ctype.h>
diff --git a/src/VBox/Devices/Audio/DrvAudioCommon.cpp b/src/VBox/Devices/Audio/DrvAudioCommon.cpp
index ed2ef12..9121979 100644
--- a/src/VBox/Devices/Audio/DrvAudioCommon.cpp
+++ b/src/VBox/Devices/Audio/DrvAudioCommon.cpp
@@ -41,7 +41,8 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-
+#define LOG_GROUP LOG_GROUP_DRV_AUDIO
+#include <VBox/log.h>
 #include <iprt/asm-math.h>
 #include <iprt/assert.h>
 #include <iprt/uuid.h>
@@ -53,12 +54,6 @@
 #include <VBox/err.h>
 #include <VBox/vmm/mm.h>
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 #include <ctype.h>
 #include <stdlib.h>
 
diff --git a/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp b/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
index 5f1dc0f..74f6d6c 100644
--- a/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
@@ -43,7 +43,8 @@
 /*******************************************************************************
 *   Header Files                                                               *
 *******************************************************************************/
-
+#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
+#include <VBox/log.h>
 #include <iprt/alloc.h>
 #include <iprt/uuid.h> /* For PDMIBASE_2_PDMDRV. */
 #include <VBox/vmm/pdmaudioifs.h>
@@ -60,13 +61,6 @@ RT_C_DECLS_END
 
 #include "VBoxDD.h"
 
-
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 typedef struct ALSAAUDIOSTREAMIN
 {
     PDMAUDIOHSTSTRMIN   pStreamIn;
@@ -824,8 +818,13 @@ static DECLCALLBACK(int) drvHostALSAAudioCaptureIn(PPDMIHOSTAUDIO pInterface, PP
         }
     }
 
+    /*
+     * Check how much we can read from the capture device without overflowing
+     * the mixer buffer.
+     */
     Assert(cAvail);
-    size_t cbToRead = AUDIOMIXBUF_S2B(&pHstStrmIn->MixBuf, cAvail);
+    size_t cbMixFree = AudioMixBufFreeBytes(&pHstStrmIn->MixBuf);
+    size_t cbToRead = RT_MIN((size_t)AUDIOMIXBUF_S2B(&pHstStrmIn->MixBuf, cAvail), cbMixFree);
 
     LogFlowFunc(("cbToRead=%zu, cAvail=%RI32\n", cbToRead, cAvail));
 
@@ -885,6 +884,13 @@ static DECLCALLBACK(int) drvHostALSAAudioCaptureIn(PPDMIHOSTAUDIO pInterface, PP
             if (RT_FAILURE(rc))
                 break;
 
+            /*
+             * We should not run into a full mixer buffer or we loose samples and
+             * run into an endless loop if ALSA keeps producing samples ("null"
+             * capture device for example).
+             */
+            AssertLogRelMsgBreakStmt(cWritten > 0, ("Mixer buffer shouldn't be full at this point!\n"),
+                                     rc = VERR_INTERNAL_ERROR);
             uint32_t cbWritten = AUDIOMIXBUF_S2B(&pHstStrmIn->MixBuf, cWritten);
 
             Assert(cbToRead >= cbWritten);
@@ -997,7 +1003,7 @@ static DECLCALLBACK(int) drvHostALSAAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDM
             if (RT_FAILURE(rc))
                 break;
 
-            Assert(cbToRead >= cRead);
+            Assert(cbToRead >= cbRead);
             cbToRead -= cbRead;
             cbReadTotal += cbRead;
         }
diff --git a/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp b/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
index 2efe5ea..a98d1aa 100644
--- a/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
@@ -14,6 +14,9 @@
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
+#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
+#include <VBox/log.h>
+
 #include "DrvAudio.h"
 #include "AudioMixBuffer.h"
 
@@ -31,12 +34,6 @@
 #include <AudioUnit/AudioUnit.h>
 #include <AudioToolbox/AudioConverter.h>
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 /* TODO:
  * - Maybe make sure the threads are immediately stopped if playing/recording stops.
  */
@@ -1509,7 +1506,8 @@ static DECLCALLBACK(int) drvHostCoreAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDM
 
     do
     {
-        size_t cbBuf = RT_MIN(AudioMixBufSizeBytes(&pHstStrmOut->MixBuf), pStreamOut->cbPCMBuf);
+        size_t cbMixBuf = AudioMixBufSizeBytes(&pHstStrmOut->MixBuf);
+        size_t cbBuf    = RT_MIN(cbMixBuf, pStreamOut->cbPCMBuf);
         size_t cbToRead = RT_MIN(cbBuf, RTCircBufFree(pStreamOut->pBuf));
         LogFlowFunc(("cbToRead=%zu\n", cbToRead));
 
@@ -1543,7 +1541,7 @@ static DECLCALLBACK(int) drvHostCoreAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDM
             /* Release the ring buffer, so the read thread could start reading this data. */
             RTCircBufReleaseWriteBlock(pStreamOut->pBuf, cbToWrite);
 
-            Assert(cbToRead >= cRead);
+            Assert(cbToRead >= cbRead);
             cbToRead -= cbRead;
             cbReadTotal += cbRead;
         }
diff --git a/src/VBox/Devices/Audio/DrvHostDSound.cpp b/src/VBox/Devices/Audio/DrvHostDSound.cpp
index d2b932c..c032a25 100644
--- a/src/VBox/Devices/Audio/DrvHostDSound.cpp
+++ b/src/VBox/Devices/Audio/DrvHostDSound.cpp
@@ -16,7 +16,8 @@
  * --------------------------------------------------------------------
  *
  */
-
+#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
+#include <VBox/log.h>
 #include <dsound.h>
 
 #include <iprt/alloc.h>
@@ -26,12 +27,6 @@
 #include "DrvAudio.h"
 #include "VBoxDD.h"
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 #define DSLOG(a) do { LogRel2(a); } while(0)
 #define DSLOGF(a) do { LogRel3(a); } while(0)
 #define DSLOGREL(a)                 \
diff --git a/src/VBox/Devices/Audio/DrvHostNullAudio.cpp b/src/VBox/Devices/Audio/DrvHostNullAudio.cpp
index b5ddf5a..1f50bbb 100644
--- a/src/VBox/Devices/Audio/DrvHostNullAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostNullAudio.cpp
@@ -40,6 +40,8 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
+#include <VBox/log.h>
 #include "DrvAudio.h"
 #include "AudioMixBuffer.h"
 
@@ -49,12 +51,6 @@
 #include <iprt/uuid.h> /* For PDMIBASE_2_PDMDRV. */
 #include <VBox/vmm/pdmaudioifs.h>
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 typedef struct NULLAUDIOSTREAMOUT
 {
     /** Note: Always must come first! */
diff --git a/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp b/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
index 9eaedeb..af63f75 100644
--- a/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
@@ -1,4 +1,4 @@
-/* $Id */
+/* $Id: DrvHostOSSAudio.cpp $ */
 /** @file
  * OSS (Open Sound System) host audio backend.
  */
@@ -15,6 +15,8 @@
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  * --------------------------------------------------------------------
  */
+#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
+#include <VBox/log.h>
 #include "DrvAudio.h"
 #include "AudioMixBuffer.h"
 
@@ -31,13 +33,6 @@
 #include <iprt/uuid.h> /* For PDMIBASE_2_PDMDRV. */
 #include <VBox/vmm/pdmaudioifs.h>
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
-
 /**
  * OSS host audio driver instance data.
  * @implements PDMIAUDIOCONNECTOR
@@ -874,7 +869,7 @@ static DECLCALLBACK(int) drvHostOSSAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDMA
                 break;
             }
 
-            Assert(cbToRead >= cRead);
+            Assert(cbToRead >= cbRead);
             cbToRead -= cbRead;
             cbReadTotal += cbRead;
         }
diff --git a/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp b/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
index 27408d8..ed7de9e 100644
--- a/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
@@ -19,6 +19,8 @@
 /*******************************************************************************
 *   Header Files                                                               *
 *******************************************************************************/
+#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
+#include <VBox/log.h>
 
 #include <stdio.h>
 
@@ -38,12 +40,6 @@ RT_C_DECLS_END
 
 #include "VBoxDD.h"
 
-#ifdef LOG_GROUP
-# undef LOG_GROUP
-#endif
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
 #define VBOX_PULSEAUDIO_MAX_LOG_REL_ERRORS 32 /** @todo Make this configurable thru driver options. */
 
 #ifndef PA_STREAM_NOFLAGS
@@ -882,7 +878,7 @@ static DECLCALLBACK(int) drvHostPulseAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPD
                 break;
             }
 
-            Assert(cbToRead >= cRead);
+            Assert(cbToRead >= cbRead);
             cbToRead    -= cbRead;
             cbReadTotal += cbRead;
 
diff --git a/src/VBox/Devices/Audio/alsa_stubs.c b/src/VBox/Devices/Audio/alsa_stubs.c
index d9bd316..cda485b 100644
--- a/src/VBox/Devices/Audio/alsa_stubs.c
+++ b/src/VBox/Devices/Audio/alsa_stubs.c
@@ -14,10 +14,9 @@
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
-
+#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
 #include <iprt/assert.h>
 #include <iprt/ldr.h>
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
 #include <VBox/log.h>
 #include <VBox/err.h>
 
diff --git a/src/VBox/Devices/Audio/pulse_stubs.c b/src/VBox/Devices/Audio/pulse_stubs.c
index 5786108..c38c090 100644
--- a/src/VBox/Devices/Audio/pulse_stubs.c
+++ b/src/VBox/Devices/Audio/pulse_stubs.c
@@ -14,10 +14,9 @@
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
-
+#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
 #include <iprt/assert.h>
 #include <iprt/ldr.h>
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
 #include <VBox/log.h>
 #include <VBox/err.h>
 
diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd
index 71f1898..9c1178a 100644
Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd differ
diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd
index 876e924..be17d03 100644
Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd differ
diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
index ec0d69d..072db21 100644
--- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
+++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
@@ -6769,7 +6769,7 @@ vesa_pm_end:                                 ; 0xc4514 LB 0x1
 
 section _DATA progbits vstart=0x4600 align=1 ; size=0x3726 class=DATA group=DGROUP
 _msg_vga_init:                               ; 0xc4600 LB 0x32
-    db  'Oracle VM VirtualBox Version 5.0.0_RC2 VGA BIOS', 00dh, 00ah, 000h
+    db  'Oracle VM VirtualBox Version 5.0.0_RC3 VGA BIOS', 00dh, 00ah, 000h
 _vga_modes:                                  ; 0xc4632 LB 0x80
     db  000h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 001h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
     db  002h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 003h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
@@ -7664,7 +7664,7 @@ _vbebios_vendor_name:                        ; 0xc7c77 LB 0x13
 _vbebios_product_name:                       ; 0xc7c8a LB 0x21
     db  'Oracle VM VirtualBox VBE Adapter', 000h
 _vbebios_product_revision:                   ; 0xc7cab LB 0x27
-    db  'Oracle VM VirtualBox Version 5.0.0_RC2', 000h
+    db  'Oracle VM VirtualBox Version 5.0.0_RC3', 000h
 _vbebios_info_string:                        ; 0xc7cd2 LB 0x2b
     db  'VirtualBox VBE Display Adapter enabled', 00dh, 00ah, 00dh, 00ah, 000h
 _no_vbebios_info_string:                     ; 0xc7cfd LB 0x29
@@ -7720,4 +7720,4 @@ section CONST2 progbits vstart=0x7d26 align=1 ; size=0x0 class=DATA group=DGROUP
     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
-    db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0aeh
+    db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ach
diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
index 8cef6b9..40c7a0a 100644
--- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
+++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
@@ -1 +1 @@
-e508f7f4f6f5b90ae4c1cac2ae6b4ccc *VBoxVgaBios.rom
+3cd25bfc319bf0c0eb3d8865c5944e35 *VBoxVgaBios.rom
diff --git a/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp b/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
index b955adf..6e7429f 100644
--- a/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
@@ -568,11 +568,18 @@ static int vbvaEnable(unsigned uScreenId, PVGASTATE pVGAState, VBVACONTEXT *pCtx
         return VERR_INVALID_PARAMETER;
     }
 
-    if (   parms.off32Data != 0
-        || parms.off32Free != 0
-        || parms.indexRecordFirst != 0
-        || parms.indexRecordFree != 0
-        || parms.cbPartialWriteThreshold >= parms.cbData
+    if (!fRestored)
+    {
+        if (   parms.off32Data != 0
+            || parms.off32Free != 0
+            || parms.indexRecordFirst != 0
+            || parms.indexRecordFree != 0)
+        {
+            return VERR_INVALID_PARAMETER;
+        }
+    }
+
+    if (   parms.cbPartialWriteThreshold >= parms.cbData
         || parms.cbPartialWriteThreshold == 0)
     {
         return VERR_INVALID_PARAMETER;
@@ -598,8 +605,8 @@ static int vbvaEnable(unsigned uScreenId, PVGASTATE pVGAState, VBVACONTEXT *pCtx
         pVBVAData->guest.pVBVA             = pVBVA;
         pVBVAData->guest.pu8Data           = &pVBVA->au8Data[0];
         pVBVAData->u32VBVAOffset           = u32Offset;
-        pVBVAData->off32Data               = 0;
-        pVBVAData->indexRecordFirst        = 0;
+        pVBVAData->off32Data               = parms.off32Data;
+        pVBVAData->indexRecordFirst        = parms.indexRecordFirst;
         pVBVAData->cbPartialWriteThreshold = parms.cbPartialWriteThreshold;
         pVBVAData->cbData                  = parms.cbData;
 
diff --git a/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp b/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp
index 9b7d6d2..83c7931 100644
--- a/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp
+++ b/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp
@@ -652,7 +652,11 @@ static int hgsmiHostHeapRestoreMA(HGSMIHOSTHEAP *pHeap,
     {
         rc = HGSMIMAInit(&pHeap->u.ma, &pHeap->area, paDescriptors, cBlocks, cbMaxBlock, pEnv);
 
-        if (RT_FAILURE(rc))
+        if (RT_SUCCESS(rc))
+        {
+            pHeap->u32HeapType = HGSMI_HEAP_TYPE_MA;
+        }
+        else
         {
             HGSMIAreaClear(&pHeap->area);
         }
diff --git a/src/VBox/Devices/Input/PS2K.cpp b/src/VBox/Devices/Input/PS2K.cpp
index 80650ad..aef3716 100644
--- a/src/VBox/Devices/Input/PS2K.cpp
+++ b/src/VBox/Devices/Input/PS2K.cpp
@@ -732,7 +732,7 @@ int PS2KByteToKbd(PPS2K pThis, uint8_t cmd)
                     else if (cmd < 4)
                     {
                         pThis->u8ScanSet = cmd;
-                        LogRel(("PS2K: Selected scan set %d.\n", cmd));
+                        LogRel(("PS2K: Selected scan set %d\n", cmd));
                     }
                     /* Other values are simply ignored. */
                     pThis->u8CurrCmd = 0;
diff --git a/src/VBox/Devices/Makefile.kmk b/src/VBox/Devices/Makefile.kmk
index 3386800..1cf002e 100644
--- a/src/VBox/Devices/Makefile.kmk
+++ b/src/VBox/Devices/Makefile.kmk
@@ -1217,10 +1217,10 @@ if !defined(VBOX_ONLY_EXTPACKS)         # Goes on almost to the end of the file.
    tstIntNetHardened-1_TEMPLATE = VBoxR3HardenedTstExe
    tstIntNetHardened-1_NAME     = tstIntNet-1
    tstIntNetHardened-1_DEFS     = PROGRAM_NAME_STR=\"tstIntNet-1\"
-   tstIntNetHardened-1_SOURCES  = ../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
+   tstIntNetHardened-1_SOURCES  = ../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
 
    DLLS += tstIntNet-1
-   tstIntNet-1_TEMPLATE   = VBoxR3TstDll
+   tstIntNet-1_TEMPLATE   = VBoxR3HardenedTstDll
   else
    PROGRAMS += tstIntNet-1
    tstIntNet-1_TEMPLATE   = VBOXR3TSTEXE
diff --git a/src/VBox/Devices/Network/DevE1000.cpp b/src/VBox/Devices/Network/DevE1000.cpp
index 9039769..799a3c5 100644
--- a/src/VBox/Devices/Network/DevE1000.cpp
+++ b/src/VBox/Devices/Network/DevE1000.cpp
@@ -2629,7 +2629,7 @@ static int e1kRegWriteCTRL(PE1KSTATE pThis, uint32_t offset, uint32_t index, uin
     if (value & CTRL_RESET)
     { /* RST */
 #ifndef IN_RING3
-        return VINF_IOM_R3_IOPORT_WRITE;
+        return VINF_IOM_R3_MMIO_WRITE;
 #else
         e1kHardReset(pThis);
 #endif
@@ -3029,7 +3029,7 @@ static int e1kRegWriteRCTL(PE1KSTATE pThis, uint32_t offset, uint32_t index, uin
     {
         /* Promiscuity has changed, pass the knowledge on. */
 #ifndef IN_RING3
-        return VINF_IOM_R3_IOPORT_WRITE;
+        return VINF_IOM_R3_MMIO_WRITE;
 #else
         if (pThis->pDrvR3)
             pThis->pDrvR3->pfnSetPromiscuousMode(pThis->pDrvR3, fBecomePromiscous);
@@ -5229,7 +5229,7 @@ static int e1kXmitPending(PE1KSTATE pThis, bool fOnWorkerThread)
 # ifdef IN_RING3
                 rc = VERR_NET_INCOMPLETE_TX_PACKET;
 # else /* !IN_RING3 */
-                rc = VINF_IOM_R3_IOPORT_WRITE;
+                rc = VINF_IOM_R3_MMIO_WRITE;
 # endif /* !IN_RING3 */
                 goto out;
             }
@@ -5385,7 +5385,7 @@ static int e1kRegWriteTDT(PE1KSTATE pThis, uint32_t offset, uint32_t index, uint
             if (rc == VERR_TRY_AGAIN)
                 rc = VINF_SUCCESS;
             else if (rc == VERR_SEM_BUSY)
-                rc = VINF_IOM_R3_IOPORT_WRITE;
+                rc = VINF_IOM_R3_MMIO_WRITE;
             AssertRC(rc);
         }
     }
diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
index 8b9b985..1ce6f75 100644
--- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
+++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
@@ -983,7 +983,7 @@ section CONST progbits vstart=0xb0 align=1 ; size=0xce0 class=DATA group=DGROUP
 
 section CONST2 progbits vstart=0xd90 align=1 ; size=0x3fe class=DATA group=DGROUP
 _bios_cvs_version_string:                    ; 0xf0d90 LB 0x16
-    db  'VirtualBox 5.0.0_RC2', 000h, 000h
+    db  'VirtualBox 5.0.0_RC3', 000h, 000h
 _bios_prefix_string:                         ; 0xf0da6 LB 0x8
     db  'BIOS: ', 000h, 000h
 _isotag:                                     ; 0xf0dae LB 0x6
@@ -16348,4 +16348,4 @@ dummy_iret:                                  ; 0xfff53 LB 0x9d
     db  'XM'
 cpu_reset:                                   ; 0xffff0 LB 0x10
     jmp far 0f000h:0e05bh                     ; ea 5b e0 00 f0
-    db  030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 04dh
+    db  030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 04ch
diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
index 093ec36..cf4b52f 100644
--- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
+++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
@@ -1 +1 @@
-beb4fae868345c4f95fe481666af4a6f *VBoxPcBios.rom
+a8579d1e2df1ae49b45cbb8a5bb47d0e *VBoxPcBios.rom
diff --git a/src/VBox/Devices/Storage/DevAHCI.cpp b/src/VBox/Devices/Storage/DevAHCI.cpp
index 11154e5..30ac15f 100644
--- a/src/VBox/Devices/Storage/DevAHCI.cpp
+++ b/src/VBox/Devices/Storage/DevAHCI.cpp
@@ -574,10 +574,18 @@ typedef struct AHCIPort
     /** Head of the global free request list. */
     R3PTRTYPE(PRTLISTANCHOR)        pListReqsFree;
 
+    /** Align to a multiple of 8. */
+#if HC_ARCH_BITS == 32
+    uint32_t                        u32Alignment6;
+#endif
+
 } AHCIPort;
 /** Pointer to the state of an AHCI port. */
 typedef AHCIPort *PAHCIPort;
 
+AssertCompileMemberAlignment(AHCIPort, StatDMA, 8);
+AssertCompileSizeAlignment(AHCIPort, 8);
+
 /**
  * Main AHCI device state.
  *
@@ -723,6 +731,8 @@ typedef struct AHCI
 /** Pointer to the state of an AHCI device. */
 typedef AHCI *PAHCI;
 
+AssertCompileMemberAlignment(AHCI, ahciPort, 8);
+
 /**
  * Scatter gather list entry.
  */
@@ -4653,6 +4663,12 @@ static AHCITXDIR atapiParseCmdVirtualATAPI(PAHCIPort pAhciPort, PAHCIREQ pAhciRe
                      */
                     ahciR3PortCachedReqsFree(pAhciPort);
 
+                    /*
+                     * Also make sure that the current request has no memory allocated
+                     * from the driver below us. We don't require it here anyway.
+                     */
+                    ahciReqMemFree(pAhciPort, pAhciReq, true /* fForceFree */);
+
                     rc = VMR3ReqPriorityCallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY,
                                                  (PFNRT)pAhciPort->pDrvMount->pfnUnmount, 3,
                                                  pAhciPort->pDrvMount, false/*=fForce*/, true/*=fEject*/);
@@ -5709,30 +5725,33 @@ static bool ahciCancelActiveTasks(PAHCIPort pAhciPort, PAHCIREQ pAhciReqExcept)
 {
     for (unsigned i = 0; i < RT_ELEMENTS(pAhciPort->aActiveTasks); i++)
     {
-        PAHCIREQ pAhciReq = (PAHCIREQ)ASMAtomicXchgPtr((void * volatile *)&pAhciPort->aActiveTasks[i], NULL);
-
-        if (   VALID_PTR(pAhciReq)
-            && pAhciReq != pAhciReqExcept)
+        PAHCIREQ pAhciReq = ASMAtomicReadPtrT(&pAhciPort->aActiveTasks[i], PAHCIREQ);
+        if (pAhciReq != pAhciReqExcept)
         {
-            bool fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pAhciReq->enmTxState, AHCITXSTATE_CANCELED, AHCITXSTATE_ACTIVE);
-            if (fXchg)
+            pAhciReq = (PAHCIREQ)ASMAtomicXchgPtr((void * volatile *)&pAhciPort->aActiveTasks[i], NULL);
+
+            if (VALID_PTR(pAhciReq))
             {
-                /* Task is active and was canceled. */
-                AssertReleaseMsg(ASMAtomicReadU32(&pAhciPort->cTasksActive) > 0,
-                                 ("Task was canceled but none is active\n"));
-                ASMAtomicDecU32(&pAhciPort->cTasksActive);
+                bool fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pAhciReq->enmTxState, AHCITXSTATE_CANCELED, AHCITXSTATE_ACTIVE);
+                if (fXchg)
+                {
+                    /* Task is active and was canceled. */
+                    AssertReleaseMsg(ASMAtomicReadU32(&pAhciPort->cTasksActive) > 0,
+                                     ("Task was canceled but none is active\n"));
+                    ASMAtomicDecU32(&pAhciPort->cTasksActive);
 
-                /*
-                 * Clear the pointer in the cached array. The controller will allocate a
-                 * a new task structure for this tag.
-                 */
-                ASMAtomicWriteNullPtr(&pAhciPort->aActiveTasks[i]);
-                LogRel(("AHCI#%uP%u: Cancelled task %u\n", pAhciPort->CTX_SUFF(pDevIns)->iInstance,
-                        pAhciPort->iLUN, pAhciReq->uTag));
+                    /*
+                     * Clear the pointer in the cached array. The controller will allocate a
+                     * a new task structure for this tag.
+                     */
+                    ASMAtomicWriteNullPtr(&pAhciPort->aActiveTasks[i]);
+                    LogRel(("AHCI#%uP%u: Cancelled task %u\n", pAhciPort->CTX_SUFF(pDevIns)->iInstance,
+                            pAhciPort->iLUN, pAhciReq->uTag));
+                }
+                else
+                    AssertMsg(pAhciReq->enmTxState == AHCITXSTATE_FREE,
+                              ("Invalid task state, must be free!\n"));
             }
-            else
-                AssertMsg(pAhciReq->enmTxState == AHCITXSTATE_FREE,
-                          ("Invalid task state, must be free!\n"));
         }
     }
 
@@ -5953,7 +5972,10 @@ static PAHCIREQ ahciR3ReqAlloc(PAHCIPort pAhciPort)
     RTCritSectEnter(&pAhciPort->CritSectReqsFree);
     pAhciReq = RTListGetFirst(pAhciPort->pListReqsFree, AHCIREQ, NodeList);
     if (pAhciReq)
+    {
+        AssertMsg(pAhciReq->enmTxState == AHCITXSTATE_FREE, ("Should be free!\n"));
         RTListNodeRemove(&pAhciReq->NodeList);
+    }
     RTCritSectLeave(&pAhciPort->CritSectReqsFree);
 
     if (!pAhciReq)
@@ -5971,6 +5993,7 @@ static PAHCIREQ ahciR3ReqAlloc(PAHCIPort pAhciPort)
  */
 static void ahciR3ReqFree(PAHCIPort pAhciPort, PAHCIREQ pAhciReq)
 {
+    AssertMsg(pAhciReq->enmTxState != AHCITXSTATE_FREE, ("Double free!\n"));
     pAhciReq->enmTxState = AHCITXSTATE_FREE;
 
     RTCritSectEnter(&pAhciPort->CritSectReqsFree);
@@ -6010,6 +6033,7 @@ static bool ahciTransferComplete(PAHCIPort pAhciPort, PAHCIREQ pAhciReq, int rcR
      */
     bool fPortReset = ASMAtomicReadBool(&pAhciPort->fPortReset);
     bool fXchg = ASMAtomicCmpXchgPtr(&pAhciPort->aActiveTasks[pAhciReq->uTag], NULL, pAhciReq);
+    bool fReqErrSaved = false;
 
     /*
      * Leave a release log entry if the request was active for more than 25 seconds
@@ -6088,7 +6112,7 @@ static bool ahciTransferComplete(PAHCIPort pAhciPort, PAHCIREQ pAhciReq, int rcR
                 pAhciReq->cmdHdr.u32PRDBC = 0;
                 pAhciReq->uATARegError    = ID_ERR;
                 pAhciReq->uATARegStatus   = ATA_STAT_READY | ATA_STAT_ERR;
-                ASMAtomicCmpXchgPtr(&pAhciPort->pTaskErr, pAhciReq, NULL);
+                fReqErrSaved = ASMAtomicCmpXchgPtr(&pAhciPort->pTaskErr, pAhciReq, NULL);
             }
             else
                 ASMAtomicOrU32(&pAhciPort->u32TasksRedo, RT_BIT_32(pAhciReq->uTag));
@@ -6200,7 +6224,10 @@ static bool ahciTransferComplete(PAHCIPort pAhciPort, PAHCIREQ pAhciReq, int rcR
     if (pAhciPort->cTasksActive == 0 && pAhciPort->pAhciR3->fSignalIdle)
         PDMDevHlpAsyncNotificationCompleted(pAhciPort->pDevInsR3);
 
-    if (pAhciReq && !(pAhciReq->fFlags & AHCI_REQ_IS_ON_STACK))
+    /* Don't free the request yet when it is saved for the error log page. */
+    if (   pAhciReq
+        && !(pAhciReq->fFlags & AHCI_REQ_IS_ON_STACK)
+        && !fReqErrSaved)
         ahciR3ReqFree(pAhciPort, pAhciReq);
     return fCanceled;
 }
@@ -6464,7 +6491,7 @@ static AHCITXDIR ahciProcessCmd(PAHCIPort pAhciPort, PAHCIREQ pAhciReq, uint8_t
                             if (pTaskErr->enmTxDir == AHCITXDIR_TRIM)
                                 ahciTrimRangesDestroy(pTaskErr);
                             else if (pTaskErr->enmTxDir != AHCITXDIR_FLUSH)
-                                ahciIoBufFree(pAhciPort, pTaskErr, false /* fCopyToGuest */);
+                                ahciReqMemFree(pAhciPort, pTaskErr, true /* fForceFree */);
 
                             /* Finally free the error task state structure because it is completely unused now. */
                             RTMemFree(pTaskErr);
@@ -6744,8 +6771,17 @@ static bool ahciR3CmdPrepare(PAHCIPort pAhciPort, PAHCIREQ pAhciReq)
 
         if (pAhciReq->cmdFis[AHCI_CMDFIS_BITS] & AHCI_CMDFIS_C)
         {
-            AssertReleaseMsg(ASMAtomicReadU32(&pAhciPort->cTasksActive) < AHCI_NR_COMMAND_SLOTS,
-                             ("There are more than 32 requests active"));
+            /*
+             * It is possible that the request counter can get one higher than the maximum because
+             * the request counter is decremented after the guest was notified about the completed
+             * request (see @bugref{7859}). If the completing thread is preempted in between the
+             * guest might already issue another request before the request counter is decremented
+             * which would trigger the following assertion incorrectly in the past.
+             */
+            AssertLogRelMsg(ASMAtomicReadU32(&pAhciPort->cTasksActive) <= AHCI_NR_COMMAND_SLOTS,
+                            ("AHCI#%uP%u: There are more than %u (+1) requests active",
+                             pAhciPort->CTX_SUFF(pDevIns)->iInstance, pAhciPort->iLUN,
+                             AHCI_NR_COMMAND_SLOTS));
             ASMAtomicIncU32(&pAhciPort->cTasksActive);
         }
         else
@@ -7596,6 +7632,9 @@ static DECLCALLBACK(void) ahciR3UnmountNotify(PPDMIMOUNTNOTIFY pInterface)
     PAHCIPort pAhciPort = PDMIMOUNTNOTIFY_2_PAHCIPORT(pInterface);
     Log(("%s:\n", __FUNCTION__));
 
+    /* Free all cached I/O tasks. */
+    ahciR3PortCachedReqsFree(pAhciPort);
+
     pAhciPort->cTotalSectors = 0;
 
     if (pAhciPort->fATAPI)
diff --git a/src/VBox/Devices/Storage/DevATA.cpp b/src/VBox/Devices/Storage/DevATA.cpp
index 2173101..576c74d 100644
--- a/src/VBox/Devices/Storage/DevATA.cpp
+++ b/src/VBox/Devices/Storage/DevATA.cpp
@@ -440,10 +440,10 @@ typedef struct ATACONTROLLER
     uint8_t             Alignment3[1]; /**< Explicit padding of the 1 byte gap. */
     /** Magic delay before triggering interrupts in DMA mode. */
     uint32_t            DelayIRQMillies;
-    /** The lock protecting the request queue. */
-    PDMCRITSECT         AsyncIORequestLock;
     /** The event semaphore the thread is waiting on during suspended I/O. */
     RTSEMEVENT          SuspendIOSem;
+    /** The lock protecting the request queue. */
+    PDMCRITSECT         AsyncIORequestLock;
 #if 0 /*HC_ARCH_BITS == 32*/
     uint32_t            Alignment0;
 #endif
@@ -463,6 +463,8 @@ AssertCompileMemberAlignment(ATACONTROLLER, lock, 8);
 AssertCompileMemberAlignment(ATACONTROLLER, aIfs, 8);
 AssertCompileMemberAlignment(ATACONTROLLER, u64ResetTime, 8);
 AssertCompileMemberAlignment(ATACONTROLLER, StatAsyncOps, 8);
+AssertCompileMemberAlignment(ATACONTROLLER, AsyncIORequestLock, 8);
+AssertCompileSizeAlignment(ATACONTROLLER, 8);
 
 typedef enum CHIPSET
 {
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_printf.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_printf.c
index a6200a0..3a8ec1f 100644
--- a/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_printf.c
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_printf.c
@@ -523,7 +523,7 @@ pfprint_time822(dtrace_hdl_t *dtp, FILE *fp, const char *format,
 	char 		buf[64];
 
 	RTTimeLocalExplode(&Time, RTTimeSpecSetNano(&TimeSpec, *(uint64_t *)addr));
-	RTStrPrintf(buf, sizeof(buf), "%s, %u %s %u %02u:%02u:%02u %s%u%s",
+	RTStrPrintf(buf, sizeof(buf), "%s, %u %s %02u:%02u:%02u %s%u%s",
 				g_aszDay[Time.u8WeekDay], Time.u8MonthDay, g_aszMonth[Time.u8Month - 1],
 				Time.u8Hour, Time.u8Minute, Time.u8Second,
 				Time.offUTC >= 0 ? "UTC+" : "UTC", Time.offUTC / 60,
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
index bf42e56..9af0455 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
@@ -1663,9 +1663,9 @@ static RTEXITCODE gctlHandleRunCommon(PGCTLCMDCTX pCtx, int argc, char **argv, b
                          || procStatus == ProcessStatus_TimedOutAbnormally)
                 {
                     if (pCtx->cVerbose > 1)
-                        RTPrintf("Process timed out (guest side) and\n",
+                        RTPrintf("Process timed out (guest side) and %s\n",
                                  procStatus == ProcessStatus_TimedOutAbnormally
-                                 ? " failed to terminate so far" : " was terminated");
+                                 ? "failed to terminate so far" : "was terminated");
                     rcExit = EXITCODEEXEC_TIMEOUT;
                 }
                 else
@@ -2907,7 +2907,7 @@ static DECLCALLBACK(RTEXITCODE) handleCtrtMkDir(PGCTLCMDCTX pCtx, int argc, char
     int ch;
     RTGETOPTUNION ValueUnion;
     RTGETOPTSTATE GetState;
-    RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 2, RTGETOPTINIT_FLAGS_OPTS_FIRST);
+    RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, RTGETOPTINIT_FLAGS_OPTS_FIRST);
 
     SafeArray<DirectoryCreateFlag_T> dirCreateFlags;
     uint32_t    fDirMode     = 0; /* Default mode. */
diff --git a/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk b/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
index 36c6e91..9a77c5b 100644
--- a/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
+++ b/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
@@ -36,6 +36,5 @@ VBOX_APPROVED_GUI_LANGUAGES := \
 	pt_BR \
 	ru    \
 	tr    \
-	uk    \
 	zh_CN \
 	zh_TW
diff --git a/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts b/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts
index 5ad889a..0eb6127 100644
--- a/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts
+++ b/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts
@@ -456,11 +456,11 @@
     </message>
     <message>
         <source>&Menu Bar Settings...</source>
-        <translation>&Einstelungen...</translation>
+        <translation>&Einstelungen für Menüleiste...</translation>
     </message>
     <message>
         <source>Show Menu &Bar</source>
-        <translation>Zeigt die &Menüleiste</translation>
+        <translation>Zeige &Menüleiste</translation>
     </message>
     <message>
         <source>&Status Bar</source>
@@ -599,7 +599,7 @@
     <message>
         <source>&Preferences...</source>
         <comment>global preferences window</comment>
-        <translation>&Globale Einstellungen...</translation>
+        <translation>&Einstellungen...</translation>
     </message>
     <message>
         <source>Display the global preferences window</source>
diff --git a/src/VBox/Frontends/VirtualBox/nls/VirtualBox_eu.ts b/src/VBox/Frontends/VirtualBox/nls/VirtualBox_eu.ts
index 9908a40..7a486f4 100644
--- a/src/VBox/Frontends/VirtualBox/nls/VirtualBox_eu.ts
+++ b/src/VBox/Frontends/VirtualBox/nls/VirtualBox_eu.ts
@@ -2003,12 +2003,12 @@
 <context>
     <name>UIDnDHandler</name>
     <message>
-        <location filename="../src/runtime/UIDnDHandler.cpp" line="+175"/>
+        <location filename="../src/runtime/UIDnDHandler.cpp" line="+220"/>
         <source>Dropping data ...</source>
         <translation>Datuak erortzen...</translation>
     </message>
     <message>
-        <location line="+283"/>
+        <location line="+310"/>
         <source>Retrieving data ...</source>
         <translation type="unfinished"></translation>
     </message>
@@ -10409,7 +10409,7 @@
 <context>
     <name>UIWizardNewVM</name>
     <message>
-        <location filename="../src/wizards/newvm/UIWizardNewVM.cpp" line="+291"/>
+        <location filename="../src/wizards/newvm/UIWizardNewVM.cpp" line="+293"/>
         <source>Create Virtual Machine</source>
         <translation>Sortu Makina Birtuala</translation>
     </message>
diff --git a/src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts b/src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts
index e29e1aa..80000a0 100644
--- a/src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts
+++ b/src/VBox/Frontends/VirtualBox/nls/VirtualBox_hu.ts
@@ -67,7 +67,7 @@
     <name>BootItemsTable</name>
     <message>
         <source>Defines the boot device order. Use the checkboxes on the left to enable or disable individual boot devices. Move items up and down to change the device order.</source>
-        <translation type="obsolete">Meghatározza a bootsorrendet. Használja ezt az opciót a boot eszközök engedélyezésére/tiltására. Mozgassa fel vagy le az elemeket a pontos sorrendhez.</translation>
+        <translation type="obsolete">Meghatározza a boot-sorrendet. Használja ezt az opciót a boot eszközök engedélyezésére/tiltására. Mozgassa fel vagy le az elemeket a pontos sorrendhez.</translation>
     </message>
 </context>
 <context>
@@ -105,7 +105,7 @@
     </message>
     <message>
         <source>Please try reinstalling VirtualBox.</source>
-        <translation>Talán újra kellene telepítened a VirtualBox-ot.</translation>
+        <translation>Talán újra kellene telepítened a VirtualBoxot.</translation>
     </message>
     <message>
         <source>This error means that the kernel driver was either not able to allocate enough memory or that some mapping operation failed.<br/><br/>There are known problems with Linux 2.6.29. If you are running such a kernel, please edit /usr/src/vboxdrv-*/Makefile and enable <i>VBOX_USE_INSERT_PAGE = 1</i>. After that, re-compile the kernel module by executing<br/><br/>  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br [...]
@@ -137,11 +137,11 @@
     </message>
     <message>
         <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Please try completely uninstalling and reinstalling VirtualBox.</source>
-        <translation>A VirtualBox kernel modul verziója nem megfelelő ehhez a VirtualBox-hoz. Valószínű, hogy a telepítés nem sikerült, és a program vagy a kernelmodul eltávolítása és újratelepítése segíthet.</translation>
+        <translation>A VirtualBox kernel modul verziója nem megfelelő ehhez a VirtualBoxhoz. Valószínű, hogy a telepítés nem sikerült, és a program vagy a kernelmodul eltávolítása és újratelepítése segíthet.</translation>
     </message>
     <message>
         <source>The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing<br/><br/>  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br/><br/>may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.</source>
-        <translation>A VirtualBox kernel modul nem megfelelő a VirtualBox-hoz. Valószínű, hogy a telepítés nem volt sikeres, de a <br/><br/>  <font color=blue>/etc/init.d/vboxdrv setup</font><br/><br/>parancs lefuttatása segíthet. Figyelj arra, hogy a VirtualBox OSE és a PUEL verziója nem kompatibilis egymással.</translation>
+        <translation>A VirtualBox kernel modul nem megfelelő a VirtualBoxhoz. Valószínű, hogy a telepítés nem volt sikeres, de a <br/><br/>  <font color=blue>/etc/init.d/vboxdrv setup</font><br/><br/>parancs lefuttatása segíthet. Figyelj arra, hogy a VirtualBox OSE és a PUEL verziója nem kompatibilis egymással.</translation>
     </message>
     <message>
         <source>This error means that the kernel driver was either not able to allocate enough memory or that some mapping operation failed.</source>
@@ -150,7 +150,7 @@
     </message>
     <message>
         <source>The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing<br/><br/>  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br/><br/>as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necess [...]
-        <translation>A VirtualBox Linuxos eszközmeghajtója nem tölthető be, vagy jogosultságprobléma van a /dev/vboxdrv eszközfájllal. Kérlek, telepítsd újra a kernel modult a<br/><br/>  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br/><br/>parancs rendszergazdaként történő végrehajtásával. Lehet,  hogy ehhez előbb telepítened kell a megfelelő DKMS csomagot, ha ez elérhető a disztribúciódhoz. Ez a csomag figyeli a Linux kenel változása [...]
+        <translation>A VirtualBox Linuxos eszközmeghajtója nem tölthető be, vagy jogosultságprobléma van a /dev/vboxdrv eszközfájllal. Kérlek, telepítsd újra a kernel modult a<br/><br/>  <font color=blue>'/etc/init.d/vboxdrv setup'</font><br/><br/>parancs rendszergazdaként történő végrehajtásával. Lehet,  hogy ehhez előbb telepítened kell a megfelelő DKMS csomagot, ha ez elérhető a disztribúciódhoz. Ez a csomag figyeli a Linux kernel változás [...]
     </message>
 </context>
 <context>
@@ -297,7 +297,7 @@
     </message>
     <message>
         <source>Seam&less Mode</source>
-        <translation type="unfinished">Aszta&l-integráció</translation>
+        <translation>Aszta&l-integráció</translation>
     </message>
     <message>
         <source>Switch to seamless desktop integration mode</source>
@@ -528,7 +528,7 @@
     </message>
     <message>
         <source>Disable automatic resize of the guest display when the window is resized</source>
-        <translation type="obsolete">Letiltja a vendég gép képernyőjének automatikus méretezesét az ablakának méretezésekor</translation>
+        <translation type="obsolete">Letiltja a vendég gép képernyőjének automatikus méretezését az ablakának méretezésekor</translation>
     </message>
     <message>
         <source>&Enable Remote Display</source>
@@ -680,7 +680,7 @@
     </message>
     <message>
         <source>Import an appliance into VirtualBox</source>
-        <translation>Gép importálása a VirtualBox-ba</translation>
+        <translation>Gép importálása a VirtualBoxba</translation>
     </message>
     <message>
         <source>&Export Appliance...</source>
@@ -688,7 +688,7 @@
     </message>
     <message>
         <source>Export one or more VirtualBox virtual machines as an appliance</source>
-        <translation>Egy vagy több virtuális gép exportálása a VirtualBox-ból</translation>
+        <translation>Egy vagy több virtuális gép exportálása a VirtualBoxból</translation>
     </message>
     <message>
         <source>&Preferences...</source>
@@ -853,11 +853,11 @@
     </message>
     <message>
         <source>Sort the items of the selected virtual machine group alphabetically</source>
-        <translation type="obsolete">A kiválasztott virtuális gép csoport elemeinek betűrentdbe rendezése</translation>
+        <translation type="obsolete">A kiválasztott virtuális gép csoport elemeinek betűrendbe rendezése</translation>
     </message>
     <message>
         <source>Remove the selected virtual machines</source>
-        <translation type="obsolete">A kiválasztott viruális gépek eltávolítása</translation>
+        <translation type="obsolete">A kiválasztott virtuális gépek eltávolítása</translation>
     </message>
     <message>
         <source>Start the selected virtual machines</source>
@@ -913,7 +913,7 @@
     </message>
     <message>
         <source>Power off the selected virtual machines</source>
-        <translation type="obsolete">A kiválasztott viruális gépek kikapcsolása</translation>
+        <translation type="obsolete">A kiválasztott virtuális gépek kikapcsolása</translation>
     </message>
     <message>
         <source>&New Machine...</source>
@@ -957,7 +957,7 @@
     </message>
     <message>
         <source>Power off the virtual machine</source>
-        <translation>A viruális gép kikapcsolása</translation>
+        <translation>A virtuális gép kikapcsolása</translation>
     </message>
     <message>
         <source>&Network Settings...</source>
@@ -1020,446 +1020,446 @@
     </message>
     <message>
         <source>&VirtualBox</source>
-        <translation type="unfinished"></translation>
+        <translation>&VirtualBox</translation>
     </message>
     <message>
         <source>&File</source>
-        <translation type="unfinished">&Fájl</translation>
+        <translation>&Fájl</translation>
     </message>
     <message>
         <source>&Window</source>
-        <translation type="unfinished"></translation>
+        <translation>&Ablak</translation>
     </message>
     <message>
         <source>&Minimize</source>
-        <translation type="unfinished"></translation>
+        <translation>Kis &méretre</translation>
     </message>
     <message>
         <source>Minimize active window</source>
-        <translation type="unfinished"></translation>
+        <translation>Aktív gépablakot kis méretre állítja</translation>
     </message>
     <message>
         <source>Display the Network Operations Manager window</source>
-        <translation type="unfinished"></translation>
+        <translation>Megjeleníti a Hálózati műveletek kezelőt</translation>
     </message>
     <message>
         <source>Display a window with product information</source>
-        <translation type="unfinished"></translation>
+        <translation>Egy ablak a termékinformációkkal</translation>
     </message>
     <message>
         <source>&Preferences...</source>
         <comment>global preferences window</comment>
-        <translation type="unfinished">&Beállítások...</translation>
+        <translation>&Beállítások...</translation>
     </message>
     <message>
         <source>Display the global preferences window</source>
-        <translation type="unfinished"></translation>
+        <translation>Megjeleníti a globális beállításokat</translation>
     </message>
     <message>
         <source>Display the virtual machine settings window</source>
-        <translation type="unfinished"></translation>
+        <translation>Megjeleníti a virtuális gép beállításait</translation>
     </message>
     <message>
         <source>Display the virtual machine session information window</source>
-        <translation type="unfinished"></translation>
+        <translation>Megjeleníti a virtuális gép munkamenet információit</translation>
     </message>
     <message>
         <source>&Save State</source>
-        <translation type="unfinished"></translation>
+        <translation>Állapot menté&se</translation>
     </message>
     <message>
         <source>Save the state of the virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép állapotának mentése</translation>
     </message>
     <message>
         <source>Send the ACPI Shutdown signal to the virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>ACPI leállítási parancs küldése a virtuális gépnek</translation>
     </message>
     <message>
         <source>&Full-screen Mode</source>
-        <translation type="unfinished"></translation>
+        <translation>&Teljes képernyős mód</translation>
     </message>
     <message>
         <source>Switch between normal and full-screen mode</source>
-        <translation type="unfinished"></translation>
+        <translation>Váltás a normál és teljes képernyős mód között</translation>
     </message>
     <message>
         <source>S&caled Mode</source>
-        <translation type="unfinished"></translation>
+        <translation>&Méretezett</translation>
     </message>
     <message>
         <source>&Minimize Window</source>
-        <translation type="unfinished"></translation>
+        <translation>Ablak kis &méretre</translation>
     </message>
     <message>
         <source>Automatically resize the guest display when the window is resized</source>
-        <translation type="unfinished"></translation>
+        <translation>Automatikusan átméretezi a vendég gép képernyőjét, ha az ablak mérete változik</translation>
     </message>
     <message>
         <source>Take guest display screenshot</source>
-        <translation type="unfinished"></translation>
+        <translation>Képernyőmentés a vendég képernyőjéről</translation>
     </message>
     <message>
         <source>Display virtual machine settings window to configure video capture</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép beállításai a videórögzítés módosításához</translation>
     </message>
     <message>
         <source>Enable guest display video capture</source>
-        <translation type="unfinished"></translation>
+        <translation>Vendég képernyőjének videórögzítése</translation>
     </message>
     <message>
         <source>Allow remote desktop (RDP) connections to this machine</source>
-        <translation type="unfinished"></translation>
+        <translation>Távoli asztal (RDP) csatlakozás kapcsoló ehhez a géphez</translation>
     </message>
     <message>
         <source>&Menu Bar</source>
-        <translation type="unfinished"></translation>
+        <translation>&Menü sor</translation>
     </message>
     <message>
         <source>&Menu Bar Settings...</source>
-        <translation type="unfinished"></translation>
+        <translation>&Menü sor beállítások...</translation>
     </message>
     <message>
         <source>Display window to configure menu-bar</source>
-        <translation type="unfinished"></translation>
+        <translation>Megnyitja a menü sor beállítási lehetőségeit</translation>
     </message>
     <message>
         <source>Show Menu &Bar</source>
-        <translation type="unfinished"></translation>
+        <translation>&Menü sor mutatása</translation>
     </message>
     <message>
         <source>Enable menu-bar</source>
-        <translation type="unfinished"></translation>
+        <translation>Menü sor bekapcsolása</translation>
     </message>
     <message>
         <source>&Status Bar</source>
-        <translation type="unfinished"></translation>
+        <translation>Állapot&sor</translation>
     </message>
     <message>
         <source>&Status Bar Settings...</source>
-        <translation type="unfinished"></translation>
+        <translation>Állapot&sor beállítások...</translation>
     </message>
     <message>
         <source>Display window to configure status-bar</source>
-        <translation type="unfinished"></translation>
+        <translation>Megnyitja az állapotsor beállítási lehetőségeit</translation>
     </message>
     <message>
         <source>Show Status &Bar</source>
-        <translation type="unfinished"></translation>
+        <translation>Á&llapotsor mutatása</translation>
     </message>
     <message>
         <source>Enable status-bar</source>
-        <translation type="unfinished"></translation>
+        <translation>Állapotsor bekapcsolása</translation>
     </message>
     <message>
         <source>S&cale Factor</source>
-        <translation type="unfinished"></translation>
+        <translation>&Méretezési faktor</translation>
     </message>
     <message>
         <source>&Input</source>
-        <translation type="unfinished"></translation>
+        <translation>Bev&itel</translation>
     </message>
     <message>
         <source>&Keyboard</source>
-        <translation type="unfinished">&Billentyűzet</translation>
+        <translation>&Billentyűzet</translation>
     </message>
     <message>
         <source>&Keyboard Settings...</source>
-        <translation type="unfinished"></translation>
+        <translation>&Billentyűzet beállítások...</translation>
     </message>
     <message>
         <source>Display global preferences window to configure keyboard shortcuts</source>
-        <translation type="unfinished"></translation>
+        <translation>Globális beállítások a gyorsbillentyűk módosításához</translation>
     </message>
     <message>
         <source>&Insert %1</source>
         <comment>that means send the %1 key sequence to the virtual machine</comment>
-        <translation type="unfinished"></translation>
+        <translation>%1 &küldése</translation>
     </message>
     <message>
         <source>Send the %1 sequence to the virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>Egy %1 kérést küld a virtuális gépnek</translation>
     </message>
     <message>
         <source>&Mouse</source>
-        <translation type="unfinished"></translation>
+        <translation>&Egér</translation>
     </message>
     <message>
         <source>&Mouse Integration</source>
-        <translation type="unfinished"></translation>
+        <translation>&Egér-integráció</translation>
     </message>
     <message>
         <source>Enable host mouse pointer integration</source>
-        <translation type="unfinished"></translation>
+        <translation>Gazda egér integrációjának engedélyezése</translation>
     </message>
     <message>
         <source>&Hard Disks</source>
-        <translation type="unfinished">&Merevlemezek</translation>
+        <translation>&Merevlemezek</translation>
     </message>
     <message>
         <source>&Hard Disk Settings...</source>
-        <translation type="unfinished"></translation>
+        <translation>&Merevlemez beállítások...</translation>
     </message>
     <message>
         <source>Display virtual machine settings window to configure hard disks</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép beállításai a merevlemezek módosításához</translation>
     </message>
     <message>
         <source>&Optical Drives</source>
-        <translation type="unfinished"></translation>
+        <translation>&Optikai meghajtók</translation>
     </message>
     <message>
         <source>&Floppy Drives</source>
-        <translation type="unfinished"></translation>
+        <translation>&Floppy meghajtók</translation>
     </message>
     <message>
         <source>&Network</source>
-        <translation type="unfinished"></translation>
+        <translation>&Hálózat</translation>
     </message>
     <message>
         <source>Display virtual machine settings window to configure network adapters</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép beállításai a hálózati adapterek módosításához</translation>
     </message>
     <message>
         <source>&USB</source>
-        <translation type="unfinished"></translation>
+        <translation>&USB</translation>
     </message>
     <message>
         <source>&USB Settings...</source>
-        <translation type="unfinished"></translation>
+        <translation>&USB beállítások...</translation>
     </message>
     <message>
         <source>Display virtual machine settings window to configure USB devices</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép beállításai az USB eszközök módosításához</translation>
     </message>
     <message>
         <source>&Drag and Drop</source>
-        <translation type="unfinished"></translation>
+        <translation>Fog&d és vidd</translation>
     </message>
     <message>
         <source>&Shared Folders</source>
-        <translation type="unfinished"></translation>
+        <translation>Mego&sztott mappák</translation>
     </message>
     <message>
         <source>Display virtual machine settings window to configure shared folders</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép beállításai a megosztott mappák módosításához</translation>
     </message>
     <message>
         <source>Insert the Guest Additions disk file into the virtual optical drive</source>
-        <translation type="unfinished"></translation>
+        <translation>Az Integrációs szolgáltatások behelyezése a virtuális optikai meghajtóba</translation>
     </message>
     <message>
         <source>&Logging</source>
         <comment>debug action</comment>
-        <translation type="unfinished"></translation>
+        <translation>Nap&lózás</translation>
     </message>
     <message>
         <source>Show &Log...</source>
         <comment>debug action</comment>
-        <translation type="unfinished">Nap&ló mutatása...</translation>
+        <translation>Nap&ló mutatása...</translation>
     </message>
     <message>
         <source>%1%</source>
         <comment>scale-factor</comment>
-        <translation type="unfinished">%1%</translation>
+        <translation>%1%</translation>
     </message>
     <message>
         <source>Enable</source>
         <comment>Virtual Screen</comment>
-        <translation type="unfinished">Engedélyez</translation>
+        <translation>Engedélyez</translation>
     </message>
     <message>
         <source>Resize to %1x%2</source>
         <comment>Virtual Screen</comment>
-        <translation type="unfinished"></translation>
+        <translation>Átméretezés: %1x%2</translation>
     </message>
     <message>
         <source>Preview Monitor %1</source>
-        <translation type="unfinished">Monitor-előnézet: %1</translation>
+        <translation>Monitor-előnézet: %1</translation>
     </message>
     <message>
         <source>&Connect Network Adapter</source>
-        <translation type="unfinished"></translation>
+        <translation>Hálózati adapter &csatlakoztatása</translation>
     </message>
     <message>
         <source>Connect Network Adapter &%1</source>
-        <translation type="unfinished"></translation>
+        <translation>&%1 hálózati adapter csatlakoztatása</translation>
     </message>
     <message>
         <source>No USB Devices Connected</source>
-        <translation type="unfinished">Nincs USB eszköz csatlakoztatva</translation>
+        <translation>Nincs USB eszköz csatlakoztatva</translation>
     </message>
     <message>
         <source>No supported devices connected to the host PC</source>
-        <translation type="unfinished">Nincs támogatott eszköz a gazda PC-hez csatlakoztatva</translation>
+        <translation>Nincs támogatott eszköz a gazda PC-hez csatlakoztatva</translation>
     </message>
     <message>
         <source>No Webcams Connected</source>
-        <translation type="unfinished">Nincs webkamera csatlakoztatva</translation>
+        <translation>Nincs webkamera csatlakoztatva</translation>
     </message>
     <message>
         <source>No supported webcams connected to the host PC</source>
-        <translation type="unfinished">Nincs támogatott webkamera a gazda PC-hez csatlakoztatva</translation>
+        <translation>Nincs támogatott webkamera a gazda PC-hez csatlakoztatva</translation>
     </message>
     <message>
         <source>E&xtra Data Manager...</source>
-        <translation type="unfinished"></translation>
+        <translation>E&xtra adatkezelő...</translation>
     </message>
     <message>
         <source>Display the Extra Data Manager window</source>
-        <translation type="unfinished"></translation>
+        <translation>Extra adatkezelő ablak megjelenítése</translation>
     </message>
     <message>
         <source>Create new virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>Új virtuális gép készítése</translation>
     </message>
     <message>
         <source>Add existing virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>Létező virtuális gép hozzáadása</translation>
     </message>
     <message>
         <source>Rename selected virtual machine group</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gép csoport átnevezése</translation>
     </message>
     <message>
         <source>&Ungroup</source>
-        <translation type="unfinished"></translation>
+        <translation>&Csoportosítatlan</translation>
     </message>
     <message>
         <source>Ungroup items of selected virtual machine group</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gép csoportosítatlan elemei</translation>
     </message>
     <message>
         <source>&Sort</source>
-        <translation type="unfinished"></translation>
+        <translation>Rendezé&s</translation>
     </message>
     <message>
         <source>Sort items of selected virtual machine group alphabetically</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gép csoport elemeinek betűrendbe rendezése</translation>
     </message>
     <message>
         <source>Add new group based on selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>Új csoport hozzáadása a kiválasztott virtuális gépek alapján</translation>
     </message>
     <message>
         <source>Clone selected virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gép klónozása</translation>
     </message>
     <message>
         <source>Remove selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gépek eltávolítása</translation>
     </message>
     <message>
         <source>Start selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gép elindítása</translation>
     </message>
     <message>
         <source>Switch to the windows of selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gépek ablakaira váltás</translation>
     </message>
     <message>
         <source>&Normal Start</source>
-        <translation type="unfinished"></translation>
+        <translation>&Normál indítás</translation>
     </message>
     <message>
         <source>&Headless Start</source>
-        <translation type="unfinished"></translation>
+        <translation>&Ablaktalan indítás</translation>
     </message>
     <message>
         <source>Start selected virtual machines in the background</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gépek indítása a háttérben</translation>
     </message>
     <message>
         <source>&Detachable Start</source>
-        <translation type="unfinished"></translation>
+        <translation>&Leválasztható indítás</translation>
     </message>
     <message>
         <source>Start selected virtual machines with option of continuing in background</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gépek indítása, hogy a háttérben is futhatnak tovább</translation>
     </message>
     <message>
         <source>Suspend execution of selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gépek futásának felfüggesztése</translation>
     </message>
     <message>
         <source>Reset selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gépek visszaállítása</translation>
     </message>
     <message>
         <source>D&iscard Saved State...</source>
-        <translation type="unfinished"></translation>
+        <translation>&Mentett állapot eldobása...</translation>
     </message>
     <message>
         <source>Discard saved state of selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation> A kiválasztott virtuális gép mentett állapotának eldobása</translation>
     </message>
     <message>
         <source>Show log files of selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott gép naplófájljainak mutatása</translation>
     </message>
     <message>
         <source>Re&fresh</source>
-        <translation type="unfinished"></translation>
+        <translation>&Frissítés</translation>
     </message>
     <message>
         <source>Refresh accessibility state of selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>Frissíti az állapotinformációkat a kiválasztott virtuális gépen</translation>
     </message>
     <message>
         <source>S&how in Finder</source>
-        <translation type="unfinished"></translation>
+        <translation>&Megjelenítés a keresőben</translation>
     </message>
     <message>
         <source>Show the VirtualBox Machine Definition files in Finder</source>
-        <translation type="unfinished"></translation>
+        <translation>A VirtualBox gép definíciós fájljának megjelenítése a keresőben</translation>
     </message>
     <message>
         <source>S&how in Explorer</source>
-        <translation type="unfinished"></translation>
+        <translation>&Megjelenítés az Intézőben</translation>
     </message>
     <message>
         <source>Show the VirtualBox Machine Definition files in Explorer</source>
-        <translation type="unfinished"></translation>
+        <translation>A VirtualBox gép definíciós fájljának megjelenítése az Intézőben</translation>
     </message>
     <message>
         <source>S&how in File Manager</source>
-        <translation type="unfinished"></translation>
+        <translation>&Megjelenítés a fájlkezelőben</translation>
     </message>
     <message>
         <source>Show the VirtualBox Machine Definition files in the File Manager</source>
-        <translation type="unfinished"></translation>
+        <translation>A VirtualBox gép definíciós fájljának megjelenítése a fájlkezelőben</translation>
     </message>
     <message>
         <source>Cr&eate Alias on Desktop</source>
-        <translation type="unfinished"></translation>
+        <translation>Alias létr&ehozása az asztalon</translation>
     </message>
     <message>
         <source>Create alias files to the VirtualBox Machine Definition files on your desktop</source>
-        <translation type="unfinished"></translation>
+        <translation>Létrehoz egy Alias-t az asztalon a VirtualBox gép definíciós fájljához</translation>
     </message>
     <message>
         <source>Cr&eate Shortcut on Desktop</source>
-        <translation type="unfinished"></translation>
+        <translation>Parancsikon létr&ehozása az asztalon</translation>
     </message>
     <message>
         <source>Create shortcut files to the VirtualBox Machine Definition files on your desktop</source>
-        <translation type="unfinished"></translation>
+        <translation>Létrehoz egy parancsikont az asztalon a VirtualBox gép definíciós fájljához</translation>
     </message>
     <message>
         <source>Sort group of first selected virtual machine alphabetically</source>
-        <translation type="unfinished"></translation>
+        <translation>Az elsőnek kiválasztott gép csoportjának betűrendbe rendezése</translation>
     </message>
     <message>
         <source>Save state of selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gép állapotának mentése</translation>
     </message>
     <message>
         <source>Send ACPI Shutdown signal to selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>ACPI leállítási parancs küldése a virtuális gépnek</translation>
     </message>
     <message>
         <source>Power off selected virtual machines</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gépek kikapcsolása</translation>
     </message>
 </context>
 <context>
@@ -1467,34 +1467,34 @@
     <message>
         <source>Status</source>
         <comment>password table field</comment>
-        <translation type="unfinished"></translation>
+        <translation>Státusz</translation>
     </message>
     <message>
         <source>ID</source>
         <comment>password table field</comment>
-        <translation type="unfinished"></translation>
+        <translation>Azonosító</translation>
     </message>
     <message>
         <source>Password</source>
         <comment>password table field</comment>
-        <translation type="unfinished"></translation>
+        <translation>Jelszó</translation>
     </message>
     <message numerus="yes">
         <source><nobr>Used by the following %n hard disk(s):</nobr><br>%1</source>
         <comment>This text is never used with n == 0. Feel free to drop the %n where possible, we only included it because of problems with Qt Linguist (but the user can see how many hard drives are in the tool-tip and doesn't need to be told).</comment>
-        <translation type="unfinished">
-            <numerusform></numerusform>
+        <translation>
+            <numerusform><nobr>A következő merevlemez használja::</nobr><br>%1</numerusform>
         </translation>
     </message>
     <message>
         <source>%1 - Disk Encryption</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 - Lemeztitkosítás</translation>
     </message>
     <message numerus="yes">
         <source>This virtual machine is password protected. Please enter the %n encryption password(s) below.</source>
         <comment>This text is never used with n == 0. Feel free to drop the %n where possible, we only included it because of problems with Qt Linguist (but the user can see how many passwords are in the list and doesn't need to be told).</comment>
-        <translation type="unfinished">
-            <numerusform></numerusform>
+        <translation>
+            <numerusform>A virtuális gép jelszóval védett. Kérlek, add meg lentebb a titkosítási jelszót.</numerusform>
         </translation>
     </message>
 </context>
@@ -1628,19 +1628,19 @@
     </message>
     <message>
         <source>Storage Controller (IDE)</source>
-        <translation type="unfinished"></translation>
+        <translation>Tárolási vezérlő (IDE)</translation>
     </message>
     <message>
         <source>Storage Controller (SATA)</source>
-        <translation type="unfinished"></translation>
+        <translation>Tárolási vezérlő (SATA)</translation>
     </message>
     <message>
         <source>Storage Controller (SCSI)</source>
-        <translation type="unfinished"></translation>
+        <translation>Tárolási vezérlő (SCSI)</translation>
     </message>
     <message>
         <source>Storage Controller (SAS)</source>
-        <translation type="unfinished"></translation>
+        <translation>Tárolási vezérlő (SAS)</translation>
     </message>
 </context>
 <context>
@@ -1733,7 +1733,7 @@
     </message>
     <message>
         <source>If you select <b>All states</b>, the current machine state and all snapshots are cloned.</source>
-        <translation type="obsolete">Ha a <b>Minden állapot</b>ot választod, az aktuális virtuális gép és minden piialantkép klónozva lesz.</translation>
+        <translation type="obsolete">Ha a <b>Minden állapot</b>ot választod, az aktuális virtuális gép és minden pillanatkép klónozva lesz.</translation>
     </message>
     <message>
         <source>Full Clone</source>
@@ -1784,7 +1784,7 @@
     </message>
     <message>
         <source>If you select <b>All states</b>, the current machine state and all snapshots are cloned.</source>
-        <translation type="obsolete">Ha a <b>Minden állapot</b>ot választod, az aktuális virtuális gép és minden piialantkép klónozva lesz.</translation>
+        <translation type="obsolete">Ha a <b>Minden állapot</b>ot választod, az aktuális virtuális gép és minden pillanatkép klónozva lesz.</translation>
     </message>
 </context>
 <context>
@@ -2338,7 +2338,7 @@
     </message>
     <message>
         <source>Retrieving data ...</source>
-        <translation type="unfinished"></translation>
+        <translation>Adatgyűjtés...</translation>
     </message>
 </context>
 <context>
@@ -2597,7 +2597,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>This wizard will guide you through the process of exporting an appliance.</p><p>%1</p><p>Please select the virtual machines that should be added to the appliance. You can select more than one. Please note that these machines have to be turned off before they can be exported.</p></source>
-        <translation type="obsolete"><p>Ez a varázsló végig fog vezetni a virtuális gép exportálás folyamatán.</p><p>%1</p><p>Válaszd ki azt a virtuális gépet, melyet hozzá szeretnél adni a mostanihoz. Egynél többetis kijelölhetsz. Ne feledd, hogy ezeknek a gépeknek kikapcsolva kell lenniük az exportálás megkezdése előtt.</p></translation>
+        <translation type="obsolete"><p>Ez a varázsló végig fog vezetni a virtuális gép exportálás folyamatán.</p><p>%1</p><p>Válaszd ki azt a virtuális gépet, melyet hozzá szeretnél adni a mostanihoz. Egynél többet is kijelölhetsz. Ne feledd, hogy ezeknek a gépeknek kikapcsolva kell lenniük az exportálás megkezdése előtt.</p></translation>
     </message>
 </context>
 <context>
@@ -2933,7 +2933,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>If the above is correct, press the <b>Finish</b> button. Once you press it, the selected media will be temporarily mounted on the virtual machine and the machine will start execution.</p><p>Please note that when you close the virtual machine, the specified media will be automatically unmounted and the boot device will be set back to the first hard disk.</p><p>Depending on the type of the setup program, you may need to manually  [...]
-        <translation type="obsolete"><p>Ha a fentiek megfelelőek, nyomd meg a <b>Befejezés</b> gombot. Ha megnyomtad, a kiválasztott média ideiglenesen felcsatolódik a virtuális gépre és a gép el fogja indítani.</p><p>Ne feledd, hogy mikor bezárod a virtuális gépet, a megadott média automatikusan le fog választódni és az első merevlemezről fog indulni a gép.</p><p>A telepítőprogram típusától függgően, talán neked kell kézzel leválasztani (kiadni) [...]
+        <translation type="obsolete"><p>Ha a fentiek megfelelőek, nyomd meg a <b>Befejezés</b> gombot. Ha megnyomtad, a kiválasztott média ideiglenesen felcsatolódik a virtuális gépre és a gép el fogja indítani.</p><p>Ne feledd, hogy mikor bezárod a virtuális gépet, a megadott média automatikusan le fog választódni és az első merevlemezről fog indulni a gép.</p><p>A telepítőprogram típusától függően, talán neked kell kézzel leválasztani (kiadni)  [...]
     </message>
     <message>
         <source>Start</source>
@@ -2986,7 +2986,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>If the above is correct, press the <b>Finish</b> button. Once you press it, the selected media will be temporarily mounted on the virtual machine and the machine will start execution.</p><p>Please note that when you close the virtual machine, the specified media will be automatically unmounted and the boot device will be set back to the first hard disk.</p><p>Depending on the type of the setup program, you may need to manually  [...]
-        <translation type="obsolete"><p>Ha a fentiek megfelelőek, nyomd meg a <b>Befejezés</b> gombot. Ha megnyomtad, a kiválasztott média ideiglenesen felcsatolódik a virtuális gépre és a gép el fogja indítani.</p><p>Ne feledd, hogy mikor bezárod a virtuális gépet, a megadott média automatikusan le fog választódni és az első merevlemezről fog indulni a gép.</p><p>A telepítőprogram típusától függgően, talán neked kell kézzel leválasztani (kiadni) [...]
+        <translation type="obsolete"><p>Ha a fentiek megfelelőek, nyomd meg a <b>Befejezés</b> gombot. Ha megnyomtad, a kiválasztott média ideiglenesen felcsatolódik a virtuális gépre és a gép el fogja indítani.</p><p>Ne feledd, hogy mikor bezárod a virtuális gépet, a megadott média automatikusan le fog választódni és az első merevlemezről fog indulni a gép.</p><p>A telepítőprogram típusától függően, talán neked kell kézzel leválasztani (kiadni)  [...]
     </message>
     <message>
         <source><p>If the above is correct, press the <b>Finish</b> button. Once you press it, the selected media will be mounted on the virtual machine and the machine will start execution.</p></source>
@@ -3352,107 +3352,107 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps</source>
-        <translation>Méret: %1x%2, frissitési ráta: %3fps, bitráta: %4kbps</translation>
+        <translation>Méret: %1x%2, frissítési ráta: %3fps, bitráta: %4kbps</translation>
     </message>
     <message>
         <source>Minimal Paravirtualization</source>
         <comment>details (system)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Minimális paravirtualizáció</translation>
     </message>
     <message>
         <source>Hyper-V Paravirtualization</source>
         <comment>details (system)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Hyper-V paravirtualizáció</translation>
     </message>
     <message>
         <source>KVM Paravirtualization</source>
         <comment>details (system)</comment>
-        <translation type="unfinished"></translation>
+        <translation>KVM paravirtualizáció</translation>
     </message>
     <message>
         <source>Scale-factor</source>
         <comment>details (display)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Képméretezési faktor</translation>
     </message>
     <message>
         <source>Unscaled HiDPI Video Output</source>
         <comment>details (display)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Méretezés nélküli HiDPI videókimenet</translation>
     </message>
     <message>
         <source>Enabled</source>
         <comment>details (display/Unscaled HiDPI Video Output)</comment>
-        <translation type="unfinished">Engedélyezve</translation>
+        <translation>Engedélyezve</translation>
     </message>
     <message>
         <source>[Optical Drive]</source>
         <comment>details (storage)</comment>
-        <translation type="unfinished"></translation>
+        <translation>[Optikai meghajtó]</translation>
     </message>
     <message>
         <source>Generic Driver, '%1' { %2 }</source>
         <comment>details (network)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Általános meghajtó, '%1' { %2 }</translation>
     </message>
     <message>
         <source>USB Controller</source>
         <comment>details (usb)</comment>
-        <translation type="unfinished">USB vezérlő</translation>
+        <translation>USB vezérlő</translation>
     </message>
     <message>
         <source>Menu-bar</source>
         <comment>details (user interface)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Menü sor</translation>
     </message>
     <message>
         <source>Enabled</source>
         <comment>details (user interface/menu-bar)</comment>
-        <translation type="unfinished">Engedélyezve</translation>
+        <translation>Engedélyezve</translation>
     </message>
     <message>
         <source>Disabled</source>
         <comment>details (user interface/menu-bar)</comment>
-        <translation type="unfinished">Letiltva</translation>
+        <translation>Letiltva</translation>
     </message>
     <message>
         <source>Status-bar</source>
         <comment>details (user interface)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Állapotsor</translation>
     </message>
     <message>
         <source>Enabled</source>
         <comment>details (user interface/status-bar)</comment>
-        <translation type="unfinished">Engedélyezve</translation>
+        <translation>Engedélyezve</translation>
     </message>
     <message>
         <source>Disabled</source>
         <comment>details (user interface/status-bar)</comment>
-        <translation type="unfinished">Letiltva</translation>
+        <translation>Letiltva</translation>
     </message>
     <message>
         <source>Mini-toolbar Position</source>
         <comment>details (user interface)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Mini eszköztár pozíció</translation>
     </message>
     <message>
         <source>Top</source>
         <comment>details (user interface/mini-toolbar position)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Fent</translation>
     </message>
     <message>
         <source>Bottom</source>
         <comment>details (user interface/mini-toolbar position)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Lent</translation>
     </message>
     <message>
         <source>Mini-toolbar</source>
         <comment>details (user interface)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Mini eszköztár</translation>
     </message>
     <message>
         <source>Disabled</source>
         <comment>details (user interface/mini-toolbar)</comment>
-        <translation type="unfinished">Letiltva</translation>
+        <translation>Letiltva</translation>
     </message>
 </context>
 <context>
@@ -3707,7 +3707,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Suggest a reasonable maximum screen size to the guest. The guest will only see this suggestion when guest additions are installed.</source>
-        <translation>Javaslat, egy ésszerű maximális képernyőméret használatához. A vendég csak ezt a javaslatot fogja látni, mikor az intergációs szolgáltatás telepítve van.</translation>
+        <translation>Javaslat, egy ésszerű maximális képernyőméret használatához. A vendég csak ezt a javaslatot fogja látni, mikor az integrációs szolgáltatás telepítve van.</translation>
     </message>
     <message>
         <source>None</source>
@@ -3725,27 +3725,27 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Suggest a maximum screen size to the guest. The guest will only see this suggestion when guest additions are installed.</source>
-        <translation>Javaslat, a vendég maximális képernyőméretére. A vendég csak ezt a javaslatot fogja látni, mikor az intergációs szolgáltatás telepítve van.</translation>
+        <translation>Javaslat, a vendég maximális képernyőméretére. A vendég csak ezt a javaslatot fogja látni, mikor az integrációs szolgáltatás telepítve van.</translation>
     </message>
     <message>
         <source>Machine Windows:</source>
-        <translation type="unfinished"></translation>
+        <translation>Gép ablakai:</translation>
     </message>
     <message>
         <source>&Raise Window Under Mouse</source>
-        <translation type="unfinished"></translation>
+        <translation>Ablak kiemelése az egé&r alatt</translation>
     </message>
     <message>
         <source>Holds the maximum width which we would like the guest to use.</source>
-        <translation type="unfinished"></translation>
+        <translation>A maximális szélesség, melyet a vendég használhat.</translation>
     </message>
     <message>
         <source>Holds the maximum height which we would like the guest to use.</source>
-        <translation type="unfinished"></translation>
+        <translation>A maximális magasság, melyet a vendég használhat.</translation>
     </message>
     <message>
         <source>When checked, machine windows will be raised when the mouse pointer moves over them.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a gép ablakai kiemelkednek, mikor föléjük viszed az egeret.</translation>
     </message>
 </context>
 <context>
@@ -3796,19 +3796,19 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Add Package</source>
-        <translation type="unfinished"></translation>
+        <translation>Csomag hozzáadása</translation>
     </message>
     <message>
         <source>Remove Package</source>
-        <translation type="unfinished"></translation>
+        <translation>Csomag eltávolítása</translation>
     </message>
     <message>
         <source>Adds new package.</source>
-        <translation type="unfinished"></translation>
+        <translation>Hozzáad egy új csomagot.</translation>
     </message>
     <message>
         <source>Removes selected package.</source>
-        <translation type="unfinished"></translation>
+        <translation>Eltávolítja a kiválasztott csomagot.</translation>
     </message>
 </context>
 <context>
@@ -3823,7 +3823,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Holds the path to the library that provides authentication for Remote Display (VRDP) clients.</source>
-        <translation>Az azonosítási könyvtár elérési útját mutatja, ami a VRDP klienseket autentikálja. </translation>
+        <translation>Az azonosítási könyvtár elérési útját mutatja, ami a VRDP klienseket hitelesítése. </translation>
     </message>
     <message>
         <source>Default &Hard Disk Folder:</source>
@@ -3835,7 +3835,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>V&RDP Authentication Library:</source>
-        <translation>V&RDP azonosítási könyvtár:</translation>
+        <translation>V&RDP hitelesítési könyvtár:</translation>
     </message>
     <message>
         <source>Holds the path to the default hard disk folder. This folder is used, if not explicitly specified otherwise, when adding existing or creating new virtual hard disks.</source>
@@ -3891,7 +3891,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>When checked, the host screensaver will be disabled whenever a virtual machine is running.</source>
-        <translation>Ha engedélyezed, a gazda képernyővédője ki lesz kapcsolva, mikoregy virtuális gép fut.</translation>
+        <translation>Ha engedélyezed, a gazda képernyővédője ki lesz kapcsolva, mikor egy virtuális gép fut.</translation>
     </message>
     <message>
         <source>Disable When Running Virtual Machines</source>
@@ -3899,11 +3899,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Host Screensaver:</source>
-        <translation type="unfinished"></translation>
+        <translation>Gazda képernyővédő:</translation>
     </message>
     <message>
         <source>&Disable When Running Virtual Machines</source>
-        <translation type="unfinished"></translation>
+        <translation>&Letiltva, ha virtuális gép fut</translation>
     </message>
 </context>
 <context>
@@ -3966,11 +3966,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Lists all available shortcuts which can be configured.</source>
-        <translation type="unfinished"></translation>
+        <translation>Elérhető gyorsbillentyűk listája.</translation>
     </message>
     <message>
         <source>Holds a sequence to filter the shortcut list.</source>
-        <translation type="unfinished"></translation>
+        <translation>A gyorsbillentyűk szűrési feltételei.</translation>
     </message>
 </context>
 <context>
@@ -4311,51 +4311,51 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Add NAT Network</source>
-        <translation type="unfinished"></translation>
+        <translation>NAT hálózat hozzáadása</translation>
     </message>
     <message>
         <source>Remove NAT Network</source>
-        <translation type="unfinished"></translation>
+        <translation>NAT hálózat eltávolítása</translation>
     </message>
     <message>
         <source>Edit NAT Network</source>
-        <translation type="unfinished"></translation>
+        <translation>NAT hálózat szerkesztése</translation>
     </message>
     <message>
         <source>Adds new NAT network.</source>
-        <translation type="unfinished"></translation>
+        <translation>Hozzáad egy új NAT hálózatot.</translation>
     </message>
     <message>
         <source>Removes selected NAT network.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott NAT hálózat eltávolítása.</translation>
     </message>
     <message>
         <source>Edits selected NAT network.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott NAT hálózat szerkesztése.</translation>
     </message>
     <message>
         <source>Add Host-only Network</source>
-        <translation type="unfinished"></translation>
+        <translation>Host-only hálózat hozzáadása</translation>
     </message>
     <message>
         <source>Remove Host-only Network</source>
-        <translation type="unfinished"></translation>
+        <translation>Host-only hálózat eltávolítása</translation>
     </message>
     <message>
         <source>Edit Host-only Network</source>
-        <translation type="unfinished"></translation>
+        <translation>Host-only hálózat szerkesztése</translation>
     </message>
     <message>
         <source>Adds new host-only network.</source>
-        <translation type="unfinished"></translation>
+        <translation>Új host-only hálózat hozzáadása.</translation>
     </message>
     <message>
         <source>Removes selected host-only network.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott host-only hálózat eltávolítása.</translation>
     </message>
     <message>
         <source>Edits selected host-only network.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott host-only hálózat szerkesztése.</translation>
     </message>
 </context>
 <context>
@@ -4549,11 +4549,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>When checked, manual configuration will be used for this network adapter.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, ennél a hálózati kártyánál a manuális beállítások lesznek használva.</translation>
     </message>
     <message>
         <source>When checked, the DHCP Server will be enabled for this network on machine start-up.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a DHCP szerver be lesz kapcsolva ezen a hálózaton a gép indulásakor.</translation>
     </message>
 </context>
 <context>
@@ -4588,7 +4588,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Network Options:</source>
-        <translation>Hálózati beállításak:</translation>
+        <translation>Hálózati beállítások:</translation>
     </message>
     <message>
         <source>Supports &DHCP</source>
@@ -4624,23 +4624,23 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>When checked, this network will be enabled.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, ez a hálózat be lesz kapcsolva.</translation>
     </message>
     <message>
         <source>When checked, this network will support DHCP.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, ez a hálózat támogatni fogja a DHCP-t.</translation>
     </message>
     <message>
         <source>When checked, this network will support IPv6.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, ez a hálózat támogatni fogja az IPv6-ot.</translation>
     </message>
     <message>
         <source>When checked, this network will be advertised as the default IPv6 route.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, ez a hálózat lesz kinevezve alapértelmezett IPv6 útvonalnak.</translation>
     </message>
     <message>
         <source>Displays a window to configure port forwarding rules.</source>
-        <translation type="unfinished"></translation>
+        <translation>Megjeleníti a port továbbítási szabályokat.</translation>
     </message>
 </context>
 <context>
@@ -4718,11 +4718,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Holds the proxy host.</source>
-        <translation type="unfinished"></translation>
+        <translation>A proxy gazda.</translation>
     </message>
     <message>
         <source>Holds the proxy port.</source>
-        <translation type="unfinished"></translation>
+        <translation>A proxy port.</translation>
     </message>
 </context>
 <context>
@@ -4777,7 +4777,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Selects how often the new version check should be performed. Note that if you want to completely disable this check, just clear the above check box.</source>
-        <translation type="unfinished"></translation>
+        <translation>Megadhatod, hogy a VirtualBox milyen sűrűn keressen frissítéseket. Ha szeretnéd teljesen kikapcsolni, csak vedd ki a jelölőnégyzet pipáját.</translation>
     </message>
 </context>
 <context>
@@ -5286,25 +5286,25 @@ p, li { white-space: pre-wrap; }
     <message>
         <source><p style='white-space:pre'><nobr>Indicates the activity of the hard disks:</nobr>%1</p></source>
         <comment>HDD tooltip</comment>
-        <translation type="unfinished"></translation>
+        <translation><p style='white-space:pre'><nobr>A merevlemez aktivitását jelzi:</nobr>%1</p></translation>
     </message>
     <message>
         <source><p style='white-space:pre'><nobr>Indicates the activity of the optical drives:</nobr>%1</p></source>
         <comment>CD tooltip</comment>
-        <translation type="unfinished"></translation>
+        <translation><p style='white-space:pre'><nobr>Az optikai meghajtók aktivitását jelzi:</nobr>%1</p></translation>
     </message>
     <message>
         <source><p style='white-space:pre'><nobr>Indicates the activity of the floppy drives:</nobr>%1</p></source>
         <comment>FD tooltip</comment>
-        <translation type="unfinished"></translation>
+        <translation><p style='white-space:pre'><nobr>A floppy meghajtók aktivitását jelzi:</nobr>%1</p></translation>
     </message>
     <message>
         <source><p style='white-space:pre'><nobr>Indicates the activity of the display:</nobr>%1</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p style='white-space:pre'><nobr>A képernyő aktivitását jelzi:</nobr>%1</p></translation>
     </message>
     <message>
         <source>Indicates whether the host keyboard is captured by the guest OS:<br><nobr><img src=:/hostkey_16px.png/>&nbsp;&nbsp;keyboard is not captured</nobr><br><nobr><img src=:/hostkey_captured_16px.png/>&nbsp;&nbsp;keyboard is captured</nobr></source>
-        <translation type="unfinished"></translation>
+        <translation>Jelzi, hogy a vendég gép elfogta-e a gazda billentyűzetét:<br><nobr><img src=:/hostkey_16px.png/>&nbsp;&nbsp;billentyűzet nincs elfogva</nobr><br><nobr><img src=:/hostkey_captured_16px.png/>&nbsp;&nbsp;billentyűzet elfogva</nobr></translation>
     </message>
 </context>
 <context>
@@ -5401,7 +5401,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Controls the audio output driver. The <b>Null Audio Driver</b> makes the guest see an audio card, however every access to it will be ignored.</source>
-        <translation type="obsolete">Az audio kimenet driver beállítása. A <b>Null Audio Driver</b> hatására a virtuális gép látni fogja a hangkártyát, de nem szólal meg a gazda gépen.</translation>
+        <translation type="obsolete">Az audió kimenet driver beállítása. A <b>Null Audio Driver</b> hatására a virtuális gép látni fogja a hangkártyát, de nem szólal meg a gazda gépen.</translation>
     </message>
     <message>
         <source>Audio &Controller:</source>
@@ -5413,7 +5413,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Selects the audio output driver. The <b>Null Audio Driver</b> makes the guest see an audio card, however every access to it will be ignored.</source>
-        <translation type="unfinished"></translation>
+        <translation>Az audió kimenet driver beállítása. A <b>Null Audio Driver</b> hatására a virtuális gép látni fogja a hangkártyát, de nem szólal meg a gazda gépen.</translation>
     </message>
 </context>
 <context>
@@ -5476,23 +5476,23 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Authentication &Method:</source>
-        <translation>Autentikációs &metódus:</translation>
+        <translation>Hitelesítési &metódus:</translation>
     </message>
     <message>
         <source>Defines the VRDP authentication method.</source>
-        <translation type="obsolete">A VRDP autentikációs metódus.</translation>
+        <translation type="obsolete">A VRDP hitelesítési metódus.</translation>
     </message>
     <message>
         <source>Authentication &Timeout:</source>
-        <translation>Autentikációs &időkorlát:</translation>
+        <translation>Hitelesítési &időkorlát:</translation>
     </message>
     <message>
         <source>Specifies the timeout for guest authentication, in milliseconds.</source>
-        <translation type="obsolete">Időkorlát a vendég autentikálásához, ezredmásodpercben.</translation>
+        <translation type="obsolete">Időkorlát a vendég hitelesítéséhez, ezredmásodpercben.</translation>
     </message>
     <message>
         <source>you have assigned less than <b>%1</b> of video memory which is the minimum amount required for HD Video to be played efficiently.</source>
-        <translation type="obsolete">kevesebb, mint <b>%1</b> videómemóriát rendeltél a géphez, pedig ez a minimum, ami a nagyfelbontású videók lejátszásához kell.</translation>
+        <translation type="obsolete">kevesebb, mint <b>%1</b> videómemóriát rendeltél a géphez, pedig ez a minimum, ami a nagy felbontású videók lejátszásához kell.</translation>
     </message>
     <message>
         <source>When checked, the virtual machine will be given access to the Video Acceleration capabilities available on the host.</source>
@@ -5613,11 +5613,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>The virtual machine is currently assigned less than <b>%1</b> of video memory which is the minimum amount required for High Definition Video to be played efficiently.</source>
-        <translation>A virtuális gépen kevesebb, mint <b>%1</b> videómemóriát adtál meg, pedig ez a minimum, ami a nagyfelbontású videók lejátszásához szükséges.</translation>
+        <translation>A virtuális gépen kevesebb, mint <b>%1</b> videómemóriát adtál meg, pedig ez a minimum, ami a nagy felbontású videók lejátszásához szükséges.</translation>
     </message>
     <message>
         <source>The virtual machine is set up to use hardware graphics acceleration and the operating system hint is set to Windows Vista or later. For best performance you should set the machine's video memory to at least b>%1</b>.</source>
-        <translation type="obsolete">A virtuális gép a gardveres gafikus gyorsító használatása, és az operációs rendszer Windows Vistára vagy újabbra van állítva. A legjobb teljesítmény érdekében, a videómemória ajánlott minimuma: <b>%1</b>.</translation>
+        <translation type="obsolete">A virtuális gép a hardveres grafikus gyorsító használatára, és az operációs rendszer Windows Vistára vagy újabbra van állítva. A legjobb teljesítmény érdekében, a videómemória ajánlott minimuma: <b>%1</b>.</translation>
     </message>
     <message>
         <source>The virtual machine is set up to use Video Stream Acceleration. As this feature only works with Windows guest systems it will be disabled.</source>
@@ -5672,107 +5672,107 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>&Screen</source>
-        <translation type="unfinished"></translation>
+        <translation>&Képernyők</translation>
     </message>
     <message>
         <source>Scale Factor:</source>
-        <translation type="unfinished"></translation>
+        <translation>Képméretezési faktor:</translation>
     </message>
     <message>
         <source>Controls the guest screen scale factor.</source>
-        <translation type="unfinished"></translation>
+        <translation>A vendég képméretezési faktorát állítja be.</translation>
     </message>
     <message>
         <source>%</source>
-        <translation type="unfinished"></translation>
+        <translation>%</translation>
     </message>
     <message>
         <source>HiDPI Support:</source>
-        <translation type="unfinished"></translation>
+        <translation>HiDPI támogatás:</translation>
     </message>
     <message>
         <source>When checked, guest screen contents will not be scaled up to compensate for high host screen resolutions.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a vendég képernyője nem lesz felskálázva a nagy gazda felbontás kompenzálásához.</translation>
     </message>
     <message>
         <source>Use &Unscaled HiDPI Output</source>
-        <translation type="unfinished"></translation>
+        <translation>&Méretezés nélküli HiDPI kimenet használata</translation>
     </message>
     <message>
         <source>Acceleration:</source>
-        <translation type="unfinished"></translation>
+        <translation>Gyorsítás:</translation>
     </message>
     <message>
         <source>Holds the VRDP Server port number. You may specify <tt>0</tt> (zero), to select port 3389, the standard port for RDP.</source>
-        <translation type="unfinished"></translation>
+        <translation>A VRDP szerver portszáma. <tt>0</tt> (nulla) megadásával a szabványos 3389-es RDP port lép érvénybe.</translation>
     </message>
     <message>
         <source>Selects the VRDP authentication method.</source>
-        <translation type="unfinished"></translation>
+        <translation>A VRDP hitelesítési metódus.</translation>
     </message>
     <message>
         <source>Holds the timeout for guest authentication, in milliseconds.</source>
-        <translation type="unfinished"></translation>
+        <translation>Időkorlát a vendég hitelesítéshez, ezredmásodpercben.</translation>
     </message>
     <message>
         <source>When checked, multiple simultaneous connections to the VM are permitted.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, több egyidejű kapcsolatot engedélyez a virtuális géphez.</translation>
     </message>
     <message>
         <source>Holds the filename VirtualBox uses to save the recorded content.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ez a beállítás határozza meg a rögzített tartalom mentési fájlnevét.</translation>
     </message>
     <message>
         <source>Selects the resolution (frame size) of the recorded video.</source>
-        <translation type="unfinished"></translation>
+        <translation>A rögzített videó felbontása (keretméret).</translation>
     </message>
     <message>
         <source>Holds the <b>horizontal</b> resolution (frame width) of the recorded video.</source>
-        <translation type="unfinished"></translation>
+        <translation>A rögzített videó <b>vízszintes</b> felbontása.</translation>
     </message>
     <message>
         <source>Holds the <b>vertical</b> resolution (frame height) of the recorded video.</source>
-        <translation type="unfinished"></translation>
+        <translation>A rögzített videó <b>függőleges</b> felbontása.</translation>
     </message>
     <message>
         <source>Controls the maximum number of <b>frames per second</b>. Additional frames will be skipped. Reducing this value will increase the number of skipped frames and reduce the file size.</source>
-        <translation type="unfinished"></translation>
+        <translation>A <b>percenkénti képkockák</b> maximális száma. A további képkockák ki lesznek hagyva. Ezen érték csökkentése növeli a kihagyott képkockák számát és csökkenti a fájlméretet.</translation>
     </message>
     <message>
         <source>Controls the <b>quality</b>. Increasing this value will make the video look better at the cost of an increased file size.</source>
-        <translation type="unfinished"></translation>
+        <translation>A <b>képminőséget</b> határozza meg. Ezen érték növelése javítja a videó minőségét, és megnő a fájlméret.</translation>
     </message>
     <message>
         <source>Holds the bitrate in <b>kilobits per second</b>. Increasing this value will make the video look better at the cost of an increased file size.</source>
-        <translation type="unfinished"></translation>
+        <translation>A <b>másodpercenkénti kilobitek</b> száma. Ezen érték növelése javítja a képminőséget, és megnő a fájlméret.</translation>
     </message>
     <message>
         <source>The virtual machine is currently assigned less than <b>%1</b> of video memory which is the minimum amount required to switch to full-screen or seamless mode.</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális géphez jelenleg kevesebb, mint <b>%1</b> videomemória van társítva, mely a minimális érték, ami a teljes képernyős- vagy asztal-integrációs módhoz szükséges.</translation>
     </message>
     <message>
         <source>The virtual machine is set up to use hardware graphics acceleration and the operating system hint is set to Windows Vista or later. For best performance you should set the machine's video memory to at least <b>%1</b>.</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép készen áll a hardveres grafikus gyorsítás használatára, amihez Windows Vista vagy újabb szükséges. A legjobb teljesítményhez legalább <b>%1</b> videomemória használata ajánlott.</translation>
     </message>
     <message>
         <source>Remote Display is currently enabled for this virtual machine. However, this requires the <i>%1</i> to be installed. Please install the Extension Pack from the VirtualBox download site as otherwise your VM will be started with Remote Display disabled.</source>
-        <translation type="unfinished"></translation>
+        <translation>A távoli képernyő jelenleg engedélyezett a virtuális gépen. Azonban telepített <i>%1</i> szükséges hozzá. Töltsd le a Kiterjesztő csomagot a VirtualBox oldaláról, vagy a távoli képernyő ki lesz kapcsolva.</translation>
     </message>
     <message>
         <source>%1 MB</source>
-        <translation type="unfinished">%1 MB</translation>
+        <translation>%1 MB</translation>
     </message>
     <message>
         <source>%1%</source>
-        <translation type="unfinished">%1%</translation>
+        <translation>%1%</translation>
     </message>
     <message>
         <source><i>About %1MB per 5 minute video</i></source>
-        <translation type="unfinished"></translation>
+        <translation><i>5 perc videó kb. %1MB</i></translation>
     </message>
     <message>
         <source>When checked, enables video recording for screen %1.</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 képernyő videórögzítése.</translation>
     </message>
 </context>
 <context>
@@ -5835,7 +5835,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Defines the boot device order. Use the checkboxes on the left to enable or disable individual boot devices. Move items up and down to change the device order.</source>
-        <translation type="obsolete">Meghatározza a bootsorrendet. A pipadobozok segítségével lehetőség nyílik a boot eszközök engedélyezésére/tiltására, illetve az elemek fel-le mozgatásával a bootolási sorrend meghatározására.</translation>
+        <translation type="obsolete">Meghatározza a boot-sorrendet. A pipadobozok segítségével lehetőség nyílik a boot eszközök engedélyezésére/tiltására, illetve az elemek fel-le mozgatásával a bootolási sorrend meghatározására.</translation>
     </message>
     <message>
         <source>Move Up (Ctrl-Up)</source>
@@ -6008,7 +6008,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>No name specified for the virtual machine.</source>
-        <translation>Nincs megadva név a vituális géphez.</translation>
+        <translation>Nincs megadva név a virtuális géphez.</translation>
     </message>
     <message>
         <source>The virtual machine operating system hint is set to a 64-bit type. 64-bit guest systems require hardware virtualization, so this will be enabled automatically if you confirm the changes.</source>
@@ -6016,111 +6016,111 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Basi&c</source>
-        <translation type="unfinished"></translation>
+        <translation>&Alap</translation>
     </message>
     <message>
         <source>A&dvanced</source>
-        <translation type="unfinished">H&aladó</translation>
+        <translation>H&aladó</translation>
     </message>
     <message>
         <source>D&rag'n'Drop:</source>
-        <translation type="unfinished"></translation>
+        <translation>Fog&d és vidd:</translation>
     </message>
     <message>
         <source>D&escription</source>
-        <translation type="unfinished">L&eírás</translation>
+        <translation>L&eírás</translation>
     </message>
     <message>
         <source>Enc&ryption</source>
-        <translation type="unfinished"></translation>
+        <translation>&Titkosítás</translation>
     </message>
     <message>
         <source>When checked, enables encryption for this virtual machine.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, bekapcsolod a virtuális gép titkosítását.</translation>
     </message>
     <message>
         <source>En&able Encryption</source>
-        <translation type="unfinished"></translation>
+        <translation>&Titkosítás engedélyezése</translation>
     </message>
     <message>
         <source>Encryption C&ipher:</source>
-        <translation type="unfinished"></translation>
+        <translation>T&itkosítási mód:</translation>
     </message>
     <message>
         <source>Selects the cipher to be used for encrypting the virtual machine disks.</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép merevlemezeinek titkosításához használt titkosítási eljárás.</translation>
     </message>
     <message>
         <source>E&nter New Password:</source>
-        <translation type="unfinished"></translation>
+        <translation>Ú&j jelszó megadása:</translation>
     </message>
     <message>
         <source>Holds the password to be assigned to the virtual machine.</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális géphez társított jelszó.</translation>
     </message>
     <message>
         <source>C&onfirm New Password:</source>
-        <translation type="unfinished"></translation>
+        <translation>Új j&elszó megerősítése:</translation>
     </message>
     <message>
         <source>Confirms the password to be assigned to the virtual machine.</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális géphez társított jelszó megerősítése.</translation>
     </message>
     <message>
         <source>You are trying to encrypt this virtual machine. However, this requires the <i>%1</i> to be installed. Please install the Extension Pack from the VirtualBox download site.</source>
-        <translation type="unfinished"></translation>
+        <translation>Titkosítani próbálod a virtuális gépet. Azonban ehhez telepített <i>%1</i> szükséges. Telepítsd fel a Kiterjesztő csomagot a VirtualBox oldaláról.</translation>
     </message>
     <message>
         <source>Encryption cipher type not specified.</source>
-        <translation type="unfinished"></translation>
+        <translation>A titkosítási típus nincs megadva.</translation>
     </message>
     <message>
         <source>Encryption password empty.</source>
-        <translation type="unfinished"></translation>
+        <translation>A titkosítási jelszó üres.</translation>
     </message>
     <message>
         <source>Encryption passwords do not match.</source>
-        <translation type="unfinished"></translation>
+        <translation>A titkosítási jelszavak nem egyeznek.</translation>
     </message>
     <message>
         <source>Holds the path where snapshots of this virtual machine will be stored. Be aware that snapshots can take quite a lot of storage space.</source>
-        <translation type="unfinished"></translation>
+        <translation>A gépről készített pillanatképek útvonala. A pillanatképek egy picit sok helyet foglalnak el.</translation>
     </message>
     <message>
         <source>Leave Unchanged</source>
         <comment>cipher type</comment>
-        <translation type="unfinished"></translation>
+        <translation>Változatlanul hagy</translation>
     </message>
 </context>
 <context>
     <name>UIMachineSettingsInterface</name>
     <message>
         <source>Allows to modify VM menu-bar contents.</source>
-        <translation type="unfinished"></translation>
+        <translation>Lehetővé teszi a VM menüsor tartalmának módosítását.</translation>
     </message>
     <message>
         <source>Mini ToolBar:</source>
-        <translation type="unfinished">Mini eszköztár:</translation>
+        <translation>Mini eszköztár:</translation>
     </message>
     <message>
         <source>When checked, show the Mini ToolBar in full-screen and seamless modes.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a Mini eszköztár meg fog jelenni teljes képernyős és asztal-integrációs módban.</translation>
     </message>
     <message>
         <source>Show in &Full-screen/Seamless</source>
-        <translation type="unfinished"></translation>
+        <translation>&Megjelenítés teljes képernyőn/asztal-integrációban</translation>
     </message>
     <message>
         <source>When checked, show the Mini ToolBar at the top of the screen, rather than in its default position at the bottom of the screen.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a mini eszköztár a képernyő tetején fog megjelenni, és nem pedig alul, az alapértelmezett helyén.</translation>
     </message>
     <message>
         <source>Show at &Top of Screen</source>
-        <translation type="unfinished">Legyen a képernyő &tetején</translation>
+        <translation>Legyen a képernyő &tetején</translation>
     </message>
     <message>
         <source>Allows to modify VM status-bar contents.</source>
-        <translation type="unfinished"></translation>
+        <translation>Lehetővé teszi a VM állapotsor tartalmának módosítását.</translation>
     </message>
 </context>
 <context>
@@ -6370,23 +6370,23 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Selects how this virtual adapter is attached to the real network of the Host OS.</source>
-        <translation type="unfinished"></translation>
+        <translation>Megadhatod, hogyan legyen a virtuális adapter a valódi hálózathoz csatlakoztatva.</translation>
     </message>
     <message>
         <source>Shows additional network adapter options.</source>
-        <translation type="unfinished"></translation>
+        <translation>További hálózati kártya beállítások.</translation>
     </message>
     <message>
         <source>Holds the configuration settings for the network attachment driver. The settings should be of the form <b>name=value</b> and will depend on the driver. Use <b>shift-enter</b> to add a new entry.</source>
-        <translation type="unfinished"></translation>
+        <translation>A hálózati driver konfigurációs beállításai. A beállításokat <b>név=érték</b> formátumban kell megadni és a drivertől fognak függni. Új bejegyzés hozzáadásához <b>shift-enter</b>.</translation>
     </message>
     <message>
         <source>When checked, the virtual network cable is plugged in.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a virtuális hálózati kábel be van dugva.</translation>
     </message>
     <message>
         <source>Displays a window to configure port forwarding rules.</source>
-        <translation type="unfinished"></translation>
+        <translation>Port továbbítási szabályok beállításai.</translation>
     </message>
 </context>
 <context>
@@ -6488,23 +6488,23 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>No IRQ is currently specified.</source>
-        <translation type="unfinished">Jelenleg nincs IRQ megadva.</translation>
+        <translation>Jelenleg nincs IRQ megadva.</translation>
     </message>
     <message>
         <source>No I/O port is currently specified.</source>
-        <translation type="unfinished">Jelenleg nincs I/O port megadva.</translation>
+        <translation>Jelenleg nincs I/O port megadva.</translation>
     </message>
     <message>
         <source>Two or more ports have the same settings.</source>
-        <translation type="unfinished">Kettő vagy több portnak ugyanazok a beállításai.</translation>
+        <translation>Kettő vagy több portnak ugyanazok a beállításai.</translation>
     </message>
     <message>
         <source>No port path is currently specified.</source>
-        <translation type="unfinished">Jelenleg nincs port elérési út megadva.</translation>
+        <translation>Jelenleg nincs port elérési út megadva.</translation>
     </message>
     <message>
         <source>There are currently duplicate port paths specified.</source>
-        <translation type="unfinished">Jelenleg duplikált port elérési út van megadva.</translation>
+        <translation>Jelenleg duplikált port elérési út van megadva.</translation>
     </message>
 </context>
 <context>
@@ -6617,7 +6617,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Lists all shared folders accessible to this machine. Use 'net use x: \\vboxsvr\share' to access a shared folder named <i>share</i> from a DOS-like OS, or 'mount -t vboxsf share mount_point' to access it from a Linux OS. This feature requires Guest Additions.</source>
-        <translation>Minden a gép számára elérhető megosztott mappa listázása. A 'net use x: \\vboxsvr\share' parancs segítségével használható a <i>share</i> nevű megosztás a DOS-szerű OS-ekból, a 'mount -t vboxsf share mount_point' paranccsal pedig Linux-alapú OS-ekből. Az integrációs szolgáltatások telepítése szükséges hozzá.</translation>
+        <translation>Minden a gép számára elérhető megosztott mappa listázása. A 'net use x: \\vboxsvr\share' parancs segítségével használható a <i>share</i> nevű megosztás a DOS-szerű OS-ekből, a 'mount -t vboxsf share mount_point' paranccsal pedig Linux-alapú OS-ekből. Az integrációs szolgáltatások telepítése szükséges hozzá.</translation>
     </message>
     <message>
         <source>Name</source>
@@ -6661,27 +6661,27 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Add Shared Folder</source>
-        <translation type="unfinished"></translation>
+        <translation>Megosztott mappa hozzáadása</translation>
     </message>
     <message>
         <source>Edit Shared Folder</source>
-        <translation type="unfinished"></translation>
+        <translation>Megosztott mappa szerkesztése</translation>
     </message>
     <message>
         <source>Remove Shared Folder</source>
-        <translation type="unfinished"></translation>
+        <translation>Megosztott mappa eltávolítása</translation>
     </message>
     <message>
         <source>Adds new shared folder.</source>
-        <translation type="unfinished"></translation>
+        <translation>Új megosztott mappa hozzáadása.</translation>
     </message>
     <message>
         <source>Edits selected shared folder.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott megosztott mappa szerkesztése.</translation>
     </message>
     <message>
         <source>Removes selected shared folder.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott megosztott mappa törlése.</translation>
     </message>
 </context>
 <context>
@@ -6740,7 +6740,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>When checked, this shared folder will be permanent.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, ez a megosztott mappa végleges lesz.</translation>
     </message>
 </context>
 <context>
@@ -6820,43 +6820,43 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Selects the working mode of this serial port. If you select <b>Disconnected</b>, the guest OS will detect the serial port but will not be able to operate it.</source>
-        <translation type="unfinished"></translation>
+        <translation>A soros port működési módja. Ha a <b>Lekapcsolva</b> módot választod, a vendég rendszer érzékeli majd a soros portot, de használni nem fogja tudni.</translation>
     </message>
     <message>
         <source>When checked, the virtual machine will assume that the pipe or socket specified in the <b>Path/Address</b> field exists and try to use it. Otherwise, the pipe or socket will be created by the virtual machine when it starts.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a virtuális gép feltételezni fogja, hogy az <b>Elérési út/Cím</b> mezőben levő cső vagy socket létezik, és megpróbálja használni. Egyéb esetben a virtuális gép hozza létre induláskor a csövet vagy socketet.</translation>
     </message>
     <message>
         <source>&Connect to existing pipe/socket</source>
-        <translation type="unfinished"></translation>
+        <translation>Létező &csőhöz/sockethez csatlakozás</translation>
     </message>
     <message>
         <source>&Path/Address:</source>
-        <translation type="unfinished"></translation>
+        <translation>&Elérési út/Cím:</translation>
     </message>
     <message>
         <source><p>In <b>Host Pipe</b> mode: Holds the path to the serial port's pipe on the host. Examples: "\\.\pipe\myvbox" or "/tmp/myvbox", for Windows and UNIX-like systems respectively.</p><p>In <b>Host Device</b> mode: Holds the host serial device name. Examples: "COM1" or "/dev/ttyS0".</p><p>In <b>Raw File</b> mode: Holds the file-path on the host system, where the seri [...]
-        <translation type="unfinished"></translation>
+        <translation><p><b>Gazda cső</b> módban: A soros port csövének elérési útja a gazda gépen. Például: "\\.\pipe\myvbox" vagy "/tmp/myvbox",Windows és UNIX jellegű rendszereken.</p><p><b>Gazda eszköz</b>módban: A gazda soros eszköz neve. Például: "COM1" vagy "/dev/ttyS0".</p><p><b>Raw fájl</b> móban: A fájl elérési útja a gazda rendszeren, ahova a soros port kimenete lesz mentve [...]
     </message>
     <message>
         <source>No IRQ is currently specified.</source>
-        <translation type="unfinished">Jelenleg nincs IRQ megadva.</translation>
+        <translation>Jelenleg nincs IRQ megadva.</translation>
     </message>
     <message>
         <source>No I/O port is currently specified.</source>
-        <translation type="unfinished">Jelenleg nincs I/O port megadva.</translation>
+        <translation>Jelenleg nincs I/O port megadva.</translation>
     </message>
     <message>
         <source>Two or more ports have the same settings.</source>
-        <translation type="unfinished">Kettő vagy több portnak ugyanazok a beállításai.</translation>
+        <translation>Kettő vagy több portnak ugyanazok a beállításai.</translation>
     </message>
     <message>
         <source>No port path is currently specified.</source>
-        <translation type="unfinished">Jelenleg nincs port elérési út megadva.</translation>
+        <translation>Jelenleg nincs port elérési út megadva.</translation>
     </message>
     <message>
         <source>There are currently duplicate port paths specified.</source>
-        <translation type="unfinished">Jelenleg duplikált port elérési út van megadva.</translation>
+        <translation>Jelenleg duplikált port elérési út van megadva.</translation>
     </message>
 </context>
 <context>
@@ -7128,7 +7128,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Selects the virtual disk image or the host drive used by this attachment.</source>
-        <translation type="obsolete">Válaszd ki a használandó virtális lemezképet vagy gazda meghajtót.</translation>
+        <translation type="obsolete">Válaszd ki a használandó virtuális lemezképet vagy gazda meghajtót.</translation>
     </message>
     <message>
         <source>Opens the Virtual Media Manager to select a virtual image for this attachment.</source>
@@ -7144,7 +7144,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>When checked, allows the guest to send ATAPI commands directly to the host-drive which makes it possible to use CD/DVD writers connected to the host inside the VM. Note that writing audio CD inside the VM is not yet supported.</source>
-        <translation>Ha ez kiválasztod, a vendég ATAPI parancsokat küldhet közvetlenül a gazda meghanjtónak, mely által a gazda géphez csatlakozó CD/DVD írókat a virtuális gépen belül is lehet használni. Megjegyzendő, hogy a virtuális gépen belül nem támogatott még az audió CD írása.</translation>
+        <translation>Ha ez kiválasztod, a vendég ATAPI parancsokat küldhet közvetlenül a gazda meghajtónak, mely által a gazda géphez csatlakozó CD/DVD írókat a virtuális gépen belül is lehet használni. Megjegyzendő, hogy a virtuális gépen belül nem támogatott még az audió CD írása.</translation>
     </message>
     <message>
         <source>&Passthrough</source>
@@ -7176,7 +7176,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Allows to use host I/O caching capabilities.</source>
-        <translation type="obsolete">Lehetővé teszi a gazda I/O cache képességeinek haszbnálatát.</translation>
+        <translation type="obsolete">Lehetővé teszi a gazda I/O cache képességeinek használatát.</translation>
     </message>
     <message>
         <source>Use Host I/O Cache</source>
@@ -7224,7 +7224,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Choose a virtual CD/DVD disk or a physical drive to use with the virtual drive. The virtual machine will see a disk inserted into the drive with the data in the file or on the disk in the physical drive as its contents.</source>
-        <translation type="obsolete">Válassz egy virtuális meghajtóként használandó virtuális CD/DVD lemezt vagy fizikai meghajtót. A virtuális gép létni fogja a meghajtóba vagy a fizikai meghajtóba helyezett lemez tartalmát.</translation>
+        <translation type="obsolete">Válassz egy virtuális meghajtóként használandó virtuális CD/DVD lemezt vagy fizikai meghajtót. A virtuális gép látni fogja a meghajtóba vagy a fizikai meghajtóba helyezett lemez tartalmát.</translation>
     </message>
     <message>
         <source>Set up the virtual CD/DVD drive</source>
@@ -7236,7 +7236,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Choose a virtual floppy disk or a physical drive to use with the virtual drive. The virtual machine will see a disk inserted into the drive with the data in the file or on the disk in the physical drive as its contents.</source>
-        <translation>Válassz egy virtuális meghajtóként használandó virtuális floppy lemezt vagy fizikai meghajtót. A virtuális gép létni fogja a meghajtóba vagy a fizikai meghajtóba helyezett lemez tartalmát.</translation>
+        <translation>Válassz egy virtuális meghajtóként használandó virtuális floppy lemezt vagy fizikai meghajtót. A virtuális gép látni fogja a meghajtóba vagy a fizikai meghajtóba helyezett lemez tartalmát.</translation>
     </message>
     <message>
         <source>Set up the virtual floppy drive</source>
@@ -7338,117 +7338,117 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Lists all storage controllers for this machine and the virtual images and host drives attached to them.</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gép minden tárolási vezérlőjének, illetve a géphez csatolt összes lemezképének, és gazdaeszközének listája.</translation>
     </message>
     <message>
         <source>Holds the name of the storage controller currently selected in the Storage Tree.</source>
-        <translation type="unfinished"></translation>
+        <translation>A tárolófán jelenleg kijelölt vezérlő neve.</translation>
     </message>
     <message>
         <source>When checked, allows to use host I/O caching capabilities.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a gazda I/O cache képességei használhatóak.</translation>
     </message>
     <message>
         <source>When checked, the virtual disk will not be removed when the guest system ejects it.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a virtuális lemez nem lesz eltávolítva, mikor a vendég rendszer kiadja azt.</translation>
     </message>
     <message>
         <source>When checked, the guest system will see the virtual disk as a solid-state device.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a vendég rendszer mozgó alkatrészek nélküli tárolóként (SSD) fogja látni a virtuális lemezt.</translation>
     </message>
     <message>
         <source>When checked, the guest system will see the virtual disk as a hot-pluggable device.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a vendég rendszer hot-plug eszközként fogja látni a virtuális lemezt.</translation>
     </message>
     <message>
         <source>&Hot-pluggable</source>
-        <translation type="unfinished"></translation>
+        <translation>&Hot-plug eszköz</translation>
     </message>
     <message>
         <source>Encrypted with key:</source>
-        <translation type="unfinished"></translation>
+        <translation>Kulccsal titkosítás:</translation>
     </message>
     <message>
         <source>Choose disk image...</source>
         <comment>This is used for hard disks, optical media and floppies</comment>
-        <translation type="unfinished"></translation>
+        <translation>Lemezkép választása...</translation>
     </message>
     <message>
         <source>Image</source>
         <comment>storage image</comment>
-        <translation type="unfinished">Képfájl</translation>
+        <translation>Képfájl</translation>
     </message>
     <message>
         <source><nobr>Expands/Collapses&nbsp;item.</nobr></source>
-        <translation type="unfinished"></translation>
+        <translation><nobr>Elem&nbsp;kibontása/becsukása.</nobr></translation>
     </message>
     <message>
         <source><nobr>Adds&nbsp;hard&nbsp;disk.</nobr></source>
-        <translation type="unfinished"></translation>
+        <translation><nobr>Merevlemez&nbsp;hozzáadása</nobr></translation>
     </message>
     <message>
         <source><nobr>Adds&nbsp;optical&nbsp;drive.</nobr></source>
-        <translation type="unfinished"></translation>
+        <translation><nobr>Optikai&nbsp;meghajtó&nbsp;hozzáadása</nobr></translation>
     </message>
     <message>
         <source><nobr>Adds&nbsp;floppy&nbsp;drive.</nobr></source>
-        <translation type="unfinished"></translation>
+        <translation><nobr>Floppy&nbsp;meghajtó&nbsp;hozzáadása</nobr></translation>
     </message>
     <message>
         <source>Add USB Controller</source>
-        <translation type="unfinished"></translation>
+        <translation>USB vezérlő hozzáadása</translation>
     </message>
     <message>
         <source>Add Optical Drive</source>
-        <translation type="unfinished"></translation>
+        <translation>Optikai meghajtók hozzáadása</translation>
     </message>
     <message>
         <source>Add Floppy Drive</source>
-        <translation type="unfinished"></translation>
+        <translation>Floppy meghajtó hozzáadása</translation>
     </message>
     <message>
         <source>Adds new storage controller.</source>
-        <translation type="unfinished"></translation>
+        <translation>Új tárolási vezérlő hozzáadása.</translation>
     </message>
     <message>
         <source>Removes selected storage controller.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott tárolási vezérlő törlése.</translation>
     </message>
     <message>
         <source>Adds new storage attachment.</source>
-        <translation type="unfinished"></translation>
+        <translation>Új tárolóeszköz hozzáadása.</translation>
     </message>
     <message>
         <source>Removes selected storage attachment.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott tárolóeszköz eltávolítása.</translation>
     </message>
     <message>
         <source>Optical &Drive:</source>
-        <translation type="unfinished"></translation>
+        <translation>&Optikai meghajtó:</translation>
     </message>
     <message>
         <source>Choose a virtual optical disk or a physical drive to use with the virtual drive. The virtual machine will see a disk inserted into the drive with the data in the file or on the disk in the physical drive as its contents.</source>
-        <translation type="unfinished"></translation>
+        <translation>Válassz egy virtuális meghajtóként használandó virtuális optikai lemezt vagy fizikai meghajtót. A virtuális gép látni fogja a meghajtóba vagy a fizikai meghajtóba helyezett lemez tartalmát.</translation>
     </message>
     <message>
         <source>Create New Hard Disk...</source>
-        <translation type="unfinished"></translation>
+        <translation>Új  merevlemez létrehozása...</translation>
     </message>
     <message>
         <source>Choose Virtual Hard Disk File...</source>
-        <translation type="unfinished"></translation>
+        <translation>Virtuális merevlemez választása...</translation>
     </message>
     <message>
         <source>Choose Virtual Optical Disk File...</source>
-        <translation type="unfinished"></translation>
+        <translation>Virtuális optikai lemez választása...</translation>
     </message>
     <message>
         <source>Remove Disk from Virtual Drive</source>
-        <translation type="unfinished"></translation>
+        <translation>Lemez eltávolítása a virtuális meghajtóból</translation>
     </message>
     <message>
         <source>Choose Virtual Floppy Disk File...</source>
-        <translation type="unfinished"></translation>
+        <translation>Virtuális floppy választása...</translation>
     </message>
 </context>
 <context>
@@ -7513,7 +7513,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Defines the boot device order. Use the checkboxes on the left to enable or disable individual boot devices. Move items up and down to change the device order.</source>
-        <translation>Meghatározza a bootsorrendet. Használd ezt az opciót a boot eszközök engedélyezésére/tiltására. Mozgasd fel vagy le az elemeket a pontos sorrendhez.</translation>
+        <translation>Meghatározza a boot-sorrendet. Használd ezt az opciót a boot eszközök engedélyezésére/tiltására. Mozgasd fel vagy le az elemeket a pontos sorrendhez.</translation>
     </message>
     <message>
         <source>Move Down (Ctrl-Down)</source>
@@ -7650,7 +7650,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>you have set the processor execution cap to a low value. This can make the machine feel slow to respond.</source>
-        <translation type="obsolete">a processzor végrehajtási csúcsát túl acsonyra állítottad. Ez lassíthatja a virtuális gépet.</translation>
+        <translation type="obsolete">a processzor végrehajtási csúcsát túl alacsonyra állítottad. Ez lassíthatja a virtuális gépet.</translation>
     </message>
     <message>
         <source>you have enabled a USB HID (Human Interface Device). This will not work unless USB emulation is also enabled. This will be done automatically when you accept the VM Settings by pressing the OK button.</source>
@@ -7692,11 +7692,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>The I/O APIC feature is not currently enabled in the Motherboard section of the System page. This is needed in order to support a chip set of type ICH9. It will be done automatically if you confirm your changes.</source>
-        <translation type="obsolete">Az I/O APIC szolgáltatás jelenleg nincs bekapcsolva a Rendszer lapon Alaplap részében. Szükség van rá az ICH9 lapkakészlet támogatásához. Automatikusan bekapcsolódik, ha eelfogadod a változtatásokat.</translation>
+        <translation type="obsolete">Az I/O APIC szolgáltatás jelenleg nincs bekapcsolva a Rendszer lapon Alaplap részében. Szükség van rá az ICH9 lapkakészlet támogatásához. Automatikusan bekapcsolódik, ha elfogadod a változtatásokat.</translation>
     </message>
     <message>
         <source>USB controller emulation is not currently enabled on the USB page. This is needed to support an emulated USB input device. It will be done automatically if you confirm your changes.</source>
-        <translation type="obsolete">Az USB vezérlő emulációja jelenleg nincs bekapcsolva az USB lapon. Az USB-s beviteli eszközök támogatásátához ban rá szükség. Automatikusan bekapcsolódik, ha eelfogadod a változtatásokat.</translation>
+        <translation type="obsolete">Az USB vezérlő emulációja jelenleg nincs bekapcsolva az USB lapon. Az USB-s beviteli eszközök támogatásához van rá szükség. Automatikusan bekapcsolódik, ha elfogadod a változtatásokat.</translation>
     </message>
     <message>
         <source>For performance reasons, the number of virtual CPUs attached to the virtual machine may not be more than twice the number of physical CPUs on the host (<b>%1</b>). Please reduce the number of virtual CPUs.</source>
@@ -7708,65 +7708,65 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>The I/O APIC feature is not currently enabled in the Motherboard section of the System page. This is needed in order to support more than one virtual processor. It will be done automatically if you confirm your changes.</source>
-        <translation type="obsolete">Az I/O APIC szolgáltatás jelenleg nincs bekapcsolva a Rendszer lapon Alaplap részében. Szükség van rá az egynél több virtuális processzor támogatásához. Automatikusan bekapcsolódik, ha eelfogadod a változtatásokat.</translation>
+        <translation type="obsolete">Az I/O APIC szolgáltatás jelenleg nincs bekapcsolva a Rendszer lapon Alaplap részében. Szükség van rá az egynél több virtuális processzor támogatásához. Automatikusan bekapcsolódik, ha elfogadod a változtatásokat.</translation>
     </message>
     <message>
         <source>Hardware virtualization is not currently enabled in the Acceleration section of the System page. This is needed in order to support more than one virtual processor. It will be done automatically if you confirm your changes.</source>
-        <translation type="obsolete">A hardveres virtualizáció jelenleg nincs bekapcsolva a Rendszer lap Gyorsítás részében. Szükség van rá az egynél több virtuális processzor támogatásához. Automatikusan bekapcsolódik, ha eelfogadod a változtatásokat.</translation>
+        <translation type="obsolete">A hardveres virtualizáció jelenleg nincs bekapcsolva a Rendszer lap Gyorsítás részében. Szükség van rá az egynél több virtuális processzor támogatásához. Automatikusan bekapcsolódik, ha elfogadod a változtatásokat.</translation>
     </message>
     <message>
         <source>The processor execution cap is set to a low value. This may make the machine feel slow to respond.</source>
-        <translation>A processzor végrehajtási csúcsát túl acsonyra állítottad. Ez lassíthatja a virtuális gép reakcióidejét.</translation>
+        <translation>A processzor végrehajtási csúcsát túl alacsonyra állítottad. Ez lassíthatja a virtuális gép reakcióidejét.</translation>
     </message>
     <message>
         <source>When checked, the RTC device will report the time in UTC, otherwise in local (host) time. Unix usually expects the hardware clock to be set to UTC.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, az RTC eszköz közli az UTC időt, egyéb esetben a helyi (gazda) idő lesz érvényben. Az Unix rendszer általában elvárja a hardveres idő UTC-re állítását.</translation>
     </message>
     <message>
         <source>%</source>
-        <translation type="unfinished"></translation>
+        <translation>%</translation>
     </message>
     <message>
         <source>&Paravirtualization Interface:</source>
-        <translation type="unfinished"></translation>
+        <translation>&Paravirtualizációs interfész:</translation>
     </message>
     <message>
         <source>Selects the paravirtualization guest interface provider to be used by this virtual machine.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ezen virtuális gép által használandó paravirtualizációs interfész szolgáltató.</translation>
     </message>
     <message>
         <source>The I/O APIC feature is not currently enabled in the Motherboard section of the System page. This is needed in order to support a chip set of type ICH9 you have enabled for this VM. It will be done automatically if you confirm your changes.</source>
-        <translation type="unfinished"></translation>
+        <translation>Az I/O APIC szolgáltatás jelenleg nincs bekapcsolva a Rendszer lapon Alaplap részében. Szükség van rá az ICH9 lapkakészlet támogatásához. Automatikusan bekapcsolódik, ha elfogadod a változtatásokat.</translation>
     </message>
     <message>
         <source>USB controller emulation is not currently enabled on the USB page. This is needed to support an emulated USB input device you have enabled for this VM. It will be done automatically if you confirm your changes.</source>
-        <translation type="unfinished"></translation>
+        <translation>Az USB vezérlő emulációja jelenleg nincs bekapcsolva az USB lapon. Az USB-s beviteli eszközök támogatásához van rá szükség. Automatikusan bekapcsolódik, ha elfogadod a változtatásokat.</translation>
     </message>
     <message>
         <source>The I/O APIC feature is not currently enabled in the Motherboard section of the System page. This is needed in order to support more than one virtual processor you have chosen for this VM. It will be done automatically if you confirm your changes.</source>
-        <translation type="unfinished"></translation>
+        <translation>Az I/O APIC szolgáltatás jelenleg nincs bekapcsolva a Rendszer lapon Alaplap részében. Szükség van rá az egynél több virtuális processzor támogatásához. Automatikusan bekapcsolódik, ha elfogadod a változtatásokat.</translation>
     </message>
     <message>
         <source>Hardware virtualization is not currently enabled in the Acceleration section of the System page. This is needed in order to support more than one virtual processor you have chosen for this VM. It will be done automatically if you confirm your changes.</source>
-        <translation type="unfinished"></translation>
+        <translation>A hardveres virtualizáció jelenleg nincs bekapcsolva a Rendszer lap Gyorsítás részében. Szükség van rá az egynél több virtuális processzor támogatásához. Automatikusan bekapcsolódik, ha elfogadod a változtatásokat.</translation>
     </message>
     <message>
         <source>%1 MB</source>
-        <translation type="unfinished">%1 MB</translation>
+        <translation>%1 MB</translation>
     </message>
     <message>
         <source>%1 CPU</source>
         <comment>%1 is 1 for now</comment>
-        <translation type="unfinished"></translation>
+        <translation>%1 CPU</translation>
     </message>
     <message>
         <source>%1 CPUs</source>
         <comment>%1 is host cpu count * 2 for now</comment>
-        <translation type="unfinished"></translation>
+        <translation>%1 CPU</translation>
     </message>
     <message>
         <source>%1%</source>
-        <translation type="unfinished">%1%</translation>
+        <translation>%1%</translation>
     </message>
 </context>
 <context>
@@ -7906,79 +7906,79 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>When chosen, enables the virtual USB OHCI controller of this machine. The USB OHCI controller provides USB 1.0 support.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a virtuális USB OHCI vezérlő használható lesz ebben a virtuális gépben. Az USB OHCI vezérlő USB 1.0 támogatással rendelkezik.</translation>
     </message>
     <message>
         <source>USB &1.1 (OHCI) Controller</source>
-        <translation type="unfinished"></translation>
+        <translation>USB &1.1 (OHCI) vezérlő</translation>
     </message>
     <message>
         <source>When chosen, enables the virtual USB EHCI controller of this machine. The USB EHCI controller provides USB 2.0 support.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a virtuális USB EHCI vezérlő használható lesz ebben a virtuális gépben. Az USB EHCI vezérlő USB 2.0 támogatással rendelkezik.</translation>
     </message>
     <message>
         <source>USB &2.0 (EHCI) Controller</source>
-        <translation type="unfinished"></translation>
+        <translation>USB &2.0 (EHCI) vezérlő</translation>
     </message>
     <message>
         <source>When chosen, enables the virtual USB xHCI controller of this machine. The USB xHCI controller provides USB 3.0 support.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ha engedélyezed, a virtuális USB xHCI vezérlő használható lesz ebben a virtuális gépben. Az USB xHCI vezérlő USB 3.0 támogatással rendelkezik.</translation>
     </message>
     <message>
         <source>USB &3.0 (xHCI) Controller</source>
-        <translation type="unfinished"></translation>
+        <translation>USB &3.0 (xHCI) vezérlő</translation>
     </message>
     <message>
         <source>USB 2.0/3.0 is currently enabled for this virtual machine. However, this requires the <i>%1</i> to be installed. Please install the Extension Pack from the VirtualBox download site or disable USB 2.0/3.0 to be able to start the machine.</source>
-        <translation type="unfinished"></translation>
+        <translation>A virtuális gépen az USB 2.0/3.0 jelenleg be van kapcsolva. Azonban telepített <i>%1</i> szükséges hozzá. Telepítsd fel a Kiterjesztő csomagot a VirtualBox oldalról, vagy kapcsold ki az USB 2.0/3.0-t, hogy el tudjon indulni a gép.</translation>
     </message>
     <message>
         <source>Add Empty Filter</source>
-        <translation type="unfinished"></translation>
+        <translation>Üres szűrő hozzáadása</translation>
     </message>
     <message>
         <source>Add Filter From Device</source>
-        <translation type="unfinished"></translation>
+        <translation>Szűrő hozzáadása eszköz alapján</translation>
     </message>
     <message>
         <source>Edit Filter</source>
-        <translation type="unfinished"></translation>
+        <translation>Szűrő szerkesztése</translation>
     </message>
     <message>
         <source>Remove Filter</source>
-        <translation type="unfinished"></translation>
+        <translation>Szűrő törlése</translation>
     </message>
     <message>
         <source>Move Filter Up</source>
-        <translation type="unfinished"></translation>
+        <translation>Feljebb</translation>
     </message>
     <message>
         <source>Move Filter Down</source>
-        <translation type="unfinished"></translation>
+        <translation>Lejjebb</translation>
     </message>
     <message>
         <source>Adds new USB filter with all fields initially set to empty strings. Note that such a filter will match any attached USB device.</source>
-        <translation type="unfinished"></translation>
+        <translation>Egy teljesen üres USB szűrőt hoz létre. Ez a szűrő minden csatlakoztatott eszközre illeszkedni fog.</translation>
     </message>
     <message>
         <source>Adds new USB filter with all fields set to the values of the selected USB device attached to the host PC.</source>
-        <translation type="unfinished"></translation>
+        <translation>Egy teljesen új USB szűrő létrehozása a kiválasztott USB eszköz paraméterei alapján.</translation>
     </message>
     <message>
         <source>Edits selected USB filter.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kijelölt szűrő szerkesztése.</translation>
     </message>
     <message>
         <source>Removes selected USB filter.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott USB szűrő törlése.</translation>
     </message>
     <message>
         <source>Moves selected USB filter up.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott USB szűrő felfelé mozgatása.</translation>
     </message>
     <message>
         <source>Moves selected USB filter down.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott USB szűrő lefelé mozgatása.</translation>
     </message>
 </context>
 <context>
@@ -8084,35 +8084,35 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Holds the vendor ID filter. The <i>exact match</i> string format is <tt>XXXX</tt> where <tt>X</tt> is a hexadecimal digit. An empty string will match any value.</source>
-        <translation type="unfinished"></translation>
+        <translation>Gyártó ID alapú szűrőt készít. A <i>pontos illeszkedéshez</i> szükséges formátum <tt>XXXX</tt>, ahol <tt>X</tt> egy hexadecimális szám. Az üres mező bármely értékre illeszkedni fog.</translation>
     </message>
     <message>
         <source>Holds the product ID filter. The <i>exact match</i> string format is <tt>XXXX</tt> where <tt>X</tt> is a hexadecimal digit. An empty string will match any value.</source>
-        <translation type="unfinished"></translation>
+        <translation>Termék ID alapú szűrőt készít. A <i>pontos illeszkedéshez</i> szükséges formátum <tt>XXXX</tt>, ahol <tt>X</tt> egy hexadecimális szám. Az üres mező bármely azonosítóra illeszkedni fog.</translation>
     </message>
     <message>
         <source>Holds the revision number filter. The <i>exact match</i> string format is <tt>IIFF</tt> where <tt>I</tt> is a decimal digit of the integer part and <tt>F</tt> is a decimal digit of the fractional part. An empty string will match any value.</source>
-        <translation type="unfinished"></translation>
+        <translation>Revízió szám alapú szűrőt készít. A <i>pontos illeszkedéshez</i> szükséges formátum <tt>IIFF</tt>, ahol <tt>I</tt> az egész rész egy számjegye, <tt>F</tt> pedig a törtrész számjegye. Az üres mező bármely azonosítóra illeszkedni fog.</translation>
     </message>
     <message>
         <source>Holds the manufacturer filter as an <i>exact match</i> string. An empty string will match any value.</source>
-        <translation type="unfinished"></translation>
+        <translation>Gyártó alapú szűrőt készít a gyártó <i>pontos</i> neve alapján. Az üres mező bármely értékre illeszkedni fog.</translation>
     </message>
     <message>
         <source>Holds the product name filter as an <i>exact match</i> string. An empty string will match any value.</source>
-        <translation type="unfinished"></translation>
+        <translation>Termék alapú szűrőt készít a termék <i>pontos</i> neve alapján. Az üres mező bármely értékre illeszkedni fog.</translation>
     </message>
     <message>
         <source>Holds the serial number filter as an <i>exact match</i> string. An empty string will match any value.</source>
-        <translation type="unfinished"></translation>
+        <translation>Sorozatszám alapú szűrőt készít a sorozatszám alapján. Az üres mező bármely értékre illeszkedni fog.</translation>
     </message>
     <message>
         <source>Holds the host USB port filter as an <i>exact match</i> string. An empty string will match any value.</source>
-        <translation type="unfinished"></translation>
+        <translation>Gazda USB port alapú szűrőt készít a port <i>pontos</i> neve alapján. Az üres mező bármely értékre illeszkedni fog.</translation>
     </message>
     <message>
         <source>Holds whether this filter applies to USB devices attached locally to the host computer (<i>No</i>), to a VRDP client's computer (<i>Yes</i>), or both (<i>Any</i>).</source>
-        <translation type="unfinished"></translation>
+        <translation>A csatlakoztatás módjára épülő szűrő, azaz hogy az USB eszköz helyileg (<i>Nem</i>), a VRDP kliens gépen (<i>Igen</i>) van csatlakoztatva, vagy mindegy (<i>Bárhol</i>).</translation>
     </message>
 </context>
 <context>
@@ -8153,18 +8153,18 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Removing medium...</source>
-        <translation type="unfinished"></translation>
+        <translation>Médium eltávolítása...</translation>
     </message>
     <message>
         <source>&Hard disks</source>
-        <translation type="unfinished"></translation>
+        <translation>&Merevlemezek</translation>
     </message>
 </context>
 <context>
     <name>UIMediumTypeChangeDialog</name>
     <message>
         <source>Modify medium attributes</source>
-        <translation>Médium atttribútimainak módosítása</translation>
+        <translation>Médium attribútumainak módosítása</translation>
     </message>
     <message>
         <source><p>You are about to change the settings of the disk image file <b>%1</b>.</p><p>Please choose one of the following modes and press <b>%2</b> to proceed or <b>%3</b> otherwise.</p></source>
@@ -8179,23 +8179,23 @@ p, li { white-space: pre-wrap; }
     <name>UIMenuBarEditorWidget</name>
     <message>
         <source>Virtual Screen Resize</source>
-        <translation type="unfinished"></translation>
+        <translation>Virtuális képernyő átméretezés</translation>
     </message>
     <message>
         <source>Virtual Screen Mapping</source>
-        <translation type="unfinished"></translation>
+        <translation>Virtuális képernyő leképezése</translation>
     </message>
     <message>
         <source>Switch</source>
-        <translation type="unfinished">Átváltás</translation>
+        <translation>Átváltás</translation>
     </message>
     <message>
         <source>Close</source>
-        <translation type="unfinished">Bezárás</translation>
+        <translation>Bezárás</translation>
     </message>
     <message>
         <source>Enable Menu Bar</source>
-        <translation type="unfinished"></translation>
+        <translation>Menü sor bekapcsolása</translation>
     </message>
 </context>
 <context>
@@ -8433,7 +8433,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>The VirtualBox Guest Additions installed in the Guest OS are too old: the installed version is %1, the expected version is %2. Some features that require Guest Additions (mouse integration, guest display auto-resize) will most likely stop working properly.</p><p>Please update the Guest Additions to the current version by choosing <b>Insert Guest Additions CD image</b> from the <b>Devices</b> menu.</p></source>
-        <translation type="obsolete"><p>A vendég rendszerre telepített VirtualBox Integrációs szolgáltatások túl régiiek: telepített verzió: %1, ajánlott verzió: %2. Néhány, Integrációs szolgáltatást igénylő funkció (egér-integráció, vendég képernyőjének átméretezése) valószínűleg nem fog helyesen működni.</p><p>Az <b>Eszközök</b> menüből, az <b>Integrációs szolgáltatások telepítése</b> menüpont kiválasztásával frissítsd az Integrációs szolgáltat [...]
+        <translation type="obsolete"><p>A vendég rendszerre telepített VirtualBox Integrációs szolgáltatások túl régiek: telepített verzió: %1, ajánlott verzió: %2. Néhány, Integrációs szolgáltatást igénylő funkció (egér-integráció, vendég képernyőjének átméretezése) valószínűleg nem fog helyesen működni.</p><p>Az <b>Eszközök</b> menüből, az <b>Integrációs szolgáltatások telepítése</b> menüpont kiválasztásával frissítsd az Integrációs szolgáltatá [...]
     </message>
     <message>
         <source><p>The VirtualBox Guest Additions installed in the Guest OS are outdated: the installed version is %1, the expected version is %2. Some features that require Guest Additions (mouse integration, guest display auto-resize) may not work as expected.</p><p>It is recommended to update the Guest Additions to the current version  by choosing <b>Insert Guest Additions CD image</b> from the <b>Devices</b> menu.</p></source>
@@ -8450,7 +8450,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>A fatal error has occurred during virtual machine execution! The virtual machine will be powered off. Please copy the following error message using the clipboard to help diagnose the problem:</p></source>
-        <translation><p>Végzetes hiba lépett fel a virtuális gép futása során! A virtuáis gép ki fog kapcsolni. Ajánlott a következő hibaüzenet vágólapra másolása a későbbi megvizsgáláshoz:</p></translation>
+        <translation><p>Végzetes hiba lépett fel a virtuális gép futása során! A virtuális gép ki fog kapcsolni. Ajánlott a következő hibaüzenet vágólapra másolása a későbbi megvizsgáláshoz:</p></translation>
     </message>
     <message>
         <source><p>An error has occurred during virtual machine execution! The error details are shown below. You may try to correct the error and resume the virtual machine execution.</p></source>
@@ -8458,11 +8458,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Failed to change the snapshot folder path of the virtual machine <b>%1<b> to <nobr><b>%2</b></nobr>.</source>
-        <translation type="obsolete">A virtuális gép <b>%1</b> pillantkép mappájának <nobr><b>%2</b></nobr> mappára történő átállítása sikertelen.</translation>
+        <translation type="obsolete">A virtuális gép <b>%1</b> pillanatkép mappájának <nobr><b>%2</b></nobr> mappára történő átállítása sikertelen.</translation>
     </message>
     <message>
         <source><p>Failed to remove the shared folder <b>%1</b> (pointing to <nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p><p>Please close all programs in the guest OS that may be using this shared folder and try again.</p></source>
-        <translation><p>A(z) <b>%1</b>megosztott mappa (ami ide mutat: <nobr><b>%2</b></nobr>) eltávolítása sikertelen a virtuáis gépről: <b>%3</b>.</p><p>Zárj be minden programot a vendég OS-en belül, mely a mappát használhatja és próbáld újra.</p></translation>
+        <translation><p>A(z) <b>%1</b>megosztott mappa (ami ide mutat: <nobr><b>%2</b></nobr>) eltávolítása sikertelen a virtuális gépről: <b>%3</b>.</p><p>Zárj be minden programot a vendég OS-en belül, mely a mappát használhatja és próbáld újra.</p></translation>
     </message>
     <message>
         <source><p>Could not find the VirtualBox Guest Additions disk image file file <nobr><b>%1</b></nobr> or <nobr><b>%2</b>.</nobr></p><p>Do you wish to download this disk image file from the Internet?</p></source>
@@ -8482,7 +8482,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>The virtual machine window is optimized to work in <b>%1&nbsp;bit</b> color mode but the virtual display is currently set to <b>%2&nbsp;bit</b>.</p><p>Please open the display properties dialog of the guest OS and select a <b>%3&nbsp;bit</b> color mode, if it is available, for best possible performance of the virtual video subsystem.</p><p><b>Note</b>. Some operating systems, like  [...]
-        <translation type="obsolete"><p>A virtuális gép ablaka <b>%1&nbsp;bites</b> színmélységű munkára van optimalizálva, de a virtuális megjelenítő jelenlegi színmélysége <b>%2&nbsp;bit</b>.</p><p>Nyisd meg a vendég OS megjelenítési tulajdonságait és válassz egy <b>%3&nbsp;bites</b> módot, ha elérhető, a virtuális videóalrendszer legjobb teljesítménye érdekében.</p><p><b>Megjegyzés</b>. Néhány op [...]
+        <translation type="obsolete"><p>A virtuális gép ablaka <b>%1&nbsp;bites</b> színmélységű munkára van optimalizálva, de a virtuális megjelenítő jelenlegi színmélysége <b>%2&nbsp;bit</b>.</p><p>Nyisd meg a vendég OS megjelenítési tulajdonságait és válassz egy <b>%3&nbsp;bites</b> módot, ha elérhető, a virtuális videóalrendszer legjobb teljesítménye érdekében.</p><p><b>Megjegyzés</b>. Néhány op [...]
     </message>
     <message>
         <source><p>You didn't attach a hard disk to the new virtual machine. The machine will not be able to boot unless you attach a hard disk with a guest operating system or some other bootable media to it later using the machine settings window or the First Run Wizard.</p><p>Do you wish to continue?</p></source>
@@ -8672,7 +8672,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>The virtual machine window will be now switched to <b>fullscreen</b> mode. You can go back to windowed mode at any time by pressing <b>%1</b>. Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p><p>Note that the main menu bar is hidden in fullscreen mode. You can access it by pressing <b>Host+Home</b>.</p></source>
-        <translation type="obsolete"><p>A virtuális gép ablaka most <b>teljesképernyős</b> módra vált. Bármikor visszaléphetsz ablakos módba a(z) <b>%1</b> gomb megnyomásával. Ne feledd, hogy a <i>gazda</i> gomb jelenleg ez: <b>%2</b>.</p><p>Ne feledd, hogy a főmenü eltűnik teljesképernyős módnál. A <b>gazda+Home</b> gombok megnyomásával érheted el.</p></translation>
+        <translation type="obsolete"><p>A virtuális gép ablaka most <b>teljes képernyős</b> módra vált. Bármikor visszaléphetsz ablakos módba a(z) <b>%1</b> gomb megnyomásával. Ne feledd, hogy a <i>gazda</i> gomb jelenleg ez: <b>%2</b>.</p><p>Ne feledd, hogy a főmenü eltűnik teljes képernyős módnál. A <b>gazda+Home</b> gombok megnyomásával érheted el.</p></translation>
     </message>
     <message>
         <source><p>The virtual machine window will be now switched to <b>Seamless</b> mode. You can go back to windowed mode at any time by pressing <b>%1</b>. Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p><p>Note that the main menu bar is hidden in seamless mode. You can access it by pressing <b>Host+Home</b>.</p></source>
@@ -8894,7 +8894,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Could not access USB on the host system, because neither the USB file system (usbfs) nor the DBus and hal services are currently available. If you wish to use host USB devices inside guest systems, you must correct this and restart VirtualBox.</source>
-        <translation type="obsolete">Nem lehet használni az USB-t a gazda rendszerben, mert sem az USB fájlrendszer (usbfs), sem a DBus/Hal szolgáltatások nem elérhetők. Ha szeretnél USB eszközt használni a gazda gép rendszeréből, ennek a problémának a javítása szükséges. Ha végeztél, indítsd újra a VirtualBox-ot.</translation>
+        <translation type="obsolete">Nem lehet használni az USB-t a gazda rendszerben, mert sem az USB fájlrendszer (usbfs), sem a DBus/Hal szolgáltatások nem elérhetők. Ha szeretnél USB eszközt használni a gazda gép rendszeréből, ennek a problémának a javítása szükséges. Ha végeztél, indítsd újra a VirtualBoxot.</translation>
     </message>
     <message>
         <source>You are trying to shut down the guest with the ACPI power button. This is currently not possible because the guest does not support software shutdown.</source>
@@ -9039,7 +9039,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>There are no unused media available for the newly created attachment.</p><p>Press the <b>Create</b> button to start the <i>New Virtual Disk</i> wizard and create a new medium, or press the <b>Select</b> if you wish to open the <i>Virtual Media Manager</i>.</p></source>
-        <translation type="obsolete"><p>Nem érhető el felhasználható média az újonnan létrehozott perifériához.</p><p>Nyomd meg az <b>Új</b> gombot az <i>Új virtuális lemez</i> varázsló elindításához, és készíts egy új médiumot, vagy nyomd meg a <b>Kiválasztás</b> gombot a <i>Virtuális média-kezelő</> elinditásához.</p></translation>
+        <translation type="obsolete"><p>Nem érhető el felhasználható média az újonnan létrehozott perifériához.</p><p>Nyomd meg az <b>Új</b> gombot az <i>Új virtuális lemez</i> varázsló elindításához, és készíts egy új médiumot, vagy nyomd meg a <b>Kiválasztás</b> gombot a <i>Virtuális média-kezelő</> elindításához.</p></translation>
     </message>
     <message>
         <source>&Create</source>
@@ -9053,7 +9053,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>There are no unused media available for the newly created attachment.</p><p>Press the <b>Select</b> if you wish to open the <i>Virtual Media Manager</i>.</p></source>
-        <translation type="obsolete"><p>Nem érhető el felhasználható média az újonnan létrehozott perifériához.</p><p>Nyomd meg a <b>Kiválasztás</b> gombot a <i>Virtuális média-kezelő</> elinditásához.</p></translation>
+        <translation type="obsolete"><p>Nem érhető el felhasználható média az újonnan létrehozott perifériához.</p><p>Nyomd meg a <b>Kiválasztás</b> gombot a <i>Virtuális média-kezelő</> elindításához.</p></translation>
     </message>
     <message>
         <source>Failed to attach the %1 to slot <i>%2</i> of the machine <b>%3</b>.</source>
@@ -9089,7 +9089,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>Could not insert the VirtualBox Guest Additions installer disk image file into the virtual machine <b>%1</b>, as the machine has no CD/DVD drives. Please add a drive using the storage page of the virtual machine settings window.</p></source>
-        <translation type="obsolete"><p>Nem lehet a VirtualBox integrációs szolgáltatások telepítőlemezét felcsatolni a(z) <b>%1</b> virtuálus gépre, mert a gép nem rendelkezik CD/DVD meghajtóval. Adj egyet a hozzá a virtuális gép beállításainál a Tároló fülön.</p></translation>
+        <translation type="obsolete"><p>Nem lehet a VirtualBox integrációs szolgáltatások telepítőlemezét felcsatolni a(z) <b>%1</b> virtuális gépre, mert a gép nem rendelkezik CD/DVD meghajtóval. Adj egyet a hozzá a virtuális gép beállításainál a Tároló fülön.</p></translation>
     </message>
     <message>
         <source>E&xit</source>
@@ -9098,7 +9098,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>The following VirtualBox settings files will be automatically converted from the old format to a new format required by the new version of VirtualBox.</p><p>Press <b>OK</b> to start VirtualBox now or press <b>Exit</b> if you want to terminate the VirtualBox application without any further actions.</p></source>
-        <translation type="obsolete"><p>A következő VirtualBox beállításfájlok automatikusan konvertálva lesznek a régi formátumról az újra.</p><p>Nyomd meg az <b>OK</b> gombot a VirtualBox indításához, vagy a <b>Kilépés</b>-t a VirtualBox-ból való azonnali kilépéshez</p></translation>
+        <translation type="obsolete"><p>A következő VirtualBox beállításfájlok automatikusan konvertálva lesznek a régi formátumról az újra.</p><p>Nyomd meg az <b>OK</b> gombot a VirtualBox indításához, vagy a <b>Kilépés</b>-t a VirtualBoxból való azonnali kilépéshez</p></translation>
     </message>
     <message>
         <source>hard disk</source>
@@ -9159,7 +9159,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>Deleting the snapshot %1 will temporarily need more disk space. In the worst case the size of image %2 will grow by %3, however on this filesystem there is only %4 free.</p><p>Running out of disk space during the merge operation can result in corruption of the image and the VM configuration, i.e. loss of the VM and its data.</p><p>You may continue with deleting the snapshot at your own risk.</p></source>
-        <translation type="obsolete"><p>A(z) %1 pillanatfelvéte törléséhez időlegesen többszabad hely szükséges. A legrosszabb esetben a(z) %2 kép mérete %3 mérettel nőhet meg, miközben csak %4 szabad hely van a rendszeren.</p><p>Ha a művelet közben fogy el a szabad hely, az a kép és a virtuális gép beállításainak megsérülését okozhatja,mint például a virtuális gép és annak adatainak elvesztése.</p><p>Saját felelősségre folytathatja a pillanatfelvétel törlés [...]
+        <translation type="obsolete"><p>A(z) %1 pillanatfelvétel törléséhez időlegesen több szabad hely szükséges. A legrosszabb esetben a(z) %2 kép mérete %3 mérettel nőhet meg, miközben csak %4 szabad hely van a rendszeren.</p><p>Ha a művelet közben fogy el a szabad hely, az a kép és a virtuális gép beállításainak megsérülését okozhatja,mint például a virtuális gép és annak adatainak elvesztése.</p><p>Saját felelősségre folytathatja a pillanatfelvétel törl [...]
     </message>
     <message>
         <source><p>Could not change the guest screen to this host screen due to insufficient guest video memory.</p><p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p></source>
@@ -9171,11 +9171,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>Can not switch the guest display to fullscreen mode. You have more virtual screens configured than physical screens are attached to your host.</p><p>Please either lower the virtual screens in your VM configuration or attach additional screens to your host.</p></source>
-        <translation type="obsolete"><p>Nem tudsz teljes képernyőre váltani. Több virtuális képernyőd van beállítva, mint mannyi fizikai van csatlakoztatva a gazda géphez.</p><p>Csökkentsd a virtuális képernyők számát a beállításoknál vagy csatlakoztass további képernyőt a gazda géphez.</p></translation>
+        <translation type="obsolete"><p>Nem tudsz teljes képernyőre váltani. Több virtuális képernyőd van beállítva, mint amennyi fizikai van csatlakoztatva a gazda géphez.</p><p>Csökkentsd a virtuális képernyők számát a beállításoknál vagy csatlakoztass további képernyőt a gazda géphez.</p></translation>
     </message>
     <message>
         <source><p>Can not switch the guest display to seamless mode. You have more virtual screens configured than physical screens are attached to your host.</p><p>Please either lower the virtual screens in your VM configuration or attach additional screens to your host.</p></source>
-        <translation type="obsolete"><p>Nem tudsz asztal-integrációs módba váltani. Több virtuális képernyőd van beállítva, mint mannyi fizikai van csatlakoztatva a gazda géphez.</p><p>Csökkentsd a virtuális képernyők számát a beállításoknál vagy csatlakoztass további képernyőt a gazda géphez.</p></translation>
+        <translation type="obsolete"><p>Nem tudsz asztal-integrációs módba váltani. Több virtuális képernyőd van beállítva, mint amennyi fizikai van csatlakoztatva a gazda géphez.</p><p>Csökkentsd a virtuális képernyők számát a beállításoknál vagy csatlakoztass további képernyőt a gazda géphez.</p></translation>
     </message>
     <message>
         <source><p>Could not find the VirtualBox User Manual <nobr><b>%1</b>.</nobr></p><p>Do you wish to download this file from the Internet?</p></source>
@@ -9191,11 +9191,11 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>The VirtualBox User Manual has been successfully downloaded from <nobr><a href="%1">%2</a></nobr> and saved locally as <nobr><b>%3</b>.</nobr></p></source>
-        <translation type="obsolete"><p>A VirtualBox Felhasználói kézikönyv sikresen letöltődött innen: <nobr><a href="%1">%2</a></nobr> és el lett mentve mint <nobr><b>%3</b>.</nobr></p></translation>
+        <translation type="obsolete"><p>A VirtualBox Felhasználói kézikönyv sikeresen letöltődött innen: <nobr><a href="%1">%2</a></nobr> és el lett mentve mint <nobr><b>%3</b>.</nobr></p></translation>
     </message>
     <message>
         <source><p>The VirtualBox User Manual has been successfully downloaded from <nobr><a href="%1">%2</a></nobr> but can't be saved locally as <nobr><b>%3</b>.</nobr></p><p>Please choose another location for that file.</p></source>
-        <translation type="obsolete"><p>A VirtualBox Felhasználói kézikönyv sikresen letöltődött innen: <nobr><a href="%1">%2</a></nobr> de nem lett helyikeg elmentve, mint <nobr><b>%3</b>.</nobr></p><p>Válassz a fájl számára másik helyet.</p></translation>
+        <translation type="obsolete"><p>A VirtualBox Felhasználói kézikönyv sikeresen letöltődött innen: <nobr><a href="%1">%2</a></nobr> de nem lett helyileg elmentve, mint <nobr><b>%3</b>.</nobr></p><p>Válassz a fájl számára másik helyet.</p></translation>
     </message>
     <message>
         <source>Failed to open virtual machine located in %1.</source>
@@ -9259,7 +9259,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>You are about to add a new floppy drive to controller <b>%1</b>.</p><p>Would you like to choose a virtual floppy disk to put in the drive or to leave it empty for now?</p></source>
-        <translation><p>Virtuális floppy meghajtót adsz hozzá a vezérlőhöz: <b>%1</b>.</p><p>Szeretnél egy virtuálisfloppy lemezt a meghajtóba tenni vagy még maradjon üresen?</p></translation>
+        <translation><p>Virtuális floppy meghajtót adsz hozzá a vezérlőhöz: <b>%1</b>.</p><p>Szeretnél egy virtuális floppy lemezt a meghajtóba tenni vagy még maradjon üresen?</p></translation>
     </message>
     <message>
         <source>Failed to detach the hard disk (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.</source>
@@ -9285,7 +9285,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Failed to update Guest Additions. The Guest Additions disk image file will be inserted for user installation.</source>
-        <translation>Az Integrációs szolgáltatások telepítése sikertelen. Az Integrációs szolgáltatások telepítési képe fel lesz csatolva a manuális etlepítés biztosításához.</translation>
+        <translation>Az Integrációs szolgáltatások telepítése sikertelen. Az Integrációs szolgáltatások telepítési képe fel lesz csatolva a manuális telepítés biztosításához.</translation>
     </message>
     <message>
         <source>Failed to install the Extension Pack <b>%1</b>.</source>
@@ -9309,7 +9309,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>There are unsaved changes in the port forwarding configuration.</p><p>If you proceed your changes will be discarded.</p></source>
-        <translation><p>A port továbbítási beállítások mentetlen módosításokattartalmaznak.</p><p>Ha folytatod, a módosítások elvesznek.</p></translation>
+        <translation><p>A port továbbítási beállítások mentetlen módosításokat tartalmaznak.</p><p>Ha folytatod, a módosítások elvesznek.</p></translation>
     </message>
     <message>
         <source>Sorry, some generic error happens.</source>
@@ -9358,7 +9358,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>You are about to install a VirtualBox extension pack. Extension packs complement the functionality of VirtualBox and can contain system level software that could be potentially harmful to your system. Please review the description below and only proceed if you have obtained the extension pack from a trusted source.</p><p><table cellpadding=0 cellspacing=0><tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%1< [...]
-        <translation><p>Egy VirtualBox kiterjesztő csomagot telepítesz. A kiterjesztő csomagok kiegészítik a VirtualBox képességeit és rendszerszintű szoftvert tartalmaznak, mely teljesen ártalmatlan a rendszeredre. Nézd át a lenti leírást és csak akkor folytasd, ha megbízható forásból származik a kiterjesztő csomag.</p><p><table cellpadding=0 cellspacing=0><tr><td><b>Név:&nbsp;&nbsp;</b></td><td>%1</td></tr> [...]
+        <translation><p>Egy VirtualBox kiterjesztő csomagot telepítesz. A kiterjesztő csomagok kiegészítik a VirtualBox képességeit és rendszerszintű szoftvert tartalmaznak, mely teljesen ártalmatlan a rendszeredre. Nézd át a lenti leírást és csak akkor folytasd, ha megbízható forrásból származik a kiterjesztő csomag.</p><p><table cellpadding=0 cellspacing=0><tr><td><b>Név:&nbsp;&nbsp;</b></td><td>%1</td></tr&gt [...]
     </message>
     <message>
         <source>&Install</source>
@@ -9366,7 +9366,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>Extension packs complement the functionality of VirtualBox and can contain system level software that could be potentially harmful to your system. Please review the description below and only proceed if you have obtained the extension pack from a trusted source.</source>
-        <translation>A kiterjesztő csomagok kiegészítik a VirtualBox képességeit és rendszerszintű szoftvert tartalmaznak, mely teljesen ártalmatlan a rendszeredre. Nézd át a lenti leírást és csak akkor folytasd, ha megbízható forásból származik a kiterjesztő csomag.</translation>
+        <translation>A kiterjesztő csomagok kiegészítik a VirtualBox képességeit és rendszerszintű szoftvert tartalmaznak, mely teljesen ártalmatlan a rendszeredre. Nézd át a lenti leírást és csak akkor folytasd, ha megbízható forrásból származik a kiterjesztő csomag.</translation>
     </message>
     <message>
         <source><p>An older version of the extension pack is already installed, would you like to upgrade? <p>%1</p><p><table cellpadding=0 cellspacing=0><tr><td><b>Name:&nbsp;&nbsp;</b></td><td>%2</td></tr><tr><td><b>New Version:&nbsp;&nbsp;</b></td><td>%3</td></tr><tr><td><b>Current Version:&nbsp;&nbsp;</b></td& [...]
@@ -9394,7 +9394,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p><p>Are you sure you want to proceed?</p></source>
-        <translation><p>Eltávolítod a VirtualBox kiterjesztő scomagot: <b>%1</b>.</p><p>Biztos folytatni akarod?</p></translation>
+        <translation><p>Eltávolítod a VirtualBox kiterjesztő csomagot: <b>%1</b>.</p><p>Biztos folytatni akarod?</p></translation>
     </message>
     <message>
         <source>The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.</source>
@@ -9639,7 +9639,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>Cannot start the VirtualBox Manager due to local restrictions.</p><p>The application will now terminate.</p></source>
-        <translation><p>A VirtualBox kezelő helyi korlátozások miatt nem tud elindulni.</p><p>A progmram most leáll-</p></translation>
+        <translation><p>A VirtualBox kezelő helyi korlátozások miatt nem tud elindulni.</p><p>Az alkalmazás most bezáródik.</p></translation>
     </message>
     <message>
         <source><p>Could not find a language file for the language <b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p><p>The language will be temporarily reset to the system default language. Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p></source>
@@ -9699,7 +9699,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>Are you sure you want to release the virtual optical disk <nobr><b>%1</b></nobr>?</p><p>This will detach it from the following virtual machine(s): <b>%2</b>.</p></source>
-        <translation type="obsolete"><p>Biztos elengeded a virtuálisoptikai lemezt: <nobr><b>%1</b></nobr>?</p><p>Le fog választódni a következő virtuális gép(ek)ről: <b>%2</b>.</p></translation>
+        <translation type="obsolete"><p>Biztos elengeded a virtuális optikai lemezt: <nobr><b>%1</b></nobr>?</p><p>Le fog választódni a következő virtuális gép(ek)ről: <b>%2</b>.</p></translation>
     </message>
     <message>
         <source><p>Are you sure you want to release the virtual floppy disk <nobr><b>%1</b></nobr>?</p><p>This will detach it from the following virtual machine(s): <b>%2</b>.</p></source>
@@ -9872,131 +9872,131 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source><p>The virtual screen is currently set to a <b>%1&nbsp;bit</b> color mode. For better performance please change this to <b>%2&nbsp;bit</b>. This can usually be done from the <b>Display</b> section of the guest operating system's Control Panel or System Settings.</p></source>
-        <translation><p>A virtuális képernyő jelenleg <b>%1&nbsp;bit</b> színmódra van beállítva. A jobb teljesítmény érdekében, állítsd át <b>%2&nbsp;bitre</b>. Ez alapesetben megtehető a vendég operációs rendszer Vezérlőpult vagy Rendszerbeállítások. <b>Képernyő</b> részében.</p></translation>
+        <translation><p>A virtuális képernyő színmélysége jelenleg <b>%1&nbsp;bit</b>. A jobb teljesítmény érdekében kérlek, válts <b>%2&nbsp;bitre</b>.Ezt általában a rendszer Vezérlőpultjában vagy Rendszerbeállításainál a <b>Képernyő</b> részben teheted meg.</p></translation>
     </message>
     <message>
         <source><p>Failed to create the VirtualBoxClient COM object.</p><p>The application will now terminate.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A VirtualBoxCleint COM elem létrehozása sikertelen.</p><p>Az alkalmazás most bezáródik.</p></translation>
     </message>
     <message>
         <source>Failed to set the global VirtualBox extra data for key <i>%1</i> to value <i>{%2}</i>.</source>
-        <translation type="unfinished"></translation>
+        <translation>A globális Virtualbox extra adat beállítása, <i>{%2}</i> értékre, sikertelen ennél a kulcsnál: <i>%1</i>.</translation>
     </message>
     <message>
         <source>Failed to set the extra data for key <i>%1</i> of machine <i>%2</i> to value <i>{%3}</i>.</source>
-        <translation type="unfinished"></translation>
+        <translation>Az extra adat beállítása, <i>{%3}</i> értékre, sikertelen a(z) <i>%2</i> virtuális gépen ennél a kulcsnál: <i>%1</i>.</translation>
     </message>
     <message>
         <source><p>One or more disk image files are not currently accessible. As a result, you will not be able to operate virtual machines that use these files until they become accessible later.</p><p>Press <b>Check</b> to open the Virtual Media Manager window and see which files are inaccessible, or press <b>Ignore</b> to ignore this message.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Egy vagy több virtuális merevlemez, optikai vagy floppy képfájl jelenleg nem érhető el. Ennek eredményeképp, nem leszel képes olyan műveletek végrehajtására, melyek ezt a médiumot használnák, amíg az újra elérhető nem lesz.</p><p>Az <b>Ellenőrzés</b> gombbal nyisd meg a Virtuális médiakezelő ablakot és láthatod az elérhetetlen médiát, vagy a <b>Kihagy</b> gombbal figyelmen kívül hagyod ezt az üzenetet.</p></translation>
     </message>
     <message>
         <source><p>Deleting the snapshot will cause the state information saved in it to be lost, and storage data spread over several image files that VirtualBox has created together with the snapshot will be merged into one file. This can be a lengthy process, and the information in the snapshot cannot be recovered.</p></p>Are you sure you want to delete the selected snapshot <b>%1</b>?</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A pillanatkép törlése azt okozhatja, hogy a mentett állapotinformációk elvesznek, és a VirtualBox által készített lemez-pillanatképek rá lesznek játszva az aktuális lemezre. Ez hosszú ideig is eltarthat, és a pillanatkép-beli információk ezután már nem lesznek helyreállíthatóak.</p></p>Biztos törlöd ezt a pillanatképet: <b>%1</b>?</p></translation>
     </message>
     <message>
         <source><p>Deleting the snapshot %1 will temporarily need more storage space. In the worst case the size of image %2 will grow by %3, however on this filesystem there is only %4 free.</p><p>Running out of storage space during the merge operation can result in corruption of the image and the VM configuration, i.e. loss of the VM and its data.</p><p>You may continue with deleting the snapshot at your own risk.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A(z) %1 pillanatfelvétel törléséhez időlegesen több szabad hely szükséges. A legrosszabb esetben a(z) %2 kép mérete %3 mérettel nőhet meg, miközben csak %4 szabad hely van a rendszeren.</p><p>Ha a művelet közben fogy el a szabad hely, az a kép és a virtuális gép beállításainak megsérülését okozhatja, mint például a virtuális gép és annak adatainak elvesztése.</p><p>Saját felelősségre folytathatja a pillanatfelvétel törlését.</p> [...]
     </message>
     <message>
         <source>Failed to save the settings.</source>
-        <translation type="unfinished"></translation>
+        <translation>Beállítások mentése sikertelen.</translation>
     </message>
     <message>
         <source><p>You are about to add a new optical drive to controller <b>%1</b>.</p><p>Would you like to choose a virtual optical disk to put in the drive or to leave it empty for now?</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Virtuális optikai meghajtót adsz hozzá a vezérlőhöz: <b>%1</b>.</p><p>Szeretnél egy virtuális optikai lemezt a meghajtóba tenni vagy még maradjon üresen?</p></translation>
     </message>
     <message>
         <source><p>Are you sure you want to delete the optical drive?</p><p>You will not be able to insert any optical disks or ISO images or install the Guest Additions without it!</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Biztos, hogy törlöd ezt az optikai meghajtót?</p><p>Enélkül nem leszel képes optikai lemezt vagy ISO képfájlt csatolni, illetve az Integrációs szolgáltatásokat telepíteni!</p></translation>
     </message>
     <message>
         <source>Failed to attach the optical drive (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nem sikerült az optikai meghajtót (<nobr><b>%1</b></nobr>) a(z) <i>%2</i> foglalathoz társítani ezen a virtuális gépen: <b>%3</b>.</translation>
     </message>
     <message>
         <source>Failed to attach the floppy drive (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nem sikerült a floppy meghajtót (<nobr><b>%1</b></nobr>) a(z) <i>%2</i> foglalathoz társítani ezen a virtuális gépen: <b>%3</b>.</translation>
     </message>
     <message>
         <source>The current port forwarding rules are not valid. Rule names should be unique.</source>
-        <translation type="unfinished"></translation>
+        <translation>Az aktuális port továbbítási szabályok nem érvényesek. A szabály nevének egyedinek kell lennie.</translation>
     </message>
     <message>
         <source>The current port forwarding rules are not valid. Few rules have same host ports and conflicting IP addresses.</source>
-        <translation type="unfinished"></translation>
+        <translation>Az aktuális port továbbítási szabályok nem érvényesek. Néhány szabálynak ugyanaz a gazda portja, és ütköznek az IP címek.</translation>
     </message>
     <message>
         <source><p>Are you sure you want to release the disk image file <nobr><b>%1</b></nobr>?</p><p>This will detach it from the following virtual machine(s): <b>%2</b>.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Biztos elengeded a képfájlt: <nobr><b>%1</b></nobr>?</p><p>Le fog választódni a következő virtuális gép(ek)ről: <b>%2</b>.</p></translation>
     </message>
     <message>
         <source><p>Do you want to delete the storage unit of the virtual hard disk <nobr><b>%1</b></nobr>?</p><p>If you select <b>Delete</b> then the specified storage unit will be permanently deleted. This operation <b>cannot be undone</b>.</p><p>If you select <b>Keep</b> then the hard disk will be only removed from the list of known hard disks, but the storage unit will be left untouched which mak [...]
-        <translation type="unfinished"></translation>
+        <translation><p>Törölni akarod a virtuális merevlemez ezen tárolóegységét: <nobr><b>%1</b></nobr>?</p><p>Ha a <b>Törlést</b> választod, a tárolóegység véglegesen törlődni fog. Ez a művelet <b>nem vonható vissza</b>.</p><p>Ha a <b>Megtartást</b> választod, a merevlemez csak az ismert merevlemezek listájáról törlődik, de a tárolóegység érintetlen marad, amit később újra hozzá lehet adni a mere [...]
     </message>
     <message>
         <source>Failed to detach the optical drive (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nem sikerült az optikai meghajtót (<nobr><b>%1</b></nobr>) leválasztani a(z) <i>%2</i> foglalatról, ezen a virtuális gépen: <b>%3</b>.</translation>
     </message>
     <message>
         <source>Failed to detach the floppy drive (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nem sikerült a floppy meghajtót (<nobr><b>%1</b></nobr>) leválasztani a(z) <i>%2</i> foglalatról, ezen a virtuális gépen: <b>%3</b>.</translation>
     </message>
     <message>
         <source>Failed to open the disk image file <nobr><b>%1</b></nobr>.</source>
-        <translation type="unfinished"></translation>
+        <translation>A lemezfájl megnyitása sikertelen: <nobr><b>%1</b></nobr>.</translation>
     </message>
     <message>
         <source>Failed to close the disk image file <nobr><b>%1</b></nobr>.</source>
-        <translation type="unfinished"></translation>
+        <translation>A lemezfájl bezárása sikertelen: <nobr><b>%1</b></nobr>.</translation>
     </message>
     <message>
         <source>You are about to create a new virtual machine without a hard disk. You will not be able to install an operating system on the machine until you add one. In the mean time you will only be able to start the machine using a virtual optical disk or from the network.</source>
-        <translation type="unfinished"></translation>
+        <translation>Merevlemez nélküli gépet készülsz létrehozni. Merevlemez nélkül nem leszel képes operációs rendszert telepíteni rá. Addig csak virtuális optikai meghajtóról vagy hálózatról tudod elindítani a gépet.</translation>
     </message>
     <message>
         <source>Bad password or authentication failure.</source>
-        <translation type="unfinished"></translation>
+        <translation>Rossz jelszó vagy sikertelen hitelesítés.</translation>
     </message>
     <message>
         <source><p>A critical error has occurred while running the virtual machine and the machine execution should be stopped.</p><p>For help, please see the Community section on <a href=https://www.virtualbox.org>https://www.virtualbox.org</a> or your support contract. Please provide the contents of the log file <tt>VBox.log</tt>, which you can find in the virtual machine log directory, as well as a description of what you were doing when this  [...]
-        <translation type="unfinished"></translation>
+        <translation><p>Kritikus hiba lépett fel a virtuális gép futása során és a gép leállt.</p><p>Segítségért látogass el a <a href=https://www.virtualbox.org>https://www.virtualbox.org</a> közösségi részlegébe vagy a támogatási oldalra. Mellékeld a <tt>VBox.log</tt> naplófájl tartalmát , melyet a virtuális gép naplózási mappájában találsz, ahogy annak a leírását is, mit csináltál mikor a hiba bekövetkezett. és a. Ne feledd, hogy a fenti fájlo [...]
     </message>
     <message>
         <source><p>The virtual machine window will be now switched to <b>full-screen</b> mode. You can go back to windowed mode at any time by pressing <b>%1</b>.</p><p>Note that the <i>Host</i> key is currently defined as <b>%2</b>.</p><p>Note that the main menu bar is hidden in full-screen mode. You can access it by pressing <b>Host+Home</b>.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A virtuális gép ablaka most <b>teljes képernyős</b> módra vált. Bármikor visszaléphetsz az ablakos módba a(z) <b>%1</b> gomb megnyomásával. Ne feledd, hogy a <i>gazda</i> gomb jelenleg ez: <b>%2</b>.</p><p>Ne feledd, hogy a főmenü eltűnik a teljes képernyős módnál. A <b>gazda+Home</b> gombok megnyomásával érheted el.</p></translation>
     </message>
     <message>
         <source><p>Could not switch the guest display to full-screen mode due to insufficient guest video memory.</p><p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p><p>Press <b>Ignore</b> to switch to full-screen mode anyway or press <b>Cancel</b> to cancel the operation.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Nem tudsz teljes képernyőre váltani a vendég kevés videómemóriája miatt.</p><p>Be kell állítanod a virtuális gépet, hogy legalább <b>%1</b> videómemóriával rendelkezzen.</p><p>A <b>Kihagy</b> gombbal teljes képernyőre válthatsz vagy a <b>Mégsem</b> gombbal megszakíthatod a műveletet.</p></translation>
     </message>
     <message>
         <source>Failed to connect the network adapter cable of the virtual machine <b>%1</b>.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nem sikerült csatlakoztatni a virtuális gép hálózati kábelét: <b>%1</b>.</translation>
     </message>
     <message>
         <source>Failed to disconnect the network adapter cable of the virtual machine <b>%1</b>.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nem sikerült leválasztani a virtuális gép hálózati kábelét: <b>%1</b>.</translation>
     </message>
     <message>
         <source><p>Could not insert the <b>VirtualBox Guest Additions</b> disk image file into the virtual machine <b>%1</b>, as the machine has no optical drives. Please add a drive using the storage page of the virtual machine settings window.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Nem lehet a <b>VirtualBox integrációs szolgáltatások</b> telepítőlemezét felcsatolni a(z) <b>%1</b> virtuális gépre, mert a gép nem rendelkezik optikai meghajtóval. Adj hozzá egyet a virtuális gép beállításainál.</p></translation>
     </message>
     <message>
         <source><p>The <b>VirtualBox Guest Additions</b> disk image file has been successfully downloaded from <nobr><a href="%1">%1</a></nobr> and saved locally as <nobr><b>%2</b>.</nobr></p><p>Do you wish to register this disk image file and insert it into the virtual optical drive?</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A VirtualBox Integrációs szolgáltatások lemezkép fájl sikeresen letöltődött a <nobr><a href="%1">%1</a></nobr> helyről és el lett mentve: <nobr><b>%2</b>.</nobr></p><p>Szeretnéd regisztrálni a lemezkép fájlt és berakni a virtuális optikai meghajtóba?</p></translation>
     </message>
     <message>
         <source>Drag and drop operation from host to guest failed.</source>
-        <translation type="unfinished"></translation>
+        <translation>A fogd és vidd művelet sikertelen a vendég gép irányában.</translation>
     </message>
     <message>
         <source>Unable to cancel host to guest drag and drop operation.</source>
-        <translation type="unfinished"></translation>
+        <translation>A fogd és vidd művelet megszakítása sikertelen a vendég gép irányában.</translation>
     </message>
     <message>
         <source>Drag and drop operation from guest to host failed.</source>
-        <translation type="unfinished"></translation>
+        <translation>A fogd és vidd művelet sikertelen a gazda gép irányában.</translation>
     </message>
 </context>
 <context>
@@ -10113,7 +10113,7 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <source>N&ame:</source>
-        <translation type="unfinished"></translation>
+        <translation>&Név:</translation>
     </message>
 </context>
 <context>
@@ -10272,7 +10272,7 @@ to store the virtual hard disk image or type a file name in the entry field.<
     <message>
         <source><p>Select the size of the virtual hard disk image in megabytes. This size will be reported to the Guest OS
 as the size of the virtual hard disk.</p></source>
-        <translation type="obsolete"><p>Adja meg a virtuális lemez méretét megabájtban. Ezt a méretet fogják a virtuális gépek látni a
+        <translation type="obsolete"><p>Adja meg a virtuális lemez méretét megabyte-ban. Ezt a méretet fogják a virtuális gépek látni a
 lemezből</p></translation>
     </message>
     <message>
@@ -10349,7 +10349,7 @@ a rámásolt adatok függvényében növekszik az általa elfoglalt hely - míg
     </message>
     <message>
         <source><p>Select the size of the virtual hard disk image in megabytes. This size will be reported to the Guest OS as the size of the virtual hard disk.</p></source>
-        <translation type="obsolete"><p>Add meg a virtuális lemez méretét megabájtban. Ezt a méretet fogja a virtuális gép látni a lemezből</p></translation>
+        <translation type="obsolete"><p>Add meg a virtuális lemez méretét megabyte-ban. Ezt a méretet fogja a virtuális gép látni a lemezből</p></translation>
     </message>
     <message>
         <source>If the above settings are correct, press the <b>Finish</b> button. Once you press it, a new hard disk image will be created.</source>
@@ -10417,7 +10417,7 @@ a rámásolt adatok függvényében növekszik az általa elfoglalt hely - míg
     </message>
     <message>
         <source><p>Select the size of the virtual hard disk in megabytes. This size will be reported to the Guest OS as the maximum size of this hard disk.</p></source>
-        <translation type="obsolete"><p>Add meg a virtuális lemez méretét megabájtban. Ezt a méretet fogják a virtuális gépek látni a lemezből</p></translation>
+        <translation type="obsolete"><p>Add meg a virtuális lemez méretét megabyte-ban. Ezt a méretet fogják a virtuális gépek látni a lemezből</p></translation>
     </message>
     <message>
         <source>&Size</source>
@@ -10458,7 +10458,7 @@ a rámásolt adatok függvényében növekszik az általa elfoglalt hely - míg
     </message>
     <message>
         <source>Please select the virtual disk which you would like to copy if it is not already selected. You can either choose one from the list or use the folder icon beside the list to select a virtual disk file.</source>
-        <translation type="obsolete">Válaszd ki a virtuális lemezt, amelyiket másolni szeretnél, ha még nincs kiválasztva. válaszhatsz másikat is  alistából vagy a mappa ikonnal kiválaszthatsz egy virtuális lemezfájlt.</translation>
+        <translation type="obsolete">Válaszd ki a virtuális lemezt, amelyiket másolni szeretnél, ha még nincs kiválasztva. Választhatsz másikat is a listából vagy a mappa ikonnal kiválaszthatsz egy virtuális lemezfájlt.</translation>
     </message>
     <message>
         <source>&VDI (VirtualBox Disk Image)</source>
@@ -10486,7 +10486,7 @@ a rámásolt adatok függvényében növekszik az általa elfoglalt hely - míg
     </message>
     <message>
         <source>Virtual disk file type</source>
-        <translation type="obsolete">Virtuális lemez fájtípusa</translation>
+        <translation type="obsolete">Virtuális lemez fájltípusa</translation>
     </message>
     <message>
         <source>Please choose the type of file that you would like to use for the new virtual disk. If you do not need to use it with other virtualization software you can leave this setting unchanged.</source>
@@ -10502,7 +10502,7 @@ a rámásolt adatok függvényében növekszik az általa elfoglalt hely - míg
     </message>
     <message>
         <source><p>A <b>dynamically allocated</b> virtual disk file will only use space on your physical hard disk as it fills up, although it will not shrink again automatically when space on it is freed.</p></source>
-        <translation type="obsolete"><p>A <b>dinamikus növekvő</b> virtuális lemezfájl a benne levő adatokhoz mérten foglal helyet, bár a felszabaduló hellyel nem fog automatikusan csökkeni a mérete.</p></translation>
+        <translation type="obsolete"><p>A <b>dinamikus növekvő</b> virtuális lemezfájl a benne levő adatokhoz mérten foglal helyet, bár a felszabaduló hellyel nem fog automatikusan csökkenni a mérete.</p></translation>
     </message>
     <message>
         <source><p>A <b>fixed size</b> virtual disk file may take longer to create on some systems but is often faster to use.</p></source>
@@ -10530,7 +10530,7 @@ a rámásolt adatok függvényében növekszik az általa elfoglalt hely - míg
     </message>
     <message>
         <source>Select the size of the virtual disk in megabytes. This size will be reported to the Guest OS as the maximum size of this virtual disk.</source>
-        <translation type="obsolete">Add meg a virtuális lemez méretét megabájtban. Ezt a méretet fogják a virtuális gépek látni a lemezből.</translation>
+        <translation type="obsolete">Add meg a virtuális lemez méretét megabyte-ban. Ezt a méretet fogják a virtuális gépek látni a lemezből.</translation>
     </message>
     <message>
         <source>Virtual disk file location</source>
@@ -10662,7 +10662,7 @@ a rámásolt adatok függvényében növekszik az általa elfoglalt hely - míg
     </message>
     <message>
         <source><p>Select the size of the virtual hard disk in megabytes. This size will be reported to the Guest OS as the maximum size of this hard disk.</p></source>
-        <translation type="obsolete"><p>Add meg a virtuális lemez méretét megabájtban. Ezt a méretet fogják a virtuális gépek látni a lemezből.</p></translation>
+        <translation type="obsolete"><p>Add meg a virtuális lemez méretét megabyte-ban. Ezt a méretet fogják a virtuális gépek látni a lemezből.</p></translation>
     </message>
     <message>
         <source>&Size</source>
@@ -10751,7 +10751,7 @@ and the <b>Back</b> button to return to the previous page.</p>
     </message>
     <message>
         <source><p>Select the amount of base memory (RAM) in megabytes to be allocated to the virtual machine.</p></source>
-        <translation type="obsolete"><p>Add meg a fizikai memória (RAM) mennyiségét megabájtban, amelyet hozzá akarsz rendelni ehhez a virtuális géphez.</p></translation>
+        <translation type="obsolete"><p>Add meg a fizikai memória (RAM) mennyiségét megabyte-ban, amelyet hozzá akarsz rendelni ehhez a virtuális géphez.</p></translation>
     </message>
     <message>
         <source>Base &Memory Size</source>
@@ -10951,7 +10951,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>&Use existing hard disk</source>
-        <translation type="obsolete">Létező merevlemez &haználata</translation>
+        <translation type="obsolete">Létező merevlemez &használata</translation>
     </message>
     <message>
         <source>Create</source>
@@ -10992,7 +10992,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     <name>UINewVMWzdPage3</name>
     <message>
         <source><p>Select the amount of base memory (RAM) in megabytes to be allocated to the virtual machine.</p></source>
-        <translation type="obsolete"><p>Add meg a fizikai memória (RAM) mennyiségét megabájtban, amelyet hozzá akarsz rendelni ehhez a virtuális géphez.</p></translation>
+        <translation type="obsolete"><p>Add meg a fizikai memória (RAM) mennyiségét megabyte-ban, amelyet hozzá akarsz rendelni ehhez a virtuális géphez.</p></translation>
     </message>
     <message>
         <source>Base &Memory Size</source>
@@ -11048,7 +11048,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>If you wish you can now add a start-up disk to the new machine. You can either create a new virtual disk or select one from the list or from another location using the folder icon.</p><p>If you need a more complex virtual disk setup you can skip this step and make the changes to the machine settings once the machine is created.</p></source>
-        <translation type="obsolete"><p>Most kiválaszthatod az új virtuális gép indítólemezét. Készíthetsz új merevlemezt, vagy választhatsz egy létezőt a listából vagy a mappa ikon használatával kiválasztahtod a helyét.</p><p>Ha ennél bonyolultabb beállítást szeretnél, hagyd ki ezt a lépést, és majd később a virtuális gép beállításaoban csatlakoztass fel a merevlemezt.</p></translation>
+        <translation type="obsolete"><p>Most kiválaszthatod az új virtuális gép indítólemezét. Készíthetsz új merevlemezt, vagy választhatsz egy létezőt a listából vagy a mappa ikon használatával kiválaszthatod a helyét.</p><p>Ha ennél bonyolultabb beállítást szeretnél, hagyd ki ezt a lépést, és majd később a virtuális gép beállításaiban csatlakoztass fel a merevlemezt.</p></translation>
     </message>
     <message>
         <source>Choose a virtual hard disk file...</source>
@@ -11137,55 +11137,55 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     <name>UIPortForwardingTable</name>
     <message>
         <source>Name</source>
-        <translation type="unfinished">Név</translation>
+        <translation>Név</translation>
     </message>
     <message>
         <source>Protocol</source>
-        <translation type="unfinished">Protokoll</translation>
+        <translation>Protokoll</translation>
     </message>
     <message>
         <source>Host IP</source>
-        <translation type="unfinished">Gazda IP</translation>
+        <translation>Gazda IP</translation>
     </message>
     <message>
         <source>Host Port</source>
-        <translation type="unfinished">Gazda port</translation>
+        <translation>Gazda port</translation>
     </message>
     <message>
         <source>Guest IP</source>
-        <translation type="unfinished">Vendég IP</translation>
+        <translation>Vendég IP</translation>
     </message>
     <message>
         <source>Guest Port</source>
-        <translation type="unfinished">Vendég port</translation>
+        <translation>Vendég port</translation>
     </message>
     <message>
         <source>Contains a list of port forwarding rules.</source>
-        <translation type="unfinished"></translation>
+        <translation>A port továbbítási szabályokat tartalmazó lista.</translation>
     </message>
     <message>
         <source>Add New Rule</source>
-        <translation type="unfinished"></translation>
+        <translation>Új szabály hozzáadása</translation>
     </message>
     <message>
         <source>Copy Selected Rule</source>
-        <translation type="unfinished"></translation>
+        <translation>Kiválasztott szabály másolása</translation>
     </message>
     <message>
         <source>Remove Selected Rule</source>
-        <translation type="unfinished"></translation>
+        <translation>Kiválasztott szabály eltávolítása</translation>
     </message>
     <message>
         <source>Adds new port forwarding rule.</source>
-        <translation type="unfinished"></translation>
+        <translation>Új port továbbítási szabály hozzáadása.</translation>
     </message>
     <message>
         <source>Copies selected port forwarding rule.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott port továbbítási szabály másolása.</translation>
     </message>
     <message>
         <source>Removes selected port forwarding rule.</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott port továbbítási szabály eltávolítása.</translation>
     </message>
 </context>
 <context>
@@ -11213,12 +11213,12 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     <message>
         <source>%1, %2 remaining</source>
         <comment>You may wish to translate this more like "Time remaining: %1, %2"</comment>
-        <translation>%2 van hátra a(z) %1 -ből</translation>
+        <translation>Hátralévő idő: %1 %2</translation>
     </message>
     <message>
         <source>%1 remaining</source>
         <comment>You may wish to translate this more like "Time remaining: %1"</comment>
-        <translation>%1 van hátra</translation>
+        <translation>Hátralévő idő: %1</translation>
     </message>
 </context>
 <context>
@@ -11335,7 +11335,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>Preferences</source>
-        <translation type="unfinished"></translation>
+        <translation>Beállítások</translation>
     </message>
 </context>
 <context>
@@ -11414,37 +11414,37 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>User Interface</source>
-        <translation type="unfinished"></translation>
+        <translation>Felhasználói felület</translation>
     </message>
     <message>
         <source>Settings</source>
-        <translation type="unfinished">Beállítások</translation>
+        <translation>Beállítások</translation>
     </message>
 </context>
 <context>
     <name>UISettingsSerializerProgress</name>
     <message>
         <source>Loading Settings...</source>
-        <translation type="unfinished"></translation>
+        <translation>Beállítások betöltése...</translation>
     </message>
     <message>
         <source>Saving Settings...</source>
-        <translation type="unfinished"></translation>
+        <translation>Beállítások mentése...</translation>
     </message>
 </context>
 <context>
     <name>UIStatusBarEditorWidget</name>
     <message>
         <source><nobr><b>Click</b> to toggle indicator presence.</nobr><br><nobr><b>Drag&Drop</b> to change indicator position.</nobr></source>
-        <translation type="unfinished"></translation>
+        <translation><nobr>A kijelzés átkapcsolásához <b>kattintás rá</b>.</nobr><br><nobr>A kijelzések áthelyezéséhez <b>&fogd és vidd</b> őket.</nobr></translation>
     </message>
     <message>
         <source>Close</source>
-        <translation type="unfinished">Bezárás</translation>
+        <translation>Bezárás</translation>
     </message>
     <message>
         <source>Enable Status Bar</source>
-        <translation type="unfinished"></translation>
+        <translation>Állapotsor bekapcsolása</translation>
     </message>
 </context>
 <context>
@@ -11570,7 +11570,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>This wizard will connect to the VirtualBox web-site and check if a newer version of VirtualBox is available.</p><p>Use the <b>Check</b> button to check for a new version now or the <b>Cancel</b> button if you do not want to perform this check.</p><p>You can run this wizard at any time by choosing <b>Check for Updates...</b> from the <b>Help</b> menu.</p></source>
-        <translation type="obsolete"><p>Ez a varázsló ellenőrizni fogja a VirtualBox weboldalán, hogy elérhető-e újabb verzió a VirtualBox-ból.</p><p>Az <b>Ellenőrzés</b> gombbal tudod elindítani a folyamatot és a <b>Mégsem</b> gombbal jelezheted, ha nem akarsz ellenőrizni.</p><p>Bármikor elindíthatod a varázslót a <b>Súgó</b> menü <b>Frissítések ellenőrzése...</b> pontjával.</p></translation>
+        <translation type="obsolete"><p>Ez a varázsló ellenőrizni fogja a VirtualBox weboldalán, hogy elérhető-e újabb verzió a VirtualBoxból.</p><p>Az <b>Ellenőrzés</b> gombbal tudod elindítani a folyamatot és a <b>Mégsem</b> gombbal jelezheted, ha nem akarsz ellenőrizni.</p><p>Bármikor elindíthatod a varázslót a <b>Súgó</b> menü <b>Frissítések ellenőrzése...</b> pontjával.</p></translation>
     </message>
 </context>
 <context>
@@ -11592,7 +11592,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>Saves the current execution state of the virtual machine to the physical hard disk of the host PC.</p><p>Next time this machine is started, it will be restored from the saved state and continue execution from the same place you saved it at, which will let you continue your work immediately.</p><p>Note that saving the machine state may take a long time, depending on the guest operating system type and the amount of memory you assigned to th [...]
-        <translation><p>Elmenti a virtuális gép aktuális állapotát a merevlemezre.</p><p>Amikor a virtuális gép legközelebb el lesz indítva, a mentett állapot lesz visszatöltve, és a futás a mentés előtti állapottól fog indulni.</p><p>A virtuális gép mentése a virtuális gép memóriájának méretétől és a vendégrendszer típusától függően hosszú ideig is eltarthat. Légy türelemmel, és ne állítsd le a VirtualBox-ot addig</p></translation>
+        <translation><p>Elmenti a virtuális gép aktuális állapotát a merevlemezre.</p><p>Amikor a virtuális gép legközelebb el lesz indítva, a mentett állapot lesz visszatöltve, és a futás a mentés előtti állapottól fog indulni.</p><p>A virtuális gép mentése a virtuális gép memóriájának méretétől és a vendégrendszer típusától függően hosszú ideig is eltarthat. Légy türelemmel, és ne állítsd le a VirtualBoxot addig</p></translation>
     </message>
     <message>
         <source>&Save the machine state</source>
@@ -11628,11 +11628,11 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>&Continue running in the background</source>
-        <translation type="unfinished"></translation>
+        <translation>&Futtatás tovább a háttérben</translation>
     </message>
     <message>
         <source><p>Close the virtual machine windows but keep the virtual machine running.</p><p>You can use the VirtualBox Manager to return to running the virtual machine in a window.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Bezárja a virtuális gépet, de a virtuális gép fut tovább.</p><p>A VirtualBox kezelővel visszaléphetsz a futó virtuális gépbe.</p></translation>
     </message>
 </context>
 <context>
@@ -11650,98 +11650,98 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     <name>UIVMInfoDialog</name>
     <message>
         <source>%1 - Session Information</source>
-        <translation type="unfinished">%1 - Munkamenet információk</translation>
+        <translation>%1 - Munkamenet információk</translation>
     </message>
     <message>
         <source>Configuration &Details</source>
-        <translation type="unfinished">&Konfigurációs részletek</translation>
+        <translation>&Konfigurációs részletek</translation>
     </message>
     <message>
         <source>&Runtime Information</source>
-        <translation type="unfinished">Futásidő info&rmációk</translation>
+        <translation>Futásidő info&rmációk</translation>
     </message>
     <message>
         <source>DMA Transfers</source>
-        <translation type="unfinished">DMA átvitelek</translation>
+        <translation>DMA átvitelek</translation>
     </message>
     <message>
         <source>PIO Transfers</source>
-        <translation type="unfinished">PIO átvitelek</translation>
+        <translation>PIO átvitelek</translation>
     </message>
     <message>
         <source>Data Read</source>
-        <translation type="unfinished">Olvasott adat</translation>
+        <translation>Olvasott adat</translation>
     </message>
     <message>
         <source>Data Written</source>
-        <translation type="unfinished">Írt adat</translation>
+        <translation>Írt adat</translation>
     </message>
     <message>
         <source>Data Transmitted</source>
-        <translation type="unfinished">Küldött adat</translation>
+        <translation>Küldött adat</translation>
     </message>
     <message>
         <source>Data Received</source>
-        <translation type="unfinished">Fogadott adat</translation>
+        <translation>Fogadott adat</translation>
     </message>
     <message>
         <source>Not Detected</source>
         <comment>guest additions</comment>
-        <translation type="unfinished">Nem található</translation>
+        <translation>Nem található</translation>
     </message>
     <message>
         <source>Not Detected</source>
         <comment>guest os type</comment>
-        <translation type="unfinished">Nem található</translation>
+        <translation>Nem található</translation>
     </message>
     <message>
         <source>Not Available</source>
         <comment>details report (VRDE server port)</comment>
-        <translation type="unfinished">Nem érhető el</translation>
+        <translation>Nem érhető el</translation>
     </message>
     <message>
         <source>Runtime Attributes</source>
-        <translation type="unfinished">Futtatókörnyezet paraméterei</translation>
+        <translation>Futtatókörnyezet paraméterei</translation>
     </message>
     <message>
         <source>Screen Resolution</source>
-        <translation type="unfinished">Felbontás</translation>
+        <translation>Felbontás</translation>
     </message>
     <message>
         <source>VM Uptime</source>
-        <translation type="unfinished"></translation>
+        <translation>VM futási ideje</translation>
     </message>
     <message>
         <source>Clipboard Mode</source>
-        <translation type="unfinished">Vágólap mód</translation>
+        <translation>Vágólap mód</translation>
     </message>
     <message>
         <source>Drag and Drop Mode</source>
-        <translation type="unfinished"></translation>
+        <translation>Fogd és vidd mód</translation>
     </message>
     <message>
         <source>Guest Additions</source>
-        <translation type="unfinished">Integrációs szolgáltatások</translation>
+        <translation>Integrációs szolgáltatások</translation>
     </message>
     <message>
         <source>Guest OS Type</source>
-        <translation type="unfinished">Vendég OS típusa</translation>
+        <translation>Vendég OS típusa</translation>
     </message>
     <message>
         <source>Storage Statistics</source>
-        <translation type="unfinished">Tároló statisztika</translation>
+        <translation>Tároló statisztika</translation>
     </message>
     <message>
         <source>No Storage Devices</source>
-        <translation type="unfinished">Nincsenek tárolóeszközök</translation>
+        <translation>Nincsenek tárolóeszközök</translation>
     </message>
     <message>
         <source>Network Statistics</source>
-        <translation type="unfinished">Hálózati statisztika</translation>
+        <translation>Hálózati statisztika</translation>
     </message>
     <message>
         <source>No Network Adapters</source>
-        <translation type="unfinished">Nincsenek hálózati adapterek</translation>
+        <translation>Nincsenek hálózati adapterek</translation>
     </message>
 </context>
 <context>
@@ -11903,19 +11903,19 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>&Expert Mode</source>
-        <translation type="unfinished"></translation>
+        <translation>&Szakértő mód</translation>
     </message>
     <message>
         <source>Switch to <nobr><b>Expert Mode</b></nobr>, a one-page dialog for experienced users.</source>
-        <translation type="unfinished"></translation>
+        <translation>A <nobr><b>Szakértő mód</b></nobr> egyetlen oldal, tapasztalt felhasználók számára.</translation>
     </message>
     <message>
         <source>&Guided Mode</source>
-        <translation type="unfinished"></translation>
+        <translation>E&gyszerű mód</translation>
     </message>
     <message>
         <source>Switch to <nobr><b>Guided Mode</b></nobr>, a step-by-step dialog with detailed explanations.</source>
-        <translation type="unfinished"></translation>
+        <translation>Az <nobr><b>Egyszerű mód</b></nobr>lépésről lépésre segít részletes magyarázatokkal.</translation>
     </message>
 </context>
 <context>
@@ -11934,7 +11934,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>Please select the virtual hard drive file that you would like to copy if it is not already selected. You can either choose one from the list or use the folder icon beside the list to select one.</p></source>
-        <translation type="obsolete"><p>Válaszd ki a virtuális lemezt, amelyiket másolni szeretnél, ha még nincs kiválasztva. Válaszhatsz másikat is a listából vagy a mappa ikonnal kiválaszthatsz egy virtuális lemezfájlt.</p></translation>
+        <translation type="obsolete"><p>Válaszd ki a virtuális lemezt, amelyiket másolni szeretnél, ha még nincs kiválasztva. Választhatsz másikat is a listából vagy a mappa ikonnal kiválaszthatsz egy virtuális lemezfájlt.</p></translation>
     </message>
     <message>
         <source>Choose a virtual hard drive file to copy...</source>
@@ -11958,7 +11958,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>A <b>dynamically allocated</b> hard drive file will only use space on your physical hard drive as it fills up (up to a maximum <b>fixed size</b>), although it will not shrink again automatically when space on it is freed.</p></source>
-        <translation type="obsolete"><p>A <b>dinamikus növekvő</b> virtuális lemezfájl a benne levő adatokhoz mérten foglal helyet a fizikai merevlemezen (a maxmimális <b>fix méretig</b>), bár a felszabaduló hellyel nem fog automatikusan csökkeni a mérete.</p></translation>
+        <translation type="obsolete"><p>A <b>dinamikus növekvő</b> virtuális lemezfájl a benne levő adatokhoz mérten foglal helyet a fizikai merevlemezen (a maximális <b>fix méretig</b>), bár a felszabaduló hellyel nem fog automatikusan csökkenni a mérete.</p></translation>
     </message>
     <message>
         <source><p>A <b>fixed size</b> hard drive file may take longer to create on some systems but is often faster to use.</p></source>
@@ -12015,75 +12015,75 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>Copy Virtual Hard Disk</source>
-        <translation type="unfinished"></translation>
+        <translation>Virtuális merevlemez másolása</translation>
     </message>
     <message>
         <source>Hard disk to copy</source>
-        <translation type="unfinished"></translation>
+        <translation>Másolandó merevlemez</translation>
     </message>
     <message>
         <source><p>Please select the virtual hard disk file that you would like to copy if it is not already selected. You can either choose one from the list or use the folder icon beside the list to select one.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Válaszd ki a virtuális lemezt, amelyiket másolni szeretnél, ha még nincs kiválasztva. Választhatsz másikat is a listából vagy a mappa ikonnal kiválaszthatsz egy virtuális lemezfájlt.</p></translation>
     </message>
     <message>
         <source>Choose a virtual hard disk file to copy...</source>
-        <translation type="unfinished"></translation>
+        <translation>Másolandó virtuális merevlemez választása...</translation>
     </message>
     <message>
         <source>Hard disk file type</source>
-        <translation type="unfinished"></translation>
+        <translation>Merevlemez típusa</translation>
     </message>
     <message>
         <source>Please choose the type of file that you would like to use for the new virtual hard disk. If you do not need to use it with other virtualization software you can leave this setting unchanged.</source>
-        <translation type="unfinished"></translation>
+        <translation>Válassz egy fájltípust, amit az új virtuális lemezhez szeretnél használni. Ha nem szeretnéd másik virtualizációs szoftverhez használni, nem kell a beállításokat módosítanod.</translation>
     </message>
     <message>
         <source>Storage on physical hard disk</source>
-        <translation type="unfinished"></translation>
+        <translation>Fizikai merevlemezen tárolás</translation>
     </message>
     <message>
         <source>Please choose whether the new virtual hard disk file should grow as it is used (dynamically allocated) or if it should be created at its maximum size (fixed size).</source>
-        <translation type="unfinished"></translation>
+        <translation>Válaszd ki, hogy az új virtuális lemez mérete folyamatosan növekedjen (dinamikusan növekvő) vagy lefoglalja-e a teljes területét (fix méretű).</translation>
     </message>
     <message>
         <source><p>A <b>dynamically allocated</b> hard disk file will only use space on your physical hard disk as it fills up (up to a maximum <b>fixed size</b>), although it will not shrink again automatically when space on it is freed.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A <b>dinamikus növekvő</b> virtuális lemezfájl a benne levő adatokhoz mérten foglal helyet a fizikai merevlemezen (a maximális <b>fix méretig</b>), bár a felszabaduló hellyel nem fog automatikusan csökkenni a mérete.</p></translation>
     </message>
     <message>
         <source><p>A <b>fixed size</b> hard disk file may take longer to create on some systems but is often faster to use.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A <b>fix méretű</b> merevlemezfájl létrehozása egyes rendszereken lassú lehet, de gyakran gyorsabb a használata.</p></translation>
     </message>
     <message>
         <source><p>You can also choose to <b>split</b> the hard disk file into several files of up to two gigabytes each. This is mainly useful if you wish to store the virtual machine on removable USB devices or old systems, some of which cannot handle very large files.</source>
-        <translation type="unfinished"></translation>
+        <translation><p><b>Feldarabol</b>hatod a virtuális lemezeket, maximum 2GB-os fájlokra. Leginkább akkor hasznos, ha a virtuális gépet USB eszközön vagy régi fájlrendszeren tárolod, melyek nem tudják a nagy fájlokat kezelni.</translation>
     </message>
     <message>
         <source>Please choose a location for new virtual hard disk file</source>
-        <translation type="unfinished"></translation>
+        <translation>Válaszd ki az új virtuális merevlemez fájl helyét</translation>
     </message>
     <message>
         <source>New hard disk to create</source>
-        <translation type="unfinished"></translation>
+        <translation>Új  merevlemez létrehozása</translation>
     </message>
     <message>
         <source>Please type the name of the new virtual hard disk file into the box below or click on the folder icon to select a different folder to create the file in.</source>
-        <translation type="unfinished"></translation>
+        <translation>Kérlek add meg a lenti mezőben az új virtuális merevlemez nevét, vagy kattints a mappa ikonra a mappa kiválasztásához, ahol létrejöjjön a fájl.</translation>
     </message>
     <message>
         <source>Choose a location for new virtual hard disk file...</source>
-        <translation type="unfinished"></translation>
+        <translation>Az új merevlemez helyének kiválasztása...</translation>
     </message>
     <message>
         <source>Hard disk to &copy</source>
-        <translation type="unfinished"></translation>
+        <translation>&Másolandó merevlemez</translation>
     </message>
     <message>
         <source>&New hard disk to create</source>
-        <translation type="unfinished"></translation>
+        <translation>Új  &merevlemez létrehozása</translation>
     </message>
     <message>
         <source>Hard disk file &type</source>
-        <translation type="unfinished"></translation>
+        <translation>Merevlemez &típusa</translation>
     </message>
 </context>
 <context>
@@ -12186,7 +12186,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>Please choose the type of clone you wish to create.</p><p>If you choose <b>Full clone</b>, an exact copy (including all virtual hard disk files) of the original virtual machine will be created.</p><p>If you choose <b>Linked clone</b>, a new machine will be created, but the virtual hard disk files will be tied to the virtual hard disk files of original machine and you will not be able to move the new virtual machine  [...]
-        <translation type="unfinished"></translation>
+        <translation><p>Válaszd ki a klón típusát.</p><p>Ha a <b>Teljes klón</b>t választod, az eredeti virtuális gép pontos másolata (minden virtuális lemezképpel együtt) fog létrejönni.</p><p>Ha a <b>Linkelt klón</b>t választod, egy új virtuális gép jön létre, de a virtuális lemezképek az eredeti virtuális gép lemezképeire fognak mutatni, és az eredeti virtuális gép nélkül nem tudod a virtuális gépet másik számítógépre átmozgatni.&l [...]
     </message>
 </context>
 <context>
@@ -12229,7 +12229,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>Please choose where to create the virtual appliance. You can create it on your own computer, on the Sun Cloud service or on an S3 storage server.</source>
-        <translation>Válaszd ki a virtuális gép létrehozási helyét. Létrehozhatod a saját gépeden, Sun Cloudszolgáltatáson vagy egy S3 szerveren.</translation>
+        <translation>Válaszd ki a virtuális gép létrehozási helyét. Létrehozhatod a saját gépeden, Sun Cloud szolgáltatáson vagy egy S3 szerveren.</translation>
     </message>
     <message>
         <source>Create on</source>
@@ -12394,7 +12394,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>Please select a virtual optical disk file or a physical optical drive containing a disk to start your new virtual machine from.</p><p>The disk should be suitable for starting a computer from and should contain the operating system you wish to install on the virtual machine if you want to do that now. The disk will be ejected from the virtual drive automatically next time you switch the virtual machine off, but you can also do this yourself if needed u [...]
-        <translation><p>Válassz ki egy virtuális optikai lemezt vagy egy fizikai optikai meghajtót, melyről az új virtuális gép indulhat.</p><p>A lemeznek alkalmasnak kell lennie, egy számítógép elindításához és tartalmaznia kell a virtuális gépre telepítendő opreációs rendszert, ha ezt szeretnéd tenni. A lemez automatikusan leválasztódik a virtuális meghajtóról, amint kikapcsolod a virtuális gépet, de ezt te is megteheted az Eszközök menüből.</p></translation>
+        <translation><p>Válassz ki egy virtuális optikai lemezt vagy egy fizikai optikai meghajtót, melyről az új virtuális gép indulhat.</p><p>A lemeznek alkalmasnak kell lennie, egy számítógép elindításához és tartalmaznia kell a virtuális gépre telepítendő operációs rendszert, ha ezt szeretnéd tenni. A lemez automatikusan leválasztódik a virtuális meghajtóról, amint kikapcsolod a virtuális gépet, de ezt te is megteheted az Eszközök menüből.</p></translation>
     </message>
     <message>
         <source><p>Please select a virtual optical disk file or a physical optical drive containing a disk to start your new virtual machine from.</p><p>The disk should be suitable for starting a computer from. As this virtual machine has no hard drive you will not be able to install an operating system on it at the moment.</p></source>
@@ -12488,7 +12488,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>A <b>dynamically allocated</b> hard drive file will only use space on your physical hard drive as it fills up (up to a maximum <b>fixed size</b>), although it will not shrink again automatically when space on it is freed.</p></source>
-        <translation type="obsolete"><p>A <b>dinamikus növekvő</b> virtuális lemezfájl a benne levő adatokhoz mérten foglal helyet a fizikai merevlemezen (a maxmimális <b>fix méretig</b>), bár a felszabaduló hellyel nem fog automatikusan csökkeni a mérete.</p></translation>
+        <translation type="obsolete"><p>A <b>dinamikus növekvő</b> virtuális lemezfájl a benne levő adatokhoz mérten foglal helyet a fizikai merevlemezen (a maximális <b>fix méretig</b>), bár a felszabaduló hellyel nem fog automatikusan csökkenni a mérete.</p></translation>
     </message>
     <message>
         <source><p>A <b>fixed size</b> hard drive file may take longer to create on some systems but is often faster to use.</p></source>
@@ -12528,7 +12528,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>Select the size of the virtual hard drive in megabytes. This size is the limit on the amount of file data that a virtual machine will be able to store on the hard drive.</source>
-        <translation type="obsolete">Add meg a virtuális lemez méretét megabájtban. Ezt a méretet fogja a virtuális gép látni a lemezből.</translation>
+        <translation type="obsolete">Add meg a virtuális lemez méretét megabyte-ban. Ezt a méretet fogja a virtuális gép látni a lemezből.</translation>
     </message>
     <message>
         <source>File &location</source>
@@ -12544,51 +12544,51 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>Create Virtual Hard Disk</source>
-        <translation type="unfinished"></translation>
+        <translation>Virtuális merevlemez készítése</translation>
     </message>
     <message>
         <source>Hard disk file type</source>
-        <translation type="unfinished"></translation>
+        <translation>Merevlemez típusa</translation>
     </message>
     <message>
         <source>Please choose the type of file that you would like to use for the new virtual hard disk. If you do not need to use it with other virtualization software you can leave this setting unchanged.</source>
-        <translation type="unfinished"></translation>
+        <translation>Válassz egy fájltípust, amit az új virtuális lemezhez szeretnél használni. Ha nem szeretnéd másik virtualizációs szoftverhez használni, nem kell a beállításokat módosítanod.</translation>
     </message>
     <message>
         <source>Storage on physical hard disk</source>
-        <translation type="unfinished"></translation>
+        <translation>Fizikai merevlemezen tárolás</translation>
     </message>
     <message>
         <source>Please choose whether the new virtual hard disk file should grow as it is used (dynamically allocated) or if it should be created at its maximum size (fixed size).</source>
-        <translation type="unfinished"></translation>
+        <translation>Válaszd ki, hogy az új virtuális lemez mérete folyamatosan növekedjen (dinamikusan növekvő) vagy lefoglalja-e a teljes területét (fix méretű).</translation>
     </message>
     <message>
         <source><p>A <b>dynamically allocated</b> hard disk file will only use space on your physical hard disk as it fills up (up to a maximum <b>fixed size</b>), although it will not shrink again automatically when space on it is freed.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A <b>dinamikus növekvő</b> virtuális lemezfájl a benne levő adatokhoz mérten foglal helyet a fizikai merevlemezen (a maximális <b>fix méretig</b>), bár a felszabaduló hellyel nem fog automatikusan csökkenni a mérete.</p></translation>
     </message>
     <message>
         <source><p>A <b>fixed size</b> hard disk file may take longer to create on some systems but is often faster to use.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>A <b>fix méretű</b> merevlemezfájl létrehozása egyes rendszereken lassú lehet, de gyakran gyorsabb a használata.</p></translation>
     </message>
     <message>
         <source><p>You can also choose to <b>split</b> the hard disk file into several files of up to two gigabytes each. This is mainly useful if you wish to store the virtual machine on removable USB devices or old systems, some of which cannot handle very large files.</source>
-        <translation type="unfinished"></translation>
+        <translation><p><b>Feldarabol</b>hatod a virtuális lemezeket, maximum 2GB-os fájlokra. Leginkább akkor hasznos, ha a virtuális gépet USB eszközön vagy régi fájlrendszeren tárolod, melyek nem tudják a nagy fájlokat kezelni.</translation>
     </message>
     <message>
         <source>Please type the name of the new virtual hard disk file into the box below or click on the folder icon to select a different folder to create the file in.</source>
-        <translation type="unfinished"></translation>
+        <translation>Kérlek add meg a lenti mezőben az új virtuális merevlemez nevét, vagy kattints a mappa ikonra a mappa kiválasztásához, ahol létrejöjjön a fájl.</translation>
     </message>
     <message>
         <source>Choose a location for new virtual hard disk file...</source>
-        <translation type="unfinished"></translation>
+        <translation>Az új merevlemez helyének kiválasztása...</translation>
     </message>
     <message>
         <source>Select the size of the virtual hard disk in megabytes. This size is the limit on the amount of file data that a virtual machine will be able to store on the hard disk.</source>
-        <translation type="unfinished"></translation>
+        <translation>Add meg a virtuális lemez méretét megabyte-ban. Ezt a méretet fogja a virtuális gép látni a lemezből.</translation>
     </message>
     <message>
         <source>Hard disk file &type</source>
-        <translation type="unfinished"></translation>
+        <translation>Merevlemez &típusa</translation>
     </message>
 </context>
 <context>
@@ -12635,7 +12635,7 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source><p>Select the amount of memory (RAM) in megabytes to be allocated to the virtual machine.</p><p>The recommended memory size is <b>%1</b> MB.</p></source>
-        <translation><p>Válaszd ki a virtuális gép számára fenntartott memória méretét (RAM), megabájtban.</p><p>Ajánlott memóriaméret: <b>%1</b> MB.</p></translation>
+        <translation><p>Válaszd ki a virtuális gép számára fenntartott memória méretét (RAM), megabyte-ban.</p><p>Ajánlott memóriaméret: <b>%1</b> MB.</p></translation>
     </message>
     <message>
         <source>Hard drive</source>
@@ -12667,27 +12667,27 @@ esetleg a <b>Létező</b> gombbal a Virtuális lemezkezelőből.<
     </message>
     <message>
         <source>Hard disk</source>
-        <translation type="unfinished"></translation>
+        <translation>Merevlemez</translation>
     </message>
     <message>
         <source><p>If you wish you can add a virtual hard disk to the new machine. You can either create a new hard disk file or select one from the list or from another location using the folder icon.</p><p>If you need a more complex storage set-up you can skip this step and make the changes to the machine settings once the machine is created.</p><p>The recommended size of the hard disk is <b>%1</b>.</p></source>
-        <translation type="unfinished"></translation>
+        <translation><p>Ha szeretnéd, hozzáadhatsz merevlemezt az új virtuális géphez. Létrehozhatsz új merevlemezt, választhatsz egyet a listából, vagy a mappa ikonra kattintva, kikereshetsz egyet.</p><p>Ha összetettebb felépítésre van szükséged, kihagyhatod ezt a lépést, és a virtuális gép létrejötte után is végezhetsz módosításokat.</p><p>Ajánlott merevlemezméret: <b>%1</b>.</p></translation>
     </message>
     <message>
         <source>&Do not add a virtual hard disk</source>
-        <translation type="unfinished"></translation>
+        <translation>Ne a&djon hozzá virtuális merevlemezt</translation>
     </message>
     <message>
         <source>&Create a virtual hard disk now</source>
-        <translation type="unfinished"></translation>
+        <translation>Ú&j virtuális merevlemez készítése</translation>
     </message>
     <message>
         <source>&Use an existing virtual hard disk file</source>
-        <translation type="unfinished"></translation>
+        <translation>&Létező virtuális merevlemez használata</translation>
     </message>
     <message>
         <source>Choose a virtual hard disk file...</source>
-        <translation type="unfinished">Virtuális merevlemez választása...</translation>
+        <translation>Virtuális merevlemez választása...</translation>
     </message>
 </context>
 <context>
@@ -12888,7 +12888,7 @@ Verzió %1</translation>
     </message>
     <message>
         <source><p>Saves the current execution state of the virtual machine to the physical hard disk of the host PC.</p><p>Next time this machine is started, it will be restored from the saved state and continue execution from the same place you saved it at, which will let you continue your work immediately.</p><p>Note that saving the machine state may take a long time, depending on the guest operating system type and the amount of memory you assigned to th [...]
-        <translation type="obsolete"><p>Elmenti a virtuális gép aktuális állapotát a merevlemezre.</p><p>Amikor a virtuális gép legközelebb el lesz indítva, a mentett állapot lesz visszatöltve, és a futás a mentés előtti állapottól fog indulni.</p><p>A virtuális gép mentése a virtuális gép memóriájának méretétől és a vendégrendszer típusától függően hosszú ideig is eltarthat. Légy türelemmel, és ne állítsd le a VirtualBox-ot addig</p></translation>
+        <translation type="obsolete"><p>Elmenti a virtuális gép aktuális állapotát a merevlemezre.</p><p>Amikor a virtuális gép legközelebb el lesz indítva, a mentett állapot lesz visszatöltve, és a futás a mentés előtti állapottól fog indulni.</p><p>A virtuális gép mentése a virtuális gép memóriájának méretétől és a vendégrendszer típusától függően hosszú ideig is eltarthat. Légy türelemmel, és ne állítsd le a VirtualBoxot addig</p></translation>
     </message>
     <message>
         <source><p>Sends the ACPI Power Button press event to the virtual machine.</p><p>Normally, the guest operating system running inside the virtual machine will detect this event and perform a clean shutdown procedure. This is a recommended way to turn off the virtual machine because all applications running inside it will get a chance to save their data and state.</p><p>If the machine doesn't respond to this action then the guest operating system  [...]
@@ -13924,19 +13924,19 @@ Verzió %1</translation>
     </message>
     <message>
         <source>Displays a window to select a different folder.</source>
-        <translation type="unfinished"></translation>
+        <translation>Megnyit egy ablakot az egy másik mappa kiválasztásához.</translation>
     </message>
     <message>
         <source>Displays a window to select a different file.</source>
-        <translation type="unfinished"></translation>
+        <translation>Megnyit egy ablakot az egy másik fájl kiválasztásához.</translation>
     </message>
     <message>
         <source>Holds the folder path.</source>
-        <translation type="unfinished"></translation>
+        <translation>A mappa elérési útja.</translation>
     </message>
     <message>
         <source>Holds the file path.</source>
-        <translation type="unfinished"></translation>
+        <translation>A fájl elérési útja.</translation>
     </message>
 </context>
 <context>
@@ -14017,7 +14017,7 @@ Verzió %1</translation>
     <message>
         <source><br><nobr>Serial No. %1</nobr></source>
         <comment>USB device tooltip</comment>
-        <translation><br><nobr>Serial No. %1</nobr></translation>
+        <translation><br><nobr>Sorozatszám %1</nobr></translation>
     </message>
     <message>
         <source><br><nobr>State: %1</nobr></source>
@@ -14764,7 +14764,7 @@ Verzió %1</translation>
     <message>
         <source><nobr>Serial No.: %1</nobr></source>
         <comment>USB filter tooltip</comment>
-        <translation><nobr>Serial No. %1</nobr></translation>
+        <translation><nobr>Sorozatszám: %1</nobr></translation>
     </message>
     <message>
         <source><nobr>Port: %1</nobr></source>
@@ -15844,7 +15844,7 @@ Verzió %1</translation>
     <message>
         <source>NAT network, '%1'</source>
         <comment>details report (network)</comment>
-        <translation>Nat hálózat, '%1'</translation>
+        <translation>NAT hálózat, '%1'</translation>
     </message>
     <message>
         <source>You can create or add disk image files in the virtual machine settings.</source>
@@ -15853,153 +15853,153 @@ Verzió %1</translation>
     <message>
         <source>USB</source>
         <comment>StorageControllerType</comment>
-        <translation type="unfinished">USB</translation>
+        <translation>USB</translation>
     </message>
     <message>
         <source>off</source>
         <comment>guest monitor status</comment>
-        <translation type="unfinished"></translation>
+        <translation>ki</translation>
     </message>
     <message>
         <source>Active</source>
         <comment>details report (VT-x/AMD-V)</comment>
-        <translation type="unfinished">Aktív</translation>
+        <translation>Aktív</translation>
     </message>
     <message>
         <source>Inactive</source>
         <comment>details report (VT-x/AMD-V)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Inaktív</translation>
     </message>
     <message>
         <source>Active</source>
         <comment>details report (Nested Paging)</comment>
-        <translation type="unfinished">Aktív</translation>
+        <translation>Aktív</translation>
     </message>
     <message>
         <source>Inactive</source>
         <comment>details report (Nested Paging)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Inaktív</translation>
     </message>
     <message>
         <source>Active</source>
         <comment>details report (Unrestricted Execution)</comment>
-        <translation type="unfinished">Aktív</translation>
+        <translation>Aktív</translation>
     </message>
     <message>
         <source>Inactive</source>
         <comment>details report (Unrestricted Execution)</comment>
-        <translation type="unfinished"></translation>
+        <translation>Inaktív</translation>
     </message>
     <message>
         <source>Paravirtualization Interface</source>
         <comment>details report</comment>
-        <translation type="unfinished"></translation>
+        <translation>Paravirtualizációs interfész</translation>
     </message>
     <message>
         <source>Taking Snapshot</source>
         <comment>MachineState</comment>
-        <translation type="unfinished"></translation>
+        <translation>Pillanatfelvétel készítése</translation>
     </message>
     <message>
         <source>Taking Online Snapshot</source>
         <comment>MachineState</comment>
-        <translation type="unfinished"></translation>
+        <translation>Online pillanatkép készítése</translation>
     </message>
     <message>
         <source>None</source>
         <comment>ParavirtProvider</comment>
-        <translation type="unfinished"></translation>
+        <translation>Nincs</translation>
     </message>
     <message>
         <source>Default</source>
         <comment>ParavirtProvider</comment>
-        <translation type="unfinished">Alapértelmezett</translation>
+        <translation>Alapértelmezett</translation>
     </message>
     <message>
         <source>Legacy</source>
         <comment>ParavirtProvider</comment>
-        <translation type="unfinished"></translation>
+        <translation>Örökölt</translation>
     </message>
     <message>
         <source>Minimal</source>
         <comment>ParavirtProvider</comment>
-        <translation type="unfinished"></translation>
+        <translation>Minimális</translation>
     </message>
     <message>
         <source>Hyper-V</source>
         <comment>ParavirtProvider</comment>
-        <translation type="unfinished"></translation>
+        <translation>Hyper-V</translation>
     </message>
     <message>
         <source>KVM</source>
         <comment>ParavirtProvider</comment>
-        <translation type="unfinished"></translation>
+        <translation>KVM</translation>
     </message>
     <message>
         <source>Optical</source>
         <comment>DeviceType</comment>
-        <translation type="unfinished"></translation>
+        <translation>Optikai</translation>
     </message>
     <message>
         <source>New dynamically allocated storage</source>
         <comment>MediumVariant</comment>
-        <translation type="unfinished"></translation>
+        <translation>Új dinamikusan növekvő tároló</translation>
     </message>
     <message>
         <source>TCP</source>
         <comment>PortMode</comment>
-        <translation type="unfinished">TCP</translation>
+        <translation>TCP</translation>
     </message>
     <message>
         <source>OHCI</source>
         <comment>USBControllerType</comment>
-        <translation type="unfinished"></translation>
+        <translation>OHCI</translation>
     </message>
     <message>
         <source>EHCI</source>
         <comment>USBControllerType</comment>
-        <translation type="unfinished"></translation>
+        <translation>EHCI</translation>
     </message>
     <message>
         <source>xHCI</source>
         <comment>USBControllerType</comment>
-        <translation type="unfinished"></translation>
+        <translation>xHCI</translation>
     </message>
     <message>
         <source>USB Port %1</source>
         <comment>StorageSlot</comment>
-        <translation type="unfinished"></translation>
+        <translation>USB port %1</translation>
     </message>
     <message>
         <source>User interface</source>
         <comment>DetailsElementType</comment>
-        <translation type="unfinished"></translation>
+        <translation>Felhasználói felület</translation>
     </message>
     <message>
         <source>(Optical Drive)</source>
-        <translation type="unfinished"></translation>
+        <translation>(Optikai meghajtó)</translation>
     </message>
     <message>
         <source>Please choose a virtual hard disk file</source>
-        <translation type="unfinished"></translation>
+        <translation>Válassz egy virtuális merevlemez fájlt</translation>
     </message>
     <message>
         <source>All virtual hard disk files (%1)</source>
-        <translation type="unfinished"></translation>
+        <translation>Minden virtuális merevlemez fájl (%1)</translation>
     </message>
     <message>
         <source>Encrypted</source>
         <comment>medium</comment>
-        <translation type="unfinished"></translation>
+        <translation>Titkosított</translation>
     </message>
     <message>
         <source>Some of the files in this hard disk chain are inaccessible. Please use the Virtual Medium Manager to inspect these files.</source>
         <comment>medium</comment>
-        <translation type="unfinished"></translation>
+        <translation>Valamelyik fájl ebben a merevlemez-láncban elérhetetlen. Kérlek, használd a Virtuális médiakezelőt a fájlok ellenőrzéséhez.</translation>
     </message>
     <message>
         <source>Please choose a location for new virtual hard disk file</source>
-        <translation type="unfinished"></translation>
+        <translation>Válaszd ki az új virtuális merevlemez fájl helyét</translation>
     </message>
 </context>
 <context>
@@ -16312,7 +16312,7 @@ to the system default language.</qt>
     </message>
     <message>
         <source>Holds the path to the library that provides authentication for Remote Display (VRDP) clients.</source>
-        <translation type="obsolete">Az azonosítási könyvtár elérési útját mutatja, ami a VRDP klienseket autentikálja. </translation>
+        <translation type="obsolete">Az azonosítási könyvtár elérési útját mutatja, ami a VRDP klienseket hitelesíti. </translation>
     </message>
     <message>
         <source>Opens a window to select the VRDP authentication library file.</source>
@@ -16654,15 +16654,15 @@ to the system default language.</qt>
     </message>
     <message>
         <source><i>Not&nbsp;Encrypted</i></source>
-        <translation type="unfinished"></translation>
+        <translation><i>Nem&nbsp;titkosított</i></translation>
     </message>
     <message>
         <source>Encrypted with key:</source>
-        <translation type="unfinished"></translation>
+        <translation>Kulccsal titkosított:</translation>
     </message>
     <message>
         <source>UUID:</source>
-        <translation type="unfinished"></translation>
+        <translation>UUID:</translation>
     </message>
 </context>
 <context>
@@ -16781,7 +16781,7 @@ to the system default language.</qt>
     </message>
     <message>
         <source>Check this box if you do not want to receive mail from innotek at the e-mail address specified above.</source>
-        <translation type="obsolete">Akkor engedélyezd ezt, ha nem szeretnél levelet kapni az Innotek-től erre az e-mail címre.</translation>
+        <translation type="obsolete">Akkor engedélyezd ezt, ha nem szeretnél levelet kapni az Innotektől erre az e-mail címre.</translation>
     </message>
     <message>
         <source>Welcome to the VirtualBox Registration Form!</source>
@@ -16805,7 +16805,7 @@ to the system default language.</qt>
     </message>
     <message>
         <source><p>Please fill out this registration form to let us know that you use VirtualBox and, optionally, to keep you informed about VirtualBox news and updates.</p><p>Enter your full name using Latin characters and your e-mail address to the fields below. Sun Microsystems will use this information only to gather product usage statistics and to send you VirtualBox newsletters. In particular, Sun Microsystems will never pass your data to third parties. Detailed i [...]
-        <translation type="obsolete"><p>Kérlek töltsd ki ezt a regisztrációs űrlapot, hogy tudjuk, hogy használod a VirtualBox-ot. Ha akarod, a friss VirtualBox-os hírekről és frissítésekről is értesítünk.</p><p>Add meg a nevedet ékezet nélkül, és az e-mail címedet az alábbi mezőkben. A Sun Microsystems ezeket az adatokat csakis statisztikai célokra és hírlevél küldésére használja. Természetesen a Sun Microsystems vállalja, hogy harmadik fél számára ezeket az adatokat n [...]
+        <translation type="obsolete"><p>Kérlek töltsd ki ezt a regisztrációs űrlapot, hogy tudjuk, hogy használod a VirtualBoxot. Ha akarod, a friss VirtualBoxos hírekről és frissítésekről is értesítünk.</p><p>Add meg a nevedet ékezet nélkül, és az e-mail címedet az alábbi mezőkben. A Sun Microsystems ezeket az adatokat csakis statisztikai célokra és hírlevél küldésére használja. Természetesen a Sun Microsystems vállalja, hogy harmadik fél számára ezeket az adatokat nem [...]
     </message>
     <message>
         <source>Check this box if you do not want to receive mail from Sun Microsystems at the e-mail address specified above.</source>
@@ -16825,7 +16825,7 @@ to the system default language.</qt>
     </message>
     <message>
         <source><p>Please fill out this registration form to let us know that you use VirtualBox and, optionally, to keep you informed about VirtualBox news and updates.</p><p>Please use Latin characters only to fill in  the fields below. Sun Microsystems will use this information only to gather product usage statistics and to send you VirtualBox newsletters. In particular, Sun Microsystems will never pass your data to third parties. Detailed information about how we us [...]
-        <translation type="obsolete"><p>Kérlek, töltsd ki ezt a regisztrációs űrlapot, hogy tudjuk azt, hogy a felhasználóink táborába tartozol, valamint, hogy informálhassunk téged a különböző hírekről, újdonságokról.</p><p>Add meg speciális karakterek nélkül a neved, illetve az e-mail címedet. A Sun Microsystems az adataidat kizárólag statisztikai célokra, és a te informálásodra használja, harmadik fél számára ki nem adja. A személyes adatok felhasználásának és kezelé [...]
+        <translation type="obsolete"><p>Kérlek, töltsd ki ezt a regisztrációs űrlapot, hogy tudjuk azt, hogy a felhasználóink táborába tartozol, valamint, hogy informálhassunk téged a különböző hírekről, újdonságokról.</p><p>Add meg speciális karakterek nélkül a neved, illetve az e-mail címedet. A Sun Microsystems az adataidat kizárólag statisztikai célokra, és a te informálásodra használja, harmadik fél számára ki nem adja. A személyes adatok felhasználásának és kezelé [...]
     </message>
     <message>
         <source>I &already have a Sun Online account:</source>
@@ -17051,11 +17051,11 @@ to the system default language.</qt>
     </message>
     <message>
         <source>&VirtualBox Web Site...</source>
-        <translation type="obsolete">&VirtualBox website...</translation>
+        <translation type="obsolete">&VirtualBox weboldal...</translation>
     </message>
     <message>
         <source>Open the browser and go to the VirtualBox product web site</source>
-        <translation type="obsolete">Böngésző megnyitása a VirtualBox website-jával</translation>
+        <translation type="obsolete">Böngésző megnyitása a VirtualBox weboldalával</translation>
     </message>
     <message>
         <source>&About VirtualBox...</source>
@@ -17184,7 +17184,7 @@ to the system default language.</qt>
     </message>
     <message>
         <source>Import an appliance into VirtualBox</source>
-        <translation type="obsolete">Virtuális gép importálása a VirtualBox-ba</translation>
+        <translation type="obsolete">Virtuális gép importálása a VirtualBoxba</translation>
     </message>
     <message>
         <source>&Export Appliance...</source>
@@ -17192,7 +17192,7 @@ to the system default language.</qt>
     </message>
     <message>
         <source>Export one or more VirtualBox virtual machines as an appliance</source>
-        <translation type="obsolete">Virtuális gép exportálása a VirtualBox-ból</translation>
+        <translation type="obsolete">Virtuális gép exportálása a VirtualBoxból</translation>
     </message>
     <message>
         <source>Re&fresh</source>
@@ -17350,7 +17350,7 @@ to access it from a Linux OS. This feature requires Guest Additions.</qt><
         <translation type="obsolete"><qt>Minden a gép számára elérhető megosztott mappa listázása.
 Használja a
 <tt>net use x: \\vboxsvr\share</tt>
-parancsot a <i>share</i> nevű megosztás eléréséhez a DOS-szerű OS-ekból, vagy
+parancsot a <i>share</i> nevű megosztás eléréséhez a DOS-szerű OS-ekből, vagy
 a <tt>mount -t vboxsf share mount_point</tt>
 parancsot Linux-alapú OS-ekből. Integrációs szolgáltatások szükségesek hozzá.</qt></translation>
     </message>
@@ -17592,12 +17592,12 @@ parancsot Linux-alapú OS-ekből. Integrációs szolgáltatások szükségesek h
     </message>
     <message>
         <source>The current state is identical to the state stored in the current snapshot</source>
-        <translation>A jelen állapot egyezik az aktuális snapshot-ban található állapottal</translation>
+        <translation>A jelen állapot egyezik az aktuális pillanatfelvételben található állapottal</translation>
     </message>
     <message>
         <source> (current, </source>
         <comment>Snapshot details</comment>
-        <translation> (current, </translation>
+        <translation> (jelenlegi, </translation>
     </message>
     <message>
         <source>online)</source>
@@ -17612,12 +17612,12 @@ parancsot Linux-alapú OS-ekből. Integrációs szolgáltatások szükségesek h
     <message>
         <source>Taken at %1</source>
         <comment>Snapshot (time)</comment>
-        <translation>%1 fogadva</translation>
+        <translation>Készítve: %1</translation>
     </message>
     <message>
         <source>Taken on %1</source>
         <comment>Snapshot (date + time)</comment>
-        <translation>%1 fogadva</translation>
+        <translation>Készítve: %1</translation>
     </message>
     <message>
         <source>%1 since %2</source>
@@ -17710,19 +17710,19 @@ parancsot Linux-alapú OS-ekből. Integrációs szolgáltatások szükségesek h
     </message>
     <message>
         <source>Restore selected snapshot of the virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott pillanatkép helyreállítása a virtuális gépre</translation>
     </message>
     <message>
         <source>Delete selected snapshot of the virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott pillanatkép törlése</translation>
     </message>
     <message>
         <source>Display a window with selected snapshot details</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott pillanatkép részleteinek megjelenítése</translation>
     </message>
     <message>
         <source>Clone selected virtual machine</source>
-        <translation type="unfinished"></translation>
+        <translation>A kiválasztott virtuális gép klónozása</translation>
     </message>
 </context>
 <context>
@@ -17782,7 +17782,7 @@ parancsot Linux-alapú OS-ekből. Integrációs szolgáltatások szükségesek h
     </message>
     <message>
         <source>Snapshot %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Pillanatkép: %1</translation>
     </message>
 </context>
 <context>
@@ -17854,7 +17854,7 @@ parancsot Linux-alapú OS-ekből. Integrációs szolgáltatások szükségesek h
     </message>
     <message>
         <source>&Revision</source>
-        <translation type="obsolete">&Revizió</translation>
+        <translation type="obsolete">&Revízió</translation>
     </message>
     <message>
         <source>Por&t</source>
@@ -18561,7 +18561,7 @@ value.</qt></source>
     </message>
     <message>
         <source>Controls the amount of memory provided to the virtual machine. If you assign too much, the machine might not start.</source>
-        <translation type="obsolete">A virtuális gép memóriahasználatát állítja be. Ha túl magas az értek, a virtuális gp nem indul el.</translation>
+        <translation type="obsolete">A virtuális gép memóriahasználatát állítja be. Ha túl magas az értek, a virtuális gép nem indul el.</translation>
     </message>
     <message>
         <source><</source>
@@ -18781,11 +18781,11 @@ value.</qt></source>
     </message>
     <message>
         <source>Authentication Method </source>
-        <translation type="obsolete">Autentikáció típusa </translation>
+        <translation type="obsolete">Hitelesítés típusa </translation>
     </message>
     <message>
         <source>Authentication Timeout </source>
-        <translation type="obsolete">Autentikációs időtúllépés </translation>
+        <translation type="obsolete">Hitelesítési időtúllépés </translation>
     </message>
     <message>
         <source>Holds the VRDP Server port.</source>
@@ -18793,11 +18793,11 @@ value.</qt></source>
     </message>
     <message>
         <source>Defines the VRDP authentication method.</source>
-        <translation type="obsolete">A VRDP autentikációs metódus.</translation>
+        <translation type="obsolete">A VRDP hitelesítési metódus.</translation>
     </message>
     <message>
         <source>Specifies the timeout for guest authentication, in milliseconds.</source>
-        <translation type="obsolete">Időkorlát a vendég autentikálásához, millisec-ben.</translation>
+        <translation type="obsolete">Időkorlát a vendég hitelesítéséhez, ezredmásodpercben.</translation>
     </message>
     <message>
         <source>Help</source>
@@ -18972,7 +18972,7 @@ Input Output APIC (I/O APIC), amely egy picit visszafogja a virtuális gép telj
     <message>
         <source><qt>Controls the audio output driver. The <b>Null Audio Driver</b>
 makes the guest see an audio card, however every access to it will be ignored.</qt></source>
-        <translation type="obsolete"><qt>Az audio kimenet driver beállítása. A <b>Null Audio Driver</b>
+        <translation type="obsolete"><qt>Az audió kimenet driver beállítása. A <b>Null Audio Driver</b>
 hatására a virtuális gép látni fogja a hangkártyát, de nem szólal meg a gazda gépen.</qt></translation>
     </message>
     <message>
@@ -19082,11 +19082,11 @@ hatására a virtuális gép látni fogja a hangkártyát, de nem szólal meg a
     </message>
     <message>
         <source>Authentication &Method </source>
-        <translation type="obsolete">Autentikációs &metódus </translation>
+        <translation type="obsolete">Hitelesítési &metódus </translation>
     </message>
     <message>
         <source>Authentication &Timeout </source>
-        <translation type="obsolete">Autentikációs &időkorlát </translation>
+        <translation type="obsolete">Hitelesítési &időkorlát </translation>
     </message>
     <message>
         <source><qt>Holds the VRDP Server port number. You may specify <tt>0</tt> (zero) to reset the port to the default value.</qt></source>
@@ -19346,19 +19346,19 @@ hatására a virtuális gép látni fogja a hangkártyát, de nem szólal meg a
     </message>
     <message>
         <source>Authentication &Method:</source>
-        <translation type="obsolete">Autentikációs &metódus:</translation>
+        <translation type="obsolete">Hitelesítési &metódus:</translation>
     </message>
     <message>
         <source>Defines the VRDP authentication method.</source>
-        <translation type="obsolete">A VRDP autentikációs metódus.</translation>
+        <translation type="obsolete">A VRDP hitelesítési metódus.</translation>
     </message>
     <message>
         <source>Authentication &Timeout:</source>
-        <translation type="obsolete">Autentikációs &időkorlát:</translation>
+        <translation type="obsolete">Hitelesítési &időkorlát:</translation>
     </message>
     <message>
         <source>Specifies the timeout for guest authentication, in milliseconds.</source>
-        <translation type="obsolete">Időkorlát a vendég autentikálásához, ezredmásodpercben.</translation>
+        <translation type="obsolete">Időkorlát a vendég hitelesítéséhez, ezredmásodpercben.</translation>
     </message>
 </context>
 </TS>
diff --git a/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp b/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
index 0c256cb..a2df988 100644
--- a/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
@@ -3255,6 +3255,8 @@ int VBoxVHWAImage::vhwaLoadSurface(VHWACommandList * pCmdList, struct SSMHANDLE
 //            AssertRC(rc);
 //        }
     }
+    else
+        free(buf);
 
     VBOXQGL_LOAD_SURFSTOP(pSSM);
 
diff --git a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
index 5ec1fe1..1de7c90 100644
--- a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
@@ -111,6 +111,7 @@ const char* UIExtraDataDefs::GUI_Scale = "GUI/Scale";
 const char* UIExtraDataDefs::GUI_Fullscreen_LegacyMode = "GUI/Fullscreen/LegacyMode";
 #endif /* Q_WS_X11 */
 const char* UIExtraDataDefs::GUI_AutoresizeGuest = "GUI/AutoresizeGuest";
+const char* UIExtraDataDefs::GUI_LastVisibilityStatusForGuestScreen = "GUI/LastVisibilityStatusForGuestScreen";
 const char* UIExtraDataDefs::GUI_LastGuestSizeHint = "GUI/LastGuestSizeHint";
 const char* UIExtraDataDefs::GUI_VirtualScreenToHostScreen = "GUI/VirtualScreenToHostScreen";
 const char* UIExtraDataDefs::GUI_AutomountGuestScreens = "GUI/AutomountGuestScreens";
diff --git a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
index c25ae02..d98ba95 100644
--- a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
+++ b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
@@ -189,6 +189,9 @@ namespace UIExtraDataDefs
         /** Holds whether guest-screen auto-resize according machine-window size is enabled. */
         extern const char* GUI_AutoresizeGuest;
         /** Prefix used by composite extra-data keys,
+          * which holds last guest-screen visibility status per screen-index. */
+        extern const char* GUI_LastVisibilityStatusForGuestScreen;
+        /** Prefix used by composite extra-data keys,
           * which holds last guest-screen size-hint per screen-index. */
         extern const char* GUI_LastGuestSizeHint;
         /** Prefix used by composite extra-data keys,
diff --git a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
index f59f1c9..7eb4d77 100644
--- a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
@@ -1776,7 +1776,7 @@ QStringList UIExtraDataManagerWindow::knownExtraDataKeys()
 #ifdef Q_WS_X11
            << GUI_Fullscreen_LegacyMode
 #endif /* Q_WS_X11 */
-           << GUI_AutoresizeGuest << GUI_LastGuestSizeHint
+           << GUI_AutoresizeGuest << GUI_LastVisibilityStatusForGuestScreen << GUI_LastGuestSizeHint
            << GUI_VirtualScreenToHostScreen << GUI_AutomountGuestScreens
 #ifdef VBOX_WITH_VIDEOHWACCEL
            << GUI_Accelerate2D_StretchLinear
@@ -3071,7 +3071,31 @@ void UIExtraDataManager::setGuestScreenAutoResizeEnabled(bool fEnabled, const QS
     setExtraDataString(GUI_AutoresizeGuest, toFeatureRestricted(!fEnabled), strID);
 }
 
-QSize UIExtraDataManager::lastGuestSizeHint(ulong uScreenIndex, const QString &strID)
+bool UIExtraDataManager::lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QString &strID)
+{
+    /* Not for primary screen: */
+    AssertReturn(uScreenIndex > 0, true);
+
+    /* Compose corresponding key: */
+    const QString strKey = extraDataKeyPerScreen(GUI_LastVisibilityStatusForGuestScreen, uScreenIndex);
+
+    /* 'False' unless feature allowed: */
+    return isFeatureAllowed(strKey, strID);
+}
+
+void UIExtraDataManager::setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QString &strID)
+{
+    /* Not for primary screen: */
+    AssertReturnVoid(uScreenIndex > 0);
+
+    /* Compose corresponding key: */
+    const QString strKey = extraDataKeyPerScreen(GUI_LastVisibilityStatusForGuestScreen, uScreenIndex);
+
+    /* 'True' if feature allowed, null-string otherwise: */
+    return setExtraDataString(strKey, toFeatureAllowed(fEnabled), strID);
+}
+
+QSize UIExtraDataManager::lastGuestScreenSizeHint(ulong uScreenIndex, const QString &strID)
 {
     /* Choose corresponding key: */
     const QString strKey = extraDataKeyPerScreen(GUI_LastGuestSizeHint, uScreenIndex);
@@ -3095,7 +3119,7 @@ QSize UIExtraDataManager::lastGuestSizeHint(ulong uScreenIndex, const QString &s
     return fOk ? QSize(iW, iH) : QSize();
 }
 
-void UIExtraDataManager::setLastGuestSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID)
+void UIExtraDataManager::setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID)
 {
     /* Choose corresponding key: */
     const QString strKey = extraDataKeyPerScreen(GUI_LastGuestSizeHint, uScreenIndex);
diff --git a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
index 18de0f4..a015c23 100644
--- a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
+++ b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
@@ -378,10 +378,15 @@ public:
         /** Defines whether guest-screen auto-resize according machine-window size is @a fEnabled. */
         void setGuestScreenAutoResizeEnabled(bool fEnabled, const QString &strID);
 
+        /** Returns last guest-screen visibility status for screen with @a uScreenIndex. */
+        bool lastGuestScreenVisibilityStatus(ulong uScreenIndex, const QString &strID);
+        /** Defines whether last guest-screen visibility status was @a fEnabled for screen with @a uScreenIndex. */
+        void setLastGuestScreenVisibilityStatus(ulong uScreenIndex, bool fEnabled, const QString &strID);
+
         /** Returns last guest-screen size-hint for screen with @a uScreenIndex. */
-        QSize lastGuestSizeHint(ulong uScreenIndex, const QString &strID);
+        QSize lastGuestScreenSizeHint(ulong uScreenIndex, const QString &strID);
         /** Defines last guest-screen @a sizeHint for screen with @a uScreenIndex. */
-        void setLastGuestSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID);
+        void setLastGuestScreenSizeHint(ulong uScreenIndex, const QSize &sizeHint, const QString &strID);
 
         /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */
         int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QString &strID);
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp
index c54f177..753cc80 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp
@@ -46,12 +46,13 @@ UIDnDDataObject::UIDnDDataObject(UIDnDHandler *pDnDHandler, const QStringList &l
     , mcFormats(0)
     , mpFormatEtc(NULL)
     , mpStgMedium(NULL)
+    , mSemEvent(NIL_RTSEMEVENT)
     , mpvData(NULL)
     , mcbData(0)
 {
     HRESULT hr;
 
-    ULONG cMaxFormats = 16; /* Maximum number of registered formats. */
+    ULONG cMaxFormats        = 16; /* Maximum number of registered formats. */
     ULONG cRegisteredFormats = 0;
 
     try
@@ -82,7 +83,7 @@ UIDnDDataObject::UIDnDDataObject(UIDnDHandler *pDnDHandler, const QStringList &l
                 mlstFormats << strFormat;
             }
             /* Plain text ("text/plain"). */
-            else if (strFormat.contains("text/plain", Qt::CaseInsensitive))
+            if (strFormat.contains("text/plain", Qt::CaseInsensitive))
             {
                 RegisterFormat(&mpFormatEtc[cRegisteredFormats], CF_TEXT);
                 mpStgMedium[cRegisteredFormats++].tymed = TYMED_HGLOBAL;
@@ -129,10 +130,7 @@ UIDnDDataObject::UIDnDDataObject(UIDnDHandler *pDnDHandler, const QStringList &l
                        RegisterClipboardFormat(CFSTR_SHELLIDLISTOFFSET));
 #endif
         mcFormats = cRegisteredFormats;
-
-        /* Put the object in the "dropped" state already. We don't need
-         * to handle the other states here at the moment. */
-        mStatus = Dropped;
+        mStatus   = Dropped;
     }
 
     LogFlowFunc(("hr=%Rhrc\n", hr));
@@ -149,6 +147,9 @@ UIDnDDataObject::~UIDnDDataObject(void)
     if (mpvData)
         RTMemFree(mpvData);
 
+    if (mSemEvent != NIL_RTSEMEVENT)
+        RTSemEventDestroy(mSemEvent);
+
     LogFlowFunc(("mRefCount=%RI32\n", mRefCount));
 }
 
@@ -198,251 +199,258 @@ STDMETHODIMP UIDnDDataObject::QueryInterface(REFIID iid, void **ppvObject)
  * @param   pFormatEtc
  * @param   pMedium
  */
-STDMETHODIMP UIDnDDataObject::GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium)
+STDMETHODIMP UIDnDDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
 {
     AssertPtrReturn(pFormatEtc, DV_E_FORMATETC);
     AssertPtrReturn(pMedium, DV_E_FORMATETC);
 
-    LogFlowFunc(("pFormatEtc=%p, pMedium=%p\n", pFormatEtc, pMedium));
-
-    ULONG lIndex;
-    if (!LookupFormatEtc(pFormatEtc, &lIndex)) /* Format supported? */
-        return DV_E_FORMATETC;
-    if (lIndex >= mcFormats) /* Paranoia. */
-        return DV_E_FORMATETC;
-
-    FORMATETC *pThisFormat = &mpFormatEtc[lIndex];
-    AssertPtr(pThisFormat);
-
-    STGMEDIUM *pThisMedium = &mpStgMedium[lIndex];
-    AssertPtr(pThisMedium);
-
     HRESULT hr = DV_E_FORMATETC;
 
-    LogFlowFunc(("mStatus=%ld\n", mStatus));
-    if (mStatus == Dropping)
-    {
-        LogRel3(("DnD: Dropping\n"));
-        LogFlowFunc(("Waiting for event ...\n"));
-        int rc2 = RTSemEventWait(mSemEvent, RT_INDEFINITE_WAIT);
-        LogFlowFunc(("rc=%Rrc, mStatus=%ld\n", rc2, mStatus));
-    }
+    LPFORMATETC pThisFormat = NULL;
+    LPSTGMEDIUM pThisMedium = NULL;
 
-    if (mStatus == Dropped)
+    /* Format supported? */
+    ULONG lIndex;
+    if (   LookupFormatEtc(pFormatEtc, &lIndex)
+        && lIndex < mcFormats) /* Paranoia. */
     {
-        LogRel3(("DnD: Dropped\n"));
-        LogRel3(("DnD: cfFormat=%RI16, sFormat=%s, tyMed=%RU32, dwAspect=%RU32\n",
-                 pThisFormat->cfFormat, UIDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
-                 pThisFormat->tymed, pThisFormat->dwAspect));
-        LogRel3(("DnD: Got strFormat=%s, pvData=%p, cbData=%RU32\n",
-                 mstrFormat.toAscii().constData(), mpvData, mcbData));
-
-        QVariant::Type vaType;
-        QString strMIMEType;
-        if (    (pFormatEtc->tymed & TYMED_HGLOBAL)
-             && (pFormatEtc->dwAspect == DVASPECT_CONTENT)
-             && (   pFormatEtc->cfFormat == CF_TEXT
-                 || pFormatEtc->cfFormat == CF_UNICODETEXT)
-           )
+        pThisMedium = &mpStgMedium[lIndex];
+        AssertPtr(pThisMedium);
+        pThisFormat = &mpFormatEtc[lIndex];
+        AssertPtr(pThisFormat);
+
+        LogFlowFunc(("pThisMedium=%p, pThisFormat=%p\n", pThisMedium, pThisFormat));
+        LogFlowFunc(("mStatus=%ld\n", mStatus));
+        switch (mStatus)
         {
-            strMIMEType = "text/plain"; /** @todo Indicate UTF8 encoding? */
-            vaType = QVariant::String;
-        }
-        else if (   (pFormatEtc->tymed & TYMED_HGLOBAL)
-                 && (pFormatEtc->dwAspect == DVASPECT_CONTENT)
-                 && (pFormatEtc->cfFormat == CF_HDROP))
-        {
-            strMIMEType = "text/uri-list";
-            vaType = QVariant::StringList;
-        }
+            case Dropping:
+            {
+                    LogRel3(("DnD: Dropping\n"));
+                    LogFlowFunc(("Waiting for event ...\n"));
+                    int rc2 = RTSemEventWait(mSemEvent, RT_INDEFINITE_WAIT);
+                    LogFlowFunc(("rc=%Rrc, mStatus=%ld\n", rc2, mStatus));
+            }
+
+            case Dropped:
+            {
+                LogRel3(("DnD: Dropped\n"));
+                LogRel3(("DnD: cfFormat=%RI16, sFormat=%s, tyMed=%RU32, dwAspect=%RU32\n",
+                         pThisFormat->cfFormat, UIDnDDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
+                         pThisFormat->tymed, pThisFormat->dwAspect));
+                LogRel3(("DnD: Got strFormat=%s, pvData=%p, cbData=%RU32\n",
+                         mstrFormat.toAscii().constData(), mpvData, mcbData));
+
+                QVariant::Type vaType;
+                QString strMIMEType;
+                if (    (pFormatEtc->tymed & TYMED_HGLOBAL)
+                     && (pFormatEtc->dwAspect == DVASPECT_CONTENT)
+                     && (   pFormatEtc->cfFormat == CF_TEXT
+                         || pFormatEtc->cfFormat == CF_UNICODETEXT)
+                   )
+                {
+                    strMIMEType = "text/plain"; /** @todo Indicate UTF8 encoding? */
+                    vaType = QVariant::String;
+                }
+                else if (   (pFormatEtc->tymed & TYMED_HGLOBAL)
+                         && (pFormatEtc->dwAspect == DVASPECT_CONTENT)
+                         && (pFormatEtc->cfFormat == CF_HDROP))
+                {
+                    strMIMEType = "text/uri-list";
+                    vaType = QVariant::StringList;
+                }
 #if 0 /* More formats; not needed right now. */
-        else if (   (pFormatEtc->tymed & TYMED_ISTREAM)
-                && (pFormatEtc->dwAspect == DVASPECT_CONTENT)
-                && (pFormatEtc->cfFormat == CF_FILECONTENTS))
-        {
+                else if (   (pFormatEtc->tymed & TYMED_ISTREAM)
+                        && (pFormatEtc->dwAspect == DVASPECT_CONTENT)
+                        && (pFormatEtc->cfFormat == CF_FILECONTENTS))
+                {
 
-        }
-        else if  (   (pFormatEtc->tymed & TYMED_HGLOBAL)
-                  && (pFormatEtc->dwAspect == DVASPECT_CONTENT)
-                  && (pFormatEtc->cfFormat == CF_FILEDESCRIPTOR))
-        {
+                }
+                else if  (   (pFormatEtc->tymed & TYMED_HGLOBAL)
+                          && (pFormatEtc->dwAspect == DVASPECT_CONTENT)
+                          && (pFormatEtc->cfFormat == CF_FILEDESCRIPTOR))
+                {
 
-        }
-        else if (   (pFormatEtc->tymed & TYMED_HGLOBAL)
-                 && (pFormatEtc->cfFormat == CF_PREFERREDDROPEFFECT))
-        {
-            HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE | GMEM_ZEROINIT, sizeof(DWORD));
-            DWORD *pdwEffect = (DWORD *)GlobalLock(hData);
-            AssertPtr(pdwEffect);
-            *pdwEffect = DROPEFFECT_COPY;
-            GlobalUnlock(hData);
-
-            pMedium->hGlobal = hData;
-            pMedium->tymed = TYMED_HGLOBAL;
-        }
+                }
+                else if (   (pFormatEtc->tymed & TYMED_HGLOBAL)
+                         && (pFormatEtc->cfFormat == CF_PREFERREDDROPEFFECT))
+                {
+                    HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE | GMEM_ZEROINIT, sizeof(DWORD));
+                    DWORD *pdwEffect = (DWORD *)GlobalLock(hData);
+                    AssertPtr(pdwEffect);
+                    *pdwEffect = DROPEFFECT_COPY;
+                    GlobalUnlock(hData);
+
+                    pMedium->hGlobal = hData;
+                    pMedium->tymed = TYMED_HGLOBAL;
+                }
 #endif
-        LogRel3(("DnD: strMIMEType=%s, vaType=%ld\n", strMIMEType.toAscii().constData(), vaType));
+                LogRel3(("DnD: strMIMEType=%s, vaType=%ld\n", strMIMEType.toAscii().constData(), vaType));
 
-        int rc;
-        if (!mVaData.isValid())
-        {
-            /* Note:  We're usig Qt::MoveAction because this speeds up the whole operation
-             *        significantly: Instead of copying the data from the temporary location to
-             *        the final destination we just move it.
-             *
-             * Note2: The Qt::MoveAction *only* affects the behavior on the host! The desired
-             *        action for the guest (e.g. moving a file from guest to host) is not affected
-             *        by this setting. */
-            rc = m_pDnDHandler->retrieveData(Qt::MoveAction,
-                                             strMIMEType, vaType, mVaData);
-        }
-        else
-            rc = VINF_SUCCESS; /* Data already retrieved. */
+                int rc;
+                if (!mVaData.isValid())
+                {
+                    /* Note:  We're usig Qt::MoveAction because this speeds up the whole operation
+                     *        significantly: Instead of copying the data from the temporary location to
+                     *        the final destination we just move it.
+                     *
+                     * Note2: The Qt::MoveAction *only* affects the behavior on the host! The desired
+                     *        action for the guest (e.g. moving a file from guest to host) is not affected
+                     *        by this setting. */
+                    rc = m_pDnDHandler->retrieveData(Qt::MoveAction,
+                                                     strMIMEType, vaType, mVaData);
+                }
+                else
+                    rc = VINF_SUCCESS; /* Data already retrieved. */
 
-        if (RT_SUCCESS(rc))
-        {
-            if (   strMIMEType.startsWith("text/uri-list")
-                       /* One item. */
-                && (   mVaData.canConvert(QVariant::String)
-                       /* Multiple items. */
-                    || mVaData.canConvert(QVariant::StringList))
-               )
-            {
-                QStringList lstFilesURI = mVaData.toStringList();
-                QStringList lstFiles;
-                for (size_t i = 0; i < lstFilesURI.size(); i++)
+                if (RT_SUCCESS(rc))
                 {
-                    /* Extract path from URI. */
-                    char *pszPath = RTUriPath(lstFilesURI.at(i).toAscii().constData());
-                    if (   pszPath
-                        && strlen(pszPath) > 1)
+                    if (   strMIMEType.startsWith("text/uri-list")
+                               /* One item. */
+                        && (   mVaData.canConvert(QVariant::String)
+                               /* Multiple items. */
+                            || mVaData.canConvert(QVariant::StringList))
+                       )
                     {
-                        pszPath++; /** @todo Skip first '/' (part of URI). Correct? */
-                        pszPath = RTPathChangeToDosSlashes(pszPath, false /* fForce */);
-                        lstFiles.append(pszPath);
-                    }
-                }
+                        QStringList lstFilesURI = mVaData.toStringList();
+                        QStringList lstFiles;
+                        for (size_t i = 0; i < lstFilesURI.size(); i++)
+                        {
+                            /* Extract path from URI. */
+                            char *pszPath = RTUriPath(lstFilesURI.at(i).toAscii().constData());
+                            if (   pszPath
+                                && strlen(pszPath) > 1)
+                            {
+                                pszPath++; /** @todo Skip first '/' (part of URI). Correct? */
+                                pszPath = RTPathChangeToDosSlashes(pszPath, false /* fForce */);
+                                lstFiles.append(pszPath);
+                            }
+                        }
 
-                size_t cFiles = lstFiles.size();
-                Assert(cFiles);
+                        size_t cFiles = lstFiles.size();
+                        Assert(cFiles);
 #ifdef DEBUG
-                LogFlowFunc(("Files (%zu)\n", cFiles));
-                for (size_t i = 0; i < cFiles; i++)
-                    LogFlowFunc(("\tFile: %s\n", lstFiles.at(i).toAscii().constData()));
+                        LogFlowFunc(("Files (%zu)\n", cFiles));
+                        for (size_t i = 0; i < cFiles; i++)
+                            LogFlowFunc(("\tFile: %s\n", lstFiles.at(i).toAscii().constData()));
 #endif
-                size_t cchFiles = 0; /* Number of ASCII characters. */
-                for (size_t i = 0; i < cFiles; i++)
-                {
-                    cchFiles += strlen(lstFiles.at(i).toAscii().constData());
-                    cchFiles += 1; /* Terminating '\0'. */
-                }
+                        size_t cchFiles = 0; /* Number of ASCII characters. */
+                        for (size_t i = 0; i < cFiles; i++)
+                        {
+                            cchFiles += strlen(lstFiles.at(i).toAscii().constData());
+                            cchFiles += 1; /* Terminating '\0'. */
+                        }
 
-                size_t cbBuf = sizeof(DROPFILES) + ((cchFiles + 1) * sizeof(RTUTF16));
-                DROPFILES *pDropFiles = (DROPFILES *)RTMemAllocZ(cbBuf);
-                if (pDropFiles)
-                {
-                    pDropFiles->pFiles = sizeof(DROPFILES);
-                    pDropFiles->fWide = 1; /* We use unicode. Always. */
+                        size_t cbBuf = sizeof(DROPFILES) + ((cchFiles + 1) * sizeof(RTUTF16));
+                        DROPFILES *pDropFiles = (DROPFILES *)RTMemAllocZ(cbBuf);
+                        if (pDropFiles)
+                        {
+                            pDropFiles->pFiles = sizeof(DROPFILES);
+                            pDropFiles->fWide = 1; /* We use unicode. Always. */
 
-                    uint8_t *pCurFile = (uint8_t *)pDropFiles + pDropFiles->pFiles;
-                    AssertPtr(pCurFile);
+                            uint8_t *pCurFile = (uint8_t *)pDropFiles + pDropFiles->pFiles;
+                            AssertPtr(pCurFile);
 
-                    for (size_t i = 0; i < cFiles; i++)
-                    {
-                        size_t cchCurFile;
-                        PRTUTF16 pwszFile;
-                        rc = RTStrToUtf16(lstFiles.at(i).toAscii().constData(), &pwszFile);
-                        if (RT_SUCCESS(rc))
-                        {
-                            cchCurFile = RTUtf16Len(pwszFile);
-                            Assert(cchCurFile);
-                            memcpy(pCurFile, pwszFile, cchCurFile * sizeof(RTUTF16));
-                            RTUtf16Free(pwszFile);
-                        }
-                        else
-                            break;
+                            for (size_t i = 0; i < cFiles; i++)
+                            {
+                                size_t cchCurFile;
+                                PRTUTF16 pwszFile;
+                                rc = RTStrToUtf16(lstFiles.at(i).toAscii().constData(), &pwszFile);
+                                if (RT_SUCCESS(rc))
+                                {
+                                    cchCurFile = RTUtf16Len(pwszFile);
+                                    Assert(cchCurFile);
+                                    memcpy(pCurFile, pwszFile, cchCurFile * sizeof(RTUTF16));
+                                    RTUtf16Free(pwszFile);
+                                }
+                                else
+                                    break;
+
+                                pCurFile += cchCurFile * sizeof(RTUTF16);
+
+                                /* Terminate current file name. */
+                                *pCurFile = L'\0';
+                                pCurFile += sizeof(RTUTF16);
+                            }
 
-                        pCurFile += cchCurFile * sizeof(RTUTF16);
+                            if (RT_SUCCESS(rc))
+                            {
+                                *pCurFile = L'\0'; /* Final list terminator. */
+
+                                pMedium->tymed = TYMED_HGLOBAL;
+                                pMedium->pUnkForRelease = NULL;
+                                pMedium->hGlobal = GlobalAlloc(  GMEM_ZEROINIT
+                                                               | GMEM_MOVEABLE
+                                                               | GMEM_DDESHARE, cbBuf);
+                                if (pMedium->hGlobal)
+                                {
+                                    LPVOID pvMem = GlobalLock(pMedium->hGlobal);
+                                    if (pvMem)
+                                    {
+                                        memcpy(pvMem, pDropFiles, cbBuf);
+                                        GlobalUnlock(pMedium->hGlobal);
+
+                                        hr = S_OK;
+                                    }
+                                    else
+                                        rc = VERR_ACCESS_DENIED;
+                                }
+                                else
+                                    rc = VERR_NO_MEMORY;
+                            }
 
-                        /* Terminate current file name. */
-                        *pCurFile = L'\0';
-                        pCurFile += sizeof(RTUTF16);
+                            RTMemFree(pDropFiles);
+                        }
                     }
-
-                    if (RT_SUCCESS(rc))
+                    else if (   strMIMEType.startsWith("text/plain")
+                             && mVaData.canConvert(QVariant::String))
                     {
-                        *pCurFile = L'\0'; /* Final list terminator. */
+                        bool fUnicode = pFormatEtc->cfFormat == CF_UNICODETEXT;
+                        int cbCh = fUnicode
+                                 ? sizeof(WCHAR) : sizeof(char);
+
+                        QString strText = mVaData.toString();
+                        size_t cbSrc = strText.length() * cbCh;
+                        Assert(cbSrc);
+                        LPCVOID pvSrc = fUnicode
+                                      ? (void *)strText.unicode()
+                                      : (void *)strText.toAscii().constData();
+                        AssertPtr(pvSrc);
+
+                        LogFlowFunc(("pvSrc=0x%p, cbSrc=%zu, cbch=%d, fUnicode=%RTbool\n",
+                                     pvSrc, cbSrc, cbCh, fUnicode));
 
                         pMedium->tymed = TYMED_HGLOBAL;
                         pMedium->pUnkForRelease = NULL;
                         pMedium->hGlobal = GlobalAlloc(  GMEM_ZEROINIT
                                                        | GMEM_MOVEABLE
-                                                       | GMEM_DDESHARE, cbBuf);
+                                                       | GMEM_DDESHARE,
+                                                       cbSrc);
                         if (pMedium->hGlobal)
                         {
-                            LPVOID pvMem = GlobalLock(pMedium->hGlobal);
-                            if (pvMem)
+                            LPVOID pvDst = GlobalLock(pMedium->hGlobal);
+                            if (pvDst)
                             {
-                                memcpy(pvMem, pDropFiles, cbBuf);
+                                memcpy(pvDst, pvSrc, cbSrc);
                                 GlobalUnlock(pMedium->hGlobal);
-
-                                hr = S_OK;
                             }
                             else
                                 rc = VERR_ACCESS_DENIED;
+
+                            hr = S_OK;
                         }
                         else
-                            rc = VERR_NO_MEMORY;
-                    }
-
-                    RTMemFree(pDropFiles);
-                }
-            }
-            else if (   strMIMEType.startsWith("text/plain")
-                     && mVaData.canConvert(QVariant::String))
-            {
-                bool fUnicode = pFormatEtc->cfFormat == CF_UNICODETEXT;
-                int cbCh = fUnicode
-                         ? sizeof(WCHAR) : sizeof(char);
-
-                QString strText = mVaData.toString();
-                size_t cbSrc = strText.length() * cbCh;
-                Assert(cbSrc);
-                LPCVOID pvSrc = fUnicode
-                              ? (void *)strText.unicode()
-                              : (void *)strText.toAscii().constData();
-                AssertPtr(pvSrc);
-
-                LogFlowFunc(("pvSrc=0x%p, cbSrc=%zu, cbch=%d, fUnicode=%RTbool\n",
-                             pvSrc, cbSrc, cbCh, fUnicode));
-
-                pMedium->tymed = TYMED_HGLOBAL;
-                pMedium->pUnkForRelease = NULL;
-                pMedium->hGlobal = GlobalAlloc(  GMEM_ZEROINIT
-                                               | GMEM_MOVEABLE
-                                               | GMEM_DDESHARE,
-                                               cbSrc);
-                if (pMedium->hGlobal)
-                {
-                    LPVOID pvDst = GlobalLock(pMedium->hGlobal);
-                    if (pvDst)
-                    {
-                        memcpy(pvDst, pvSrc, cbSrc);
-                        GlobalUnlock(pMedium->hGlobal);
+                            hr  = VERR_NO_MEMORY;
                     }
                     else
-                        rc = VERR_ACCESS_DENIED;
+                        LogFlowFunc(("MIME type=%s not supported\n",
+                                     strMIMEType.toAscii().constData()));
 
-                    hr = S_OK;
+                    LogFlowFunc(("Handling formats ended with rc=%Rrc\n", rc));
                 }
-                else
-                    hr  = VERR_NO_MEMORY;
             }
-            else
-                LogFlowFunc(("MIME type=%s not supported\n",
-                             strMIMEType.toAscii().constData()));
 
-            LogFlowFunc(("Handling formats ended with rc=%Rrc\n", rc));
+            default:
+                break;
         }
     }
 
@@ -451,22 +459,25 @@ STDMETHODIMP UIDnDDataObject::GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium)
      */
     if (FAILED(hr))
     {
-        LogFlowFunc(("Error hr=%Rhrc while handling data, copying raw medium data ...\n", hr));
-
-        switch (pThisMedium->tymed)
+        if (pThisMedium)
         {
+            switch (pThisMedium->tymed)
+            {
 
-        case TYMED_HGLOBAL:
-            pMedium->hGlobal = (HGLOBAL)OleDuplicateData(pThisMedium->hGlobal,
-                                                         pThisFormat->cfFormat,
-                                                         0 /* Flags */);
-            break;
+            case TYMED_HGLOBAL:
+                pMedium->hGlobal = (HGLOBAL)OleDuplicateData(pThisMedium->hGlobal,
+                                                             pThisFormat->cfFormat,
+                                                             0 /* Flags */);
+                break;
 
-        default:
-            break;
+            default:
+                break;
+            }
         }
 
-        pMedium->tymed          = pFormatEtc->tymed;
+        if (pFormatEtc)
+            pMedium->tymed = pFormatEtc->tymed;
+
         pMedium->pUnkForRelease = NULL;
     }
 
@@ -482,7 +493,7 @@ STDMETHODIMP UIDnDDataObject::GetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium)
  * @param   pFormatEtc
  * @param   pMedium
  */
-STDMETHODIMP UIDnDDataObject::GetDataHere(FORMATETC *pFormatEtc, STGMEDIUM *pMedium)
+STDMETHODIMP UIDnDDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
 {
     LogFlowFunc(("\n"));
     return DATA_E_FORMATETC;
@@ -495,12 +506,12 @@ STDMETHODIMP UIDnDDataObject::GetDataHere(FORMATETC *pFormatEtc, STGMEDIUM *pMed
  * @return  HRESULT
  * @param   pFormatEtc
  */
-STDMETHODIMP UIDnDDataObject::QueryGetData(FORMATETC *pFormatEtc)
+STDMETHODIMP UIDnDDataObject::QueryGetData(LPFORMATETC pFormatEtc)
 {
     return (LookupFormatEtc(pFormatEtc, NULL /* puIndex */)) ? S_OK : DV_E_FORMATETC;
 }
 
-STDMETHODIMP UIDnDDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatEct, FORMATETC *pFormatEtcOut)
+STDMETHODIMP UIDnDDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatEct, LPFORMATETC pFormatEtcOut)
 {
     LogFlowFunc(("\n"));
 
@@ -509,7 +520,7 @@ STDMETHODIMP UIDnDDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatEct, FORMA
     return E_NOTIMPL;
 }
 
-STDMETHODIMP UIDnDDataObject::SetData(FORMATETC *pFormatEtc, STGMEDIUM *pMedium, BOOL fRelease)
+STDMETHODIMP UIDnDDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease)
 {
     return E_NOTIMPL;
 }
@@ -531,7 +542,7 @@ STDMETHODIMP UIDnDDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **
     return hr;
 }
 
-STDMETHODIMP UIDnDDataObject::DAdvise(FORMATETC *pFormatEtc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
+STDMETHODIMP UIDnDDataObject::DAdvise(LPFORMATETC pFormatEtc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
 {
     return OLE_E_ADVISENOTSUPPORTED;
 }
@@ -638,7 +649,7 @@ const char* UIDnDDataObject::ClipboardFormatToString(CLIPFORMAT fmt)
     return "unknown";
 }
 
-bool UIDnDDataObject::LookupFormatEtc(FORMATETC *pFormatEtc, ULONG *puIndex)
+bool UIDnDDataObject::LookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex)
 {
     AssertReturn(pFormatEtc, false);
     /* puIndex is optional. */
@@ -685,7 +696,7 @@ HGLOBAL UIDnDDataObject::MemDup(HGLOBAL hMemSource)
     return NULL;
 }
 
-void UIDnDDataObject::RegisterFormat(FORMATETC *pFormatEtc, CLIPFORMAT clipFormat,
+void UIDnDDataObject::RegisterFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat,
                                      TYMED tyMed, LONG lIndex, DWORD dwAspect,
                                      DVTARGETDEVICE *pTargetDevice)
 {
@@ -714,7 +725,8 @@ int UIDnDDataObject::Signal(const QString &strFormat,
 
     int rc;
 
-    mStatus = Dropped;
+    SetStatus(Dropped);
+
     mstrFormat = strFormat;
     if (cbData)
     {
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h b/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h
index 6a500f1..2e816cf 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h
@@ -58,13 +58,13 @@ public: /* IUnknown methods. */
 
 public: /* IDataObject methods. */
 
-    STDMETHOD(GetData)(FORMATETC *pFormatEtc, STGMEDIUM *pMedium);
-    STDMETHOD(GetDataHere)(FORMATETC *pFormatEtc, STGMEDIUM *pMedium);
-    STDMETHOD(QueryGetData)(FORMATETC *pFormatEtc);
-    STDMETHOD(GetCanonicalFormatEtc)(FORMATETC *pFormatEct,  FORMATETC *pFormatEtcOut);
-    STDMETHOD(SetData)(FORMATETC *pFormatEtc, STGMEDIUM *pMedium, BOOL fRelease);
+    STDMETHOD(GetData)(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium);
+    STDMETHOD(GetDataHere)(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium);
+    STDMETHOD(QueryGetData)(LPFORMATETC pFormatEtc);
+    STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC pFormatEct,  LPFORMATETC pFormatEtcOut);
+    STDMETHOD(SetData)(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease);
     STDMETHOD(EnumFormatEtc)(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc);
-    STDMETHOD(DAdvise)(FORMATETC *pFormatEtc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
+    STDMETHOD(DAdvise)(LPFORMATETC pFormatEtc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
     STDMETHOD(DUnadvise)(DWORD dwConnection);
     STDMETHOD(EnumDAdvise)(IEnumSTATDATA **ppEnumAdvise);
 
@@ -78,9 +78,9 @@ public:
 
 protected:
 
-    bool LookupFormatEtc(FORMATETC *pFormatEtc, ULONG *puIndex);
+    bool LookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex);
     static HGLOBAL MemDup(HGLOBAL hMemSource);
-    void RegisterFormat(FORMATETC *pFormatEtc, CLIPFORMAT clipFormat, TYMED tyMed = TYMED_HGLOBAL,
+    void RegisterFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat, TYMED tyMed = TYMED_HGLOBAL,
                         LONG lindex = -1, DWORD dwAspect = DVASPECT_CONTENT, DVTARGETDEVICE *pTargetDevice = NULL);
 
     UIDnDHandler   *m_pDnDHandler;
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDropSource_win.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDropSource_win.cpp
index f7f8e2d..45017ca 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDropSource_win.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDropSource_win.cpp
@@ -104,6 +104,7 @@ STDMETHODIMP UIDnDDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD dwKey
         mdwCurEffect = 0;
         muCurAction = Qt::IgnoreAction;
 
+        LogRel2(("DnD: User cancelled dropping data to the host\n"));
         return DRAGDROP_S_CANCEL;
     }
 
@@ -111,7 +112,14 @@ STDMETHODIMP UIDnDDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD dwKey
 
     /* Left mouse button released? Start "drop" action. */
     if ((dwKeyState & MK_LBUTTON) == 0)
+        fDropContent = true;
+    /** @todo Make this configurable? */
+
+    if (fDropContent)
+    {
+        LogRel2(("DnD: User dropped data to the host\n"));
         return DRAGDROP_S_DROP;
+    }
 
     /* No change, just continue. */
     return S_OK;
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp
index dccef73..68a3381 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp
@@ -142,35 +142,80 @@ Qt::DropAction UIDnDHandler::dragDrop(ulong screenID, int x, int y,
         return Qt::IgnoreAction;
 
     /* The format the guest requests. */
-    QString format;
+    QString strFormat;
     /* Ask the guest for dropping data. */
-    KDnDAction result = m_dndTarget.Drop(screenID,
-                                         x,
-                                         y,
-                                         toVBoxDnDAction(proposedAction),
-                                         toVBoxDnDActions(possibleActions),
-                                         pMimeData->formats().toVector(), format);
+    KDnDAction enmResult = m_dndTarget.Drop(screenID,
+                                            x,
+                                            y,
+                                            toVBoxDnDAction(proposedAction),
+                                            toVBoxDnDActions(possibleActions),
+                                            pMimeData->formats().toVector(), strFormat);
 
     /* Has the guest accepted the drop event? */
     if (   m_dndTarget.isOk()
-        && result != KDnDAction_Ignore)
+        && enmResult != KDnDAction_Ignore)
     {
-        /* Get the actual MIME data in the requested format. */
+        LogFlowFunc(("strFormat=%s ...\n", strFormat.toAscii().constData()));
+
+        QByteArray arrBytes;
+
+        /*
+         * Does the host support the format requested by the guest?
+         * Lookup the format in the MIME data object.
+         */
         AssertPtr(pMimeData);
-        const QByteArray &d = pMimeData->data(format);
-        if (   !d.isEmpty()
-            && !format.isEmpty())
+        if (pMimeData->formats().indexOf(strFormat) >= 0)
+        {
+            arrBytes = pMimeData->data(strFormat);
+            Assert(!arrBytes.isEmpty());
+        }
+        /*
+         * The host does not support the format requested by the guest.
+         * This can happen if the host wants to send plan text, for example, but
+         * the guest requested something else, e.g. an URI list.
+         *
+         * In that case dictate the guest to use a fixed format from the host,
+         * so instead returning the requested URI list, return the original
+         * data format from the host. The guest has to try to deal with that then.
+         **/
+        else
+        {
+            LogRel3(("DnD: Guest requested a different format '%s'\n", strFormat.toAscii().constData()));
+            LogRel3(("DnD: The host offered:\n"));
+#if 0
+            for (QStringList::iterator itFmt  = pMimeData->formats().begin();
+                                       itFmt != pMimeData->formats().end(); itFmt++)
+            {
+                QString strTemp = *itFmt;
+                LogRel3(("DnD: \t%s\n", strTemp.toAscii().constData()));
+            }
+#endif
+            if (pMimeData->hasText())
+            {
+                LogRel3(("DnD: Converting data to text ...\n"));
+                arrBytes  = pMimeData->text().toUtf8();
+                strFormat = "text/plain;charset=utf-8";
+            }
+            else
+            {
+                LogRel(("DnD: Error: Could not convert host format to guest format\n"));
+                enmResult = KDnDAction_Ignore;
+            }
+        }
+
+        if (arrBytes.size()) /* Anything to send? */
         {
-            /* Convert the actual MIME data to a vector (needed for the COM wrapper). */
-            QVector<uint8_t> dv(d.size());
-            memcpy(dv.data(), d.constData(), d.size());
+            /* Convert data to a vector. */
+            QVector<uint8_t> vecData(arrBytes.size()); /** @todo Can this throw or anything? */
+            AssertReleaseMsg(vecData.size() == arrBytes.size(), ("Drag and drop format buffer size does not match"));
+            memcpy(vecData.data(), arrBytes.constData(), arrBytes.size());
 
-            CProgress progress = m_dndTarget.SendData(screenID, format, dv);
+            /* Send data to the guest. */
+            LogRel3(("DnD: Host is sending %d bytes of data as '%s'\n", vecData.size(), strFormat.toAscii().constData()));
+            CProgress progress = m_dndTarget.SendData(screenID, strFormat, vecData);
 
             if (m_dndTarget.isOk())
             {
-                LogFlowFunc(("Transferring data to guest ...\n"));
-
                 msgCenter().showModalProgressDialog(progress,
                                                     tr("Dropping data ..."), ":/progress_dnd_hg_90px.png",
                                                     m_pParent);
@@ -184,15 +229,17 @@ Qt::DropAction UIDnDHandler::dragDrop(ulong screenID, int x, int y,
                         ||  progress.GetResultCode() != 0))
                 {
                     msgCenter().cannotDropDataToGuest(progress, m_pParent);
-                    result = KDnDAction_Ignore;
+                    enmResult = KDnDAction_Ignore;
                 }
             }
             else
             {
                 msgCenter().cannotDropDataToGuest(m_dndTarget, m_pParent);
-                result = KDnDAction_Ignore;
+                enmResult = KDnDAction_Ignore;
             }
         }
+        else /* Error. */
+            enmResult = KDnDAction_Ignore;
     }
 
     /*
@@ -202,7 +249,7 @@ Qt::DropAction UIDnDHandler::dragDrop(ulong screenID, int x, int y,
      */
     setMode(DNDMODE_UNKNOWN);
 
-    return toQtDnDAction(result);
+    return toQtDnDAction(enmResult);
 }
 
 void UIDnDHandler::dragLeave(ulong screenID)
@@ -255,7 +302,8 @@ int UIDnDHandler::dragStartInternal(const QStringList &lstFormats,
     }
 
     DWORD dwEffect;
-    LogRel3(("DnD: dwOKEffects=0x%x\n", dwOKEffects));
+    LogRel2(("DnD: Starting drag and drop operation\n", dwOKEffects));
+    LogRel3(("DnD: DoDragDrop dwOKEffects=0x%x\n", dwOKEffects));
     HRESULT hr = ::DoDragDrop(pDataObject, pDropSource, dwOKEffects, &dwEffect);
     LogRel3(("DnD: DoDragDrop ended with hr=%Rhrc, dwEffect=%RI32\n", hr, dwEffect));
 
@@ -359,15 +407,18 @@ int UIDnDHandler::dragCheckPending(ulong screenID)
     LogRel3(("DnD: Default action is: 0x%x\n", m_dataSource.defaultAction));
     LogRel3(("DnD: Number of supported guest actions: %d\n", m_dataSource.vecActions.size()));
         for (int i = 0; i < m_dataSource.vecActions.size(); i++)
-            LogRel3(("\tAction %d: 0x%x\n", i, m_dataSource.vecActions.at(i)));
+            LogRel3(("DnD: \tAction %d: 0x%x\n", i, m_dataSource.vecActions.at(i)));
 
     LogRel3(("DnD: Number of supported guest formats: %d\n", vecFormats.size()));
         for (int i = 0; i < vecFormats.size(); i++)
         {
             const QString &strFmtGuest = vecFormats.at(i);
-            LogRel3(("\tFormat %d: %s\n", i, strFmtGuest.toAscii().constData()));
+            LogRel3(("DnD: \tFormat %d: %s\n", i, strFmtGuest.toAscii().constData()));
         }
 
+    LogFlowFunc(("defaultAction=0x%x, vecFormatsSize=%d, vecActionsSize=%d\n",
+                 m_dataSource.defaultAction, vecFormats.size(), m_dataSource.vecActions.size()));
+
     if (   m_dataSource.defaultAction != KDnDAction_Ignore
         && vecFormats.size())
     {
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
index dd344bd..03563a5 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
@@ -247,11 +247,6 @@ void UIMachineView::sltPerformGuestResize(const QSize &toSize)
     display().SetVideoModeHint(screenId(),
                                uisession()->isScreenVisible(screenId()),
                                false, 0, 0, size.width(), size.height(), 0);
-
-    /* If we are in normal or scaled mode, remember the size sent for the next
-     * time we have to restore one of those two modes: */
-    if (!isFullscreenOrSeamless())
-        storeGuestSizeHint(size);
 }
 
 void UIMachineView::sltHandleNotifyChange(int iWidth, int iHeight)
@@ -326,6 +321,11 @@ void UIMachineView::sltHandleNotifyChange(int iWidth, int iHeight)
      * the viewport through IFramebuffer::NotifyUpdate): */
     display().InvalidateAndUpdateScreen(m_uScreenId);
 
+    /* If we are in normal or scaled mode and if GA are active,
+     * remember the guest-screen size to be able to restore it when necessary: */
+    if (!isFullscreenOrSeamless() && uisession()->isGuestSupportsGraphics())
+        storeGuestSizeHint(QSize(iWidth, iHeight));
+
     LogRelFlow(("GUI: UIMachineView::sltHandleNotifyChange: Complete for Screen=%d, Size=%dx%d\n",
                 (unsigned long)m_uScreenId, iWidth, iHeight));
 }
@@ -658,7 +658,7 @@ void UIMachineView::prepareFrameBuffer()
         /* Processing pseudo resize-event to synchronize frame-buffer with stored framebuffer size.
          * On X11 this will be additional done when the machine state was 'saved'. */
         if (machine().GetState() == KMachineState_Saved)
-            size = guestSizeHint();
+            size = guestScreenSizeHint();
 #endif /* Q_WS_X11 */
 
         /* If there is a preview image saved,
@@ -922,20 +922,39 @@ QSize UIMachineView::maxGuestSize()
     return QSize(int(RT_HI_U32(u64Size)), int(RT_LO_U32(u64Size)));
 }
 
-QSize UIMachineView::guestSizeHint()
+bool UIMachineView::guestScreenVisibilityStatus() const
+{
+    /* Always 'true' for primary guest-screen: */
+    if (m_uScreenId == 0)
+        return true;
+
+    /* Actual value for other guest-screens: */
+    return gEDataManager->lastGuestScreenVisibilityStatus(m_uScreenId, vboxGlobal().managedVMUuid());
+}
+
+QSize UIMachineView::guestScreenSizeHint() const
 {
     /* Load guest-screen size-hint: */
-    QSize size = gEDataManager->lastGuestSizeHint(m_uScreenId, vboxGlobal().managedVMUuid());
+    QSize sizeHint = gEDataManager->lastGuestScreenSizeHint(m_uScreenId, vboxGlobal().managedVMUuid());
 
     /* Invent the default if necessary: */
-    if (!size.isValid())
-        size = QSize(800, 600);
+    if (!sizeHint.isValid())
+        sizeHint = QSize(800, 600);
 
     /* Take the scale-factor(s) into account: */
-    size = scaledForward(size);
+    sizeHint = scaledForward(sizeHint);
 
-    /* Return size: */
-    return size;
+    /* Return size-hint: */
+    return sizeHint;
+}
+
+void UIMachineView::storeGuestSizeHint(const QSize &sizeHint)
+{
+    /* Save guest-screen size-hint: */
+    LogRel(("GUI: UIMachineView::storeGuestSizeHint: "
+            "Storing guest-screen size-hint for screen %d as %dx%d\n",
+            (int)screenId(), sizeHint.width(), sizeHint.height()));
+    gEDataManager->setLastGuestScreenSizeHint(m_uScreenId, sizeHint, vboxGlobal().managedVMUuid());
 }
 
 void UIMachineView::handleScaleChange()
@@ -984,15 +1003,6 @@ void UIMachineView::handleScaleChange()
                 (unsigned long)m_uScreenId));
 }
 
-void UIMachineView::storeGuestSizeHint(const QSize &size)
-{
-    /* Save guest-screen size-hint: */
-    LogRel(("GUI: UIMachineView::storeGuestSizeHint: "
-            "Storing guest size-hint for screen %d as %dx%d\n",
-            (int)screenId(), size.width(), size.height()));
-    gEDataManager->setLastGuestSizeHint(m_uScreenId, size, vboxGlobal().managedVMUuid());
-}
-
 void UIMachineView::resetPausePixmap()
 {
     /* Reset pixmap(s): */
@@ -1058,7 +1068,7 @@ void UIMachineView::takePausePixmapSnapshot()
     machine().QuerySavedGuestScreenInfo(m_uScreenId, uGuestOriginX, uGuestOriginY, uGuestWidth, uGuestHeight, fEnabled);
 
     /* Create a screen-shot on the basis of the screen-data we have in saved-state: */
-    QImage screenShot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(uGuestWidth > 0 ? QSize(uGuestWidth, uGuestHeight) : guestSizeHint());
+    QImage screenShot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(uGuestWidth > 0 ? QSize(uGuestWidth, uGuestHeight) : guestScreenSizeHint());
 
     /* Dim screen-shot if it is Ok: */
     if (machine().isOk() && !screenShot.isNull())
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h b/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
index da54750..8455319 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
@@ -208,18 +208,18 @@ protected:
      * UIFramebuffer on EMT).
      * @sa m_u64MaxGuestSize. */
     QSize maxGuestSize();
-    /** Retrieve the last non-fullscreen guest size hint (from extra data).
-     */
-    QSize guestSizeHint();
+
+    /** Retrieves the last guest-screen visibility status from extra-data. */
+    bool guestScreenVisibilityStatus() const;
+
+    /** Retrieves the last guest-screen size-hint from extra-data. */
+    QSize guestScreenSizeHint() const;
+    /** Stores a guest-screen size-hint to extra-data. */
+    void storeGuestSizeHint(const QSize &sizeHint);
 
     /** Handles machine-view scale changes. */
     void handleScaleChange();
 
-    /* Protected setters: */
-    /** Store a guest size hint value to extra data, called on switching to
-     * fullscreen. */
-    void storeGuestSizeHint(const QSize &size);
-
     /** Returns the pause-pixmap: */
     const QPixmap& pausePixmap() const { return m_pausePixmap; }
     /** Returns the scaled pause-pixmap: */
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp
index ec3de8b..a0f5002 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp
@@ -80,37 +80,314 @@ void UIMenuBarEditorWidget::setActionPool(UIActionPool *pActionPool)
     prepare();
 }
 
-void UIMenuBarEditorWidget::sltHandleConfigurationChange(const QString &strMachineID)
+#ifndef Q_WS_MAC
+bool UIMenuBarEditorWidget::isMenuBarEnabled() const
 {
-    /* Skip unrelated machine IDs: */
-    if (machineID() != strMachineID)
-        return;
+    /* For VM settings only: */
+    AssertReturn(m_fStartedFromVMSettings, false);
 
-#ifndef Q_WS_MAC
-    /* Update enable-checkbox: */
-    updateEnableCheckbox();
+    /* Acquire enable-checkbox if possible: */
+    AssertPtrReturn(m_pCheckBoxEnable, false);
+    return m_pCheckBoxEnable->isChecked();
+}
+
+void UIMenuBarEditorWidget::setMenuBarEnabled(bool fEnabled)
+{
+    /* For VM settings only: */
+    AssertReturnVoid(m_fStartedFromVMSettings);
+
+    /* Update enable-checkbox if possible: */
+    AssertPtrReturnVoid(m_pCheckBoxEnable);
+    m_pCheckBoxEnable->setChecked(fEnabled);
+}
 #endif /* !Q_WS_MAC */
 
-    /* Update menus: */
-    updateMenus();
+void UIMenuBarEditorWidget::setRestrictionsOfMenuBar(UIExtraDataMetaDefs::MenuType restrictions)
+{
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuBar = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::MenuType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("MenuType");
+    const QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
+    {
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::MenuType enumValue =
+            static_cast<const UIExtraDataMetaDefs::MenuType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip MenuType_Invalid & MenuType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::MenuType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::MenuType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuBar & enumValue));
+    }
 }
 
-#ifndef RT_OS_DARWIN
-void UIMenuBarEditorWidget::sltHandleMenuBarEnableToggle(bool fEnabled)
+void UIMenuBarEditorWidget::setRestrictionsOfMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType restrictions)
 {
-    /* Toggle enable-checkbox if necessary: */
-    if (m_fStartedFromVMSettings && m_pCheckBoxEnable)
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuApplication = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::MenuApplicationActionType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("MenuApplicationActionType");
+    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
     {
-        /* Check whether this value is really changed: */
-        const bool fMenuBarEnabled = gEDataManager->menuBarEnabled(machineID());
-        if (fMenuBarEnabled != fEnabled)
-        {
-            /* Set new value: */
-            gEDataManager->setMenuBarEnabled(fEnabled, machineID());
-        }
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::MenuApplicationActionType enumValue =
+            static_cast<const UIExtraDataMetaDefs::MenuApplicationActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip MenuApplicationActionType_Invalid & MenuApplicationActionType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::MenuApplicationActionType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::MenuApplicationActionType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuApplication & enumValue));
     }
 }
-#endif /* !RT_OS_DARWIN */
+
+void UIMenuBarEditorWidget::setRestrictionsOfMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictions)
+{
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuMachine = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::RuntimeMenuMachineActionType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuMachineActionType");
+    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
+    {
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::RuntimeMenuMachineActionType enumValue =
+            static_cast<const UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip RuntimeMenuMachineActionType_Invalid & RuntimeMenuMachineActionType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuMachine & enumValue));
+    }
+}
+
+void UIMenuBarEditorWidget::setRestrictionsOfMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictions)
+{
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuView = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::RuntimeMenuViewActionType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuViewActionType");
+    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
+    {
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::RuntimeMenuViewActionType enumValue =
+            static_cast<const UIExtraDataMetaDefs::RuntimeMenuViewActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip RuntimeMenuViewActionType_Invalid & RuntimeMenuViewActionType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuViewActionType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::RuntimeMenuViewActionType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuView & enumValue));
+    }
+}
+
+void UIMenuBarEditorWidget::setRestrictionsOfMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictions)
+{
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuInput = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::RuntimeMenuInputActionType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuInputActionType");
+    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
+    {
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::RuntimeMenuInputActionType enumValue =
+            static_cast<const UIExtraDataMetaDefs::RuntimeMenuInputActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip RuntimeMenuInputActionType_Invalid & RuntimeMenuInputActionType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuInputActionType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::RuntimeMenuInputActionType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuInput & enumValue));
+    }
+}
+
+void UIMenuBarEditorWidget::setRestrictionsOfMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictions)
+{
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuDevices = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::RuntimeMenuDevicesActionType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuDevicesActionType");
+    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
+    {
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType enumValue =
+            static_cast<const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip RuntimeMenuDevicesActionType_Invalid & RuntimeMenuDevicesActionType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuDevices & enumValue));
+    }
+}
+
+#ifdef VBOX_WITH_DEBUGGER_GUI
+void UIMenuBarEditorWidget::setRestrictionsOfMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictions)
+{
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuDebug = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuDebuggerActionType");
+    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
+    {
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType enumValue =
+            static_cast<const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip RuntimeMenuDebuggerActionType_Invalid & RuntimeMenuDebuggerActionType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuDebug & enumValue));
+    }
+}
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+
+#ifdef Q_WS_MAC
+void UIMenuBarEditorWidget::setRestrictionsOfMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType restrictions)
+{
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuWindow = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::MenuWindowActionType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("MenuWindowActionType");
+    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
+    {
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::MenuWindowActionType enumValue =
+            static_cast<const UIExtraDataMetaDefs::MenuWindowActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip MenuWindowActionType_Invalid & MenuWindowActionType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::MenuWindowActionType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::MenuWindowActionType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuWindow & enumValue));
+    }
+}
+#endif /* Q_WS_MAC */
+
+void UIMenuBarEditorWidget::setRestrictionsOfMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType restrictions)
+{
+    /* Cache passed restrictions: */
+    m_restrictionsOfMenuHelp = restrictions;
+    /* Get static meta-object: */
+    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
+
+    /* We have UIExtraDataMetaDefs::MenuHelpActionType enum registered, so we can enumerate it: */
+    const int iEnumIndex = smo.indexOfEnumerator("MenuHelpActionType");
+    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
+    /* Handle other enum-values: */
+    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
+    {
+        /* Get iterated enum-value: */
+        const UIExtraDataMetaDefs::MenuHelpActionType enumValue =
+            static_cast<const UIExtraDataMetaDefs::MenuHelpActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
+        /* Skip MenuHelpActionType_Invalid & MenuHelpActionType_All enum-value: */
+        if (enumValue == UIExtraDataMetaDefs::MenuHelpActionType_Invalid ||
+            enumValue == UIExtraDataMetaDefs::MenuHelpActionType_All)
+            continue;
+        /* Which key required action registered under? */
+        const QString strKey = gpConverter->toInternalString(enumValue);
+        if (!m_actions.contains(strKey))
+            continue;
+        /* Update action 'checked' state: */
+        m_actions.value(strKey)->setChecked(!(m_restrictionsOfMenuHelp & enumValue));
+    }
+}
+
+void UIMenuBarEditorWidget::sltHandleConfigurationChange(const QString &strMachineID)
+{
+    /* Skip unrelated machine IDs: */
+    if (machineID() != strMachineID)
+        return;
+
+    /* Recache menu-bar configuration: */
+    setRestrictionsOfMenuBar(gEDataManager->restrictedRuntimeMenuTypes(machineID()));
+    setRestrictionsOfMenuApplication(gEDataManager->restrictedRuntimeMenuApplicationActionTypes(machineID()));
+    setRestrictionsOfMenuMachine(gEDataManager->restrictedRuntimeMenuMachineActionTypes(machineID()));
+    setRestrictionsOfMenuView(gEDataManager->restrictedRuntimeMenuViewActionTypes(machineID()));
+    setRestrictionsOfMenuInput(gEDataManager->restrictedRuntimeMenuInputActionTypes(machineID()));
+    setRestrictionsOfMenuDevices(gEDataManager->restrictedRuntimeMenuDevicesActionTypes(machineID()));
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    setRestrictionsOfMenuDebug(gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(machineID()));
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+    setRestrictionsOfMenuWindow(gEDataManager->restrictedRuntimeMenuWindowActionTypes(machineID()));
+#endif /* Q_WS_MAC */
+    setRestrictionsOfMenuHelp(gEDataManager->restrictedRuntimeMenuHelpActionTypes(machineID()));
+}
 
 void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
 {
@@ -126,12 +403,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::MenuType type =
                 static_cast<UIExtraDataMetaDefs::MenuType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::MenuType restrictions = gEDataManager->restrictedRuntimeMenuTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::MenuType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuTypes(restrictions, machineID());
+            m_restrictionsOfMenuBar = (UIExtraDataMetaDefs::MenuType)(m_restrictionsOfMenuBar ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuBar(m_restrictionsOfMenuBar);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuTypes(m_restrictionsOfMenuBar, machineID());
+            }
             break;
         }
         case UIExtraDataMetaDefs::MenuType_Application:
@@ -139,12 +422,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::MenuApplicationActionType type =
                 static_cast<UIExtraDataMetaDefs::MenuApplicationActionType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::MenuApplicationActionType restrictions = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::MenuApplicationActionType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuApplicationActionTypes(restrictions, machineID());
+            m_restrictionsOfMenuApplication = (UIExtraDataMetaDefs::MenuApplicationActionType)(m_restrictionsOfMenuApplication ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuApplication(m_restrictionsOfMenuApplication);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuApplicationActionTypes(m_restrictionsOfMenuApplication, machineID());
+            }
             break;
         }
         case UIExtraDataMetaDefs::MenuType_Machine:
@@ -152,12 +441,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::RuntimeMenuMachineActionType type =
                 static_cast<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictions = gEDataManager->restrictedRuntimeMenuMachineActionTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::RuntimeMenuMachineActionType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuMachineActionTypes(restrictions, machineID());
+            m_restrictionsOfMenuMachine = (UIExtraDataMetaDefs::RuntimeMenuMachineActionType)(m_restrictionsOfMenuMachine ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuMachine(m_restrictionsOfMenuMachine);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuMachineActionTypes(m_restrictionsOfMenuMachine, machineID());
+            }
             break;
         }
         case UIExtraDataMetaDefs::MenuType_View:
@@ -165,12 +460,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::RuntimeMenuViewActionType type =
                 static_cast<UIExtraDataMetaDefs::RuntimeMenuViewActionType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictions = gEDataManager->restrictedRuntimeMenuViewActionTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuViewActionTypes(restrictions, machineID());
+            m_restrictionsOfMenuView = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)(m_restrictionsOfMenuView ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuView(m_restrictionsOfMenuView);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuViewActionTypes(m_restrictionsOfMenuView, machineID());
+            }
             break;
         }
         case UIExtraDataMetaDefs::MenuType_Input:
@@ -178,12 +479,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::RuntimeMenuInputActionType type =
                 static_cast<UIExtraDataMetaDefs::RuntimeMenuInputActionType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictions = gEDataManager->restrictedRuntimeMenuInputActionTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::RuntimeMenuInputActionType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuInputActionTypes(restrictions, machineID());
+            m_restrictionsOfMenuInput = (UIExtraDataMetaDefs::RuntimeMenuInputActionType)(m_restrictionsOfMenuInput ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuInput(m_restrictionsOfMenuInput);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuInputActionTypes(m_restrictionsOfMenuInput, machineID());
+            }
             break;
         }
         case UIExtraDataMetaDefs::MenuType_Devices:
@@ -191,12 +498,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType type =
                 static_cast<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictions = gEDataManager->restrictedRuntimeMenuDevicesActionTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuDevicesActionTypes(restrictions, machineID());
+            m_restrictionsOfMenuDevices = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)(m_restrictionsOfMenuDevices ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuDevices(m_restrictionsOfMenuDevices);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuDevicesActionTypes(m_restrictionsOfMenuDevices, machineID());
+            }
             break;
         }
 #ifdef VBOX_WITH_DEBUGGER_GUI
@@ -205,12 +518,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType type =
                 static_cast<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictions = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuDebuggerActionTypes(restrictions, machineID());
+            m_restrictionsOfMenuDebug = (UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType)(m_restrictionsOfMenuDebug ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuDebug(m_restrictionsOfMenuDebug);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuDebuggerActionTypes(m_restrictionsOfMenuDebug, machineID());
+            }
             break;
         }
 #endif /* VBOX_WITH_DEBUGGER_GUI */
@@ -220,12 +539,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::MenuWindowActionType type =
                 static_cast<UIExtraDataMetaDefs::MenuWindowActionType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::MenuWindowActionType restrictions = gEDataManager->restrictedRuntimeMenuWindowActionTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::MenuWindowActionType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuWindowActionTypes(restrictions, machineID());
+            m_restrictionsOfMenuWindow = (UIExtraDataMetaDefs::MenuWindowActionType)(m_restrictionsOfMenuWindow ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuWindow(m_restrictionsOfMenuWindow);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuWindowActionTypes(m_restrictionsOfMenuWindow, machineID());
+            }
             break;
         }
 #endif /* Q_WS_MAC */
@@ -234,13 +559,18 @@ void UIMenuBarEditorWidget::sltHandleMenuBarMenuClick()
             /* Get sender type: */
             const UIExtraDataMetaDefs::MenuHelpActionType type =
                 static_cast<UIExtraDataMetaDefs::MenuHelpActionType>(pAction->property("type").toInt());
-            /* Load current menu-bar restrictions: */
-            UIExtraDataMetaDefs::MenuHelpActionType restrictions = gEDataManager->restrictedRuntimeMenuHelpActionTypes(machineID());
             /* Invert restriction for sender type: */
-            restrictions = (UIExtraDataMetaDefs::MenuHelpActionType)(restrictions ^ type);
-            /* Save updated menu-bar restrictions: */
-            gEDataManager->setRestrictedRuntimeMenuHelpActionTypes(restrictions, machineID());
-            break;
+            m_restrictionsOfMenuHelp = (UIExtraDataMetaDefs::MenuHelpActionType)(m_restrictionsOfMenuHelp ^ type);
+            if (m_fStartedFromVMSettings)
+            {
+                /* Reapply menu-bar restrictions from cache: */
+                setRestrictionsOfMenuHelp(m_restrictionsOfMenuHelp);
+            }
+            else
+            {
+                /* Save updated menu-bar restrictions: */
+                gEDataManager->setRestrictedRuntimeMenuHelpActionTypes(m_restrictionsOfMenuHelp, machineID());
+            }            break;
         }
         default: break;
     }
@@ -314,11 +644,8 @@ void UIMenuBarEditorWidget::prepare()
             {
                 /* Configure enable-checkbox: */
                 m_pCheckBoxEnable->setFocusPolicy(Qt::StrongFocus);
-                connect(m_pCheckBoxEnable, SIGNAL(toggled(bool)), this, SLOT(sltHandleMenuBarEnableToggle(bool)));
                 /* Add enable-checkbox into main-layout: */
                 m_pMainLayout->addWidget(m_pCheckBoxEnable);
-                /* Update enable-checkbox: */
-                updateEnableCheckbox();
             }
         }
 #endif /* !Q_WS_MAC */
@@ -343,16 +670,30 @@ void UIMenuBarEditorWidget::prepareMenus()
     prepareMenuDebug();
 #endif /* VBOX_WITH_DEBUGGER_GUI */
 #ifdef Q_WS_MAC
-    prepareMenuWindow();
+    prepareMenuWindow();
+#endif /* Q_WS_MAC */
+    prepareMenuHelp();
+
+    if (!m_fStartedFromVMSettings)
+    {
+        /* Cache menu-bar configuration: */
+        setRestrictionsOfMenuBar(gEDataManager->restrictedRuntimeMenuTypes(machineID()));
+        setRestrictionsOfMenuApplication(gEDataManager->restrictedRuntimeMenuApplicationActionTypes(machineID()));
+        setRestrictionsOfMenuMachine(gEDataManager->restrictedRuntimeMenuMachineActionTypes(machineID()));
+        setRestrictionsOfMenuView(gEDataManager->restrictedRuntimeMenuViewActionTypes(machineID()));
+        setRestrictionsOfMenuInput(gEDataManager->restrictedRuntimeMenuInputActionTypes(machineID()));
+        setRestrictionsOfMenuDevices(gEDataManager->restrictedRuntimeMenuDevicesActionTypes(machineID()));
+#ifdef VBOX_WITH_DEBUGGER_GUI
+        setRestrictionsOfMenuDebug(gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(machineID()));
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+        setRestrictionsOfMenuWindow(gEDataManager->restrictedRuntimeMenuWindowActionTypes(machineID()));
 #endif /* Q_WS_MAC */
-    prepareMenuHelp();
-
-    /* Listen for the menu-bar configuration changes: */
-    connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QString&)),
-            this, SLOT(sltHandleConfigurationChange(const QString&)));
-
-    /* Update menus: */
-    updateMenus();
+        setRestrictionsOfMenuHelp(gEDataManager->restrictedRuntimeMenuHelpActionTypes(machineID()));
+        /* And listen for the menu-bar configuration changes after that: */
+        connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QString&)),
+                this, SLOT(sltHandleConfigurationChange(const QString&)));
+    }
 }
 
 #ifdef Q_WS_MAC
@@ -655,298 +996,6 @@ void UIMenuBarEditorWidget::prepareMenuHelp()
     }
 }
 
-#ifndef Q_WS_MAC
-void UIMenuBarEditorWidget::updateEnableCheckbox()
-{
-    /* Update enable-checkbox if necessary: */
-    if (m_fStartedFromVMSettings && m_pCheckBoxEnable)
-    {
-        m_pCheckBoxEnable->blockSignals(true);
-        m_pCheckBoxEnable->setChecked(gEDataManager->menuBarEnabled(machineID()));
-        m_pCheckBoxEnable->blockSignals(false);
-    }
-}
-#endif /* !Q_WS_MAC */
-
-void UIMenuBarEditorWidget::updateMenus()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::MenuType restrictionsMenuBar = gEDataManager->restrictedRuntimeMenuTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::MenuType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("MenuType");
-    const QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::MenuType enumValue =
-            static_cast<const UIExtraDataMetaDefs::MenuType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip MenuType_Invalid & MenuType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::MenuType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::MenuType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuBar & enumValue));
-    }
-
-    /* Update known menu-bar menus: */
-    updateMenuApplication();
-    updateMenuMachine();
-    updateMenuView();
-    updateMenuInput();
-    updateMenuDevices();
-#ifdef VBOX_WITH_DEBUGGER_GUI
-    updateMenuDebug();
-#endif /* VBOX_WITH_DEBUGGER_GUI */
-#ifdef Q_WS_MAC
-    updateMenuWindow();
-#endif /* Q_WS_MAC */
-    updateMenuHelp();
-}
-
-void UIMenuBarEditorWidget::updateMenuApplication()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::MenuApplicationActionType restrictionsMenuApplication = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::MenuApplicationActionType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("MenuApplicationActionType");
-    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::MenuApplicationActionType enumValue =
-            static_cast<const UIExtraDataMetaDefs::MenuApplicationActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip MenuApplicationActionType_Invalid & MenuApplicationActionType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::MenuApplicationActionType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::MenuApplicationActionType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuApplication & enumValue));
-    }
-}
-
-void UIMenuBarEditorWidget::updateMenuMachine()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictionsMenuMachine = gEDataManager->restrictedRuntimeMenuMachineActionTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::RuntimeMenuMachineActionType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuMachineActionType");
-    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::RuntimeMenuMachineActionType enumValue =
-            static_cast<const UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip RuntimeMenuMachineActionType_Invalid & RuntimeMenuMachineActionType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuMachine & enumValue));
-    }
-}
-
-void UIMenuBarEditorWidget::updateMenuView()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictionsMenuView = gEDataManager->restrictedRuntimeMenuViewActionTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::RuntimeMenuViewActionType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuViewActionType");
-    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::RuntimeMenuViewActionType enumValue =
-            static_cast<const UIExtraDataMetaDefs::RuntimeMenuViewActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip RuntimeMenuViewActionType_Invalid & RuntimeMenuViewActionType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuViewActionType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::RuntimeMenuViewActionType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuView & enumValue));
-    }
-}
-
-void UIMenuBarEditorWidget::updateMenuInput()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictionsMenuInput = gEDataManager->restrictedRuntimeMenuInputActionTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::RuntimeMenuInputActionType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuInputActionType");
-    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::RuntimeMenuInputActionType enumValue =
-            static_cast<const UIExtraDataMetaDefs::RuntimeMenuInputActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip RuntimeMenuInputActionType_Invalid & RuntimeMenuInputActionType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuInputActionType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::RuntimeMenuInputActionType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuInput & enumValue));
-    }
-}
-
-void UIMenuBarEditorWidget::updateMenuDevices()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictionsMenuDevices = gEDataManager->restrictedRuntimeMenuDevicesActionTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::RuntimeMenuDevicesActionType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuDevicesActionType");
-    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType enumValue =
-            static_cast<const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip RuntimeMenuDevicesActionType_Invalid & RuntimeMenuDevicesActionType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuDevices & enumValue));
-    }
-}
-
-#ifdef VBOX_WITH_DEBUGGER_GUI
-void UIMenuBarEditorWidget::updateMenuDebug()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictionsMenuDebug = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("RuntimeMenuDebuggerActionType");
-    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType enumValue =
-            static_cast<const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip RuntimeMenuDebuggerActionType_Invalid & RuntimeMenuDebuggerActionType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuDebug & enumValue));
-    }
-}
-#endif /* VBOX_WITH_DEBUGGER_GUI */
-
-#ifdef Q_WS_MAC
-void UIMenuBarEditorWidget::updateMenuWindow()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::MenuWindowActionType restrictionsMenuWindow = gEDataManager->restrictedRuntimeMenuWindowActionTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::MenuWindowActionType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("MenuWindowActionType");
-    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::MenuWindowActionType enumValue =
-            static_cast<const UIExtraDataMetaDefs::MenuWindowActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip MenuWindowActionType_Invalid & MenuWindowActionType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::MenuWindowActionType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::MenuWindowActionType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuWindow & enumValue));
-    }
-}
-#endif /* Q_WS_MAC */
-
-void UIMenuBarEditorWidget::updateMenuHelp()
-{
-    /* Recache menu-bar configuration: */
-    const UIExtraDataMetaDefs::MenuHelpActionType restrictionsMenuHelp = gEDataManager->restrictedRuntimeMenuHelpActionTypes(machineID());
-    /* Get static meta-object: */
-    const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject;
-
-    /* We have UIExtraDataMetaDefs::MenuHelpActionType enum registered, so we can enumerate it: */
-    const int iEnumIndex = smo.indexOfEnumerator("MenuHelpActionType");
-    QMetaEnum metaEnum = smo.enumerator(iEnumIndex);
-    /* Handle other enum-values: */
-    for (int iKeyIndex = 0; iKeyIndex < metaEnum.keyCount(); ++iKeyIndex)
-    {
-        /* Get iterated enum-value: */
-        const UIExtraDataMetaDefs::MenuHelpActionType enumValue =
-            static_cast<const UIExtraDataMetaDefs::MenuHelpActionType>(metaEnum.keyToValue(metaEnum.key(iKeyIndex)));
-        /* Skip MenuHelpActionType_Invalid & MenuHelpActionType_All enum-value: */
-        if (enumValue == UIExtraDataMetaDefs::MenuHelpActionType_Invalid ||
-            enumValue == UIExtraDataMetaDefs::MenuHelpActionType_All)
-            continue;
-        /* Which key required action registered under? */
-        const QString strKey = gpConverter->toInternalString(enumValue);
-        if (!m_actions.contains(strKey))
-            continue;
-        /* Update action 'checked' state: */
-        m_actions.value(strKey)->setChecked(!(restrictionsMenuHelp & enumValue));
-    }
-}
-
 void UIMenuBarEditorWidget::retranslateUi()
 {
     /* Translate close-button if necessary: */
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.h b/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.h
index 1edf4ce..e45662f 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.h
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.h
@@ -22,6 +22,7 @@
 #include <QMap>
 
 /* GUI includes: */
+#include "UIExtraDataDefs.h"
 #include "UISlidingToolBar.h"
 #include "QIWithRetranslateUI.h"
 
@@ -84,15 +85,64 @@ public:
     /** Defines the @a pActionPool reference. */
     void setActionPool(UIActionPool *pActionPool);
 
+#ifndef Q_WS_MAC
+    /** Returns whether the menu-bar enabled. */
+    bool isMenuBarEnabled() const;
+    /** Defines whether the menu-bar @a fEnabled. */
+    void setMenuBarEnabled(bool fEnabled);
+#endif /* !Q_WS_MAC */
+
+    /** Returns the cached restrictions of menu-bar. */
+    UIExtraDataMetaDefs::MenuType restrictionsOfMenuBar() const { return m_restrictionsOfMenuBar; }
+    /** Returns the cached restrictions of menu 'Application'. */
+    UIExtraDataMetaDefs::MenuApplicationActionType restrictionsOfMenuApplication() const { return m_restrictionsOfMenuApplication; }
+    /** Returns the cached restrictions of menu 'Machine'. */
+    UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictionsOfMenuMachine() const { return m_restrictionsOfMenuMachine; }
+    /** Returns the cached restrictions of menu 'View'. */
+    UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictionsOfMenuView() const { return m_restrictionsOfMenuView; }
+    /** Returns the cached restrictions of menu 'Input'. */
+    UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictionsOfMenuInput() const { return m_restrictionsOfMenuInput; }
+    /** Returns the cached restrictions of menu 'Devices'. */
+    UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictionsOfMenuDevices() const { return m_restrictionsOfMenuDevices; }
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    /** Returns the cached restrictions of menu 'Debug'. */
+    UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictionsOfMenuDebug() const { return m_restrictionsOfMenuDebug; }
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+    /** Mac OS X: Returns the cached restrictions of menu 'Window'. */
+    UIExtraDataMetaDefs::MenuWindowActionType restrictionsOfMenuWindow() const { return m_restrictionsOfMenuWindow; }
+#endif /* Q_WS_MAC */
+    /** Returns the cached restrictions of menu 'Help'. */
+    UIExtraDataMetaDefs::MenuHelpActionType restrictionsOfMenuHelp() const { return m_restrictionsOfMenuHelp; }
+
+    /** Defines the cached @a restrictions of menu-bar. */
+    void setRestrictionsOfMenuBar(UIExtraDataMetaDefs::MenuType restrictions);
+    /** Defines the cached @a restrictions of menu 'Application'. */
+    void setRestrictionsOfMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType restrictions);
+    /** Defines the cached @a restrictions of menu 'Machine'. */
+    void setRestrictionsOfMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictions);
+    /** Defines the cached @a restrictions of menu 'View'. */
+    void setRestrictionsOfMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictions);
+    /** Defines the cached @a restrictions of menu 'Input'. */
+    void setRestrictionsOfMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictions);
+    /** Defines the cached @a restrictions of menu 'Devices'. */
+    void setRestrictionsOfMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictions);
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    /** Defines the cached @a restrictions of menu 'Debug'. */
+    void setRestrictionsOfMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictions);
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+    /** Mac OS X: Defines the cached @a restrictions of menu 'Window'. */
+    void setRestrictionsOfMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType restrictions);
+#endif /* Q_WS_MAC */
+    /** Defines the cached @a restrictions of menu 'Help'. */
+    void setRestrictionsOfMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType restrictions);
+
 private slots:
 
     /** Handles configuration change. */
     void sltHandleConfigurationChange(const QString &strMachineID);
 
-#ifndef RT_OS_DARWIN
-    /** Non Mac OS X: Handles menu-bar enable toggle. */
-    void sltHandleMenuBarEnableToggle(bool fEnabled);
-#endif /* !RT_OS_DARWIN */
     /** Handles menu-bar menu click. */
     void sltHandleMenuBarMenuClick();
 
@@ -140,33 +190,6 @@ private:
     /** Prepare 'Help' menu routine. */
     void prepareMenuHelp();
 
-#ifndef Q_WS_MAC
-    /** Non Mac OS X: Update enable-checkbox routine. */
-    void updateEnableCheckbox();
-#endif /* !Q_WS_MAC */
-    /** Update menus routine. */
-    void updateMenus();
-    /** Update 'Application' menu routine. */
-    void updateMenuApplication();
-    /** Update 'Machine' menu routine. */
-    void updateMenuMachine();
-    /** Update 'View' menu routine. */
-    void updateMenuView();
-    /** Update 'Input' menu routine. */
-    void updateMenuInput();
-    /** Update 'Devices' menu routine. */
-    void updateMenuDevices();
-#ifdef VBOX_WITH_DEBUGGER_GUI
-    /** Update 'Debug' menu routine. */
-    void updateMenuDebug();
-#endif /* VBOX_WITH_DEBUGGER_GUI */
-#ifdef Q_WS_MAC
-    /** Mac OS X: Update 'Window' menu routine. */
-    void updateMenuWindow();
-#endif /* Q_WS_MAC */
-    /** Update 'Help' menu routine. */
-    void updateMenuHelp();
-
     /** Retranslation routine. */
     virtual void retranslateUi();
 
@@ -200,6 +223,32 @@ private:
         /** Holds tool-bar action references. */
         QMap<QString, QAction*> m_actions;
     /** @} */
+
+    /** @name Contents: Restrictions
+      * @{ */
+        /** Holds the cached restrictions of menu-bar. */
+        UIExtraDataMetaDefs::MenuType m_restrictionsOfMenuBar;
+        /** Holds the cached restrictions of menu 'Application'. */
+        UIExtraDataMetaDefs::MenuApplicationActionType m_restrictionsOfMenuApplication;
+        /** Holds the cached restrictions of menu 'Machine'. */
+        UIExtraDataMetaDefs::RuntimeMenuMachineActionType m_restrictionsOfMenuMachine;
+        /** Holds the cached restrictions of menu 'View'. */
+        UIExtraDataMetaDefs::RuntimeMenuViewActionType m_restrictionsOfMenuView;
+        /** Holds the cached restrictions of menu 'Input'. */
+        UIExtraDataMetaDefs::RuntimeMenuInputActionType m_restrictionsOfMenuInput;
+        /** Holds the cached restrictions of menu 'Devices'. */
+        UIExtraDataMetaDefs::RuntimeMenuDevicesActionType m_restrictionsOfMenuDevices;
+#ifdef VBOX_WITH_DEBUGGER_GUI
+        /** Holds the cached restrictions of menu 'Debug'. */
+        UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType m_restrictionsOfMenuDebug;
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+        /** Mac OS X: Holds the cached restrictions of menu 'Window'. */
+        UIExtraDataMetaDefs::MenuWindowActionType m_restrictionsOfMenuWindow;
+#endif /* Q_WS_MAC */
+        /** Holds the cached restrictions of menu 'Help'. */
+        UIExtraDataMetaDefs::MenuHelpActionType m_restrictionsOfMenuHelp;
+    /** @} */
 };
 
 #endif /* !___UIMenuBarEditorWindow_h___ */
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
index 7a0badd..271c0d3 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
@@ -1936,15 +1936,22 @@ bool UISession::postprocessInitialization()
 
 bool UISession::isScreenVisible(ulong uScreenId) const
 {
-    Assert(uScreenId < (ulong)m_monitorVisibilityVector.size());
-    return m_monitorVisibilityVector.value((int)uScreenId, false);
+    /* Make sure index feats the bounds: */
+    AssertReturn(uScreenId < (ulong)m_monitorVisibilityVector.size(), false);
+
+    /* Return 'actual' visibility status: */
+    return m_monitorVisibilityVector.value((int)uScreenId);
 }
 
 void UISession::setScreenVisible(ulong uScreenId, bool fIsMonitorVisible)
 {
-    Assert(uScreenId < (ulong)m_monitorVisibilityVector.size());
-    if (uScreenId < (ulong)m_monitorVisibilityVector.size())
-        m_monitorVisibilityVector[(int)uScreenId] = fIsMonitorVisible;
+    /* Make sure index feats the bounds: */
+    AssertReturnVoid(uScreenId < (ulong)m_monitorVisibilityVector.size());
+
+    /* Remember 'actual' visibility status: */
+    m_monitorVisibilityVector[(int)uScreenId] = fIsMonitorVisible;
+    /* Remember 'desired' visibility status: */
+    gEDataManager->setLastGuestScreenVisibilityStatus(uScreenId, fIsMonitorVisible, vboxGlobal().managedVMUuid());
 }
 
 int UISession::countOfVisibleWindows()
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp
index 38393e3..707b402 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp
@@ -282,34 +282,73 @@ void UIStatusBarEditorWidget::setMachineID(const QString &strMachineID)
     prepare();
 }
 
-void UIStatusBarEditorWidget::sltHandleConfigurationChange(const QString &strMachineID)
+bool UIStatusBarEditorWidget::isStatusBarEnabled() const
 {
-    /* Skip unrelated machine IDs: */
-    if (machineID() != strMachineID)
-        return;
+    /* For VM settings only: */
+    AssertReturn(m_fStartedFromVMSettings, false);
 
-    /* Update enable-checkbox: */
-    updateEnableCheckbox();
+    /* Acquire enable-checkbox if possible: */
+    AssertPtrReturn(m_pCheckBoxEnable, false);
+    return m_pCheckBoxEnable->isChecked();
+}
 
-    /* Update status buttons: */
-    updateStatusButtons();
+void UIStatusBarEditorWidget::setStatusBarEnabled(bool fEnabled)
+{
+    /* For VM settings only: */
+    AssertReturnVoid(m_fStartedFromVMSettings);
+
+    /* Update enable-checkbox if possible: */
+    AssertPtrReturnVoid(m_pCheckBoxEnable);
+    m_pCheckBoxEnable->setChecked(fEnabled);
 }
 
-void UIStatusBarEditorWidget::sltHandleStatusBarEnableToggle(bool fEnabled)
+void UIStatusBarEditorWidget::setStatusBarConfiguration(const QList<IndicatorType> &restrictions,
+                                                        const QList<IndicatorType> &order)
 {
-    /* Toggle enable-checkbox if necessary: */
-    if (m_fStartedFromVMSettings && m_pCheckBoxEnable)
+    /* Cache passed restrictions: */
+    m_restrictions = restrictions;
+
+    /* Cache passed order: */
+    m_order = order;
+    /* Append order with missed indicators: */
+    for (int iType = IndicatorType_Invalid; iType < IndicatorType_Max; ++iType)
+        if (iType != IndicatorType_Invalid && iType != IndicatorType_KeyboardExtension &&
+            !m_order.contains((IndicatorType)iType))
+            m_order << (IndicatorType)iType;
+
+    /* Update configuration for all existing buttons: */
+    foreach (const IndicatorType &type, m_order)
     {
-        /* Check whether this value is really changed: */
-        const bool fStatusBarEnabled = gEDataManager->statusBarEnabled(machineID());
-        if (fStatusBarEnabled != fEnabled)
+        /* Get button: */
+        UIStatusBarEditorButton *pButton = m_buttons.value(type);
+        /* Make sure button exists: */
+        if (!pButton)
+            continue;
+        /* Update button 'checked' state: */
+        pButton->setChecked(!m_restrictions.contains(type));
+        /* Make sure it have valid position: */
+        const int iWantedIndex = position(type);
+        const int iActualIndex = m_pButtonLayout->indexOf(pButton);
+        if (iActualIndex != iWantedIndex)
         {
-            /* Set new value: */
-            gEDataManager->setStatusBarEnabled(fEnabled, machineID());
+            /* Re-inject button into main-layout at proper position: */
+            m_pButtonLayout->removeWidget(pButton);
+            m_pButtonLayout->insertWidget(iWantedIndex, pButton);
         }
     }
 }
 
+void UIStatusBarEditorWidget::sltHandleConfigurationChange(const QString &strMachineID)
+{
+    /* Skip unrelated machine IDs: */
+    if (machineID() != strMachineID)
+        return;
+
+    /* Recache status-bar configuration: */
+    setStatusBarConfiguration(gEDataManager->restrictedStatusBarIndicators(machineID()),
+                              gEDataManager->statusBarIndicatorOrder(machineID()));
+}
+
 void UIStatusBarEditorWidget::sltHandleButtonClick()
 {
     /* Make sure sender is valid: */
@@ -319,18 +358,22 @@ void UIStatusBarEditorWidget::sltHandleButtonClick()
     /* Get sender type: */
     const IndicatorType type = pButton->type();
 
-    /* Load current status-bar indicator restrictions: */
-    QList<IndicatorType> restrictions =
-        gEDataManager->restrictedStatusBarIndicators(machineID());
-
     /* Invert restriction for sender type: */
-    if (restrictions.contains(type))
-        restrictions.removeAll(type);
+    if (m_restrictions.contains(type))
+        m_restrictions.removeAll(type);
     else
-        restrictions.append(type);
+        m_restrictions.append(type);
 
-    /* Save updated status-bar indicator restrictions: */
-    gEDataManager->setRestrictedStatusBarIndicators(restrictions, machineID());
+    if (m_fStartedFromVMSettings)
+    {
+        /* Reapply status-bar configuration from cache: */
+        setStatusBarConfiguration(m_restrictions, m_order);
+    }
+    else
+    {
+        /* Save updated status-bar indicator restrictions: */
+        gEDataManager->setRestrictedStatusBarIndicators(m_restrictions, machineID());
+    }
 }
 
 void UIStatusBarEditorWidget::sltHandleDragObjectDestroy()
@@ -399,11 +442,8 @@ void UIStatusBarEditorWidget::prepare()
             {
                 /* Configure enable-checkbox: */
                 m_pCheckBoxEnable->setFocusPolicy(Qt::StrongFocus);
-                connect(m_pCheckBoxEnable, SIGNAL(toggled(bool)), this, SLOT(sltHandleStatusBarEnableToggle(bool)));
                 /* Add enable-checkbox into main-layout: */
                 m_pMainLayout->addWidget(m_pCheckBoxEnable);
-                /* Update enable-checkbox: */
-                updateEnableCheckbox();
             }
         }
         /* Insert stretch: */
@@ -443,12 +483,15 @@ void UIStatusBarEditorWidget::prepareStatusButtons()
         prepareStatusButton(type);
     }
 
-    /* Listen for the status-bar configuration changes: */
-    connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QString&)),
-            this, SLOT(sltHandleConfigurationChange(const QString&)));
-
-    /* Update status buttons: */
-    updateStatusButtons();
+    if (!m_fStartedFromVMSettings)
+    {
+        /* Cache status-bar configuration: */
+        setStatusBarConfiguration(gEDataManager->restrictedStatusBarIndicators(machineID()),
+                                  gEDataManager->statusBarIndicatorOrder(machineID()));
+        /* And listen for the status-bar configuration changes after that: */
+        connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QString&)),
+                this, SLOT(sltHandleConfigurationChange(const QString&)));
+    }
 }
 
 void UIStatusBarEditorWidget::prepareStatusButton(IndicatorType type)
@@ -467,46 +510,6 @@ void UIStatusBarEditorWidget::prepareStatusButton(IndicatorType type)
     }
 }
 
-void UIStatusBarEditorWidget::updateEnableCheckbox()
-{
-    /* Update enable-checkbox if necessary: */
-    if (m_fStartedFromVMSettings && m_pCheckBoxEnable)
-    {
-        m_pCheckBoxEnable->blockSignals(true);
-        m_pCheckBoxEnable->setChecked(gEDataManager->statusBarEnabled(machineID()));
-        m_pCheckBoxEnable->blockSignals(false);
-    }
-}
-
-void UIStatusBarEditorWidget::updateStatusButtons()
-{
-    /* Recache status-bar configuration: */
-    m_restrictions = gEDataManager->restrictedStatusBarIndicators(machineID());
-    m_order = gEDataManager->statusBarIndicatorOrder(machineID());
-    for (int iType = IndicatorType_Invalid; iType < IndicatorType_Max; ++iType)
-        if (iType != IndicatorType_Invalid && iType != IndicatorType_KeyboardExtension &&
-            !m_order.contains((IndicatorType)iType))
-            m_order << (IndicatorType)iType;
-
-    /* Update configuration for all the status buttons: */
-    foreach (const IndicatorType &type, m_order)
-    {
-        /* Get button: */
-        UIStatusBarEditorButton *pButton = m_buttons.value(type);
-        /* Update button 'checked' state: */
-        pButton->setChecked(!m_restrictions.contains(type));
-        /* Make sure it have valid position: */
-        const int iWantedIndex = position(type);
-        const int iActualIndex = m_pButtonLayout->indexOf(pButton);
-        if (iActualIndex != iWantedIndex)
-        {
-            /* Re-inject button into main-layout at proper position: */
-            m_pButtonLayout->removeWidget(pButton);
-            m_pButtonLayout->insertWidget(iWantedIndex, pButton);
-        }
-    }
-}
-
 void UIStatusBarEditorWidget::retranslateUi()
 {
     /* Translate close-button if necessary: */
@@ -681,24 +684,24 @@ void UIStatusBarEditorWidget::dropEvent(QDropEvent *pEvent)
     if (droppedType == tokenType)
         return;
 
-    /* Load current status-bar indicator order and make sure it's complete: */
-    QList<IndicatorType> order =
-        gEDataManager->statusBarIndicatorOrder(machineID());
-    for (int iType = IndicatorType_Invalid; iType < IndicatorType_Max; ++iType)
-        if (iType != IndicatorType_Invalid && iType != IndicatorType_KeyboardExtension &&
-            !order.contains((IndicatorType)iType))
-            order << (IndicatorType)iType;
-
     /* Remove type of dropped-button: */
-    order.removeAll(droppedType);
+    m_order.removeAll(droppedType);
     /* Insert type of dropped-button into position of token-button: */
-    int iPosition = order.indexOf(tokenType);
+    int iPosition = m_order.indexOf(tokenType);
     if (m_fDropAfterTokenButton)
         ++iPosition;
-    order.insert(iPosition, droppedType);
+    m_order.insert(iPosition, droppedType);
 
-    /* Save updated status-bar indicator order: */
-    gEDataManager->setStatusBarIndicatorOrder(order, machineID());
+    if (m_fStartedFromVMSettings)
+    {
+        /* Reapply status-bar configuration from cache: */
+        setStatusBarConfiguration(m_restrictions, m_order);
+    }
+    else
+    {
+        /* Save updated status-bar indicator order: */
+        gEDataManager->setStatusBarIndicatorOrder(m_order, machineID());
+    }
 }
 
 int UIStatusBarEditorWidget::position(IndicatorType type) const
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.h b/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.h
index 1c3ab5e..b97b288 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.h
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.h
@@ -72,13 +72,23 @@ public:
     /** Defines the @a strMachineID instance. */
     void setMachineID(const QString &strMachineID);
 
+    /** Returns whether the status-bar enabled. */
+    bool isStatusBarEnabled() const;
+    /** Defines whether the status-bar @a fEnabled. */
+    void setStatusBarEnabled(bool fEnabled);
+
+    /** Returns status-bar indicator restrictions. */
+    const QList<IndicatorType>& statusBarIndicatorRestrictions() const { return m_restrictions; }
+    /** Returns status-bar indicator order. */
+    const QList<IndicatorType>& statusBarIndicatorOrder() const { return m_order; }
+    /** Defines status-bar indicator @a restrictions and @a order. */
+    void setStatusBarConfiguration(const QList<IndicatorType> &restrictions, const QList<IndicatorType> &order);
+
 private slots:
 
     /** Handles configuration change. */
     void sltHandleConfigurationChange(const QString &strMachineID);
 
-    /** Handles status-bar enable toggle. */
-    void sltHandleStatusBarEnableToggle(bool fEnabled);
     /** Handles button click. */
     void sltHandleButtonClick();
 
@@ -94,11 +104,6 @@ private:
     /** Prepare status button routine. */
     void prepareStatusButton(IndicatorType type);
 
-    /** Update enable-checkbox routine. */
-    void updateEnableCheckbox();
-    /** Update status buttons routine. */
-    void updateStatusButtons();
-
     /** Retranslation routine. */
     virtual void retranslateUi();
 
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
index 1b93660..eddc4fb 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
@@ -136,10 +136,14 @@ void UIMachineViewNormal::setGuestAutoresizeEnabled(bool fEnabled)
 
 void UIMachineViewNormal::resendSizeHint()
 {
-    /* Get the last size hint, taking the scale factor into account. */
-    const QSize sizeHint = scaledBackward(guestSizeHint());
+    /* Get the last guest-screen size-hint, taking the scale factor into account. */
+    const QSize sizeHint = scaledBackward(guestScreenSizeHint());
     LogRel(("GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen %d to %dx%d\n",
             (int)screenId(), sizeHint.width(), sizeHint.height()));
+
+    /* Expand current limitations: */
+    setMaxGuestSize(sizeHint);
+
     if (uisession()->isGuestSupportsGraphics())
     {
         /* Temporarily restrict the size to prevent a brief resize to the
@@ -149,9 +153,13 @@ void UIMachineViewNormal::resendSizeHint()
         setMaximumSize(sizeHint);
         m_sizeHintOverride = sizeHint;
     }
-    /** @todo What if not m_bIsGuestAutoresizeEnabled?  Just let the guest start
-     *        at the default 800x600? */
-    display().SetVideoModeHint(screenId(), true, false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
+
+    /* Send saved size-hint to the guest: */
+    /// @todo What if not m_bIsGuestAutoresizeEnabled?
+    ///       Just let the guest start at the default 800x600?
+    display().SetVideoModeHint(screenId(),
+                               guestScreenVisibilityStatus(),
+                               false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
 }
 
 void UIMachineViewNormal::adjustGuestScreenSize()
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
index 21d5819..8d6ec48 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
@@ -152,12 +152,18 @@ void UIMachineViewScale::applyMachineViewScaleFactor()
 
 void UIMachineViewScale::resendSizeHint()
 {
-    const QSize sizeHint = scaledBackward(guestSizeHint());
+    /* Get the last guest-screen size-hint, taking the scale factor into account. */
+    const QSize sizeHint = scaledBackward(guestScreenSizeHint());
     LogRel(("GUI: UIMachineViewScale::resendSizeHint: Restoring guest size-hint for screen %d to %dx%d\n",
             (int)screenId(), sizeHint.width(), sizeHint.height()));
+
     /* Expand current limitations: */
     setMaxGuestSize(sizeHint);
-    display().SetVideoModeHint(screenId(), true, false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
+
+    /* Send saved size-hint to the guest: */
+    display().SetVideoModeHint(screenId(),
+                               guestScreenVisibilityStatus(),
+                               false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
 }
 
 QSize UIMachineViewScale::sizeHint() const
diff --git a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.cpp b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.cpp
index 8a9c8b5..0fc6f4c 100644
--- a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.cpp
@@ -54,6 +54,25 @@ void UIMachineSettingsInterface::loadToCacheFrom(QVariant &data)
     UIDataSettingsMachineInterface interfaceData;
 
     /* Cache interface data: */
+    interfaceData.m_fStatusBarEnabled = gEDataManager->statusBarEnabled(m_machine.GetId());
+    interfaceData.m_statusBarRestrictions = gEDataManager->restrictedStatusBarIndicators(m_machine.GetId());
+    interfaceData.m_statusBarOrder = gEDataManager->statusBarIndicatorOrder(m_machine.GetId());
+#ifndef Q_WS_MAC
+    interfaceData.m_fMenuBarEnabled = gEDataManager->menuBarEnabled(m_machine.GetId());
+#endif /* !Q_WS_MAC */
+    interfaceData.m_restrictionsOfMenuBar = gEDataManager->restrictedRuntimeMenuTypes(m_machine.GetId());
+    interfaceData.m_restrictionsOfMenuApplication = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(m_machine.GetId());
+    interfaceData.m_restrictionsOfMenuMachine = gEDataManager->restrictedRuntimeMenuMachineActionTypes(m_machine.GetId());
+    interfaceData.m_restrictionsOfMenuView = gEDataManager->restrictedRuntimeMenuViewActionTypes(m_machine.GetId());
+    interfaceData.m_restrictionsOfMenuInput = gEDataManager->restrictedRuntimeMenuInputActionTypes(m_machine.GetId());
+    interfaceData.m_restrictionsOfMenuDevices = gEDataManager->restrictedRuntimeMenuDevicesActionTypes(m_machine.GetId());
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    interfaceData.m_restrictionsOfMenuDebug = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(m_machine.GetId());
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+    interfaceData.m_restrictionsOfMenuWindow = gEDataManager->restrictedRuntimeMenuWindowActionTypes(m_machine.GetId());
+#endif /* Q_WS_MAC */
+    interfaceData.m_restrictionsOfMenuHelp = gEDataManager->restrictedRuntimeMenuHelpActionTypes(m_machine.GetId());
 #ifndef Q_WS_MAC
     interfaceData.m_fShowMiniToolBar = gEDataManager->miniToolbarEnabled(m_machine.GetId());
     interfaceData.m_fMiniToolBarAtTop = gEDataManager->miniToolbarAlignment(m_machine.GetId()) == Qt::AlignTop;
@@ -74,12 +93,29 @@ void UIMachineSettingsInterface::getFromCache()
     const UIDataSettingsMachineInterface &interfaceData = m_cache.base();
 
     /* Prepare interface data: */
+    m_pStatusBarEditor->setStatusBarEnabled(interfaceData.m_fStatusBarEnabled);
+    m_pStatusBarEditor->setStatusBarConfiguration(interfaceData.m_statusBarRestrictions,
+                                                  interfaceData.m_statusBarOrder);
+#ifndef Q_WS_MAC
+    m_pMenuBarEditor->setMenuBarEnabled(interfaceData.m_fMenuBarEnabled);
+#endif /* !Q_WS_MAC */
+    m_pMenuBarEditor->setRestrictionsOfMenuBar(interfaceData.m_restrictionsOfMenuBar);
+    m_pMenuBarEditor->setRestrictionsOfMenuApplication(interfaceData.m_restrictionsOfMenuApplication);
+    m_pMenuBarEditor->setRestrictionsOfMenuMachine(interfaceData.m_restrictionsOfMenuMachine);
+    m_pMenuBarEditor->setRestrictionsOfMenuView(interfaceData.m_restrictionsOfMenuView);
+    m_pMenuBarEditor->setRestrictionsOfMenuInput(interfaceData.m_restrictionsOfMenuInput);
+    m_pMenuBarEditor->setRestrictionsOfMenuDevices(interfaceData.m_restrictionsOfMenuDevices);
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    m_pMenuBarEditor->setRestrictionsOfMenuDebug(interfaceData.m_restrictionsOfMenuDebug);
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+    m_pMenuBarEditor->setRestrictionsOfMenuWindow(interfaceData.m_restrictionsOfMenuWindow);
+#endif /* Q_WS_MAC */
+    m_pMenuBarEditor->setRestrictionsOfMenuHelp(interfaceData.m_restrictionsOfMenuHelp);
 #ifndef Q_WS_MAC
     m_pCheckBoxShowMiniToolBar->setChecked(interfaceData.m_fShowMiniToolBar);
     m_pComboToolBarAlignment->setChecked(interfaceData.m_fMiniToolBarAtTop);
-#else /* Q_WS_MAC */
-    Q_UNUSED(interfaceData);
-#endif /* Q_WS_MAC */
+#endif /* !Q_WS_MAC */
 
     /* Polish page finally: */
     polishPage();
@@ -96,6 +132,25 @@ void UIMachineSettingsInterface::putToCache()
     UIDataSettingsMachineInterface interfaceData = m_cache.base();
 
     /* Gather interface data from page: */
+    interfaceData.m_fStatusBarEnabled = m_pStatusBarEditor->isStatusBarEnabled();
+    interfaceData.m_statusBarRestrictions = m_pStatusBarEditor->statusBarIndicatorRestrictions();
+    interfaceData.m_statusBarOrder = m_pStatusBarEditor->statusBarIndicatorOrder();
+#ifndef Q_WS_MAC
+    interfaceData.m_fMenuBarEnabled = m_pMenuBarEditor->isMenuBarEnabled();
+#endif /* !Q_WS_MAC */
+    interfaceData.m_restrictionsOfMenuBar = m_pMenuBarEditor->restrictionsOfMenuBar();
+    interfaceData.m_restrictionsOfMenuApplication = m_pMenuBarEditor->restrictionsOfMenuApplication();
+    interfaceData.m_restrictionsOfMenuMachine = m_pMenuBarEditor->restrictionsOfMenuMachine();
+    interfaceData.m_restrictionsOfMenuView = m_pMenuBarEditor->restrictionsOfMenuView();
+    interfaceData.m_restrictionsOfMenuInput = m_pMenuBarEditor->restrictionsOfMenuInput();
+    interfaceData.m_restrictionsOfMenuDevices = m_pMenuBarEditor->restrictionsOfMenuDevices();
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    interfaceData.m_restrictionsOfMenuDebug = m_pMenuBarEditor->restrictionsOfMenuDebug();
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+    interfaceData.m_restrictionsOfMenuWindow = m_pMenuBarEditor->restrictionsOfMenuWindow();
+#endif /* Q_WS_MAC */
+    interfaceData.m_restrictionsOfMenuHelp = m_pMenuBarEditor->restrictionsOfMenuHelp();
 #ifndef Q_WS_MAC
     interfaceData.m_fShowMiniToolBar = m_pCheckBoxShowMiniToolBar->isChecked();
     interfaceData.m_fMiniToolBarAtTop = m_pComboToolBarAlignment->isChecked();
@@ -121,12 +176,29 @@ void UIMachineSettingsInterface::saveFromCacheTo(QVariant &data)
         /* Store interface data: */
         if (isMachineInValidMode())
         {
+            gEDataManager->setStatusBarEnabled(interfaceData.m_fStatusBarEnabled, m_machine.GetId());
+            gEDataManager->setRestrictedStatusBarIndicators(interfaceData.m_statusBarRestrictions, m_machine.GetId());
+            gEDataManager->setStatusBarIndicatorOrder(interfaceData.m_statusBarOrder, m_machine.GetId());
+#ifndef Q_WS_MAC
+            gEDataManager->setMenuBarEnabled(interfaceData.m_fMenuBarEnabled, m_machine.GetId());
+#endif /* !Q_WS_MAC */
+            gEDataManager->setRestrictedRuntimeMenuTypes(interfaceData.m_restrictionsOfMenuBar, m_machine.GetId());
+            gEDataManager->setRestrictedRuntimeMenuApplicationActionTypes(interfaceData.m_restrictionsOfMenuApplication, m_machine.GetId());
+            gEDataManager->setRestrictedRuntimeMenuMachineActionTypes(interfaceData.m_restrictionsOfMenuMachine, m_machine.GetId());
+            gEDataManager->setRestrictedRuntimeMenuViewActionTypes(interfaceData.m_restrictionsOfMenuView, m_machine.GetId());
+            gEDataManager->setRestrictedRuntimeMenuInputActionTypes(interfaceData.m_restrictionsOfMenuInput, m_machine.GetId());
+            gEDataManager->setRestrictedRuntimeMenuDevicesActionTypes(interfaceData.m_restrictionsOfMenuDevices, m_machine.GetId());
+#ifdef VBOX_WITH_DEBUGGER_GUI
+            gEDataManager->setRestrictedRuntimeMenuDebuggerActionTypes(interfaceData.m_restrictionsOfMenuDebug, m_machine.GetId());
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+            gEDataManager->setRestrictedRuntimeMenuWindowActionTypes(interfaceData.m_restrictionsOfMenuWindow, m_machine.GetId());
+#endif /* Q_WS_MAC */
+            gEDataManager->setRestrictedRuntimeMenuHelpActionTypes(interfaceData.m_restrictionsOfMenuHelp, m_machine.GetId());
 #ifndef Q_WS_MAC
             gEDataManager->setMiniToolbarEnabled(interfaceData.m_fShowMiniToolBar, m_machine.GetId());
             gEDataManager->setMiniToolbarAlignment(interfaceData.m_fMiniToolBarAtTop ? Qt::AlignTop : Qt::AlignBottom, m_machine.GetId());
-#else /* Q_WS_MAC */
-            Q_UNUSED(interfaceData);
-#endif /* Q_WS_MAC */
+#endif /* !Q_WS_MAC */
         }
     }
 
diff --git a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.h b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.h
index ba86576..5ab54fc 100644
--- a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.h
+++ b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.h
@@ -30,8 +30,25 @@ struct UIDataSettingsMachineInterface
 {
     /* Constructor: */
     UIDataSettingsMachineInterface()
+        : m_fStatusBarEnabled(false)
 #ifndef Q_WS_MAC
-        : m_fShowMiniToolBar(false)
+        , m_fMenuBarEnabled(false)
+#endif /* !Q_WS_MAC */
+        , m_restrictionsOfMenuBar(UIExtraDataMetaDefs::MenuType_Invalid)
+        , m_restrictionsOfMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Invalid)
+        , m_restrictionsOfMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid)
+        , m_restrictionsOfMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Invalid)
+        , m_restrictionsOfMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_Invalid)
+        , m_restrictionsOfMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid)
+#ifdef VBOX_WITH_DEBUGGER_GUI
+        , m_restrictionsOfMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Invalid)
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+        , m_restrictionsOfMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType_Invalid)
+#endif /* Q_WS_MAC */
+        , m_restrictionsOfMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Invalid)
+#ifndef Q_WS_MAC
+        , m_fShowMiniToolBar(false)
         , m_fMiniToolBarAtTop(false)
 #endif /* !Q_WS_MAC */
     {}
@@ -39,13 +56,30 @@ struct UIDataSettingsMachineInterface
     /* Functions: */
     bool equal(const UIDataSettingsMachineInterface &other) const
     {
+        return    (m_fStatusBarEnabled == other.m_fStatusBarEnabled)
+               && (m_statusBarRestrictions == other.m_statusBarRestrictions)
+               && (m_statusBarOrder == other.m_statusBarOrder)
 #ifndef Q_WS_MAC
-        return (m_fShowMiniToolBar == other.m_fShowMiniToolBar) &&
-               (m_fMiniToolBarAtTop == other.m_fMiniToolBarAtTop);
-#else /* Q_WS_MAC */
-        Q_UNUSED(other);
-        return true;
+               && (m_fMenuBarEnabled == other.m_fMenuBarEnabled)
+#endif /* !Q_WS_MAC */
+               && (m_restrictionsOfMenuBar == other.m_restrictionsOfMenuBar)
+               && (m_restrictionsOfMenuApplication == other.m_restrictionsOfMenuApplication)
+               && (m_restrictionsOfMenuMachine == other.m_restrictionsOfMenuMachine)
+               && (m_restrictionsOfMenuView == other.m_restrictionsOfMenuView)
+               && (m_restrictionsOfMenuInput == other.m_restrictionsOfMenuInput)
+               && (m_restrictionsOfMenuDevices == other.m_restrictionsOfMenuDevices)
+#ifdef VBOX_WITH_DEBUGGER_GUI
+               && (m_restrictionsOfMenuDebug == other.m_restrictionsOfMenuDebug)
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+               && (m_restrictionsOfMenuWindow == other.m_restrictionsOfMenuWindow)
 #endif /* Q_WS_MAC */
+               && (m_restrictionsOfMenuHelp == other.m_restrictionsOfMenuHelp)
+#ifndef Q_WS_MAC
+               && (m_fShowMiniToolBar == other.m_fShowMiniToolBar)
+               && (m_fMiniToolBarAtTop == other.m_fMiniToolBarAtTop)
+#endif /* !Q_WS_MAC */
+               ;
     }
 
     /* Operators: */
@@ -53,6 +87,25 @@ struct UIDataSettingsMachineInterface
     bool operator!=(const UIDataSettingsMachineInterface &other) const { return !equal(other); }
 
     /* Variables: */
+    bool m_fStatusBarEnabled;
+    QList<IndicatorType> m_statusBarRestrictions;
+    QList<IndicatorType> m_statusBarOrder;
+#ifndef Q_WS_MAC
+    bool m_fMenuBarEnabled;
+#endif /* !Q_WS_MAC */
+    UIExtraDataMetaDefs::MenuType m_restrictionsOfMenuBar;
+    UIExtraDataMetaDefs::MenuApplicationActionType m_restrictionsOfMenuApplication;
+    UIExtraDataMetaDefs::RuntimeMenuMachineActionType m_restrictionsOfMenuMachine;
+    UIExtraDataMetaDefs::RuntimeMenuViewActionType m_restrictionsOfMenuView;
+    UIExtraDataMetaDefs::RuntimeMenuInputActionType m_restrictionsOfMenuInput;
+    UIExtraDataMetaDefs::RuntimeMenuDevicesActionType m_restrictionsOfMenuDevices;
+#ifdef VBOX_WITH_DEBUGGER_GUI
+    UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType m_restrictionsOfMenuDebug;
+#endif /* VBOX_WITH_DEBUGGER_GUI */
+#ifdef Q_WS_MAC
+    UIExtraDataMetaDefs::MenuWindowActionType m_restrictionsOfMenuWindow;
+#endif /* Q_WS_MAC */
+    UIExtraDataMetaDefs::MenuHelpActionType m_restrictionsOfMenuHelp;
 #ifndef Q_WS_MAC
     bool m_fShowMiniToolBar;
     bool m_fMiniToolBarAtTop;
diff --git a/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c b/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
index 5726c5e..6a5ea4a 100644
--- a/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
+++ b/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
@@ -1415,7 +1415,7 @@ static int crVBoxHGCMDoConnect( CRConnection *conn )
 # endif
     if (ioctl(g_crvboxhgcm.iGuestDrv, VBOXGUEST_IOCTL_HGCM_CONNECT, &Hdr) >= 0)
 #else
-    if (ioctl(g_crvboxhgcm.iGuestDrv, VBOXGUEST_IOCTL_HGCM_CONNECT, &info, sizeof (info)) >= 0)
+    if (ioctl(g_crvboxhgcm.iGuestDrv, VBOXGUEST_IOCTL_HGCM_CONNECT, &info, sizeof (info)) == 0)
 #endif
     {
         if (info.result == VINF_SUCCESS)
diff --git a/src/VBox/HostDrivers/Support/SUPDrv.cpp b/src/VBox/HostDrivers/Support/SUPDrv.cpp
index e66cea3..546e1a4 100644
--- a/src/VBox/HostDrivers/Support/SUPDrv.cpp
+++ b/src/VBox/HostDrivers/Support/SUPDrv.cpp
@@ -37,6 +37,9 @@
 #include <iprt/asm-amd64-x86.h>
 #include <iprt/asm-math.h>
 #include <iprt/cpuset.h>
+#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
+# include <iprt/dbg.h>
+#endif
 #include <iprt/handletable.h>
 #include <iprt/mem.h>
 #include <iprt/mp.h>
@@ -130,6 +133,10 @@ static int                  supdrvIOCtl_ResumeSuspendedKbds(void);
  *
  * While making changes to these exports, make sure to update the IOC
  * minor version (SUPDRV_IOC_VERSION).
+ *
+ * @remarks This array is processed by SUPR0-def-pe.sed and SUPR0-def-lx.sed to
+ *          produce definition files from which import libraries are generated.
+ *          Take care when commenting things and especially with \#ifdef'ing.
  */
 static SUPFUNC g_aFunctions[] =
 {
@@ -289,6 +296,13 @@ static SUPFUNC g_aFunctions[] =
     { "RTPowerNotificationRegister",            (void *)RTPowerNotificationRegister },
     { "RTProcSelf",                             (void *)RTProcSelf },
     { "RTR0AssertPanicSystem",                  (void *)RTR0AssertPanicSystem },
+#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
+    { "RTR0DbgKrnlInfoOpen",                    (void *)RTR0DbgKrnlInfoOpen },          /* only-darwin, only-solaris */
+    { "RTR0DbgKrnlInfoQueryMember",             (void *)RTR0DbgKrnlInfoQueryMember },   /* only-darwin, only-solaris */
+    { "RTR0DbgKrnlInfoQuerySymbol",             (void *)RTR0DbgKrnlInfoQuerySymbol },   /* only-darwin, only-solaris */
+    { "RTR0DbgKrnlInfoRelease",                 (void *)RTR0DbgKrnlInfoRelease },       /* only-darwin, only-solaris */
+    { "RTR0DbgKrnlInfoRetain",                  (void *)RTR0DbgKrnlInfoRetain },        /* only-darwin, only-solaris */
+#endif
     { "RTR0MemAreKrnlAndUsrDifferent",          (void *)RTR0MemAreKrnlAndUsrDifferent },
     { "RTR0MemKernelIsValidAddr",               (void *)RTR0MemKernelIsValidAddr },
     { "RTR0MemKernelCopyFrom",                  (void *)RTR0MemKernelCopyFrom },
diff --git a/src/VBox/HostDrivers/Support/SUPDrvIOC.h b/src/VBox/HostDrivers/Support/SUPDrvIOC.h
index 4f2b38c..47d4fc9 100644
--- a/src/VBox/HostDrivers/Support/SUPDrvIOC.h
+++ b/src/VBox/HostDrivers/Support/SUPDrvIOC.h
@@ -214,7 +214,7 @@ typedef SUPREQHDR *PSUPREQHDR;
  * @todo Pending work on next major version change:
  *          - nothing.
  */
-#define SUPDRV_IOC_VERSION                              0x00230000
+#define SUPDRV_IOC_VERSION                              0x00230001
 
 /** SUP_IOCTL_COOKIE. */
 typedef struct SUPCOOKIE
diff --git a/src/VBox/HostDrivers/Support/SUPLibInternal.h b/src/VBox/HostDrivers/Support/SUPLibInternal.h
index 4a18628..56f4132 100644
--- a/src/VBox/HostDrivers/Support/SUPLibInternal.h
+++ b/src/VBox/HostDrivers/Support/SUPLibInternal.h
@@ -78,9 +78,9 @@
  */
 # define supR3HardenedPathAppPrivateNoArch supR3HardenedStaticPathAppPrivateNoArch
 # define supR3HardenedPathAppPrivateArch   supR3HardenedStaticPathAppPrivateArch
-# define supR3HardenedPathSharedLibs       supR3HardenedStaticPathSharedLibs
+# define supR3HardenedPathAppSharedLibs    supR3HardenedStaticPathAppSharedLibs
 # define supR3HardenedPathAppDocs          supR3HardenedStaticPathAppDocs
-# define supR3HardenedPathExecDir          supR3HardenedStaticPathExecDir
+# define supR3HardenedPathAppBin           supR3HardenedStaticPathAppBin
 # define supR3HardenedPathFilename         supR3HardenedStaticPathFilename
 # define supR3HardenedFatalV               supR3HardenedStaticFatalV
 # define supR3HardenedFatal                supR3HardenedStaticFatal
@@ -175,9 +175,8 @@ typedef enum SUPINSTFILETYPE
 typedef enum SUPINSTDIR
 {
     kSupID_Invalid = 0,
-    kSupID_Bin,
     kSupID_AppBin,
-    kSupID_SharedLib,
+    kSupID_AppSharedLib,
     kSupID_AppPrivArch,
     kSupID_AppPrivArchComp,
     kSupID_AppPrivNoArch,
@@ -381,11 +380,11 @@ DECLHIDDEN(int)    supR3HardenedPathAppPrivateNoArch(char *pszPath, size_t cchPa
 /** @copydoc RTPathAppPrivateArch */
 DECLHIDDEN(int)    supR3HardenedPathAppPrivateArch(char *pszPath, size_t cchPath);
 /** @copydoc RTPathSharedLibs */
-DECLHIDDEN(int)    supR3HardenedPathSharedLibs(char *pszPath, size_t cchPath);
+DECLHIDDEN(int)    supR3HardenedPathAppSharedLibs(char *pszPath, size_t cchPath);
 /** @copydoc RTPathAppDocs */
 DECLHIDDEN(int)    supR3HardenedPathAppDocs(char *pszPath, size_t cchPath);
 /** @copydoc RTPathExecDir */
-DECLHIDDEN(int)    supR3HardenedPathExecDir(char *pszPath, size_t cchPath);
+DECLHIDDEN(int)    supR3HardenedPathAppBin(char *pszPath, size_t cchPath);
 /** @copydoc RTPathFilename */
 DECLHIDDEN(char *) supR3HardenedPathFilename(const char *pszPath);
 
@@ -440,7 +439,7 @@ DECLHIDDEN(void)    supR3HardenedLog(const char *pszFormat, ...);
 DECLHIDDEN(void)    supR3HardenedLogFlush(void);
 
 
-DECLHIDDEN(int)     supR3HardenedVerifyAll(bool fFatal, const char *pszProgName);
+DECLHIDDEN(int)     supR3HardenedVerifyAll(bool fFatal, const char *pszProgName, const char *pszExePath);
 DECLHIDDEN(int)     supR3HardenedVerifyFixedDir(SUPINSTDIR enmDir, bool fFatal);
 DECLHIDDEN(int)     supR3HardenedVerifyFixedFile(const char *pszFilename, bool fFatal);
 DECLHIDDEN(int)     supR3HardenedVerifyDir(const char *pszDirPath, bool fRecursive, bool fCheckFiles, PRTERRINFO pErrInfo);
@@ -451,8 +450,10 @@ DECLHIDDEN(int)     supR3HardenedRecvPreInitData(PCSUPPREINITDATA pPreInitData);
 
 #ifdef RT_OS_WINDOWS
 DECLHIDDEN(void)    supR3HardenedWinInit(uint32_t fFlags, bool fAvastKludge);
+DECLHIDDEN(void)    supR3HardenedWinInitAppBin(uint32_t fFlags);
 DECLHIDDEN(void)    supR3HardenedWinInitVersion(void);
 DECLHIDDEN(void)    supR3HardenedWinInitImports(void);
+DECLHIDDEN(void)    supR3HardenedWinModifyDllSearchPath(uint32_t fFlags, const char *pszAppBinPath);
 # ifdef ___iprt_nt_nt_h___
 DECLHIDDEN(void)    supR3HardenedWinGetVeryEarlyImports(uintptr_t uNtDllAddr,
                                                         PFNNTWAITFORSINGLEOBJECT *ppfnNtWaitForSingleObject,
@@ -469,7 +470,7 @@ DECLHIDDEN(int)     supR3HardenedWinReSpawn(int iWhich);
 # ifdef _WINDEF_
 DECLHIDDEN(void)    supR3HardenedWinCreateParentWatcherThread(HMODULE hVBoxRT);
 # endif
-DECLHIDDEN(void *)  supR3HardenedWinLoadLibrary(const char *pszName, bool fSystem32Only);
+DECLHIDDEN(void *)  supR3HardenedWinLoadLibrary(const char *pszName, bool fSystem32Only, uint32_t fMainFlags);
 extern RTUTF16      g_wszSupLibHardenedExePath[1024];
 # ifdef RTPATH_MAX
 extern char         g_szSupLibHardenedExePath[RTPATH_MAX];
diff --git a/src/VBox/HostDrivers/Support/SUPR0-def-lx.sed b/src/VBox/HostDrivers/Support/SUPR0-def-lx.sed
index 2e12a6e..1332d47 100644
--- a/src/VBox/HostDrivers/Support/SUPR0-def-lx.sed
+++ b/src/VBox/HostDrivers/Support/SUPR0-def-lx.sed
@@ -36,10 +36,19 @@ $b footer
 # Drop all lines not specifying an export.
 /^    { "/!d
 
+# Handle trailing selection comment (/* solaris-only, os2-only */). 
+/\*\/ *$/!b transform
+/only-os2/b transform
+/only-/!b transform
+d
+     
+:transform
 # Transform the export line, the format is like this:
 #    { "g_pSUPGlobalInfoPage",                   (void *)&g_pSUPGlobalInfoPage },            /* SED: DATA */
 
 s/^    { "\([^"]*\)",[^}]*}[,].*$/    _\1/
+
+s, */\*.*\*/ *$,,
 b end
 
 :header
diff --git a/src/VBox/HostDrivers/Support/SUPR0-def-pe.sed b/src/VBox/HostDrivers/Support/SUPR0-def-pe.sed
index 76d0e2b..786c80a 100644
--- a/src/VBox/HostDrivers/Support/SUPR0-def-pe.sed
+++ b/src/VBox/HostDrivers/Support/SUPR0-def-pe.sed
@@ -36,12 +36,20 @@ $b footer
 # Drop all lines not specifying an export.
 /^    { "/!d
 
+# Handle trailing selection comment (/* solaris-only, windows-only */). 
+/\*\/ *$/!b transform
+/only-windows/b transform
+/only-/!b transform
+d
+     
+:transform
 # Transform the export line, the format is like this:
 #    { "g_pSUPGlobalInfoPage",                   (void *)&g_pSUPGlobalInfoPage },            /* SED: DATA */
 
 s/^    { "\([^"]*\)",[^}]*}[,]/    \1/
 
 s,/\* SED: \([A-Z]*\) \*/, \1,
+s, */\*.*\*/ *$,,
 b end
 
 :header
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp
index f733a41..efa33fd 100644
--- a/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp
+++ b/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp
@@ -70,7 +70,7 @@ DECLHIDDEN(int) supR3HardenedPathAppPrivateArch(char *pszPath, size_t cchPath)
 /**
  * @copydoc RTPathSharedLibs
  */
-DECLHIDDEN(int) supR3HardenedPathSharedLibs(char *pszPath, size_t cchPath)
+DECLHIDDEN(int) supR3HardenedPathAppSharedLibs(char *pszPath, size_t cchPath)
 {
     return RTPathSharedLibs(pszPath, cchPath);
 }
@@ -88,7 +88,7 @@ DECLHIDDEN(int) supR3HardenedPathAppDocs(char *pszPath, size_t cchPath)
 /**
  * @copydoc RTPathExecDir
  */
-DECLHIDDEN(int) supR3HardenedPathExecDir(char *pszPath, size_t cchPath)
+DECLHIDDEN(int) supR3HardenedPathAppBin(char *pszPath, size_t cchPath)
 {
     return RTPathExecDir(pszPath, cchPath);
 }
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
index 422c82b..a52945c 100644
--- a/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
+++ b/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
@@ -133,8 +133,8 @@ static SUPPREINITDATA   g_SupPreInitData;
 static
 #endif
 char                    g_szSupLibHardenedExePath[RTPATH_MAX];
-/** The program directory path. */
-static char             g_szSupLibHardenedDirPath[RTPATH_MAX];
+/** The application bin directory path. */
+static char             g_szSupLibHardenedAppBinPath[RTPATH_MAX];
 
 /** The program name. */
 static const char      *g_pszSupLibHardenedProgName;
@@ -780,7 +780,7 @@ DECLHIDDEN(int) supR3HardenedPathAppPrivateNoArch(char *pszPath, size_t cchPath)
     return VINF_SUCCESS;
 
 #else
-    return supR3HardenedPathExecDir(pszPath, cchPath);
+    return supR3HardenedPathAppBin(pszPath, cchPath);
 #endif
 }
 
@@ -799,7 +799,7 @@ DECLHIDDEN(int) supR3HardenedPathAppPrivateArch(char *pszPath, size_t cchPath)
     return VINF_SUCCESS;
 
 #else
-    return supR3HardenedPathExecDir(pszPath, cchPath);
+    return supR3HardenedPathAppBin(pszPath, cchPath);
 #endif
 }
 
@@ -807,18 +807,18 @@ DECLHIDDEN(int) supR3HardenedPathAppPrivateArch(char *pszPath, size_t cchPath)
 /**
  * @copydoc RTPathSharedLibs
  */
-DECLHIDDEN(int) supR3HardenedPathSharedLibs(char *pszPath, size_t cchPath)
+DECLHIDDEN(int) supR3HardenedPathAppSharedLibs(char *pszPath, size_t cchPath)
 {
 #if !defined(RT_OS_WINDOWS) && defined(RTPATH_SHARED_LIBS)
     const char *pszSrcPath = RTPATH_SHARED_LIBS;
     size_t cchPathSharedLibs = suplibHardenedStrLen(pszSrcPath);
     if (cchPathSharedLibs >= cchPath)
-        supR3HardenedFatal("supR3HardenedPathSharedLibs: Buffer overflow, %zu >= %zu\n", cchPathSharedLibs, cchPath);
+        supR3HardenedFatal("supR3HardenedPathAppSharedLibs: Buffer overflow, %zu >= %zu\n", cchPathSharedLibs, cchPath);
     suplibHardenedMemCopy(pszPath, pszSrcPath, cchPathSharedLibs + 1);
     return VINF_SUCCESS;
 
 #else
-    return supR3HardenedPathExecDir(pszPath, cchPath);
+    return supR3HardenedPathAppBin(pszPath, cchPath);
 #endif
 }
 
@@ -837,7 +837,7 @@ DECLHIDDEN(int) supR3HardenedPathAppDocs(char *pszPath, size_t cchPath)
     return VINF_SUCCESS;
 
 #else
-    return supR3HardenedPathExecDir(pszPath, cchPath);
+    return supR3HardenedPathAppBin(pszPath, cchPath);
 #endif
 }
 
@@ -910,10 +910,23 @@ static void supR3HardenedGetFullExePath(void)
 #endif
 
     /*
-     * Strip off the filename part (RTPathStripFilename()).
+     * Determine the application binary directory location.
      */
-    suplibHardenedStrCopy(g_szSupLibHardenedDirPath, g_szSupLibHardenedExePath);
-    suplibHardenedPathStripFilename(g_szSupLibHardenedDirPath);
+    suplibHardenedStrCopy(g_szSupLibHardenedAppBinPath, g_szSupLibHardenedExePath);
+    suplibHardenedPathStripFilename(g_szSupLibHardenedAppBinPath);
+
+    if (g_enmSupR3HardenedMainState < SUPR3HARDENEDMAINSTATE_HARDENED_MAIN_CALLED)
+        supR3HardenedFatal("supR3HardenedExecDir: Called before SUPR3HardenedMain! (%d)\n", g_enmSupR3HardenedMainState);
+    switch (g_fSupHardenedMain & SUPSECMAIN_FLAGS_LOC_MASK)
+    {
+        case SUPSECMAIN_FLAGS_LOC_APP_BIN:
+            break;
+        case SUPSECMAIN_FLAGS_LOC_TESTCASE:
+            suplibHardenedPathStripFilename(g_szSupLibHardenedAppBinPath);
+            break;
+        default:
+            supR3HardenedFatal("supR3HardenedExecDir: Unknown program binary location: %#x\n", g_fSupHardenedMain);
+    }
 }
 
 
@@ -938,26 +951,27 @@ static bool supR3HardenedMainIsProcSelfExeAccssible(void)
 
 /**
  * @copydoc RTPathExecDir
+ * @remarks not quite like RTPathExecDir actually...
  */
-DECLHIDDEN(int) supR3HardenedPathExecDir(char *pszPath, size_t cchPath)
+DECLHIDDEN(int) supR3HardenedPathAppBin(char *pszPath, size_t cchPath)
 {
     /*
      * Lazy init (probably not required).
      */
-    if (!g_szSupLibHardenedDirPath[0])
+    if (!g_szSupLibHardenedAppBinPath[0])
         supR3HardenedGetFullExePath();
 
     /*
      * Calc the length and check if there is space before copying.
      */
-    size_t cch = suplibHardenedStrLen(g_szSupLibHardenedDirPath) + 1;
+    size_t cch = suplibHardenedStrLen(g_szSupLibHardenedAppBinPath) + 1;
     if (cch <= cchPath)
     {
-        suplibHardenedMemCopy(pszPath, g_szSupLibHardenedDirPath, cch + 1);
+        suplibHardenedMemCopy(pszPath, g_szSupLibHardenedAppBinPath, cch + 1);
         return VINF_SUCCESS;
     }
 
-    supR3HardenedFatal("supR3HardenedPathExecDir: Buffer too small (%u < %u)\n", cchPath, cch);
+    supR3HardenedFatal("supR3HardenedPathAppBin: Buffer too small (%u < %u)\n", cchPath, cch);
     return VERR_BUFFER_OVERFLOW;
 }
 
@@ -1627,14 +1641,14 @@ static void supR3HardenedMainInitRuntime(uint32_t fFlags)
      * Construct the name.
      */
     char szPath[RTPATH_MAX];
-    supR3HardenedPathSharedLibs(szPath, sizeof(szPath) - sizeof("/VBoxRT" SUPLIB_DLL_SUFF));
+    supR3HardenedPathAppSharedLibs(szPath, sizeof(szPath) - sizeof("/VBoxRT" SUPLIB_DLL_SUFF));
     suplibHardenedStrCat(szPath, "/VBoxRT" SUPLIB_DLL_SUFF);
 
     /*
      * Open it and resolve the symbols.
      */
 #if defined(RT_OS_WINDOWS)
-    HMODULE hMod = (HMODULE)supR3HardenedWinLoadLibrary(szPath, false /*fSystem32Only*/);
+    HMODULE hMod = (HMODULE)supR3HardenedWinLoadLibrary(szPath, false /*fSystem32Only*/, g_fSupHardenedMain);
     if (!hMod)
         supR3HardenedFatalMsg("supR3HardenedMainInitRuntime", kSupInitOp_IPRT, VERR_MODULE_NOT_FOUND,
                               "LoadLibrary \"%s\" failed (rc=%d)",
@@ -1737,7 +1751,7 @@ static PFNSUPTRUSTEDERROR supR3HardenedMainGetTrustedError(const char *pszProgNa
      */
 #if defined(RT_OS_WINDOWS)
     supR3HardenedWinEnableThreadCreation();
-    HMODULE hMod = (HMODULE)supR3HardenedWinLoadLibrary(szPath, false /*fSystem32Only*/);
+    HMODULE hMod = (HMODULE)supR3HardenedWinLoadLibrary(szPath, false /*fSystem32Only*/, 0 /*fMainFlags*/);
     if (!hMod)
         return NULL;
     FARPROC pfn = GetProcAddress(hMod, SUP_HARDENED_SYM("TrustedError"));
@@ -1773,14 +1787,27 @@ static PFNSUPTRUSTEDMAIN supR3HardenedMainGetTrustedMain(const char *pszProgName
      */
     char szPath[RTPATH_MAX];
     supR3HardenedPathAppPrivateArch(szPath, sizeof(szPath) - 10);
+    const char *pszSubDirSlash;
+    switch (g_fSupHardenedMain & SUPSECMAIN_FLAGS_LOC_MASK)
+    {
+        case SUPSECMAIN_FLAGS_LOC_APP_BIN:
+            pszSubDirSlash = "/";
+            break;
+        case SUPSECMAIN_FLAGS_LOC_TESTCASE:
+            pszSubDirSlash = "/testcase/";
+            break;
+        default:
+            pszSubDirSlash = "/";
+            supR3HardenedFatal("supR3HardenedMainGetTrustedMain: Unknown program binary location: %#x\n", g_fSupHardenedMain);
+    }
     size_t cch = suplibHardenedStrLen(szPath);
-    suplibHardenedStrCopyEx(&szPath[cch], sizeof(szPath) - cch, "/", pszProgName, SUPLIB_DLL_SUFF, NULL);
+    suplibHardenedStrCopyEx(&szPath[cch], sizeof(szPath) - cch, pszSubDirSlash, pszProgName, SUPLIB_DLL_SUFF, NULL);
 
     /*
      * Open it and resolve the symbol.
      */
 #if defined(RT_OS_WINDOWS)
-    HMODULE hMod = (HMODULE)supR3HardenedWinLoadLibrary(szPath, false /*fSystem32Only*/);
+    HMODULE hMod = (HMODULE)supR3HardenedWinLoadLibrary(szPath, false /*fSystem32Only*/, 0 /*fMainFlags*/);
     if (!hMod)
         supR3HardenedFatal("supR3HardenedMainGetTrustedMain: LoadLibrary \"%s\" failed, rc=%d\n",
                             szPath, RtlGetLastWin32Error());
@@ -1843,15 +1870,17 @@ DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int
 #endif
         g_SupPreInitData.Data.hDevice = SUP_HDEVICE_NIL;
 
-#ifdef SUP_HARDENED_SUID
-# ifdef RT_OS_LINUX
     /*
-     * On linux we have to make sure the path is initialized because we
-     * *might* not be able to access /proc/self/exe after the seteuid call.
+     * Determine the full exe path as we'll be needing it for the verify all
+     * call(s) below.  (We have to do this early on Linux because we * *might*
+     * not be able to access /proc/self/exe after the seteuid call.)
      */
     supR3HardenedGetFullExePath();
-# endif
+#ifdef RT_OS_WINDOWS
+    supR3HardenedWinInitAppBin(fFlags);
+#endif
 
+#ifdef SUP_HARDENED_SUID
     /*
      * Grab any options from the environment.
      */
@@ -1880,7 +1909,7 @@ DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int
     {
         SUP_DPRINTF(("SUPR3HardenedMain: Respawn #1\n"));
         supR3HardenedWinInit(SUPSECMAIN_FLAGS_DONT_OPEN_DEV, false /*fAvastKludge*/);
-        supR3HardenedVerifyAll(true /* fFatal */, pszProgName);
+        supR3HardenedVerifyAll(true /* fFatal */, pszProgName, g_szSupLibHardenedExePath);
         return supR3HardenedWinReSpawn(1 /*iWhich*/);
     }
 
@@ -1897,7 +1926,7 @@ DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int
     /*
      * Validate the installation.
      */
-    supR3HardenedVerifyAll(true /* fFatal */, pszProgName);
+    supR3HardenedVerifyAll(true /* fFatal */, pszProgName, g_szSupLibHardenedExePath);
 
     /*
      * The next steps are only taken if we actually need to access the support
@@ -1962,6 +1991,9 @@ DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int
     SUP_DPRINTF(("SUPR3HardenedMain: Load Runtime...\n"));
     g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_INIT_RUNTIME;
     supR3HardenedMainInitRuntime(fFlags);
+#ifdef RT_OS_WINDOWS
+    supR3HardenedWinModifyDllSearchPath(fFlags, g_szSupLibHardenedAppBinPath);
+#endif
 
     /*
      * Load the DLL/SO/DYLIB containing the actual program
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
new file mode 100644
index 0000000..3a33727
--- /dev/null
+++ b/src/VBox/HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
@@ -0,0 +1,34 @@
+/* $Id: SUPR3HardenedMainTemplateTestcase.cpp $ */
+/** @file
+ * Hardened main() template for testcases (in testcase subdir).
+ */
+
+/*
+ * Copyright (C) 2008-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#include <VBox/sup.h>
+
+
+int main(int argc, char **argv, char **envp)
+{
+    return SUPR3HardenedMain(PROGRAM_NAME_STR, SUPSECMAIN_FLAGS_LOC_TESTCASE, argc, argv, envp);
+}
+
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
index d76804d..2de46db 100644
--- a/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
+++ b/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
@@ -104,7 +104,7 @@
  * The files that gets verified.
  *
  * @todo This needs reviewing against the linux packages.
- * @todo The excessive use of kSupID_SharedLib needs to be reviewed at some point. For
+ * @todo The excessive use of kSupID_AppSharedLib needs to be reviewed at some point. For
  *       the time being we're building the linux packages with SharedLib pointing to
  *       AppPrivArch (lazy bird).
  */
@@ -122,20 +122,20 @@ static SUPINSTFILE const    g_aSupInstallFiles[] =
     {   kSupIFT_Rc,   kSupID_AppPrivArch,       false, "VBoxDD2RC.rc" },
 #endif
 
-    {   kSupIFT_Dll,  kSupID_SharedLib,         false, "VBoxRT" SUPLIB_DLL_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,         false, "VBoxVMM" SUPLIB_DLL_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,         false, "VBoxREM" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxRT" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxVMM" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxREM" SUPLIB_DLL_SUFF },
 #if HC_ARCH_BITS == 32
-    {   kSupIFT_Dll,  kSupID_SharedLib,          true, "VBoxREM32" SUPLIB_DLL_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,          true, "VBoxREM64" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxREM32" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxREM64" SUPLIB_DLL_SUFF },
 #endif
-    {   kSupIFT_Dll,  kSupID_SharedLib,         false, "VBoxDD" SUPLIB_DLL_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,         false, "VBoxDD2" SUPLIB_DLL_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,         false, "VBoxDDU" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxDD" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxDD2" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxDDU" SUPLIB_DLL_SUFF },
 
 //#ifdef VBOX_WITH_DEBUGGER_GUI
-    {   kSupIFT_Dll,  kSupID_SharedLib,          true, "VBoxDbg" SUPLIB_DLL_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,          true, "VBoxDbg3" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxDbg" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxDbg3" SUPLIB_DLL_SUFF },
 //#endif
 
 //#ifdef VBOX_WITH_SHARED_CLIPBOARD
@@ -164,10 +164,10 @@ static SUPINSTFILE const    g_aSupInstallFiles[] =
 #ifdef VBOX_WITH_MAIN
     {   kSupIFT_Exe,  kSupID_AppBin,            false, "VBoxSVC" SUPLIB_EXE_SUFF },
  #ifdef RT_OS_WINDOWS
-    {   kSupIFT_Dll,  kSupID_SharedLib,         false, "VBoxC" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxC" SUPLIB_DLL_SUFF },
  #else
     {   kSupIFT_Exe,  kSupID_AppPrivArch,       false, "VBoxXPCOMIPCD" SUPLIB_EXE_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,         false, "VBoxXPCOM" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,      false, "VBoxXPCOM" SUPLIB_DLL_SUFF },
     {   kSupIFT_Dll,  kSupID_AppPrivArchComp,   false, "VBoxXPCOMIPCC" SUPLIB_DLL_SUFF },
     {   kSupIFT_Dll,  kSupID_AppPrivArchComp,   false, "VBoxC" SUPLIB_DLL_SUFF },
     {   kSupIFT_Dll,  kSupID_AppPrivArchComp,   false, "VBoxSVCM" SUPLIB_DLL_SUFF },
@@ -175,9 +175,9 @@ static SUPINSTFILE const    g_aSupInstallFiles[] =
  #endif
 #endif
 
-    {   kSupIFT_Dll,  kSupID_SharedLib,          true, "VRDPAuth" SUPLIB_DLL_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,          true, "VBoxAuth" SUPLIB_DLL_SUFF },
-    {   kSupIFT_Dll,  kSupID_SharedLib,          true, "VBoxVRDP" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VRDPAuth" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxAuth" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxVRDP" SUPLIB_DLL_SUFF },
 
 //#ifdef VBOX_WITH_HEADLESS
     {   kSupIFT_Exe,  kSupID_AppBin,             true, "VBoxHeadless" SUPLIB_EXE_SUFF },
@@ -189,7 +189,7 @@ static SUPINSTFILE const    g_aSupInstallFiles[] =
     {   kSupIFT_Exe,  kSupID_AppBin,             true, "VirtualBox" SUPLIB_EXE_SUFF },
     {   kSupIFT_Dll,  kSupID_AppPrivArch,        true, "VirtualBox" SUPLIB_DLL_SUFF },
 # if !defined(RT_OS_DARWIN) && !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
-    {   kSupIFT_Dll,  kSupID_SharedLib,          true, "VBoxKeyboard" SUPLIB_DLL_SUFF },
+    {   kSupIFT_Dll,  kSupID_AppSharedLib,       true, "VBoxKeyboard" SUPLIB_DLL_SUFF },
 # endif
 //#endif
 
@@ -262,12 +262,11 @@ static int supR3HardenedMakePath(SUPINSTDIR enmDir, char *pszDst, size_t cchDst,
     int rc;
     switch (enmDir)
     {
-        case kSupID_AppBin: /** @todo fix this AppBin crap (uncertain wtf some binaries actually are installed). */
-        case kSupID_Bin:
-            rc = supR3HardenedPathExecDir(pszDst, cchDst);
+        case kSupID_AppBin:
+            rc = supR3HardenedPathAppBin(pszDst, cchDst);
             break;
-        case kSupID_SharedLib:
-            rc = supR3HardenedPathSharedLibs(pszDst, cchDst);
+        case kSupID_AppSharedLib:
+            rc = supR3HardenedPathAppSharedLibs(pszDst, cchDst);
             break;
         case kSupID_AppPrivArch:
             rc = supR3HardenedPathAppPrivateArch(pszDst, cchDst);
@@ -287,7 +286,7 @@ static int supR3HardenedMakePath(SUPINSTDIR enmDir, char *pszDst, size_t cchDst,
             rc = supR3HardenedPathAppPrivateNoArch(pszDst, cchDst);
             break;
         case kSupID_Testcase:
-            rc = supR3HardenedPathExecDir(pszDst, cchDst);
+            rc = supR3HardenedPathAppBin(pszDst, cchDst);
             if (RT_SUCCESS(rc))
             {
                 size_t off = suplibHardenedStrLen(pszDst);
@@ -849,11 +848,12 @@ DECLHIDDEN(int) supR3HardenedVerifyFixedFile(const char *pszFilename, bool fFata
  *
  * @returns See supR3HardenedVerifyAll.
  * @param   pszProgName         See supR3HardenedVerifyAll.
+ * @param   pszExePath          The path to the executable.
  * @param   fFatal              See supR3HardenedVerifyAll.
  * @param   fLeaveOpen          The leave open setting used by
  *                              supR3HardenedVerifyAll.
  */
-static int supR3HardenedVerifyProgram(const char *pszProgName, bool fFatal, bool fLeaveOpen)
+static int supR3HardenedVerifyProgram(const char *pszProgName, const char *pszExePath, bool fFatal, bool fLeaveOpen)
 {
     /*
      * Search the table looking for the executable and the DLL/DYLIB/SO.
@@ -890,17 +890,7 @@ static int supR3HardenedVerifyProgram(const char *pszProgName, bool fFatal, bool
                     rc = supR3HardenedVerifyFileInternal(iFile, fFatal, fLeaveOpen, false /* fVerifyAll */);
                 fExe = true;
 
-                char szFilename[RTPATH_MAX];
-                int rc2 = supR3HardenedPathExecDir(szFilename, sizeof(szFilename) - cchProgName - sizeof(SUPLIB_EXE_SUFF));
-                if (RT_SUCCESS(rc2))
-                {
-                    suplibHardenedStrCat(szFilename, "/");
-                    suplibHardenedStrCat(szFilename, g_aSupInstallFiles[iFile].pszFile);
-                    supR3HardenedVerifySameFile(iFile, szFilename, fFatal);
-                }
-                else
-                    rc = supR3HardenedError(rc2, fFatal,
-                                            "supR3HardenedVerifyProgram: failed to query program path: rc=%d\n", rc2);
+                supR3HardenedVerifySameFile(iFile, pszExePath, fFatal);
             }
         }
 
@@ -935,8 +925,9 @@ static int supR3HardenedVerifyProgram(const char *pszProgName, bool fFatal, bool
  * @param   pszProgName         The program name. This is used to verify that
  *                              both the executable and corresponding
  *                              DLL/DYLIB/SO are valid.
+ * @param   pszExePath          The path to the executable.
  */
-DECLHIDDEN(int) supR3HardenedVerifyAll(bool fFatal, const char *pszProgName)
+DECLHIDDEN(int) supR3HardenedVerifyAll(bool fFatal, const char *pszProgName, const char *pszExePath)
 {
     /*
      * On windows
@@ -963,7 +954,7 @@ DECLHIDDEN(int) supR3HardenedVerifyAll(bool fFatal, const char *pszProgName)
      * (thus verified above) and verify the signature on platforms where we
      * sign things.
      */
-    int rc2 = supR3HardenedVerifyProgram(pszProgName, fFatal, fLeaveOpen);
+    int rc2 = supR3HardenedVerifyProgram(pszProgName, pszExePath, fFatal, fLeaveOpen);
     if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
         rc2 = rc;
 
diff --git a/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp b/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
index 199360a..e760d5b 100644
--- a/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
+++ b/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
@@ -970,6 +970,10 @@ int VBOXCALL supdrvOSEnableVTx(bool fEnable)
             /*
              * Call the kernel.
              */
+            AssertLogRelMsg(!g_pVmxUseCount || *g_pVmxUseCount >= 0,
+                            ("vmx_use_count=%d (@ %p, expected it to be a positive number\n",
+                             *g_pVmxUseCount, g_pVmxUseCount));
+
             rc = host_vmxon(false /* exclusive */);
             if (rc == VMX_OK)
                 rc = VINF_SUCCESS;
@@ -986,6 +990,10 @@ int VBOXCALL supdrvOSEnableVTx(bool fEnable)
         }
         else
         {
+            AssertLogRelMsgReturn(!g_pVmxUseCount || *g_pVmxUseCount >= 1,
+                                  ("vmx_use_count=%d (@ %p, expected it to be a non-zero positive number\n",
+                                   *g_pVmxUseCount, g_pVmxUseCount),
+                                  VERR_WRONG_ORDER);
             host_vmxoff();
             rc = VINF_SUCCESS;
             LogRel(("VBoxDrv: host_vmxoff -> vmx_use_count=%d\n", *g_pVmxUseCount));
diff --git a/src/VBox/HostDrivers/Support/testcase/tstSupTscDelta.cpp b/src/VBox/HostDrivers/Support/testcase/tstSupTscDelta.cpp
index 27d1ffe..a843112 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstSupTscDelta.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstSupTscDelta.cpp
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
                     if ((iCpu % 4) == 0)
                         RTPrintf("\ntstSupTscDelta:");
                     if (pGip->aCPUs[iCpu].enmState != SUPGIPCPUSTATE_ONLINE)
-                        RTPrintf("  %02x: offline     ", iCpu, iTscDelta);
+                        RTPrintf("  %02x: offline     ", iCpu);
                     else if (iTscDelta != INT64_MAX)
                         RTPrintf("  %02x: %-12lld", iCpu, iTscDelta);
                     else
diff --git a/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h b/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
index b1fe2b5..b5f180c 100644
--- a/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
+++ b/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
@@ -204,7 +204,7 @@ extern SUPSYSROOTDIRBUF g_CommonFilesX86NtPath;
 # endif
 #endif /* IN_RING3 && !VBOX_PERMIT_EVEN_MORE */
 extern SUPSYSROOTDIRBUF g_SupLibHardenedExeNtPath;
-extern uint32_t         g_offSupLibHardenedExeNtName;
+extern SUPSYSROOTDIRBUF g_SupLibHardenedAppBinNtPath;
 
 #   ifdef IN_RING0
 /** Pointer to NtQueryVirtualMemory. */
diff --git a/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp b/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
index 3cea062..81f4427 100644
--- a/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
@@ -2038,9 +2038,9 @@ DECLHIDDEN(void) supR3HardenedWinResolveVerifyTrustApiAndHookThreadCreation(cons
      * irreversably disabling most (if not all) debug events for them.
      */
     char szPath[RTPATH_MAX];
-    supR3HardenedPathSharedLibs(szPath, sizeof(szPath) - sizeof("/VBoxSupLib.DLL"));
+    supR3HardenedPathAppSharedLibs(szPath, sizeof(szPath) - sizeof("/VBoxSupLib.DLL"));
     suplibHardenedStrCat(szPath, "/VBoxSupLib.DLL");
-    HMODULE hSupLibMod = (HMODULE)supR3HardenedWinLoadLibrary(szPath, true /*fSystem32Only*/);
+    HMODULE hSupLibMod = (HMODULE)supR3HardenedWinLoadLibrary(szPath, true /*fSystem32Only*/, 0 /*fMainFlags*/);
     if (hSupLibMod == NULL)
         supR3HardenedFatal("Error loading '%s': %u", szPath, RtlGetLastWin32Error());
 # endif
diff --git a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
index bcfe396..9618e18 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
@@ -34,8 +34,10 @@
 # define PROCESS_SET_LIMITED_INFORMATION        0x2000
 #endif
 #ifndef LOAD_LIBRARY_SEARCH_APPLICATION_DIR
-# define LOAD_LIBRARY_SEARCH_APPLICATION_DIR    0x200
-# define LOAD_LIBRARY_SEARCH_SYSTEM32           0x800
+# define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR       UINT32_C(0x100)
+# define LOAD_LIBRARY_SEARCH_APPLICATION_DIR    UINT32_C(0x200)
+# define LOAD_LIBRARY_SEARCH_USER_DIRS          UINT32_C(0x400)
+# define LOAD_LIBRARY_SEARCH_SYSTEM32           UINT32_C(0x800)
 #endif
 
 #include <VBox/sup.h>
@@ -273,10 +275,14 @@ static uint32_t volatile    g_cSuplibHardenedWindowsMainCalls;
 RTUTF16                     g_wszSupLibHardenedExePath[1024];
 /** The NT path of the executable. */
 SUPSYSROOTDIRBUF            g_SupLibHardenedExeNtPath;
+/** The NT path of the application binary directory. */
+SUPSYSROOTDIRBUF            g_SupLibHardenedAppBinNtPath;
 /** The offset into g_SupLibHardenedExeNtPath of the executable name (WCHAR,
  * not byte). This also gives the length of the exectuable directory path,
  * including a trailing slash. */
-uint32_t                    g_offSupLibHardenedExeNtName;
+static uint32_t             g_offSupLibHardenedExeNtName;
+/** Set if we need to use the LOAD_LIBRARY_SEARCH_USER_DIRS option. */
+bool                        g_fSupLibHardenedDllSearchUserDirs = false;
 /** @} */
 
 /** @name Hook related variables.
@@ -445,8 +451,16 @@ static uint64_t supR3HardenedWinGetMilliTS(void)
  * @param   fSystem32Only       Whether to only look for imports in the system32
  *                              directory.  If set to false, the application
  *                              directory is also searched.
+ * @param   fMainFlags          The main flags (giving the location), if the DLL
+ *                              being loaded is loaded from the app bin
+ *                              directory and import other DLLs from there. Pass
+ *                              0 (= SUPSECMAIN_FLAGS_LOC_APP_BIN) if not
+ *                              applicable.  Ignored if @a fSystem32Only is set.
+ *
+ *                              This is only needed to load VBoxRT.dll when
+ *                              executing a testcase from the testcase/ subdir.
  */
-DECLHIDDEN(void *) supR3HardenedWinLoadLibrary(const char *pszName, bool fSystem32Only)
+DECLHIDDEN(void *) supR3HardenedWinLoadLibrary(const char *pszName, bool fSystem32Only, uint32_t fMainFlags)
 {
     WCHAR wszPath[RTPATH_MAX];
     PRTUTF16 pwszPath = wszPath;
@@ -463,9 +477,15 @@ DECLHIDDEN(void *) supR3HardenedWinLoadLibrary(const char *pszName, bool fSystem
         DWORD fFlags = 0;
         if (g_uNtVerCombined >= SUP_MAKE_NT_VER_SIMPLE(6, 0))
         {
-           fFlags |= LOAD_LIBRARY_SEARCH_SYSTEM32;
-           if (!fSystem32Only)
-               fFlags |= LOAD_LIBRARY_SEARCH_APPLICATION_DIR;
+            fFlags |= LOAD_LIBRARY_SEARCH_SYSTEM32;
+            if (!fSystem32Only)
+            {
+                fFlags |= LOAD_LIBRARY_SEARCH_APPLICATION_DIR;
+                if (g_fSupLibHardenedDllSearchUserDirs)
+                    fFlags |= LOAD_LIBRARY_SEARCH_USER_DIRS;
+                if ((fMainFlags & SUPSECMAIN_FLAGS_LOC_MASK) != SUPSECMAIN_FLAGS_LOC_APP_BIN)
+                    fFlags |= LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR;
+            }
         }
 
         void *pvRet = (void *)LoadLibraryExW(wszPath, NULL /*hFile*/, fFlags);
@@ -805,8 +825,8 @@ DECLHIDDEN(void) supR3HardenedWinVerifyCacheScheduleImports(RTLDRMOD hLdrMod, PC
                         SUP_DPRINTF(("supR3HardenedWinVerifyCacheScheduleImports: '%s' cached for system32\n", uBuf.szName));
                         continue;
                     }
-                    if (supR3HardenedWinVerifyCacheLookupImport(g_SupLibHardenedExeNtPath.UniStr.Buffer,
-                                                                g_offSupLibHardenedExeNtName,
+                    if (supR3HardenedWinVerifyCacheLookupImport(g_SupLibHardenedAppBinNtPath.UniStr.Buffer,
+                                                                g_SupLibHardenedAppBinNtPath.UniStr.Length / sizeof(CHAR),
                                                                 uBuf.szName) != NULL)
                     {
                         SUP_DPRINTF(("supR3HardenedWinVerifyCacheScheduleImports: '%s' cached for appdir\n", uBuf.szName));
@@ -888,8 +908,8 @@ static void supR3HardenedWinVerifyCacheProcessImportTodos(void)
             if (   !supR3HardenedWinVerifyCacheLookupImport(g_System32NtPath.UniStr.Buffer,
                                                             g_System32NtPath.UniStr.Length / sizeof(WCHAR),
                                                             pCur->szName)
-                && !supR3HardenedWinVerifyCacheLookupImport(g_SupLibHardenedExeNtPath.UniStr.Buffer,
-                                                            g_offSupLibHardenedExeNtName,
+                && !supR3HardenedWinVerifyCacheLookupImport(g_SupLibHardenedAppBinNtPath.UniStr.Buffer,
+                                                            g_SupLibHardenedAppBinNtPath.UniStr.Length / sizeof(WCHAR),
                                                             pCur->szName)
                 && (   pCur->cwcAltSearchDir == 0
                     || !supR3HardenedWinVerifyCacheLookupImport(pCur->pwszAltSearchDir, pCur->cwcAltSearchDir, pCur->szName)) )
@@ -982,7 +1002,7 @@ static void supR3HardenedWinVerifyCacheProcessImportTodos(void)
                     } Tmp, aDirs[] =
                     {
                         { g_System32NtPath.UniStr.Buffer,           g_System32NtPath.UniStr.Length / sizeof(WCHAR) },
-                        { g_SupLibHardenedExeNtPath.UniStr.Buffer,  g_offSupLibHardenedExeNtName - 1 },
+                        { g_SupLibHardenedExeNtPath.UniStr.Buffer,  g_SupLibHardenedAppBinNtPath.UniStr.Length / sizeof(WCHAR) },
                         { pCur->pwszAltSearchDir,                   pCur->cwcAltSearchDir },
                     };
 
@@ -1351,15 +1371,12 @@ static NTSTATUS supR3HardenedScreenImage(HANDLE hFile, bool fImage, bool fIgnore
      *      6. Common Files  - normal code or cat signing, owner TrustedInstaller.
      *      7. x86 variations of 4 & 5 - ditto.
      */
-    Assert(g_SupLibHardenedExeNtPath.UniStr.Buffer[g_offSupLibHardenedExeNtName - 1] == '\\');
     uint32_t fFlags = 0;
     if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_System32NtPath.UniStr, true /*fCheckSlash*/))
         fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER;
     else if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_WinSxSNtPath.UniStr, true /*fCheckSlash*/))
         fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER;
-    else if (supHardViUtf16PathStartsWithEx(uBuf.UniStr.Buffer, uBuf.UniStr.Length / sizeof(WCHAR),
-                                            g_SupLibHardenedExeNtPath.UniStr.Buffer,
-                                            g_offSupLibHardenedExeNtName, false /*fCheckSlash*/))
+    else if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_SupLibHardenedAppBinNtPath.UniStr, true /*fCheckSlash*/))
         fFlags |= SUPHNTVI_F_REQUIRE_KERNEL_CODE_SIGNING | SUPHNTVI_F_REQUIRE_SIGNATURE_ENFORCEMENT;
 # ifdef VBOX_PERMIT_MORE
     else if (supHardViIsAppPatchDir(uBuf.UniStr.Buffer, uBuf.UniStr.Length / sizeof(WCHAR)))
@@ -1403,11 +1420,8 @@ static NTSTATUS supR3HardenedScreenImage(HANDLE hFile, bool fImage, bool fIgnore
      * for the VBox bits where we require kernel code signing and special
      * integrity checks.
      */
-    Assert(g_SupLibHardenedExeNtPath.UniStr.Buffer[g_offSupLibHardenedExeNtName - 1] == '\\');
     uint32_t fFlags = 0;
-    if (supHardViUtf16PathStartsWithEx(uBuf.UniStr.Buffer, uBuf.UniStr.Length / sizeof(WCHAR),
-                                       g_SupLibHardenedExeNtPath.UniStr.Buffer,
-                                       g_offSupLibHardenedExeNtName, false /*fCheckSlash*/))
+    if (supHardViUniStrPathStartsWithUniStr(&uBuf.UniStr, &g_SupLibHardenedAppBinNtPath.UniStr, true /*fCheckSlash*/))
         fFlags |= SUPHNTVI_F_REQUIRE_KERNEL_CODE_SIGNING | SUPHNTVI_F_REQUIRE_SIGNATURE_ENFORCEMENT;
     else
         fFlags |= SUPHNTVI_F_ALLOW_CAT_FILE_VERIFICATION | SUPHNTVI_F_TRUSTED_INSTALLER_OWNER;
@@ -4652,6 +4666,136 @@ DECLHIDDEN(void) supR3HardenedWinInit(uint32_t fFlags, bool fAvastKludge)
 
 
 /**
+ * Modifies the DLL search path for testcases.
+ *
+ * This makes sure the application binary path is in the search path.  When
+ * starting a testcase executable in the testcase/ subdirectory this isn't the
+ * case by default.  So, unless we do something about it we won't be able to
+ * import VBox DLLs.
+ *
+ * @param   fFlags          The main flags (giving the location).
+ * @param   pszAppBinPath   The path to the application binary directory
+ *                          (windows style).
+ */
+DECLHIDDEN(void) supR3HardenedWinModifyDllSearchPath(uint32_t fFlags, const char *pszAppBinPath)
+{
+    /*
+     * For the testcases to work, we must add the app bin directory to the
+     * DLL search list before the testcase dll is loaded or it won't be
+     * able to find the VBox DLLs.  This is done _after_ VBoxRT.dll is
+     * initialized and sets its defaults.
+     */
+    switch (fFlags & SUPSECMAIN_FLAGS_LOC_MASK)
+    {
+        case SUPSECMAIN_FLAGS_LOC_TESTCASE:
+            break;
+        default:
+            return;
+    }
+
+    /*
+     * Dynamically resolve the two APIs we need (the latter uses forwarders on w7).
+     */
+    HMODULE hModKernel32 = GetModuleHandleW(L"kernel32.dll");
+
+    typedef BOOL (WINAPI *PFNSETDLLDIRECTORY)(LPCWSTR);
+    PFNSETDLLDIRECTORY pfnSetDllDir;
+    pfnSetDllDir     = (PFNSETDLLDIRECTORY)GetProcAddress(hModKernel32, "SetDllDirectoryW");
+
+    typedef BOOL (WINAPI *PFNSETDEFAULTDLLDIRECTORIES)(DWORD);
+    PFNSETDEFAULTDLLDIRECTORIES pfnSetDefDllDirs;
+    pfnSetDefDllDirs = (PFNSETDEFAULTDLLDIRECTORIES)GetProcAddress(hModKernel32, "SetDefaultDllDirectories");
+
+    if (pfnSetDllDir != NULL)
+    {
+        /*
+         * Convert the path to UTF-16 and try set it.
+         */
+        PRTUTF16 pwszAppBinPath = NULL;
+        int rc = RTStrToUtf16(pszAppBinPath, &pwszAppBinPath);
+        if (RT_SUCCESS(rc))
+        {
+            if (pfnSetDllDir(pwszAppBinPath))
+            {
+                SUP_DPRINTF(("supR3HardenedWinModifyDllSearchPath: Set dll dir to '%ls'\n", pwszAppBinPath));
+                g_fSupLibHardenedDllSearchUserDirs = true;
+
+                /*
+                 * We set it alright, on W7 and later we also must modify the
+                 * default DLL search order.  See @bugref{6861} for details on
+                 * why we don't do this on Vista (also see init-win.cpp in IPRT).
+                 */
+                if (   pfnSetDefDllDirs
+                    && g_uNtVerCombined >= SUP_NT_VER_W70)
+                {
+                    if (pfnSetDefDllDirs(  LOAD_LIBRARY_SEARCH_APPLICATION_DIR
+                                         | LOAD_LIBRARY_SEARCH_SYSTEM32
+                                         | LOAD_LIBRARY_SEARCH_USER_DIRS))
+                        SUP_DPRINTF(("supR3HardenedWinModifyDllSearchPath: Successfully modified search dirs.\n"));
+                    else
+                        supR3HardenedFatal("supR3HardenedWinModifyDllSearchPath: SetDllDirectoryW(%ls) failed: %d\n",
+                                           pwszAppBinPath, RtlGetLastWin32Error());
+                }
+            }
+            else
+                supR3HardenedFatal("supR3HardenedWinModifyDllSearchPath: SetDllDirectoryW(%ls) failed: %d\n",
+                                   pwszAppBinPath, RtlGetLastWin32Error());
+            RTUtf16Free(pwszAppBinPath);
+        }
+        else
+            supR3HardenedFatal("supR3HardenedWinModifyDllSearchPath: RTStrToUtf16(%s) failed: %d\n", pszAppBinPath, rc);
+    }
+}
+
+
+/**
+ * Initializes the application binary directory path.
+ *
+ * This is called once or twice.
+ *
+ * @param   fFlags          The main flags (giving the location).
+ */
+DECLHIDDEN(void) supR3HardenedWinInitAppBin(uint32_t fFlags)
+{
+    USHORT cwc = (USHORT)g_offSupLibHardenedExeNtName - 1;
+    g_SupLibHardenedAppBinNtPath.UniStr.Buffer = g_SupLibHardenedAppBinNtPath.awcBuffer;
+    memcpy(g_SupLibHardenedAppBinNtPath.UniStr.Buffer, g_SupLibHardenedExeNtPath.UniStr.Buffer, cwc * sizeof(WCHAR));
+
+    switch (fFlags & SUPSECMAIN_FLAGS_LOC_MASK)
+    {
+        case SUPSECMAIN_FLAGS_LOC_APP_BIN:
+            break;
+        case SUPSECMAIN_FLAGS_LOC_TESTCASE:
+        {
+            /* Drop one directory level. */
+            USHORT off = cwc;
+            WCHAR  wc;
+            while (   off > 1
+                   && (wc = g_SupLibHardenedAppBinNtPath.UniStr.Buffer[off - 1]) != '\0')
+                if (wc != '\\' && wc != '/')
+                    off--;
+                else
+                {
+                    if (g_SupLibHardenedAppBinNtPath.UniStr.Buffer[off - 2] == ':')
+                        cwc = off;
+                    else
+                        cwc = off - 1;
+                    break;
+                }
+            break;
+        }
+        default:
+            supR3HardenedFatal("supR3HardenedWinInitAppBin: Unknown program binary location: %#x\n", fFlags);
+    }
+
+    g_SupLibHardenedAppBinNtPath.UniStr.Buffer[cwc]   = '\0';
+    g_SupLibHardenedAppBinNtPath.UniStr.Length        = cwc * sizeof(WCHAR);
+    g_SupLibHardenedAppBinNtPath.UniStr.MaximumLength = sizeof(g_SupLibHardenedAppBinNtPath.awcBuffer);
+    SUP_DPRINTF(("supR3HardenedWinInitAppBin(%#x): '%ls'\n", fFlags, g_SupLibHardenedAppBinNtPath.UniStr.Buffer));
+}
+
+
+/**
  * Converts the Windows command line string (UTF-16) to an array of UTF-8
  * arguments suitable for passing to main().
  *
@@ -5371,6 +5515,12 @@ extern "C" void __stdcall suplibHardenedWindowsMain(void)
         g_offSupLibHardenedExeNtName--;
 
     /*
+     * Preliminary app binary path init.  May change when SUPR3HardenedMain is
+     * called (via main below).
+     */
+    supR3HardenedWinInitAppBin(SUPSECMAIN_FLAGS_LOC_APP_BIN);
+
+    /*
      * If we've done early init already, register the DLL load notification
      * callback and reinstall the NtDll patches.
      */
@@ -5565,6 +5715,11 @@ DECLASM(uintptr_t) supR3HardenedEarlyProcessInit(void)
         g_offSupLibHardenedExeNtName--;
 
     /*
+     * Preliminary app binary path init.  May change when SUPR3HardenedMain is called.
+     */
+    supR3HardenedWinInitAppBin(SUPSECMAIN_FLAGS_LOC_APP_BIN);
+
+    /*
      * Initialize the image verification stuff (hooks LdrLoadDll and NtCreateSection).
      */
     supR3HardenedWinInit(0, false /*fAvastKludge*/);
diff --git a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm
index efe1305..efa7f9c 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm
+++ b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm
@@ -195,9 +195,10 @@ NAME(SUPHNTIMP_CONCAT(%1,_Early)):
 %endmacro
 
 %define SUPHARNT_COMMENT(a_Comment)
-%define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86)       SupHardNtImport a_Name, a_cbParamsX86, SUPHNTIMP_SYSCALL, 1
-%define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)       SupHardNtImport a_Name, a_cbParamsX86, 0, 0
-%define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86) SupHardNtImport a_Name, a_cbParamsX86, 0, 1
+%define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86)          SupHardNtImport a_Name, a_cbParamsX86, SUPHNTIMP_SYSCALL, 1
+%define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)          SupHardNtImport a_Name, a_cbParamsX86, 0, 0
+%define SUPHARNT_IMPORT_STDCALL_OPTIONAL(a_Name, a_cbParamsX86) SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)
+%define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86)    SupHardNtImport a_Name, a_cbParamsX86, 0, 1
 %define SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(a_Name, a_cbParamsX86) SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86)
 %include "import-template-ntdll.h"
 %include "import-template-kernel32.h"
diff --git a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp
index 49dda78..662cc76 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp
@@ -170,6 +170,7 @@ typedef SUPHNTIMPDLL *PSUPHNTIMPDLL;
 #define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86) \
     extern PFNRT    RT_CONCAT(g_pfn, a_Name); \
     extern FNRT     RT_CONCAT(a_Name, _Early);
+#define SUPHARNT_IMPORT_STDCALL_OPTIONAL(a_Name, a_cbParamsX86) SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)
 
 RT_C_DECLS_BEGIN
 #include "import-template-ntdll.h"
@@ -183,6 +184,7 @@ RT_C_DECLS_END
 #undef SUPHARNT_IMPORT_STDCALL_EARLY
 #undef SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL
 #undef SUPHARNT_IMPORT_STDCALL
+#undef SUPHARNT_IMPORT_STDCALL_OPTIONAL
 #define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86) \
     { #a_Name, &RT_CONCAT(g_pfn, a_Name), NULL, false },
 #define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86) \
@@ -191,6 +193,8 @@ RT_C_DECLS_END
     { #a_Name, &RT_CONCAT(g_pfn, a_Name), NULL, true },
 #define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86) \
     { #a_Name, &RT_CONCAT(g_pfn, a_Name), RT_CONCAT(a_Name,_Early), false },
+#define SUPHARNT_IMPORT_STDCALL_OPTIONAL(a_Name, a_cbParamsX86) \
+    { #a_Name, &RT_CONCAT(g_pfn, a_Name), RT_CONCAT(a_Name,_Early), true },
 static const SUPHNTIMPFUNC g_aSupNtImpNtDllFunctions[] =
 {
 #include "import-template-ntdll.h"
@@ -207,9 +211,10 @@ static const SUPHNTIMPFUNC g_aSupNtImpKernel32Functions[] =
  * Syscalls in ntdll.
  */
 #undef SUPHARNT_IMPORT_SYSCALL
-#undef SUPHARNT_IMPORT_STDCALL
 #undef SUPHARNT_IMPORT_STDCALL_EARLY
 #undef SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL
+#undef SUPHARNT_IMPORT_STDCALL
+#undef SUPHARNT_IMPORT_STDCALL_OPTIONAL
 #ifdef RT_ARCH_AMD64
 # define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86) \
     { NULL, NULL },
@@ -221,6 +226,7 @@ static const SUPHNTIMPFUNC g_aSupNtImpKernel32Functions[] =
 # define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86) \
     { &RT_CONCAT(g_uApiNo, a_Name), &RT_CONCAT(a_Name,_SyscallType1), &RT_CONCAT(a_Name, _SyscallType2), a_cbParamsX86 },
 #endif
+#define SUPHARNT_IMPORT_STDCALL_OPTIONAL(a_Name, a_cbParamsX86)       SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)
 #define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86)          SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)
 #define SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(a_Name, a_cbParamsX86) SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)
 static const SUPHNTIMPSYSCALL g_aSupNtImpNtDllSyscalls[] =
diff --git a/src/VBox/HostDrivers/Support/win/winstub.com b/src/VBox/HostDrivers/Support/win/winstub.com
deleted file mode 100644
index 671e58c..0000000
Binary files a/src/VBox/HostDrivers/Support/win/winstub.com and /dev/null differ
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp b/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
index 0240fc9..e8c9f4e 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
+++ b/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
@@ -1103,7 +1103,7 @@ static int vboxNetFltDarwinAttachToInterface(PVBOXNETFLTINS pThis, bool fRedisco
 
     int rc = RTErrConvertFromErrno(err);
     if (RT_SUCCESS(rc))
-        LogRel(("VBoxFltDrv: attached to '%s' / %.*Rhxs\n", pThis->szName, sizeof(pThis->u.s.MacAddr), &pThis->u.s.MacAddr));
+        LogRel(("VBoxFltDrv: attached to '%s' / %RTmac\n", pThis->szName, &pThis->u.s.MacAddr));
     else
         LogRel(("VBoxFltDrv: failed to attach to ifnet '%s' (err=%d)\n", pThis->szName, err));
     return rc;
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
index 8d3c237..88cb604 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+++ b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
@@ -1701,7 +1701,7 @@ static int vboxNetFltLinuxAttachToInterface(PVBOXNETFLTINS pThis, struct net_dev
              ));
     }
 
-    LogRel(("VBoxNetFlt: attached to '%s' / %.*Rhxs\n", pThis->szName, sizeof(pThis->u.s.MacAddr), &pThis->u.s.MacAddr));
+    LogRel(("VBoxNetFlt: attached to '%s' / %RTmac\n", pThis->szName, &pThis->u.s.MacAddr));
     return VINF_SUCCESS;
 }
 
diff --git a/src/VBox/Installer/linux/Makefile.kmk b/src/VBox/Installer/linux/Makefile.kmk
index c4f4e82..2c8526f 100644
--- a/src/VBox/Installer/linux/Makefile.kmk
+++ b/src/VBox/Installer/linux/Makefile.kmk
@@ -69,7 +69,10 @@ linux-bin_SOURCES = \
 	scripts/install.sh=>scripts/install.sh \
 	scripts/VBoxHeadlessXOrg.sh=>scripts/VBoxHeadlessXOrg.sh \
 	VBoxSysInfo.sh \
+	vboxautostart-service.sh \
+	vboxballoonctrl-service.sh \
 	VBoxCreateUSBNode.sh \
+	vboxweb-service.sh \
 	VBox.sh=>VBox.sh \
 	$(if $(VBOX_WITH_PYTHON),$(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py=>vboxshell.py,)
 
@@ -202,8 +205,12 @@ VBOX_LNX_NO_STRIP = \
 	  ExtensionPacks/VNC/ExtPack-license.rtf \
 	  ExtensionPacks/VNC/ExtPack-license.txt,) \
 	VBoxSysInfo.sh \
+	vboxautostart-service.sh \
+	vboxballoonctrl-service.sh \
 	VBoxCreateUSBNode.sh \
+	vboxdrv.sh \
 	VBox.sh \
+	vboxweb-service.sh \
 	VBox.png \
 	scripts
 
@@ -372,6 +379,14 @@ $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $
 		--output $@ \
 		$<
 
+$(PATH_STAGE_BIN)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
+	$(QUIET)$(SED_EXT) \
+		-e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
+		-e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
+		--output $@ \
+		$<
+	$(QUIET)$(CHMOD) 0755 $@
+
 $(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_PATH_LNX_INST_SRC)/installer-common.sh $(VBOX_VERSION_STAMP) $(VBOX_SVN_REV_KMK).ts | $$(dir $$@)
 	$(QUIET)$(SED) \
 		-e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
diff --git a/src/VBox/Installer/linux/install.sh b/src/VBox/Installer/linux/install.sh
index fd4ea7c..755d8d4 100755
--- a/src/VBox/Installer/linux/install.sh
+++ b/src/VBox/Installer/linux/install.sh
@@ -383,14 +383,25 @@ if [ "$ACTION" = "install" ]; then
     install_init_script vboxballoonctrl-service.sh vboxballoonctrl-service
     install_init_script vboxautostart-service.sh vboxautostart-service
     install_init_script vboxweb-service.sh vboxweb-service
+
+    # Write the configuration. Do this before we call /etc/init.d/vboxdrv setup!
+    echo "# VirtualBox installation directory" > $CONFIG_DIR/$CONFIG
+    echo "INSTALL_DIR='$INSTALLATION_DIR'" >> $CONFIG_DIR/$CONFIG
+    echo "# VirtualBox version" >> $CONFIG_DIR/$CONFIG
+    echo "INSTALL_VER='$VERSION'" >> $CONFIG_DIR/$CONFIG
+    echo "INSTALL_REV='$SVNREV'" >> $CONFIG_DIR/$CONFIG
+    echo "# Build type and user name for logging purposes" >> $CONFIG_DIR/$CONFIG
+    echo "BUILD_TYPE='$BUILD_BUILDTYPE'" >> $CONFIG_DIR/$CONFIG
+    echo "USERNAME='$BUILD_USERNAME'" >> $CONFIG_DIR/$CONFIG
+
     delrunlevel vboxdrv > /dev/null 2>&1
-    addrunlevel vboxdrv 20 80 # This may produce useful output
+    addrunlevel vboxdrv # This may produce useful output
     delrunlevel vboxballoonctrl-service > /dev/null 2>&1
-    addrunlevel vboxballoonctrl-service 25 75 # This may produce useful output
+    addrunlevel vboxballoonctrl-service # This may produce useful output
     delrunlevel vboxautostart-service > /dev/null 2>&1
-    addrunlevel vboxautostart-service 25 75 # This may produce useful output
+    addrunlevel vboxautostart-service # This may produce useful output
     delrunlevel vboxweb-service > /dev/null 2>&1
-    addrunlevel vboxweb-service 25 75 # This may produce useful output
+    addrunlevel vboxweb-service # This may produce useful output
 
     # Create users group
     groupadd -r -f $GROUPNAME 2> /dev/null
@@ -460,16 +471,6 @@ if [ "$ACTION" = "install" ]; then
 
     install_device_node_setup "$VBOXDRV_GRP" "$VBOXDRV_MODE" "$INSTALLATION_DIR"
 
-    # Write the configuration. Do this before we call /etc/init.d/vboxdrv setup!
-    echo "# VirtualBox installation directory" > $CONFIG_DIR/$CONFIG
-    echo "INSTALL_DIR='$INSTALLATION_DIR'" >> $CONFIG_DIR/$CONFIG
-    echo "# VirtualBox version" >> $CONFIG_DIR/$CONFIG
-    echo "INSTALL_VER='$VERSION'" >> $CONFIG_DIR/$CONFIG
-    echo "INSTALL_REV='$SVNREV'" >> $CONFIG_DIR/$CONFIG
-    echo "# Build type and user name for logging purposes" >> $CONFIG_DIR/$CONFIG
-    echo "BUILD_TYPE='$BUILD_BUILDTYPE'" >> $CONFIG_DIR/$CONFIG
-    echo "USERNAME='$BUILD_USERNAME'" >> $CONFIG_DIR/$CONFIG
-
     # Make kernel module
     MODULE_FAILED="false"
     if [ "$BUILD_MODULE" = "true" ]
diff --git a/src/VBox/Installer/linux/routines.sh b/src/VBox/Installer/linux/routines.sh
index ad82f43..aa004ab 100644
--- a/src/VBox/Installer/linux/routines.sh
+++ b/src/VBox/Installer/linux/routines.sh
@@ -17,21 +17,21 @@ ro_LOG_FILE=""
 ro_X11_AUTOSTART="/etc/xdg/autostart"
 ro_KDE_AUTOSTART="/usr/share/autostart"
 
-# Aborts the script and prints an error message to stderr.
+## Aborts the script and prints an error message to stderr.
 #
 # syntax: abort message
 
-abort() {
+abort()
+{
     echo 1>&2 "$1"
     exit 1
 }
 
-# Creates an empty log file and remembers the name for future logging
+## Creates an empty log file and remembers the name for future logging
 # operations
-#
-# syntax: create_log logfile
-
-create_log() {
+create_log()
+{
+    ## The path of the file to create.
     ro_LOG_FILE="$1"
     if [ "$ro_LOG_FILE" = "" ]; then
         abort "create_log called without an argument!  Aborting..."
@@ -43,19 +43,19 @@ create_log() {
     fi
 }
 
-# Writes text to standard error
+## Writes text to standard error
 #
 # Syntax: info text
-
-info() {
+info()
+{
     echo 1>&2 "$1"
 }
 
-# Writes text to the log file
+## Writes text to the log file
 #
 # Syntax: log text
-
-log() {
+log()
+{
     if [ "$ro_LOG_FILE" = "" ]; then
         abort "Error!  Logging has not been set up yet!  Aborting..."
     fi
@@ -63,20 +63,20 @@ log() {
     return 0
 }
 
-# Writes test to standard output and to the log file
+## Writes test to standard output and to the log file
 #
 # Syntax: infolog text
-
-infolog() {
+infolog()
+{
     info "$1"
     log "$1"
 }
 
-# Checks whether a module is loaded with a given string in its name.
+## Checks whether a module is loaded with a given string in its name.
 #
 # syntax: module_loaded string
-
-module_loaded() {
+module_loaded()
+{
     if [ "$1" = "" ]; then
         log "module_loaded called without an argument.  Aborting..."
         abort "Error in installer.  Aborting..."
@@ -84,17 +84,17 @@ module_loaded() {
     lsmod | grep -q $1
 }
 
-# Abort if we are not running as root
-
-check_root() {
+## Abort if we are not running as root
+check_root()
+{
     if [ `id -u` -ne 0 ]; then
         abort "This program must be run with administrator privileges.  Aborting"
     fi
 }
 
-# Abort if a copy of VirtualBox is already running
-
-check_running() {
+## Abort if a copy of VirtualBox is already running
+check_running()
+{
     VBOXSVC_PID=`pidof VBoxSVC 2> /dev/null`
     if [ -n "$VBOXSVC_PID" ]; then
         if [ -f /etc/init.d/vboxweb-service ]; then
@@ -108,9 +108,9 @@ check_running() {
     fi
 }
 
-# Do we have bzip2?
-
-check_bzip2() {
+## Do we have bzip2?
+check_bzip2()
+{
     if ! ls /bin/bzip2 /usr/bin/bzip2 /usr/local/bin/bzip2 2> /dev/null | grep bzip2 > /dev/null; then
         echo 1>&2 "Please install the bzip2 utility."
         log "Please install bzip2."
@@ -119,9 +119,9 @@ check_bzip2() {
     return 0
 }
 
-# Do we have GNU make?
-
-check_gmake() {
+## Do we have GNU make?
+check_gmake()
+{
 make --version 2>&1 | grep GNU > /dev/null
     if [ ! $? = 0 ]; then
         echo 1>&2 "Please install GNU make."
@@ -131,9 +131,9 @@ make --version 2>&1 | grep GNU > /dev/null
     return 0
 }
 
-# Can we find the kernel source?
-
-check_ksource() {
+## Can we find the kernel source?
+check_ksource()
+{
     ro_KBUILD_DIR=/lib/modules/`uname -r`/build
     if [ ! -d $ro_KBUILD_DIR/include ]; then
         ro_KBUILD_DIR=/usr/src/linux
@@ -150,9 +150,9 @@ check_ksource() {
     return 0
 }
 
-# Is GCC installed?
-
-check_gcc() {
+## Is GCC installed?
+check_gcc()
+{
     ro_gcc_version=`gcc --version 2> /dev/null | head -n 1`
     if [ "$ro_gcc_version" = "" ]; then
         echo 1>&2 "Please install the GNU compiler."
@@ -162,9 +162,9 @@ check_gcc() {
     return 0
 }
 
-# Is bash installed?  You never know...
-
-check_bash() {
+## Is bash installed?  You never know...
+check_bash()
+{
     if [ ! -x /bin/bash ]; then
         echo 1>&2 "Please install GNU bash."
         log "Please install GNU bash."
@@ -173,9 +173,9 @@ check_bash() {
     return 0
 }
 
-# Is perl installed?
-
-check_perl() {
+## Is perl installed?
+check_perl()
+{
     if [ ! `perl -e 'print "test"' 2> /dev/null` = "test" ]; then
         echo 1>&2 "Please install perl."
         echo "Please install perl."
@@ -184,416 +184,238 @@ check_perl() {
     return 0
 }
 
-# What type of system are we running on?
-
-check_system_type() {
-    if [ ! "$ro_SYS_TYPE" = "" ]; then
-        return 0
-    elif [ -f /etc/debian_version ]; then
-        ro_SYS_TYPE=debian
-        ro_INIT_TYPE=sysv
-    elif [ -f /etc/gentoo-release ]; then
-        ro_SYS_TYPE=gentoo
-        ro_INIT_TYPE=sysv
-    elif [ -x /sbin/chkconfig ]; then
-        ro_SYS_TYPE=redhat
-        ro_INIT_TYPE=sysv
-    elif [ -x /sbin/insserv ]; then
-        ro_SYS_TYPE=suse
-        ro_INIT_TYPE=sysv
-    elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then
-        ro_SYS_TYPE=lfs
-        ro_INIT_TYPE=lfs
-    elif [ -f /etc/pardus-release ]; then
-        ro_SYS_TYPE=pardus
-        ro_INIT_TYPE=pardus
-    elif [ -f /etc/rc.d/rc.local ]; then
-        ro_SYS_TYPE=unknown
-        ro_INIT_TYPE=bsd
-        ro_RC_LOCAL=/etc/rc.d/rc.local
-    elif [ -f /etc/rc.local ]; then
-        ro_SYS_TYPE=unknown
-        ro_INIT_TYPE=bsd
-        ro_RC_LOCAL=/etc/rc.local
-    elif [ -d /etc/init.d ]; then
-        ro_SYS_TYPE=unknown
-        ro_INIT_TYPE=sysv
-    else  # Perhaps we can determine what we need to know anyway though?
-        echo 1>&2 "Unable to determine your Linux distribution"
-        log "Unable to determine the Linux distribution"
-        return 1
-    fi
-    return 0
-}
-
-# Hack to handle Mandriva's speedboot runlevel
-copy_install_script() {
-    if [ "$ro_INIT_TYPE" = "sysv" -a -r /etc/sysconfig/speedboot ]; then
-        cp "$1" "$2" 2>/dev/null
-    else
-        sed -e 's/^\(#\s*chkconfig:\s*[0-9]*\)7/\1/' "$1" > "$2"
-    fi
-}
-
-# Installs a file containing a shell script as an init script
-#
-# syntax: install_init_script file name
-#
-# where file is the file to be installed and
-# name is the name of the new init script
-
-install_init_script() {
+## Installs a file containing a shell script as an init script
+install_init_script()
+{
     self="install_init_script"
-    script=$1
-    name=$2
-    pardus_script=$name-pardus.py
-    check_system_type
-    test $? -ne 1 || return 1
-    test -r "$script" || return 1
-    test ! "$name" = "" || \
+    ## The init script to be installed.  The file may be copied or referenced.
+    script="$1"
+    ## Name for the service.
+    name="$2"
+    test -x "$script" && test ! "$name" = "" || \
         { log "$self: invalid arguments" && return 1; }
-    if [ "$ro_INIT_TYPE" = "pardus" ];then
-        test -r "$pardus_script" || \
-            { log "$self: Pardus service script missing" && return 1; }
-    fi
-    if [ "$ro_INIT_TYPE" = "sysv" ]; then
-        copy_install_script "$script" "/etc/init.d/$name"
-        chmod 755 "/etc/init.d/$name" 2> /dev/null
-    elif [ "$ro_INIT_TYPE" = "bsd" ]; then
-        copy_install_script "$script" "/etc/rc.d/rc.$name"
-        chmod 755 "/etc/rc.d/rc.$name" 2> /dev/null
-    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
-        copy_install_script "$script" "/etc/rc.d/init.d/$name"
+    if test -d /etc/rc.d/init.d
+    then
+        cp "$script" "/etc/rc.d/init.d/$name" 2> /dev/null
         chmod 755 "/etc/rc.d/init.d/$name" 2> /dev/null
-    elif [ "$ro_INIT_TYPE" = "pardus" ]; then
-        copy_install_script "$script" "/usr/sbin/$name"
-        chmod 755 "/usr/sbin/$name" 2> /dev/null
-        hav register $name System.Service $pardus_script
+    elif test -d /etc/init.d
+    then
+        cp "$script" "/etc/init.d/$name" 2> /dev/null
+        chmod 755 "/etc/init.d/$name" 2> /dev/null
     else
-        log "install_init_script: error: unknown init type"
+        log "${self}: error: unknown init type"
         return 1
     fi
     return 0
 }
 
-# Remove the init script "name"
-#
-# syntax: remove_init_script name
-
-remove_init_script() {
+## Remove the init script "name"
+remove_init_script()
+{
     self="remove_init_script"
-    name=$1
-    check_system_type
-    test $? -ne 1 || return 1
+    ## Name of the service to remove.
+    name="$1"
     test ! "$name" = "" || \
         { log "$self: missing argument" && return 1; }
-    if [ "$ro_INIT_TYPE" = "sysv" ]; then
-        rm -f "/etc/init.d/$name" > /dev/null 2>&1
-    elif [ "$ro_INIT_TYPE" = "bsd" ]; then
-        rm -f "/etc/rc.d/rc.$name" > /dev/null 2>&1
-    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
+    if test -d /etc/rc.d/init.d
+    then
         rm -f "/etc/rc.d/init.d/$name" > /dev/null 2>&1
-    elif [ "$ro_INIT_TYPE" = "pardus" ]; then
-        hav remove $name
-        rm -f "/usr/sbin/$name" > /dev/null 2>&1
+    elif test -d /etc/init.d
+    then
+        rm -f "/etc/init.d/$name" > /dev/null 2>&1
     else
-        log "remove_init_script: error: unknown init type"
+        log "${self}: error: unknown init type"
         return 1
     fi
     return 0
 }
 
-# Start the init script "name"
-#
-# syntax: start_init_script name
-
-start_init_script() {
-    self="start_init_script"
-    name=$1
-    check_system_type
-    test $? -ne 1 || return 1
-    test ! -z "$name" || \
-        { log "$self: missing argument" && return 1; }
-    if [ "$ro_INIT_TYPE" = "sysv" ]; then
-        "/etc/init.d/$name" start >> $ro_LOG_FILE 2>&1
-    elif [ "$ro_INIT_TYPE" = "bsd" ]; then
-        "/etc/rc.d/rc.$name" start >> $ro_LOG_FILE  2>&1
-    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
-        "/etc/rc.d/init.d/$name" start >> $ro_LOG_FILE 2>&1
-    elif [ "$ro_INIT_TYPE" = "pardus" ]; then
-        service $name on
+## Perform an action on a service
+do_sysvinit_action()
+{
+    self="do_sysvinit_action"
+    ## Name of service to start.
+    name="${1}"
+    ## The action to perform, normally "start", "stop" or "status".
+    action="${2}"
+    ## The optional expression to check for in the script before starting.
+    expression="${3}"
+    test ! -z "${name}" && test ! -z "${action}" || \
+        { log "${self}: missing argument" && return 1; }
+    if test -x "/etc/rc.d/init.d/${name}"
+    then
+        script="/etc/rc.d/init.d/${name}"
+    elif test -x "/etc/init.d/${name}"
+    then
+        script="/etc/init.d/${name}"
     else
-        log "$self: error: unknown init type"
+        log "${self}: error: unknown init type or unknown service ${name}"
         return 1
     fi
+    test -n "${expression}" && ! grep -q "${expression}" "${script}" && return 0
+    case "${action}" in
+    start|stop|reload|restart|try-restart|force-reload|status)
+        if test -x "`which service 2>/dev/null`"
+        then
+            service "${name}" ${action}
+        elif test -x "`which invoke-rc.d 2>/dev/null`"
+        then
+            invoke-rc.d "${name}" ${action}
+        else
+            "${script}" "${action}"
+        fi
+        ;;
+    *)
+        "${script}" "${action}"
+        ;;
+    esac
 }
 
-# Stop the init script "name"
-#
-# syntax: stop_init_script name
-
-stop_init_script() {
-    self=stop_init_script
-    name=$1
-    check_system_type
-    test $? -ne 1 || return 1
-    test ! -z "$name" || \
-        { log "$self: missing argument" && return 1; }
-    if [ "$ro_INIT_TYPE" = "sysv" ]; then
-        "/etc/init.d/$name" stop >> $ro_LOG_FILE 2>&1
-    elif [ "$ro_INIT_TYPE" = "bsd" ]; then
-        "/etc/rc.d/rc.$name" stop >> $ro_LOG_FILE 2>&1
-    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
-        "/etc/rc.d/init.d/$name" stop >> $ro_LOG_FILE 2>&1
-    elif [ "$ro_INIT_TYPE" = "pardus" ]; then
-        service $name off
-    else
-        log "$self: error: unknown init type"
-        return 1
-    fi
-    return 0
+## Start a service
+start_init_script()
+{
+    do_sysvinit_action "${1}" start
 }
 
-# Add a service to a runlevel
-#
-# syntax: addrunlevel name start_order stop_order
-
-addrunlevel() {
-    test ! -z "$1" || \
-        { log "addrunlevel: missing argument(s)" && return 1; }
-    check_system_type
-    # Redhat based systems
-    if [ "$ro_SYS_TYPE" = "redhat" ]
-    then
-        test -x "/sbin/chkconfig" || \
-            { log "addrunlevel: /sbin/chkconfig not found" && return 1; }
-        /sbin/chkconfig --del $1 > /dev/null 2>&1
-
-        if /sbin/chkconfig -v > /dev/null 2>&1; then
-            /sbin/chkconfig --level 35 $1 on || {
-                log "Cannot add $1 to run levels: 35" && return 1
-            }
-        else
-            /sbin/chkconfig $1 35 || {
-                log "Cannot add $1 to run levels: 35" && return 1
-            }
-        fi
-    # SUSE-base systems
-    elif [ "$ro_SYS_TYPE" = "suse" ]
-    then
-        test -x /sbin/insserv || {
-            log "addrunlevel: insserv not found" && return 1;
-        }
-        /sbin/insserv -r $1 > /dev/null 2>&1
-        /sbin/insserv $1 > /dev/null
-    # Debian/Ubuntu-based systems
-    elif [ "$ro_SYS_TYPE" = "debian" ]; then
-        test -x `which update-rc.d` || \
-            { log "addrunlevel: update-rc.d not found" && return 1; }
-        test ! -z "$2" || \
-            { log "addrunlevel: missing second argument" && return 1; }
-        test ! -z "$3" || \
-            { log "addrunlevel: missing third argument" && return 1; }
-        # Debian does not support dependencies currently -- use argument $2
-        # for start sequence number and argument $3 for stop sequence number
-        update-rc.d -f $1 remove > /dev/null 2>&1
-        update-rc.d $1 defaults $2 $3 > /dev/null 2>&1
-    # Gentoo Linux
-    elif [ "$ro_SYS_TYPE" = "gentoo" ]; then
-        test -x `which rc-update` || \
-            { log "addrunlevel: update-rc.d not found" && return 1; }
-        rc-update del $1 > /dev/null 2>&1
-        rc-update add $1 default > /dev/null 2>&1
-    # Linux from scratch, by the book
-    elif [ "$ro_SYS_TYPE" = "lfs" ]; then
-        test -x /etc/rc.d/init.d/$1 || \
-            { log "addrunlevel: name argument must be a script in /etc/rc.d/init.d" && return 1; }
-        P2=$2
-        P3=$3
-        # add leading zero
-        if [ `expr length "$P2"` -eq 1 ]; then
-            P2=`expr 0$P2`
-        fi
-        if [ `expr length "$P3"` -eq 1 ]; then
-            P3=`expr 0$P3`
-        fi
-        expr "$P2" + 0 > /dev/null 2>&1 && expr 0 \<= "$P2" > /dev/null && \
-            [ `expr length "$P2"` -eq 2 ] || \
-            { log "addrunlevel: start sequence number must be between 00 and 99" && return 1; }
-        expr "$P3" + 0 > /dev/null 2>&1 && expr 0 \<= "$P3" > /dev/null && \
-            [ `expr length "$P3"` -eq 2 ] || \
-            { log "addrunlevel: stop sequence number must be between 00 and 99" && return 1; }
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc0.d/K`expr $P3`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc1.d/K`expr $P3`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc2.d/S`expr $P2`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc3.d/S`expr $P2`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc4.d/S`expr $P2`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc5.d/S`expr $P2`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc6.d/K`expr $P3`$1" > /dev/null 2>&1
-    # BSD-based systems require changing the rc.local file to start a new service.
-    elif [ "$ro_INIT_TYPE" = "bsd" ]; then
-        if ! grep -q $1 $ro_RC_LOCAL
-        then
-            echo "# Start $1" >> $ro_RC_LOCAL
-            echo "# If you do not wish this to be executed here then comment it out," >> $ro_RC_LOCAL
-            echo "# and the installer will skip it next time." >> $ro_RC_LOCAL
-            echo "if [ -x /etc/rc.d/rc.$1 ]; then" >> $ro_RC_LOCAL
-            echo "    /etc/rc.d/rc.$1 start" >> $ro_RC_LOCAL
-            echo "fi" >> $ro_RC_LOCAL
-            echo "" >> $ro_RC_LOCAL
-        fi
-    # Probably most unknown Linux systems will be sysv type ones.  These can theoretically
-    # be handled automatically if people give us information about them.
-    elif [ "$ro_INIT_TYPE" = "sysv" ]; then
-        echo 1>&2 "As our installer does not recognize your Linux distribution, we were unable to"
-        echo 1>&2 "set up the initialization script $1 correctly.  The script has been copied"
-        echo 1>&2 "copied to the /etc/init.d directory.  You should set up your system to start"
-        echo 1>&2 "it at system start, or start it manually before using VirtualBox."
-        echo 1>&2 ""
-        echo 1>&2 "If you would like to help us add support for your distribution, please open a"
-        echo 1>&2 "new ticket on http://www.virtualbox.org/wiki/Bugtracker."
-    fi
-    return 0
+## Stop the init script "name"
+stop_init_script()
+{
+    do_sysvinit_action "${1}" stop
 }
 
+## Do initial setup of an installed service
+setup_init_script()
+{
+    do_sysvinit_action "${1}" setup '^# *setup_script *$'
+}
 
-# Delete a service from a runlevel
-#
-# syntax: delrunlevel name
+## Do pre-removal cleanup of an installed service
+cleanup_init_script()
+{
+    do_sysvinit_action "${1}" cleanup '^# *cleanup_script *$'
+}
 
-delrunlevel() {
-    test ! -z "$1" || \
-        { log "delrunlevel: missing argument" && return 1; }
-    check_system_type
-    # Redhat-based systems
-    if [ "$ro_SYS_TYPE" = "redhat" ]
-    then
-        test -x "/sbin/chkconfig" || \
-            { log "delrunlevel: /sbin/chkconfig not found" && return 1; }
-        if /sbin/chkconfig --list $1 > /dev/null 2>&1; then
-            /sbin/chkconfig --del $1 > /dev/null 2>&1 || {
-                log "Cannot delete $1 from runlevels" && return 1
-            }
-        fi
-    # SUSE-based systems
-    elif [ "$ro_SYS_TYPE" = "suse" ]
-    then
-        test -x /sbin/insserv || {
-            log "delrunlevel: insserv not found" && return 1;
-        }
-        /sbin/insserv -r $1 > /dev/null 2>&1
-    # Debian/Ubuntu-based systems
-    elif [ "$ro_SYS_TYPE" = "debian" ]; then
-        test -x `which update-rc.d` || \
-            { log "delrunlevel: update-rc.d not found" && return 1; }
-        update-rc.d -f $1 remove > /dev/null 2>&1
-    # Gentoo Linux
-    elif [ "$ro_SYS_TYPE" = "gentoo" ]; then
-        test -x `which rc-update` || \
-            { log "delrunlevel: update-rc.d not found" && return 1; }
-        rc-update del "$1" > /dev/null 2>&1
-    # Linux from scratch, by the book
-    elif [ "$ro_SYS_TYPE" = "lfs" ]; then
-        rm "/etc/rc0.d/K??$1" > /dev/null 2>&1
-        rm "/etc/rc1.d/K??$1" > /dev/null 2>&1
-        rm "/etc/rc2.d/S??$1" > /dev/null 2>&1
-        rm "/etc/rc3.d/S??$1" > /dev/null 2>&1
-        rm "/etc/rc4.d/S??$1" > /dev/null 2>&1
-        rm "/etc/rc5.d/S??$1" > /dev/null 2>&1
-        rm "/etc/rc6.d/K??$1" > /dev/null 2>&1
-    # Unknown sysv-type system
-    elif [ "$ro_INIT_TYPE" = "sysv" ]; then
-        echo 1>&2 "Please remove remove references to the initialization script"
-        echo 1>&2 "/etc/init.d/$1 to complete the uninstallation."
-    fi
-    # BSD-type systems will just not start the script if it is not there.
-    # Assume that BSD users understand their system.
+## Extract chkconfig information from a sysvinit script.
+get_chkconfig_info()
+{
+    ## The script to extract the information from.
+    script="${1}"
+    set `sed -n 's/# *chkconfig: *\([0-9]*\) *\(.*\)/\1 \2/p' "${script}"`
+    ## Which runlevels should we start in?
+    runlevels="${1}"
+    ## How soon in the boot process will we start, from 00 (first) to 99
+    start_order="${2}"
+    ## How soon in the shutdown process will we stop, from 99 (first) to 00
+    stop_order="${3}"
+    test ! -z "${name}" || \
+        { log "${self}: missing name" && return 1; }
+    expr "${start_order}" + 0 > /dev/null 2>&1 && \
+        expr 0 \<= "${start_order}" > /dev/null 2>&1 && \
+        test `expr length "${start_order}"` -eq 2 > /dev/null 2>&1 || \
+        { log "${self}: start sequence number must be between 00 and 99" && return 1; }
+    expr "${stop_order}" + 0 > /dev/null 2>&1 && \
+        expr 0 \<= "${stop_order}" > /dev/null 2>&1 && \
+        test `expr length "${stop_order}"` -eq 2 > /dev/null 2>&1 || \
+        { log "${self}: stop sequence number must be between 00 and 99" && return 1; }
     return 0
 }
 
-# Do initial setup of an installed service
-#
-# syntax: setup_init_script name
-
-setup_init_script()
+## Add a service to a runlevel
+addrunlevel()
 {
-    self=setup_init_script
-    name=$1
-    spaces=`printf " %b" "\t"`
-    check_system_type
-    test $? -ne 1 || return 1
-    test ! -z "$name" ||
-        { log "$self: missing argument" && return 1; }
-    if [ "$ro_INIT_TYPE" = "sysv" ]; then
-        scriptname="/etc/init.d/$name"
-    elif [ "$ro_INIT_TYPE" = "bsd" ]; then
-        scriptname="/etc/rc.d/rc.$name"
-    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
-        scriptname="/etc/rc.d/init.d/$name"
-    elif [ "$ro_INIT_TYPE" = "pardus" ]; then
-        scriptname="/usr/sbin/$name"
+    self="addrunlevel"
+    ## Service name.
+    name="${1}"
+    if test -x "/etc/rc.d/init.d/${name}"
+    then
+        init_d_path=/etc/rc.d
+    elif test -x "/etc/init.d/${name}"
+    then
+        init_d_path=/etc
     else
-        log "$self: error: unknown init type"
+        log "${self}: error: unknown init type or unknown service ${name}"
         return 1
     fi
-    # Add the init script to the default runlevel
-    # This is complicated by the fact that we need to pass older Debian-based
-    # systems the start and stop order numbers, which we extract from the
-    # Redhat chkconfig information.
-    if test "$ro_INIT_TYPE" = "sysv" -a -r "$scriptname"; then
-        orders=`grep '^#['"$spaces"']*chkconfig:' "$scriptname" |
-            sed -e 's/^#['"$spaces"']*chkconfig:['"$spaces"']*[0-9]*['"$spaces"']*//'`
-        expr "$orders" : '.*[0-9][0-9]*['"$spaces"']['"$spaces"']*[0-9][0-9]*$' > /dev/null ||
-            {
-                log "$self: bad or missing chkconfig line in init script $scriptname"
-                return 1
-            }
-        # $orders is deliberately not quoted here
-        addrunlevel "$name" $orders
+    get_chkconfig_info "${init_d_path}/init.d/${name}" || return 1
+    # Redhat based sysvinit systems
+    if test -x "`which chkconfig 2>/dev/null`"
+    then
+        chkconfig --add "${name}" || {
+            log "Failed to set up init script ${name}" && return 1
+        }
+    # SUSE-based sysvinit systems
+    elif test -x "`which insserv 2>/dev/null`"
+    then
+        insserv "${name}" > /dev/null
+    # Debian/Ubuntu-based systems
+    elif test -x "`which update-rc.d 2>/dev/null`"
+    then
+        # Old Debians did not support dependencies
+        update-rc.d "${name}" defaults "${start_order}" "${stop_order}" \
+            > /dev/null 2>&1
+    # Gentoo Linux
+    elif test -x "`which rc-update 2>/dev/null`"; then
+        rc-update add "${name}" default > /dev/null 2>&1
+    # Generic sysvinit
+    elif test -n "${init_d_path}/rc0.d"
+    then
+        for locali in 0 1 2 3 4 5 6
+        do
+            target="${init_d_path}/rc${locali}.d/K${stop_order}${name}"
+            expr "${runlevels}" : ".*${locali}" >/dev/null && \
+                target="${init_d_path}/rc${locali}.d/S${start_order}${name}"
+            test -e "${init_d_path}/rc${locali}.d/"[KS][0-9]*"${name}" || \
+                ln -fs "${init_d_path}/init.d/${name}" "${target}" 2> /dev/null
+        done
     else
-        addrunlevel "$name"
+        log "${self}: error: unknown init type"
+        return 1
     fi
-    test -r "$scriptname" &&
-        grep -q '^#['"$spaces"']*setup_script['"$spaces"']*$' "$scriptname" &&
-        "$scriptname" setup
     return 0
 }
 
-# Do pre-removal cleanup of an installed service
-#
-# syntax: cleanup_init_script name
 
-cleanup_init()
+## Delete a service from a runlevel
+delrunlevel()
 {
-    self=cleanup_init_script
-    name=$1
-    spaces=`printf " %b" "\t"`
-    check_system_type
-    test $? -ne 1 || return 1
-    test ! -z "$name" || \
-        { log "$self: missing argument" && return 1; }
-    if [ "$ro_INIT_TYPE" = "sysv" ]; then
-        scriptname="/etc/init.d/$name"
-    elif [ "$ro_INIT_TYPE" = "bsd" ]; then
-        scriptname="/etc/rc.d/rc.$name"
-    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
-        scriptname="/etc/rc.d/init.d/$name"
-    elif [ "$ro_INIT_TYPE" = "pardus" ]; then
-        scriptname="/usr/sbin/$name"
+    self="delrunlevel"
+    ## Service name.
+    name="${1}"
+    test ! -z "${name}" || \
+        { log "${self}: missing argument" && return 1; }
+    # Redhat-based systems
+    if test -x "/sbin/chkconfig"
+    then
+        /sbin/chkconfig --del "${name}" > /dev/null 2>&1
+    # SUSE-based sysvinit systems
+    elif test -x /sbin/insserv
+    then
+        /sbin/insserv -r "${name}" > /dev/null 2>&1
+    # Debian/Ubuntu-based systems
+    elif test -x "`which update-rc.d 2>/dev/null`"
+    then
+        update-rc.d -f "${name}" remove > /dev/null 2>&1
+    # Gentoo Linux
+    elif test -x "`which rc-update 2>/dev/null`"
+    then
+        rc-update del "${name}" > /dev/null 2>&1
+    # Generic sysvinit
+    elif test -d /etc/rc.d/init.d
+    then
+        rm /etc/rc.d/rc?.d/[SK]??"${name}" > /dev/null 2>&1
+    elif test -d /etc/init.d
+    then
+        rm /etc/rc?.d/[SK]??"${name}" > /dev/null 2>&1
     else
-        log "$self: error: unknown init type"
+        log "${self}: error: unknown init type"
         return 1
     fi
-    test -r "$scriptname" &&
-        grep -q '^#['"$spaces"']*cleanup_script['"$spaces"']*$' "$scriptname" &&
-        "$scriptname" cleanup >> $ro_LOG_FILE 2>&1
-    delrunlevel "$name"
     return 0
 }
 
 
 terminate_proc() {
-    PROC_NAME=$1
+    PROC_NAME="${1}"
     SERVER_PID=`pidof $PROC_NAME 2> /dev/null`
     if [ "$SERVER_PID" != "" ]; then
         killall -TERM $PROC_NAME > /dev/null 2>&1
@@ -603,7 +425,7 @@ terminate_proc() {
 
 
 maybe_run_python_bindings_installer() {
-    VBOX_INSTALL_PATH=$1
+    VBOX_INSTALL_PATH="${1}"
 
     PYTHON=python
     if [ ! `python -c 'print "test"' 2> /dev/null` = "test" ]; then
@@ -620,4 +442,3 @@ maybe_run_python_bindings_installer() {
 
     return 0
 }
-
diff --git a/src/VBox/Installer/linux/run-inst.sh b/src/VBox/Installer/linux/run-inst.sh
index 1617941..ed4fe15 100755
--- a/src/VBox/Installer/linux/run-inst.sh
+++ b/src/VBox/Installer/linux/run-inst.sh
@@ -150,8 +150,9 @@ EOF
     # system
     for i in $UNINSTALL_SCRIPTS; do
         stop_init_script "$i"
-        cleanup_init "$i" 1>&2 2>> "$LOGFILE"
+        cleanup_init_script "$i" 1>&2 2>> "$LOGFILE"
         test -x "./$i" && "./$i" cleanup 1>&2 2>> "$LOGFILE"
+        delrunlevel "$i"
         remove_init_script "$i"
     done
 
@@ -418,6 +419,7 @@ fi
 for i in "$INSTALLATION_DIR/init/"*; do
   if test -r "$i"; then
     install_init_script "$i" "`basename "$i"`"
+    addrunlevel "`basename "$i"`"
     test -n "$DO_SETUP" && setup_init_script "`basename "$i"`" 1>&2
     start_init_script "`basename "$i"`"
   fi
@@ -458,7 +460,8 @@ test -r "$CONFIG_DIR/$CONFIG_FILES" || abort "Required file $CONFIG_FILES not fo
 for i in "$INSTALLATION_DIR/init/"*; do
     if test -r "\$i"; then
         stop_init_script "\`basename "\$i"\`"
-        test -z "\$NO_CLEANUP" && cleanup_init "\`basename "\$i"\`" 2>> "\$LOGFILE"
+        test -z "\$NO_CLEANUP" && cleanup_init_script "\`basename "\$i"\`" 2>> "\$LOGFILE"
+        delrunlevel "\`basename "\$i"\`"
         remove_init_script "\`basename "\$i"\`"
     fi
 done
diff --git a/src/VBox/Installer/linux/vboxautostart-service.sh b/src/VBox/Installer/linux/vboxautostart-service.sh
index 6563d2d..a0f8bf4 100755
--- a/src/VBox/Installer/linux/vboxautostart-service.sh
+++ b/src/VBox/Installer/linux/vboxautostart-service.sh
@@ -13,7 +13,7 @@
 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 #
 
-# chkconfig: 35 35 65
+# chkconfig: 345 35 65
 # description: VirtualBox autostart service
 #
 ### BEGIN INIT INFO
diff --git a/src/VBox/Installer/linux/vboxballoonctrl-service.sh b/src/VBox/Installer/linux/vboxballoonctrl-service.sh
index 708f386..530033a 100755
--- a/src/VBox/Installer/linux/vboxballoonctrl-service.sh
+++ b/src/VBox/Installer/linux/vboxballoonctrl-service.sh
@@ -13,7 +13,7 @@
 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 #
 
-# chkconfig: 35 35 65
+# chkconfig: 345 35 65
 # description: VirtualBox watchdog daemon
 #
 ### BEGIN INIT INFO
diff --git a/src/VBox/Installer/linux/vboxdrv.sh.in b/src/VBox/Installer/linux/vboxdrv.sh.in
index 0343d94..2b0f3da 100755
--- a/src/VBox/Installer/linux/vboxdrv.sh.in
+++ b/src/VBox/Installer/linux/vboxdrv.sh.in
@@ -14,7 +14,7 @@
 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 #
 
-# chkconfig: 35 20 80
+# chkconfig: 345 20 80
 # description: VirtualBox Linux kernel module
 #
 ### BEGIN INIT INFO
diff --git a/src/VBox/Installer/linux/vboxweb-service.sh b/src/VBox/Installer/linux/vboxweb-service.sh
index dbca551..bbd3cdd 100755
--- a/src/VBox/Installer/linux/vboxweb-service.sh
+++ b/src/VBox/Installer/linux/vboxweb-service.sh
@@ -13,7 +13,7 @@
 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 #
 
-# chkconfig: 35 35 65
+# chkconfig: 345 35 65
 # description: VirtualBox web service API
 #
 ### BEGIN INIT INFO
diff --git a/src/VBox/Installer/win/Makefile.kmk b/src/VBox/Installer/win/Makefile.kmk
index 98733c3..26d329b 100644
--- a/src/VBox/Installer/win/Makefile.kmk
+++ b/src/VBox/Installer/win/Makefile.kmk
@@ -315,29 +315,31 @@ ifdef VBOX_WITH_DTRACE
 		'<Directory Id="dir_DTrace" Name="dtrace">' \
 		'  <Directory Id="dir_DTrace_lib" Name="lib">' \
 		'    <Directory Id="dir_DTrace_lib_arch" Name="$(KBUILD_TARGET_ARCH)">' \
-               '      <Component Id="cp_dir_DTrace_lib_arch" Guid="7476CDF6-4157-2E17-5CCC-FF92528D2854" Win64="$$(var.Property_Win64)">' \
+		'      <Component Id="cp_dir_DTrace_lib_arch" Guid="7476CDF6-4157-2E17-5CCC-FF92528D2854" Win64="$$(var.Property_Win64)">' \
 		$(foreach file, $(VBOXINST_DTRACE_LIB_ARCH_FILES) \
                 	, '        <File Id="file_dtrace_lib_arch_$(subst -,_,$(file))" Name="$(file)" Vital="yes" ' \
 			  '              Source="$(PATH_STAGE_BIN)/dtrace/lib/$(KBUILD_TARGET_ARCH)/$(file)" />' ) \
 		'      </Component>' \
 		'    </Directory>' \
 		'  </Directory>' \
+        $(if $(VBOXINST_DTRACE_TESTCASE_ARCH_FILES), \
 		'  <Directory Id="dir_DTrace_testcase" Name="testcase">' \
 		'    <Directory Id="dir_DTrace_testcase_arch" Name="$(KBUILD_TARGET_ARCH)">' \
-               '      <Component Id="cp_dir_DTrace_testcase_arch" Guid="45DF7014-4431-6C40-6DB0-35AF7C690EE1" Win64="$$(var.Property_Win64)">' \
+		'      <Component Id="cp_dir_DTrace_testcase_arch" Guid="45DF7014-4431-6C40-6DB0-35AF7C690EE1" Win64="$$(var.Property_Win64)">' \
 		$(foreach file, $(VBOXINST_DTRACE_TESTCASE_ARCH_FILES) \
                 	, '        <File Id="file_dtrace_testcase_arch_$(subst -,_,$(file))" Name="$(file)" Vital="yes" ' \
 			  '              Source="$(PATH_STAGE_BIN)/dtrace/testcase/$(KBUILD_TARGET_ARCH)/$(file)" />' ) \
 		'      </Component>' \
 		'    </Directory>' \
-		'  </Directory>' \
+		'  </Directory>') \
+        $(if $(VBOXINST_DTRACE_SCRIPTS_FILES), \
 		'  <Directory Id="dir_DTrace_scripts" Name="scripts">' \
-               '    <Component Id="cp_dir_DTrace_scripts" Guid="AE07F9D5-4FD9-ACC7-C760-E9923CE01E16" Win64="$$(var.Property_Win64)">' \
+		'    <Component Id="cp_dir_DTrace_scripts" Guid="AE07F9D5-4FD9-ACC7-C760-E9923CE01E16" Win64="$$(var.Property_Win64)">' \
 		$(foreach file, $(VBOXINST_DTRACE_SCRIPTS_FILES) \
                 	, '      <File Id="file_dtrace_scripts_$(subst -,_,$(file))" Name="$(file)" Vital="yes" ' \
 			  '            Source="$(PATH_STAGE_BIN)/dtrace/scripts/$(file)" />' ) \
 		'    </Component>' \
-		'  </Directory>' \
+		'  </Directory>') \
 		'</Directory>'
 endif
 	$(QUIET)$(APPEND) "$@" '</Include>'
diff --git a/src/VBox/Installer/win/VirtualBox.wxs b/src/VBox/Installer/win/VirtualBox.wxs
index f9c191e..9dd1685 100644
--- a/src/VBox/Installer/win/VirtualBox.wxs
+++ b/src/VBox/Installer/win/VirtualBox.wxs
@@ -438,9 +438,11 @@
     <?if $(env.VBOX_WITH_MSM_INSTALL) = "yes" ?>
                 <MergeRef Id="msm_VBoxNetworkAdp" />
                 <MergeRef Id="msm_VBoxNetworkAdp6" />
+                <MergeRef Id="msm_VBoxNetworkLwf" />                
     <?else ?>
                 <ComponentRef Id="cp_NetAdpDriver" />
                 <ComponentRef Id="cp_NetAdp6Driver" />
+                <ComponentRef Id="cp_NetLwfDriver" />                
     <?endif ?>
             </Feature>
 
diff --git a/src/VBox/Main/cbinding/capiidl.xsl b/src/VBox/Main/cbinding/capiidl.xsl
index 3e11bcf..8553977 100644
--- a/src/VBox/Main/cbinding/capiidl.xsl
+++ b/src/VBox/Main/cbinding/capiidl.xsl
@@ -1844,12 +1844,7 @@ typedef PCVBOXCAPI (*PFNVBOXGETXPCOMCFUNCTIONS)(unsigned uVersion);
       <xsl:value-of select="concat(position(), $name)"/>
       <xsl:text>)(</xsl:text>
       <xsl:value-of select="$iface"/>
-      <xsl:text> *pThis, PRUint32 *reserved);&#x0A;</xsl:text>
-      <xsl:text>    nsresult (*SetInternalAndReservedAttribute</xsl:text>
-      <xsl:value-of select="concat(position(), $name)"/>
-      <xsl:text>)(</xsl:text>
-      <xsl:value-of select="$iface"/>
-      <xsl:text> *pThis, PRUint32 reserved);&#x0A;&#x0A;</xsl:text>
+      <xsl:text> *pThis, PRUint32 *reserved);&#x0A;&#x0A;</xsl:text>
     </xsl:for-each>
   </xsl:if>
   <!-- methods -->
@@ -1875,18 +1870,19 @@ typedef PCVBOXCAPI (*PFNVBOXGETXPCOMCFUNCTIONS)(unsigned uVersion);
 -->
 <xsl:template match="interface">
   <xsl:if test="not(@internal='yes')">
+    <xsl:variable name="name" select="@name"/>
     <xsl:text>/* Start of struct </xsl:text>
-    <xsl:value-of select="@name"/>
+    <xsl:value-of select="$name"/>
     <xsl:text> declaration */&#x0A;</xsl:text>
     <xsl:text>#define </xsl:text>
     <xsl:call-template name="string-to-upper">
-      <xsl:with-param name="str" select="@name"/>
+      <xsl:with-param name="str" select="$name"/>
     </xsl:call-template>
     <xsl:value-of select="concat('_IID_STR "', at uuid,'"')"/>
     <xsl:text>&#x0A;</xsl:text>
     <xsl:text>#define </xsl:text>
     <xsl:call-template name="string-to-upper">
-      <xsl:with-param name="str" select="@name"/>
+      <xsl:with-param name="str" select="$name"/>
     </xsl:call-template>
     <xsl:text>_IID { \&#x0A;</xsl:text>
     <xsl:text>    0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
@@ -1904,11 +1900,11 @@ typedef PCVBOXCAPI (*PFNVBOXGETXPCOMCFUNCTIONS)(unsigned uVersion);
     <xsl:text> } \&#x0A;}&#x0A;</xsl:text>
     <xsl:text>/* COM compatibility */&#x0A;</xsl:text>
     <xsl:text>VBOX_EXTERN_CONST(nsIID, IID_</xsl:text>
-    <xsl:value-of select="@name"/>
+    <xsl:value-of select="$name"/>
     <xsl:text>);&#x0A;</xsl:text>
     <xsl:text>#ifndef VBOX_WITH_GLUE&#x0A;</xsl:text>
     <xsl:text>struct </xsl:text>
-    <xsl:value-of select="@name"/>
+    <xsl:value-of select="$name"/>
     <xsl:text>_vtbl&#x0A;{&#x0A;</xsl:text>
     <xsl:text>    </xsl:text>
     <xsl:choose>
@@ -1927,39 +1923,61 @@ typedef PCVBOXCAPI (*PFNVBOXGETXPCOMCFUNCTIONS)(unsigned uVersion);
     <xsl:text>&#x0A;&#x0A;</xsl:text>
     <!-- attributes (properties) -->
     <xsl:apply-templates select="attribute | if/attribute"/>
+    <xsl:variable name="reservedAttributes" select="@reservedAttributes"/>
+    <xsl:if test="$reservedAttributes > 0">
+      <!-- tricky way to do a "for" loop without recursion -->
+      <xsl:for-each select="(//*)[position() <= $reservedAttributes]">
+        <xsl:text>    nsresult (*GetInternalAndReservedAttribute</xsl:text>
+        <xsl:value-of select="concat(position(), $name)"/>
+        <xsl:text>)(</xsl:text>
+        <xsl:value-of select="$name"/>
+        <xsl:text> *pThis, PRUint32 *reserved);&#x0A;&#x0A;</xsl:text>
+      </xsl:for-each>
+    </xsl:if>
     <!-- methods -->
     <xsl:apply-templates select="method | if/method"/>
+    <xsl:variable name="reservedMethods" select="@reservedMethods"/>
+    <xsl:if test="$reservedMethods > 0">
+      <!-- tricky way to do a "for" loop without recursion -->
+      <xsl:for-each select="(//*)[position() <= $reservedMethods]">
+        <xsl:text>    nsresult (*InternalAndReservedMethod</xsl:text>
+        <xsl:value-of select="concat(position(), $name)"/>
+        <xsl:text>)(</xsl:text>
+        <xsl:value-of select="$name"/>
+        <xsl:text> *pThis);&#x0A;&#x0A;</xsl:text>
+      </xsl:for-each>
+    </xsl:if>
     <!-- -->
     <xsl:text>};&#x0A;</xsl:text>
     <xsl:text>#else /* VBOX_WITH_GLUE */&#x0A;</xsl:text>
     <xsl:text>struct </xsl:text>
-    <xsl:value-of select="@name"/>
+    <xsl:value-of select="$name"/>
     <xsl:text>Vtbl&#x0A;{&#x0A;</xsl:text>
     <xsl:apply-templates select="." mode="vtab_flat">
-      <xsl:with-param name="iface" select="@name"/>
+      <xsl:with-param name="iface" select="$name"/>
     </xsl:apply-templates>
     <xsl:text>};&#x0A;</xsl:text>
     <xsl:apply-templates select="." mode="cobjmacro">
-      <xsl:with-param name="iface" select="@name"/>
+      <xsl:with-param name="iface" select="$name"/>
     </xsl:apply-templates>
     <!-- -->
     <xsl:text>#endif /* VBOX_WITH_GLUE */&#x0A;</xsl:text>
     <xsl:text>&#x0A;</xsl:text>
     <xsl:text>interface </xsl:text>
-    <xsl:value-of select="@name"/>
+    <xsl:value-of select="$name"/>
     <xsl:text>&#x0A;{&#x0A;</xsl:text>
     <xsl:text>#ifndef VBOX_WITH_GLUE&#x0A;</xsl:text>
     <xsl:text>    struct </xsl:text>
-    <xsl:value-of select="@name"/>
+    <xsl:value-of select="$name"/>
     <xsl:text>_vtbl *vtbl;&#x0A;</xsl:text>
     <xsl:text>#else /* VBOX_WITH_GLUE */&#x0A;</xsl:text>
     <xsl:text>    CONST_VTBL struct </xsl:text>
-    <xsl:value-of select="@name"/>
+    <xsl:value-of select="$name"/>
     <xsl:text>Vtbl *lpVtbl;&#x0A;</xsl:text>
     <xsl:text>#endif /* VBOX_WITH_GLUE */&#x0A;</xsl:text>
     <xsl:text>};&#x0A;</xsl:text>
     <xsl:text>/* End of struct </xsl:text>
-    <xsl:value-of select="@name"/>
+    <xsl:value-of select="$name"/>
     <xsl:text> declaration */&#x0A;&#x0A;</xsl:text>
     <xsl:call-template name="xsltprocNewlineOutputHack"/>
   </xsl:if>
diff --git a/src/VBox/Main/cbinding/tstCAPIGlue.c b/src/VBox/Main/cbinding/tstCAPIGlue.c
index ff66d91..70de489 100644
--- a/src/VBox/Main/cbinding/tstCAPIGlue.c
+++ b/src/VBox/Main/cbinding/tstCAPIGlue.c
@@ -676,7 +676,7 @@ static void PrintErrorInfo(const char *pszExecutable, const char *pszErrorMsg, H
     HRESULT rc2 = S_OK;
     fprintf(stderr, "%s: %s (rc=%#010x)\n", pszExecutable, pszErrorMsg, (unsigned)rc);
     rc2 = g_pVBoxFuncs->pfnGetException(&ex);
-    if (SUCCEEDED(rc2))
+    if (SUCCEEDED(rc2) && ex)
     {
         IVirtualBoxErrorInfo *ei;
         rc2 = IErrorInfo_QueryInterface(ex, &IID_IVirtualBoxErrorInfo, (void **)&ei);
diff --git a/src/VBox/Main/glue/vboxapi.py b/src/VBox/Main/glue/vboxapi.py
index ce79dca..8d8c64a 100644
--- a/src/VBox/Main/glue/vboxapi.py
+++ b/src/VBox/Main/glue/vboxapi.py
@@ -16,7 +16,7 @@ __copyright__ = \
     VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     """
-__version__ = "$Revision: 99962 $"
+__version__ = "$Revision: 101311 $"
 
 
 # Note! To set Python bitness on OSX use 'export VERSIONER_PYTHON_PREFER_32_BIT=yes'
@@ -564,7 +564,32 @@ class PlatformMSCOM(PlatformBase):
         return oInterface.__getattr__(sAttrib)
 
     def setArray(self, oInterface, sAttrib, aoArray):
-        return oInterface.__setattr__(sAttrib, aoArray)
+        #
+        # HACK ALERT!
+        #
+        # With pywin32 build 218, we're seeing type mismatch errors here for
+        # IGuestSession::environmentChanges (safearray of BSTRs). The Dispatch
+        # object (_oleobj_) seems to get some type conversion wrong and COM
+        # gets upset.  So, we redo some of the dispatcher work here, picking
+        # the missing type information from the getter.
+        #
+        oOleObj     = getattr(oInterface, '_oleobj_');
+        aPropMapGet = getattr(oInterface, '_prop_map_get_');
+        aPropMapPut = getattr(oInterface, '_prop_map_put_');
+        sComAttrib  = sAttrib if sAttrib in aPropMapGet else ComifyName(sAttrib);
+        try:
+            aArgs, aDefaultArgs = aPropMapPut[sComAttrib];
+            aGetArgs            = aPropMapGet[sComAttrib];
+        except KeyError: # fallback.
+            return oInterface.__setattr__(sAttrib, aoArray);
+
+        import pythoncom;
+        oOleObj.InvokeTypes(aArgs[0],                   # dispid
+                            aArgs[1],                   # LCID
+                            aArgs[2],                   # DISPATCH_PROPERTYPUT
+                            (pythoncom.VT_HRESULT, 0),  # retType - or void?
+                            (aGetArgs[2],),             # argTypes - trick: we get the type from the getter.
+                            aoArray,);                  # The array
 
     def initPerThread(self):
         import pythoncom
diff --git a/src/VBox/Main/include/GuestCtrlImplPrivate.h b/src/VBox/Main/include/GuestCtrlImplPrivate.h
index 84d7b45..4abb5e5 100644
--- a/src/VBox/Main/include/GuestCtrlImplPrivate.h
+++ b/src/VBox/Main/include/GuestCtrlImplPrivate.h
@@ -382,6 +382,9 @@ protected:
         RTENV hNewEnv = NIL_RTENV;
         if (rThat.m_hEnv != NIL_RTENV)
         {
+            /*
+             * Clone it.
+             */
             if (RTEnvIsChangeRecord(rThat.m_hEnv) == fChangeRecord)
                 rc = RTEnvClone(&hNewEnv, rThat.m_hEnv);
             else
@@ -398,7 +401,17 @@ protected:
                         RTEnvDestroy(hNewEnv);
                 }
             }
-
+        }
+        else
+        {
+            /*
+             * Create an empty one so the object works smoothly.
+             * (Relevant for GuestProcessStartupInfo and internal commands.)
+             */
+            if (fChangeRecord)
+                rc = RTEnvCreateChangeRecord(&hNewEnv);
+            else
+                rc = RTEnvCreate(&hNewEnv);
         }
         if (RT_SUCCESS(rc))
         {
diff --git a/src/VBox/Main/include/GuestDnDPrivate.h b/src/VBox/Main/include/GuestDnDPrivate.h
index 7ca10f5..61a37ed 100644
--- a/src/VBox/Main/include/GuestDnDPrivate.h
+++ b/src/VBox/Main/include/GuestDnDPrivate.h
@@ -146,8 +146,8 @@ typedef struct SENDDATACTX
     bool                                mIsActive;
     /** Target (VM) screen ID. */
     uint32_t                            mScreenID;
-    /** Drag'n drop format to send. */
-    com::Utf8Str                        mFormat;
+    /** Drag'n drop format requested by the guest. */
+    com::Utf8Str                        mFmtReq;
     /** Drag'n drop data to send.
      *  This can be arbitrary data or an URI list. */
     GuestDnDData                        mData;
@@ -360,8 +360,8 @@ public:
     void setDefAction(uint32_t a) { m_defAction = a; }
     uint32_t defAction(void) const { return m_defAction; }
 
-    void setFormat(const Utf8Str &strFormat) { m_strFormat = strFormat; }
-    Utf8Str format(void) const { return m_strFormat; }
+    void setFmtReq(const Utf8Str &strFormat) { m_strFmtReq = strFormat; }
+    Utf8Str fmtReq(void) const { return m_strFmtReq; }
 
     void reset(void);
 
@@ -382,11 +382,16 @@ protected:
 
     /** Pointer to context this class is tied to. */
     void                 *m_pvCtx;
+    /** Event for waiting for response. */
     RTSEMEVENT            m_EventSem;
+    /** Default action to perform in case of a
+     *  successful drop. */
     uint32_t              m_defAction;
+    /** Actions supported by the guest in case of
+     *  a successful drop. */
     uint32_t              m_allActions;
-    Utf8Str               m_strFormat;
-
+    /** Format requested by the guest. */
+    Utf8Str               m_strFmtReq;
     /** Pointer to IGuest parent object. */
     ComObjPtr<Guest>      m_parent;
     /** Pointer to associated progress object. Optional. */
@@ -450,7 +455,7 @@ public:
 
     /** @name Static helper methods.
      * @{ */
-    static com::Utf8Str        toFormatString(const std::vector<com::Utf8Str> &lstSupportedFormats, const std::vector<com::Utf8Str> &lstFormats);
+    static com::Utf8Str        toFormatString(const std::vector<com::Utf8Str> &lstSupportedFormats, const std::vector<com::Utf8Str> &lstWantedFormats);
     static void                toFormatVector(const std::vector<com::Utf8Str> &lstSupportedFormats, const com::Utf8Str &strFormats, std::vector<com::Utf8Str> &vecformats);
     static DnDAction_T         toMainAction(uint32_t uAction);
     static void                toMainActions(uint32_t uActions, std::vector<DnDAction_T> &vecActions);
@@ -527,7 +532,10 @@ protected:
     /** Pointer to guest implementation. */
     const ComObjPtr<Guest>          m_pGuest;
     /** List of supported MIME/Content-type formats. */
-    std::vector<com::Utf8Str>       m_strFormats;
+    std::vector<com::Utf8Str>       m_vecFmtSup;
+    /** List of offered/compatible MIME/Content-type formats to the
+     *  counterpart. */
+    std::vector<com::Utf8Str>       m_vecFmtOff;
     /** @}  */
 
     struct
diff --git a/src/VBox/Main/src-client/DrvAudioVRDE.cpp b/src/VBox/Main/src-client/DrvAudioVRDE.cpp
index a94dc11..f8edb8b 100644
--- a/src/VBox/Main/src-client/DrvAudioVRDE.cpp
+++ b/src/VBox/Main/src-client/DrvAudioVRDE.cpp
@@ -19,6 +19,8 @@
 /*******************************************************************************
 *   Header Files                                                               *
 *******************************************************************************/
+#define LOG_GROUP LOG_GROUP_DRV_VRDE_AUDIO
+#include <VBox/log.h>
 #include "DrvAudioVRDE.h"
 #include "ConsoleImpl.h"
 #include "ConsoleVRDPServer.h"
@@ -38,11 +40,6 @@
 #include <VBox/vmm/cfgm.h>
 #include <VBox/err.h>
 
-#undef LOG_GROUP
-#define LOG_GROUP LOG_GROUP_DEV_AUDIO
-#include <VBox/log.h>
-
-
 /*******************************************************************************
 *   Structures and Typedefs                                                    *
 *******************************************************************************/
diff --git a/src/VBox/Main/src-client/GuestDirectoryImpl.cpp b/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
index 9db7f3a..5964e04 100644
--- a/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
+++ b/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
@@ -88,10 +88,11 @@ int GuestDirectory::init(Console *pConsole, GuestSession *pSession,
         /* Start the directory process on the guest. */
         GuestProcessStartupInfo procInfo;
         procInfo.mName      = Utf8StrFmt(tr("Reading directory \"%s\""), openInfo.mPath.c_str());
-        procInfo.mExecutable= Utf8Str(VBOXSERVICE_TOOL_LS);
         procInfo.mTimeoutMS = 5 * 60 * 1000; /* 5 minutes timeout. */
         procInfo.mFlags     = ProcessCreateFlag_WaitForStdOut;
+        procInfo.mExecutable= Utf8Str(VBOXSERVICE_TOOL_LS);
 
+        procInfo.mArguments.push_back(procInfo.mExecutable);
         procInfo.mArguments.push_back(Utf8Str("--machinereadable"));
         /* We want the long output format which contains all the object details. */
         procInfo.mArguments.push_back(Utf8Str("-l"));
diff --git a/src/VBox/Main/src-client/GuestDnDPrivate.cpp b/src/VBox/Main/src-client/GuestDnDPrivate.cpp
index 65f3df7..3c5cdb9 100644
--- a/src/VBox/Main/src-client/GuestDnDPrivate.cpp
+++ b/src/VBox/Main/src-client/GuestDnDPrivate.cpp
@@ -220,7 +220,7 @@ void GuestDnDResponse::reset(void)
     m_defAction  = 0;
     m_allActions = 0;
 
-    m_strFormat  = "";
+    m_strFmtReq  = "";
 }
 
 HRESULT GuestDnDResponse::resetProgress(const ComObjPtr<Guest>& pParent)
@@ -381,13 +381,13 @@ int GuestDnDResponse::onDispatch(uint32_t u32Function, void *pvParms, uint32_t c
             AssertReturn(DragAndDropSvc::CB_MAGIC_DND_HG_REQ_DATA == pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER);
 
             if (   pCBData->cbFormat == 0
-                || pCBData->cbFormat >  _64K)
+                || pCBData->cbFormat > _64K)
             {
                 rc = VERR_INVALID_PARAMETER;
             }
             else
             {
-                setFormat(pCBData->pszFormat);
+                setFmtReq(pCBData->pszFormat);
 
                 rc = VINF_SUCCESS;
             }
@@ -427,7 +427,7 @@ int GuestDnDResponse::onDispatch(uint32_t u32Function, void *pvParms, uint32_t c
             }
             else
             {
-                setFormat    (pCBData->pszFormat);
+                setFmtReq    (pCBData->pszFormat);
                 setDefAction (pCBData->uDefAction);
                 setAllActions(pCBData->uAllActions);
 
@@ -491,9 +491,13 @@ GuestDnD::GuestDnD(const ComObjPtr<Guest> &pGuest)
     m_pResponse = new GuestDnDResponse(pGuest);
 
     /* List of supported default MIME types. */
+    LogRel2(("DnD: Supported default host formats:\n"));
     const com::Utf8Str arrEntries[] = { VBOX_DND_FORMATS_DEFAULT };
     for (size_t i = 0; i < RT_ELEMENTS(arrEntries); i++)
+    {
         m_strDefaultFormats.push_back(arrEntries[i]);
+        LogRel2(("DnD: \t%s\n", arrEntries[i].c_str()));
+    }
 }
 
 GuestDnD::~GuestDnD(void)
@@ -576,12 +580,12 @@ DECLCALLBACK(int) GuestDnD::notifyDnDDispatcher(void *pvExtension, uint32_t u32F
 
 /* static */
 com::Utf8Str GuestDnD::toFormatString(const std::vector<com::Utf8Str> &lstSupportedFormats,
-                                      const std::vector<com::Utf8Str> &lstFormats)
+                                      const std::vector<com::Utf8Str> &lstWantedFormats)
 {
     com::Utf8Str strFormat;
-    for (size_t i = 0; i < lstFormats.size(); ++i)
+    for (size_t i = 0; i < lstWantedFormats.size(); ++i)
     {
-        const com::Utf8Str &f = lstFormats.at(i);
+        const com::Utf8Str &f = lstWantedFormats.at(i);
         /* Only keep allowed format types. */
         if (std::find(lstSupportedFormats.begin(),
                       lstSupportedFormats.end(), f) != lstSupportedFormats.end())
@@ -644,31 +648,37 @@ uint32_t GuestDnD::toHGCMAction(DnDAction_T enmAction)
 }
 
 /* static */
-void GuestDnD::toHGCMActions(DnDAction_T enmDefAction,
-                             uint32_t *puDefAction,
+void GuestDnD::toHGCMActions(DnDAction_T                    enmDefAction,
+                             uint32_t                      *puDefAction,
                              const std::vector<DnDAction_T> vecAllowedActions,
-                             uint32_t *puAllowedActions)
+                             uint32_t                      *puAllowedActions)
 {
-    if (puDefAction)
-        *puDefAction = toHGCMAction(enmDefAction);
-    if (puAllowedActions)
-    {
-        *puAllowedActions = DND_IGNORE_ACTION;
+    uint32_t uAllowedActions = DND_IGNORE_ACTION;
+    uint32_t uDefAction      = toHGCMAction(enmDefAction);
 
+    if (!vecAllowedActions.empty())
+    {
         /* First convert the allowed actions to a bit array. */
-        for (size_t i = 0; i < vecAllowedActions.size(); ++i)
-            *puAllowedActions |= toHGCMAction(vecAllowedActions[i]);
+        for (size_t i = 0; i < vecAllowedActions.size(); i++)
+            uAllowedActions |= toHGCMAction(vecAllowedActions[i]);
 
-        /* Second check if the default action is a valid action and if not so try
-         * to find an allowed action. */
-        if (isDnDIgnoreAction(*puAllowedActions))
+        /*
+         * If no default action is set (ignoring), try one of the
+         * set allowed actions, preferring copy, move (in that order).
+         */
+        if (isDnDIgnoreAction(uDefAction))
         {
-            if (hasDnDCopyAction(*puAllowedActions))
-                *puAllowedActions = DND_COPY_ACTION;
-            else if (hasDnDMoveAction(*puAllowedActions))
-                *puAllowedActions = DND_MOVE_ACTION;
+            if (hasDnDCopyAction(uAllowedActions))
+                uDefAction = DND_COPY_ACTION;
+            else if (hasDnDMoveAction(uAllowedActions))
+                uDefAction = DND_MOVE_ACTION;
         }
     }
+
+    if (puDefAction)
+        *puDefAction      = uDefAction;
+    if (puAllowedActions)
+        *puAllowedActions = uAllowedActions;
 }
 
 /* static */
@@ -706,20 +716,20 @@ GuestDnDBase::GuestDnDBase(void)
     /*
      * Initialize public attributes.
      */
-    m_strFormats = GuestDnDInst()->defaultFormats();
+    m_vecFmtSup = GuestDnDInst()->defaultFormats();
 }
 
 HRESULT GuestDnDBase::i_isFormatSupported(const com::Utf8Str &aFormat, BOOL *aSupported)
 {
-    *aSupported = std::find(m_strFormats.begin(),
-                            m_strFormats.end(), aFormat) != m_strFormats.end()
+    *aSupported = std::find(m_vecFmtSup.begin(),
+                            m_vecFmtSup.end(), aFormat) != m_vecFmtSup.end()
                 ? TRUE : FALSE;
     return S_OK;
 }
 
 HRESULT GuestDnDBase::i_getFormats(std::vector<com::Utf8Str> &aFormats)
 {
-    aFormats = m_strFormats;
+    aFormats = m_vecFmtSup;
 
     return S_OK;
 }
@@ -729,10 +739,10 @@ HRESULT GuestDnDBase::i_addFormats(const std::vector<com::Utf8Str> &aFormats)
     for (size_t i = 0; i < aFormats.size(); ++i)
     {
         Utf8Str strFormat = aFormats.at(i);
-        if (std::find(m_strFormats.begin(),
-                      m_strFormats.end(), strFormat) == m_strFormats.end())
+        if (std::find(m_vecFmtSup.begin(),
+                      m_vecFmtSup.end(), strFormat) == m_vecFmtSup.end())
         {
-            m_strFormats.push_back(strFormat);
+            m_vecFmtSup.push_back(strFormat);
         }
     }
 
@@ -744,10 +754,10 @@ HRESULT GuestDnDBase::i_removeFormats(const std::vector<com::Utf8Str> &aFormats)
     for (size_t i = 0; i < aFormats.size(); ++i)
     {
         Utf8Str strFormat = aFormats.at(i);
-        std::vector<com::Utf8Str>::iterator itFormat = std::find(m_strFormats.begin(),
-                                                                 m_strFormats.end(), strFormat);
-        if (itFormat != m_strFormats.end())
-            m_strFormats.erase(itFormat);
+        std::vector<com::Utf8Str>::iterator itFormat = std::find(m_vecFmtSup.begin(),
+                                                                 m_vecFmtSup.end(), strFormat);
+        if (itFormat != m_vecFmtSup.end())
+            m_vecFmtSup.erase(itFormat);
     }
 
     return S_OK;
diff --git a/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp b/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
index 834d49d..9eb9ee1 100644
--- a/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
+++ b/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
@@ -254,10 +254,11 @@ HRESULT GuestDnDSource::dragIsPending(ULONG uScreenId, std::vector<com::Utf8Str>
     int rc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
     if (RT_SUCCESS(rc))
     {
-        bool fFetchResult = true;
         GuestDnDResponse *pResp = GuestDnDInst()->response();
         if (pResp)
         {
+            bool fFetchResult = true;
+
             if (pResp->waitForGuestResponse(5000 /* Timeout in ms */) == VERR_TIMEOUT)
                 fFetchResult = false;
 
@@ -269,7 +270,7 @@ HRESULT GuestDnDSource::dragIsPending(ULONG uScreenId, std::vector<com::Utf8Str>
             {
                 defaultAction = GuestDnD::toMainAction(pResp->defAction());
 
-                GuestDnD::toFormatVector(m_strFormats, pResp->format(), aFormats);
+                GuestDnD::toFormatVector(m_vecFmtSup, pResp->fmtReq(), aFormats);
                 GuestDnD::toMainActions(pResp->allActions(), aAllowedActions);
             }
         }
@@ -757,7 +758,7 @@ int GuestDnDSource::i_receiveData(PRECVDATACTX pCtx, RTMSINTERVAL msTimeout)
     /* Set the format we are going to retrieve to have it around
      * when retrieving the data later. */
     pResp->reset();
-    pResp->setFormat(pCtx->mFormat);
+    pResp->setFmtReq(pCtx->mFormat);
 
     bool fHasURIList = DnDMIMENeedsDropDir(pCtx->mFormat.c_str(), pCtx->mFormat.length());
     LogFlowFunc(("strFormat=%s, uAction=0x%x, fHasURIList=%RTbool\n", pCtx->mFormat.c_str(), pCtx->mAction, fHasURIList));
@@ -1235,4 +1236,3 @@ int GuestDnDSource::i_updateProcess(PRECVDATACTX pCtx, uint64_t cbDataAdd)
                                        : DragAndDropSvc::DND_PROGRESS_RUNNING);
     return rc;
 }
-
diff --git a/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp b/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
index c52af7d..d6475dd 100644
--- a/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
+++ b/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
@@ -240,10 +240,10 @@ HRESULT GuestDnDTarget::getProtocolVersion(ULONG *aProtocolVersion)
 /////////////////////////////////////////////////////////////////////////////
 
 HRESULT GuestDnDTarget::enter(ULONG aScreenId, ULONG aX, ULONG aY,
-                              DnDAction_T aDefaultAction,
-                              const std::vector<DnDAction_T> &aAllowedActions,
+                              DnDAction_T                      aDefaultAction,
+                              const std::vector<DnDAction_T>  &aAllowedActions,
                               const std::vector<com::Utf8Str> &aFormats,
-                              DnDAction_T *aResultAction)
+                              DnDAction_T                     *aResultAction)
 {
 #if !defined(VBOX_WITH_DRAG_AND_DROP)
     ReturnComNotImplemented();
@@ -276,10 +276,21 @@ HRESULT GuestDnDTarget::enter(ULONG aScreenId, ULONG aX, ULONG aY,
         return S_OK;
 
     /* Make a flat data string out of the supported format list. */
-    Utf8Str strFormats = GuestDnD::toFormatString(m_strFormats, aFormats);
+    Utf8Str strFormats = GuestDnD::toFormatString(m_vecFmtSup, aFormats);
+
     /* If there is no valid supported format, ignore this request. */
     if (strFormats.isEmpty())
-        return S_OK;
+        return setError(E_INVALIDARG, tr("Specified format(s) not supported"));
+
+    LogRel2(("DnD: Offered formats to guest:\n"));
+    RTCList<RTCString> lstFormats = strFormats.split("\r\n");
+    for (size_t i = 0; i < lstFormats.size(); i++)
+        LogRel2(("DnD: \t%s\n", lstFormats[i].c_str()));
+
+    /* Save the formats offered to the guest. This is needed to later
+     * decide what to do with the data when sending stuff to the guest. */
+    m_vecFmtOff = aFormats;
+    Assert(m_vecFmtOff.size());
 
     HRESULT hr = S_OK;
 
@@ -306,8 +317,14 @@ HRESULT GuestDnDTarget::enter(ULONG aScreenId, ULONG aX, ULONG aY,
         }
     }
 
-    if (aResultAction)
-        *aResultAction = resAction;
+    if (RT_FAILURE(rc))
+        hr = VBOX_E_IPRT_ERROR;
+
+    if (SUCCEEDED(hr))
+    {
+        if (aResultAction)
+            *aResultAction = resAction;
+    }
 
     LogFlowFunc(("hr=%Rhrc, resAction=%ld\n", hr, resAction));
     return hr;
@@ -315,10 +332,10 @@ HRESULT GuestDnDTarget::enter(ULONG aScreenId, ULONG aX, ULONG aY,
 }
 
 HRESULT GuestDnDTarget::move(ULONG aScreenId, ULONG aX, ULONG aY,
-                             DnDAction_T aDefaultAction,
-                             const std::vector<DnDAction_T> &aAllowedActions,
+                             DnDAction_T                      aDefaultAction,
+                             const std::vector<DnDAction_T>  &aAllowedActions,
                              const std::vector<com::Utf8Str> &aFormats,
-                             DnDAction_T *aResultAction)
+                             DnDAction_T                     *aResultAction)
 {
 #if !defined(VBOX_WITH_DRAG_AND_DROP)
     ReturnComNotImplemented();
@@ -342,10 +359,10 @@ HRESULT GuestDnDTarget::move(ULONG aScreenId, ULONG aX, ULONG aY,
         return S_OK;
 
     /* Make a flat data string out of the supported format list. */
-    RTCString strFormats = GuestDnD::toFormatString(m_strFormats, aFormats);
+    RTCString strFormats = GuestDnD::toFormatString(m_vecFmtSup, aFormats);
     /* If there is no valid supported format, ignore this request. */
     if (strFormats.isEmpty())
-        return S_OK;
+        return setError(E_INVALIDARG, tr("Specified format(s) not supported"));
 
     HRESULT hr = S_OK;
 
@@ -371,8 +388,14 @@ HRESULT GuestDnDTarget::move(ULONG aScreenId, ULONG aX, ULONG aY,
         }
     }
 
-    if (aResultAction)
-        *aResultAction = resAction;
+    if (RT_FAILURE(rc))
+        hr = VBOX_E_IPRT_ERROR;
+
+    if (SUCCEEDED(hr))
+    {
+        if (aResultAction)
+            *aResultAction = resAction;
+    }
 
     LogFlowFunc(("hr=%Rhrc, *pResultAction=%ld\n", hr, resAction));
     return hr;
@@ -398,16 +421,20 @@ HRESULT GuestDnDTarget::leave(ULONG uScreenId)
             pResp->waitForGuestResponse();
     }
 
+    if (RT_FAILURE(rc))
+        hr = VBOX_E_IPRT_ERROR;
+
     LogFlowFunc(("hr=%Rhrc\n", hr));
     return hr;
 #endif /* VBOX_WITH_DRAG_AND_DROP */
 }
 
 HRESULT GuestDnDTarget::drop(ULONG aScreenId, ULONG aX, ULONG aY,
-                             DnDAction_T aDefaultAction,
-                             const std::vector<DnDAction_T> &aAllowedActions,
+                             DnDAction_T                      aDefaultAction,
+                             const std::vector<DnDAction_T>  &aAllowedActions,
                              const std::vector<com::Utf8Str> &aFormats,
-                             com::Utf8Str &aFormat, DnDAction_T *aResultAction)
+                             com::Utf8Str                    &aFormat,
+                             DnDAction_T                     *aResultAction)
 {
 #if !defined(VBOX_WITH_DRAG_AND_DROP)
     ReturnComNotImplemented();
@@ -430,13 +457,18 @@ HRESULT GuestDnDTarget::drop(ULONG aScreenId, ULONG aX, ULONG aY,
                             aAllowedActions, &uAllowedActions);
     /* If there is no usable action, ignore this request. */
     if (isDnDIgnoreAction(uDefAction))
+    {
+        aFormat = "";
+        if (aResultAction)
+            *aResultAction = DnDAction_Ignore;
         return S_OK;
+    }
 
     /* Make a flat data string out of the supported format list. */
-    Utf8Str strFormats = GuestDnD::toFormatString(m_strFormats, aFormats);
+    Utf8Str strFormats = GuestDnD::toFormatString(m_vecFmtSup, aFormats);
     /* If there is no valid supported format, ignore this request. */
     if (strFormats.isEmpty())
-        return S_OK;
+        return setError(E_INVALIDARG, tr("Specified format(s) not supported"));
 
     HRESULT hr = S_OK;
 
@@ -461,17 +493,24 @@ HRESULT GuestDnDTarget::drop(ULONG aScreenId, ULONG aX, ULONG aY,
             if (pResp && RT_SUCCESS(pResp->waitForGuestResponse()))
             {
                 resAction = GuestDnD::toMainAction(pResp->defAction());
-                aFormat = pResp->format();
+                aFormat = pResp->fmtReq();
 
                 LogFlowFunc(("resFormat=%s, resAction=%RU32\n",
-                             pResp->format().c_str(), pResp->defAction()));
+                             pResp->fmtReq().c_str(), pResp->defAction()));
             }
         }
     }
 
-    if (aResultAction)
-        *aResultAction = resAction;
+    if (RT_FAILURE(rc))
+        hr = VBOX_E_IPRT_ERROR;
 
+    if (SUCCEEDED(hr))
+    {
+        if (aResultAction)
+            *aResultAction = resAction;
+    }
+
+    LogFlowFunc(("Returning hr=%Rhrc\n", hr));
     return hr;
 #endif /* VBOX_WITH_DRAG_AND_DROP */
 }
@@ -555,7 +594,7 @@ HRESULT GuestDnDTarget::sendData(ULONG aScreenId, const com::Utf8Str &aFormat, c
         pSendCtx->mpTarget      = this;
         pSendCtx->mpResp        = pResp;
         pSendCtx->mScreenID     = aScreenId;
-        pSendCtx->mFormat       = aFormat;
+        pSendCtx->mFmtReq       = aFormat;
         pSendCtx->mData.vecData = aData;
 
         SendDataTask *pTask = new SendDataTask(this, pSendCtx);
@@ -680,10 +719,6 @@ int GuestDnDTarget::i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
 {
     AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
 
-    GuestDnD *pInst = GuestDnDInst();
-    if (!pInst)
-        return VERR_INVALID_POINTER;
-
     int rc;
 
     ASMAtomicWriteBool(&pCtx->mIsActive, true);
@@ -691,11 +726,18 @@ int GuestDnDTarget::i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
     /* Clear all remaining outgoing messages. */
     mDataBase.mListOutgoing.clear();
 
-    const char *pszFormat = pCtx->mFormat.c_str();
-    uint32_t cbFormat = pCtx->mFormat.length() + 1;
-
-    /* Do we need to build up a file tree? */
-    bool fHasURIList = DnDMIMEHasFileURLs(pszFormat, cbFormat);
+    /**
+     * Do we need to build up a file tree?
+     * Note: The decision whether we need to build up a file tree and sending
+     *       actual file data only depends on the actual formats offered by this target.
+     *       If the guest does not want an URI list ("text/uri-list") but text ("TEXT" and
+     *       friends) instead, still send the data over to the guest -- the file as such still
+     *       is needed on the guest in this case, as the guest then just wants a simple path
+     *       instead of an URI list (pointing to a file on the guest itself).
+     *
+     ** @todo Support more than one format; add a format<->function handler concept. Later. */
+    bool fHasURIList = std::find(m_vecFmtOff.begin(),
+                                 m_vecFmtOff.end(), "text/uri-list") != m_vecFmtOff.end();
     if (fHasURIList)
     {
         rc = i_sendURIData(pCtx, msTimeout);
@@ -1128,8 +1170,8 @@ int GuestDnDTarget::i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
         GuestDnDMsg MsgSndData;
         MsgSndData.setType(DragAndDropSvc::HOST_DND_HG_SND_DATA);
         MsgSndData.setNextUInt32(pCtx->mScreenID);
-        MsgSndData.setNextPointer((void *)pCtx->mFormat.c_str(), (uint32_t)pCtx->mFormat.length() + 1);
-        MsgSndData.setNextUInt32((uint32_t)pCtx->mFormat.length() + 1);
+        MsgSndData.setNextPointer((void *)pCtx->mFmtReq.c_str(), (uint32_t)pCtx->mFmtReq.length() + 1);
+        MsgSndData.setNextUInt32((uint32_t)pCtx->mFmtReq.length() + 1);
         MsgSndData.setNextPointer((void*)strData.c_str(), (uint32_t)cbData);
         MsgSndData.setNextUInt32((uint32_t)cbData);
 
@@ -1266,7 +1308,8 @@ int GuestDnDTarget::i_sendRawData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
     GuestDnD *pInst = GuestDnDInst();
     AssertPtr(pInst);
 
-    /* At the moment we only allow up to 64K raw data. */
+    /** @todo At the moment we only allow sending up to 64K raw data. Fix this by
+     *        using HOST_DND_HG_SND_MORE_DATA. */
     size_t cbDataTotal = pCtx->mData.vecData.size();
     if (   !cbDataTotal
         || cbDataTotal > _64K)
@@ -1278,14 +1321,25 @@ int GuestDnDTarget::i_sendRawData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
     GuestDnDMsg Msg;
     Msg.setType(DragAndDropSvc::HOST_DND_HG_SND_DATA);
     Msg.setNextUInt32(pCtx->mScreenID);
-    Msg.setNextPointer((void *)pCtx->mFormat.c_str(), (uint32_t)pCtx->mFormat.length() + 1);
-    Msg.setNextUInt32((uint32_t)pCtx->mFormat.length() + 1);
+    Msg.setNextPointer((void *)pCtx->mFmtReq.c_str(), (uint32_t)pCtx->mFmtReq.length() + 1);
+    Msg.setNextUInt32((uint32_t)pCtx->mFmtReq.length() + 1);
     Msg.setNextPointer((void*)&pCtx->mData.vecData.front(), (uint32_t)cbDataTotal);
     Msg.setNextUInt32(cbDataTotal);
 
-    LogFlowFunc(("%zu total bytes of raw data to transfer\n", cbDataTotal));
+    LogFlowFunc(("Transferring %zu total bytes of raw data ('%s')\n", cbDataTotal, pCtx->mFmtReq.c_str()));
+
+    int rc2;
 
-    return pInst->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
+    int rc = pInst->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
+    if (RT_FAILURE(rc))
+        rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, rc,
+                                        GuestDnDTarget::i_hostErrorToString(rc));
+    else
+        rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_COMPLETE, rc);
+    AssertRC(rc2);
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
 }
 
 HRESULT GuestDnDTarget::cancel(BOOL *aVeto)
@@ -1299,7 +1353,10 @@ HRESULT GuestDnDTarget::cancel(BOOL *aVeto)
     if (aVeto)
         *aVeto = FALSE; /** @todo */
 
-    return RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
+    HRESULT hr = RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
+
+    LogFlowFunc(("hr=%Rhrc\n", hr));
+    return hr;
 #endif /* VBOX_WITH_DRAG_AND_DROP */
 }
 
diff --git a/src/VBox/Main/src-client/GuestProcessImpl.cpp b/src/VBox/Main/src-client/GuestProcessImpl.cpp
index e1b9036..5408a28 100644
--- a/src/VBox/Main/src-client/GuestProcessImpl.cpp
+++ b/src/VBox/Main/src-client/GuestProcessImpl.cpp
@@ -1926,6 +1926,7 @@ int GuestProcessTool::Init(GuestSession *pGuestSession, const GuestProcessStartu
                      pGuestSession, startupInfo.mExecutable.c_str(), fAsync));
 
     AssertPtrReturn(pGuestSession, VERR_INVALID_POINTER);
+    Assert(startupInfo.mArguments[0] == startupInfo.mExecutable);
 
     pSession = pGuestSession;
     mStartupInfo = startupInfo;
@@ -2021,7 +2022,8 @@ int GuestProcessTool::i_runEx(      GuestSession            *pGuestSession,
                                     uint32_t                 cStrmOutObjects,
                                     int                     *pGuestRc)
 {
-    GuestProcessTool procTool; int guestRc;
+    GuestProcessTool procTool;
+    int guestRc;
     int vrc = procTool.Init(pGuestSession, startupInfo, false /* Async */, &guestRc);
     if (RT_SUCCESS(vrc))
     {
diff --git a/src/VBox/Main/src-client/GuestSessionImpl.cpp b/src/VBox/Main/src-client/GuestSessionImpl.cpp
index bec7232..3dafeb4 100644
--- a/src/VBox/Main/src-client/GuestSessionImpl.cpp
+++ b/src/VBox/Main/src-client/GuestSessionImpl.cpp
@@ -648,8 +648,9 @@ int GuestSession::i_directoryCreateInternal(const Utf8Str &strPath, uint32_t uMo
     int vrc = VINF_SUCCESS;
 
     GuestProcessStartupInfo procInfo;
-    procInfo.mExecutable = Utf8Str(VBOXSERVICE_TOOL_MKDIR);
     procInfo.mFlags      = ProcessCreateFlag_Hidden;
+    procInfo.mExecutable = Utf8Str(VBOXSERVICE_TOOL_MKDIR);
+    procInfo.mArguments.push_back(procInfo.mExecutable);
 
     try
     {
@@ -805,8 +806,9 @@ int GuestSession::i_objectCreateTempInternal(const Utf8Str &strTemplate, const U
     int vrc = VINF_SUCCESS;
 
     GuestProcessStartupInfo procInfo;
-    procInfo.mExecutable = Utf8Str(VBOXSERVICE_TOOL_MKTEMP);
     procInfo.mFlags      = ProcessCreateFlag_WaitForStdOut;
+    procInfo.mExecutable = Utf8Str(VBOXSERVICE_TOOL_MKTEMP);
+    procInfo.mArguments.push_back(procInfo.mExecutable);
 
     try
     {
@@ -1207,8 +1209,9 @@ int GuestSession::i_fileRemoveInternal(const Utf8Str &strPath, int *pGuestRc)
     GuestProcessStartupInfo procInfo;
     GuestProcessStream      streamOut;
 
-    procInfo.mExecutable = Utf8Str(VBOXSERVICE_TOOL_RM);
     procInfo.mFlags      = ProcessCreateFlag_WaitForStdOut;
+    procInfo.mExecutable = Utf8Str(VBOXSERVICE_TOOL_RM);
+    procInfo.mArguments.push_back(procInfo.mExecutable);
 
     try
     {
@@ -1374,8 +1377,9 @@ int GuestSession::i_fsQueryInfoInternal(const Utf8Str &strPath, bool fFollowSyml
 
     /** @todo Merge this with IGuestFile::queryInfo(). */
     GuestProcessStartupInfo procInfo;
-    procInfo.mExecutable = Utf8Str(VBOXSERVICE_TOOL_STAT);
     procInfo.mFlags      = ProcessCreateFlag_WaitForStdOut;
+    procInfo.mExecutable = Utf8Str(VBOXSERVICE_TOOL_STAT);
+    procInfo.mArguments.push_back(procInfo.mExecutable);
 
     try
     {
@@ -3170,8 +3174,8 @@ HRESULT GuestSession::fsObjQueryInfo(const com::Utf8Str &aPath, BOOL aFollowSyml
         else
             hrc = setErrorVrc(vrc, tr("Querying file information for \"%s\" failed: %Rrc"), aPath.c_str(), vrc);
     }
-    /* else: If the file name is empty, there is no way it can exists. So, don't
-       be a tedious and return E_INVALIDARG, simply return FALSE. */
+    else
+            hrc = setError(E_INVALIDARG, tr("the path parameter must not be empty/NULL"));
     LogFlowThisFuncLeave();
     return hrc;
 }
diff --git a/src/VBox/Main/src-client/SessionImpl.cpp b/src/VBox/Main/src-client/SessionImpl.cpp
index 988bc2a..f32d8ae 100644
--- a/src/VBox/Main/src-client/SessionImpl.cpp
+++ b/src/VBox/Main/src-client/SessionImpl.cpp
@@ -526,11 +526,17 @@ HRESULT Session::uninitialize()
             return S_OK;
         }
 
-        AssertMsgReturn(   mState == SessionState_Locked
-                        || mState == SessionState_Spawning,
-                        ("Session is in wrong state (%ld), expected locked (%ld) or spawning (%ld)\n",
-                         mState, SessionState_Locked, SessionState_Spawning),
-                        VBOX_E_INVALID_VM_STATE);
+        if (   mState == SessionState_Locked
+            || mState == SessionState_Spawning)
+        { /* likely */ }
+        else
+        {
+#ifndef DEBUG_bird /* bird: hitting this all the time running tdAddBaseic1.py. */
+            AssertMsgFailed(("Session is in wrong state (%d), expected locked (%d) or spawning (%d)\n",
+                             mState, SessionState_Locked, SessionState_Spawning));
+#endif
+            return VBOX_E_INVALID_VM_STATE;
+        }
 
         /* close ourselves */
         rc = i_unlockMachine(false /* aFinalRelease */, true /* aFromServer */, alock);
diff --git a/src/VBox/Main/src-server/AudioAdapterImpl.cpp b/src/VBox/Main/src-server/AudioAdapterImpl.cpp
index c1c864a..1bda982 100644
--- a/src/VBox/Main/src-server/AudioAdapterImpl.cpp
+++ b/src/VBox/Main/src-server/AudioAdapterImpl.cpp
@@ -322,28 +322,38 @@ HRESULT AudioAdapter::setAudioController(AudioControllerType_T aAudioController)
 
     if (mData->m->mAudioController != aAudioController)
     {
+        AudioCodecType_T defaultCodec;
+
         /*
          * which audio hardware type are we supposed to use?
          */
         switch (aAudioController)
         {
+            /* codec type needs to match the controller. */
             case AudioControllerType_AC97:
+                defaultCodec = AudioCodecType_STAC9700;
+                break;
             case AudioControllerType_SB16:
+                defaultCodec = AudioCodecType_SB16;
+                break;
             case AudioControllerType_HDA:
-            {
-                mData->m.backup();
-                mData->m->mAudioController = aAudioController;
-                alock.release();
-                AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
-                mParent->i_setModified(Machine::IsModified_AudioAdapter);
+                defaultCodec = AudioCodecType_STAC9221;
                 break;
-            }
 
             default:
                 AssertMsgFailed (("Wrong audio controller type %d\n",
                                   aAudioController));
                 rc = E_FAIL;
         }
+        if (rc == S_OK)
+        {
+            mData->m.backup();
+            mData->m->mAudioController = aAudioController;
+            mData->m->mAudioCodec = defaultCodec;
+            alock.release();
+            AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
+            mParent->i_setModified(Machine::IsModified_AudioAdapter);
+        }
     }
 
     return rc;
@@ -369,7 +379,7 @@ HRESULT AudioAdapter::setAudioCodec(AudioCodecType_T aAudioCodec)
     HRESULT rc = S_OK;
 
     /*
-     * which audio hardware type are we supposed to use?
+     * ensure that the codec type matches the audio controller
      */
     switch (mData->m->mAudioController)
     {
diff --git a/src/VBox/Runtime/VBox/log-vbox.cpp b/src/VBox/Runtime/VBox/log-vbox.cpp
index bfb9dbf..daf961f 100644
--- a/src/VBox/Runtime/VBox/log-vbox.cpp
+++ b/src/VBox/Runtime/VBox/log-vbox.cpp
@@ -205,6 +205,8 @@ RTDECL(PRTLOGGER) RTLogDefaultInit(void)
 #define ASSERT_LOG_GROUP2(def, str) \
     do { if (strcmp(g_apszGroups[def], str)) {printf("%s='%s' expects '%s'\n", #def, g_apszGroups[def], str); RTAssertDoPanic(); } } while (0)
     ASSERT_LOG_GROUP(DEFAULT);
+    ASSERT_LOG_GROUP(AUDIO_MIXER);
+    ASSERT_LOG_GROUP(AUDIO_MIXER_BUFFER);
     ASSERT_LOG_GROUP(CFGM);
     ASSERT_LOG_GROUP(CPUM);
     ASSERT_LOG_GROUP(CSAM);
@@ -212,10 +214,12 @@ RTDECL(PRTLOGGER) RTLogDefaultInit(void)
     ASSERT_LOG_GROUP(DBGF);
     ASSERT_LOG_GROUP(DBGF_INFO);
     ASSERT_LOG_GROUP(DEV);
+    ASSERT_LOG_GROUP(DEV_AC97);
     ASSERT_LOG_GROUP(DEV_ACPI);
     ASSERT_LOG_GROUP(DEV_APIC);
-    ASSERT_LOG_GROUP(DEV_AUDIO);
     ASSERT_LOG_GROUP(DEV_FDC);
+    ASSERT_LOG_GROUP(DEV_HDA);
+    ASSERT_LOG_GROUP(DEV_HDA_CODEC);
     ASSERT_LOG_GROUP(DEV_HPET);
     ASSERT_LOG_GROUP(DEV_IDE);
     ASSERT_LOG_GROUP(DEV_KBD);
@@ -229,6 +233,7 @@ RTDECL(PRTLOGGER) RTLogDefaultInit(void)
     ASSERT_LOG_GROUP(DEV_PIC);
     ASSERT_LOG_GROUP(DEV_PIT);
     ASSERT_LOG_GROUP(DEV_RTC);
+    ASSERT_LOG_GROUP(DEV_SB16);
     ASSERT_LOG_GROUP(DEV_SERIAL);
     ASSERT_LOG_GROUP(DEV_SMC);
     ASSERT_LOG_GROUP(DEV_VGA);
@@ -237,8 +242,10 @@ RTDECL(PRTLOGGER) RTLogDefaultInit(void)
     ASSERT_LOG_GROUP(DIS);
     ASSERT_LOG_GROUP(DRV);
     ASSERT_LOG_GROUP(DRV_ACPI);
+    ASSERT_LOG_GROUP(DRV_AUDIO);
     ASSERT_LOG_GROUP(DRV_BLOCK);
     ASSERT_LOG_GROUP(DRV_FLOPPY);
+    ASSERT_LOG_GROUP(DRV_HOST_AUDIO);
     ASSERT_LOG_GROUP(DRV_HOST_DVD);
     ASSERT_LOG_GROUP(DRV_HOST_FLOPPY);
     ASSERT_LOG_GROUP(DRV_ISO);
@@ -249,6 +256,7 @@ RTDECL(PRTLOGGER) RTLogDefaultInit(void)
     ASSERT_LOG_GROUP(DRV_TUN);
     ASSERT_LOG_GROUP(DRV_USBPROXY);
     ASSERT_LOG_GROUP(DRV_VBOXHDD);
+    ASSERT_LOG_GROUP(DRV_VRDE_AUDIO);
     ASSERT_LOG_GROUP(DRV_VSWITCH);
     ASSERT_LOG_GROUP(DRV_VUSB);
     ASSERT_LOG_GROUP(EM);
diff --git a/src/VBox/Runtime/common/misc/getopt.cpp b/src/VBox/Runtime/common/misc/getopt.cpp
index 8bad39f..ac58209 100644
--- a/src/VBox/Runtime/common/misc/getopt.cpp
+++ b/src/VBox/Runtime/common/misc/getopt.cpp
@@ -739,7 +739,7 @@ RTDECL(RTEXITCODE) RTGetOptPrintError(int ch, PCRTGETOPTUNION pValueUnion)
     }
     else if (ch == VERR_GETOPT_UNKNOWN_OPTION)
         RTMsgError("Unknown option: '%s'", pValueUnion->psz);
-    else if (ch == VERR_GETOPT_INVALID_ARGUMENT_FORMAT)
+    else if (pValueUnion->pDef && ch == VERR_GETOPT_INVALID_ARGUMENT_FORMAT)
         /** @todo r=klaus not really ideal, as the value isn't available */
         RTMsgError("The value given '%s' has an invalid format.", pValueUnion->pDef->pszLong);
     else if (pValueUnion->pDef)
diff --git a/src/VBox/Runtime/common/path/RTPathRmCmd.cpp b/src/VBox/Runtime/common/path/RTPathRmCmd.cpp
index 3902cde..3203f56 100644
--- a/src/VBox/Runtime/common/path/RTPathRmCmd.cpp
+++ b/src/VBox/Runtime/common/path/RTPathRmCmd.cpp
@@ -117,7 +117,7 @@ static int rtPathRmError(PRTPATHRMCMDOPTS pOpts, const char *pszPath, int rc,
                          const char *pszFormat, ...)
 {
     if (pOpts->fMachineReadable)
-        RTPrintf("fname=%s%crc=%d%c", pszPath, rc);
+        RTPrintf("fname=%s%crc=%d%c", pszPath, 0, rc, 0);
     else
     {
         va_list va;
diff --git a/src/VBox/Runtime/generic/env-generic.cpp b/src/VBox/Runtime/generic/env-generic.cpp
index 612cdd4..9030597 100644
--- a/src/VBox/Runtime/generic/env-generic.cpp
+++ b/src/VBox/Runtime/generic/env-generic.cpp
@@ -175,7 +175,7 @@ static int rtEnvCreate(PRTENVINTERNAL *ppIntEnv, size_t cAllocated, bool fCaseSe
 RTDECL(int) RTEnvCreate(PRTENV pEnv)
 {
     AssertPtrReturn(pEnv, VERR_INVALID_POINTER);
-    return rtEnvCreate(pEnv, RTENV_GROW_SIZE, false /*fCaseSensitive*/, false /*fPutEnvBlock*/);
+    return rtEnvCreate(pEnv, RTENV_GROW_SIZE, true /*fCaseSensitive*/, false /*fPutEnvBlock*/);
 }
 RT_EXPORT_SYMBOL(RTEnvCreate);
 
@@ -1136,7 +1136,7 @@ RT_EXPORT_SYMBOL(RTEnvGetByIndexRawEx);
 RTDECL(int) RTEnvCreateChangeRecord(PRTENV phEnv)
 {
     AssertPtrReturn(phEnv, VERR_INVALID_POINTER);
-    return rtEnvCreate(phEnv, RTENV_GROW_SIZE, false /*fCaseSensitive*/, true /*fPutEnvBlock*/);
+    return rtEnvCreate(phEnv, RTENV_GROW_SIZE, true /*fCaseSensitive*/, true /*fPutEnvBlock*/);
 }
 RT_EXPORT_SYMBOL(RTEnvCreateChangeRecord);
 
diff --git a/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp
index d52aa81..eb052d7 100644
--- a/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp
@@ -453,7 +453,7 @@ static int rtR0DbgKrnlDarwinCheckStandardSymbols(RTDBGKRNLINFOINT *pThis)
         KNOWN_ENTRY(ostype),
         KNOWN_ENTRY(panic),
         KNOWN_ENTRY(strprefix),
-        //KNOWN_ENTRY(sysctlbyname), - we get kernel_sysctlbyname from the kernel.
+        //KNOWN_ENTRY(sysctlbyname), - we get kernel_sysctlbyname from the 10.10+ kernels.
         KNOWN_ENTRY(vsscanf),
         KNOWN_ENTRY(page_mask),
 
@@ -520,7 +520,7 @@ static int rtR0DbgKrnlDarwinCheckStandardSymbols(RTDBGKRNLINFOINT *pThis)
         KNOWN_ENTRY(vm_map),
         KNOWN_ENTRY(vm_protect),
         KNOWN_ENTRY(vm_region),
-        KNOWN_ENTRY(vm_map_wire),
+        KNOWN_ENTRY(vm_map_unwire), /* vm_map_wire has an alternative symbol, vm_map_wire_external, in 10.11  */
         KNOWN_ENTRY(PE_kputc),
         KNOWN_ENTRY(kernel_map),
         KNOWN_ENTRY(kernel_pmap),
diff --git a/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp
index 38f5a49..c685015 100644
--- a/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp
@@ -94,7 +94,7 @@ typedef struct RTTIMER
     /** The timer interval. 0 if one-shot. */
     uint64_t                u64NanoInterval;
 #ifdef RTR0TIMER_NT_MANUAL_RE_ARM
-    /** The NT start time . */
+    /** The desired NT time of the first tick. */
     uint64_t                uNtStartTime;
 #endif
     /** The Nt timer object. */
@@ -371,7 +371,7 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First)
     ASMAtomicWriteS32(&pTimer->cOmniSuspendCountDown, 0);
     ASMAtomicWriteBool(&pTimer->fSuspended, false);
 #ifdef RTR0TIMER_NT_MANUAL_RE_ARM
-    pTimer->uNtStartTime = rtTimerNtQueryInterruptTime();
+    pTimer->uNtStartTime = rtTimerNtQueryInterruptTime() + u64First / 100;
     KeSetTimerEx(&pTimer->NtTimer, DueTime, 0, pMasterDpc);
 #else
     KeSetTimerEx(&pTimer->NtTimer, DueTime, ulInterval, pMasterDpc);
diff --git a/src/VBox/Runtime/r3/isofs.cpp b/src/VBox/Runtime/r3/isofs.cpp
index fba89ab..2dacf03 100644
--- a/src/VBox/Runtime/r3/isofs.cpp
+++ b/src/VBox/Runtime/r3/isofs.cpp
@@ -334,7 +334,12 @@ static int rtIsoFsFindEntry(PRTISOFSFILE pFile, const char *pszFileName,
                     break;
 
                 char *pszName = RTStrAlloc(pCurRecord->name_len + 1);
-                AssertPtr(pszName);
+                if (RT_UNLIKELY(!pszName))
+                {
+                    rc = VERR_NO_STR_MEMORY;
+                    break;
+                }
+
                 Assert(idx + sizeof(RTISOFSDIRRECORD) < cbRead);
                 memcpy(pszName, &abBuffer[idx + sizeof(RTISOFSDIRRECORD)], pCurRecord->name_len);
                 pszName[pCurRecord->name_len] = '\0'; /* Force string termination. */
@@ -384,6 +389,7 @@ static int rtIsoFsFindEntry(PRTISOFSFILE pFile, const char *pszFileName,
                     }
                 }
                 idx += pCurRecord->record_length;
+                RTStrFree(pszName);
             }
         }
     }
diff --git a/src/VBox/Runtime/testcase/Makefile.kmk b/src/VBox/Runtime/testcase/Makefile.kmk
index 6a99a6e..3ee37d2 100644
--- a/src/VBox/Runtime/testcase/Makefile.kmk
+++ b/src/VBox/Runtime/testcase/Makefile.kmk
@@ -668,8 +668,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstRTR0DbgKrnlInfoDriverHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstRTR0DbgKrnlInfoDriverHardened_NAME = tstRTR0DbgKrnlInfoDriver
  tstRTR0DbgKrnlInfoDriverHardened_DEFS = PROGRAM_NAME_STR=\"tstRTR0DbgKrnlInfoDriver\"
- tstRTR0DbgKrnlInfoDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstRTR0DbgKrnlInfoDriver_TEMPLATE = VBoxR3TstDll
+ tstRTR0DbgKrnlInfoDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstRTR0DbgKrnlInfoDriver_TEMPLATE = VBoxR3HardenedTstDll
 else
  tstRTR0DbgKrnlInfoDriver_TEMPLATE = VBOXR3TSTEXE
 endif
@@ -690,8 +690,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstRTR0MemUserKernelDriverHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstRTR0MemUserKernelDriverHardened_NAME = tstRTR0MemUserKernelDriver
  tstRTR0MemUserKernelDriverHardened_DEFS = PROGRAM_NAME_STR=\"tstRTR0MemUserKernelDriver\"
- tstRTR0MemUserKernelDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstRTR0MemUserKernelDriver_TEMPLATE = VBoxR3TstDll
+ tstRTR0MemUserKernelDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstRTR0MemUserKernelDriver_TEMPLATE = VBoxR3HardenedTstDll
 else
  tstRTR0MemUserKernelDriver_TEMPLATE = VBOXR3TSTEXE
 endif
@@ -711,8 +711,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstRTR0SemMutexDriverHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstRTR0SemMutexDriverHardened_NAME = tstRTR0SemMutexDriver
  tstRTR0SemMutexDriverHardened_DEFS = PROGRAM_NAME_STR=\"tstRTR0SemMutexDriver\"
- tstRTR0SemMutexDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstRTR0SemMutexDriver_TEMPLATE = VBoxR3TstDll
+ tstRTR0SemMutexDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstRTR0SemMutexDriver_TEMPLATE = VBoxR3HardenedTstDll
 else
  tstRTR0SemMutexDriver_TEMPLATE = VBOXR3TSTEXE
 endif
@@ -732,8 +732,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstRTR0ThreadDriverHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstRTR0ThreadDriverHardened_NAME = tstRTR0ThreadDriver
  tstRTR0ThreadDriverHardened_DEFS = PROGRAM_NAME_STR=\"tstRTR0ThreadDriver\"
- tstRTR0ThreadDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstRTR0ThreadDriver_TEMPLATE = VBoxR3TstDll
+ tstRTR0ThreadDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstRTR0ThreadDriver_TEMPLATE = VBoxR3HardenedTstDll
 else
  tstRTR0ThreadDriver_TEMPLATE = VBOXR3TSTEXE
 endif
@@ -753,8 +753,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstRTR0TimerDriverHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstRTR0TimerDriverHardened_NAME = tstRTR0TimerDriver
  tstRTR0TimerDriverHardened_DEFS = PROGRAM_NAME_STR=\"tstRTR0TimerDriver\"
- tstRTR0TimerDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstRTR0TimerDriver_TEMPLATE = VBoxR3TstDll
+ tstRTR0TimerDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstRTR0TimerDriver_TEMPLATE = VBoxR3HardenedTstDll
 else
  tstRTR0TimerDriver_TEMPLATE = VBOXR3TSTEXE
 endif
@@ -774,8 +774,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstRTR0ThreadPreemptionDriverHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstRTR0ThreadPreemptionDriverHardened_NAME = tstRTR0ThreadPreemptionDriver
  tstRTR0ThreadPreemptionDriverHardened_DEFS = PROGRAM_NAME_STR=\"tstRTR0ThreadPreemptionDriver\"
- tstRTR0ThreadPreemptionDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstRTR0ThreadPreemptionDriver_TEMPLATE = VBoxR3TstDll
+ tstRTR0ThreadPreemptionDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstRTR0ThreadPreemptionDriver_TEMPLATE = VBoxR3HardenedTstDll
 else
  tstRTR0ThreadPreemptionDriver_TEMPLATE = VBOXR3TSTEXE
 endif
diff --git a/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp b/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp
index 4403776..8867938 100644
--- a/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp
@@ -64,6 +64,8 @@ DECLEXPORT(int) TSTR0DbgKrnlInfoSrvReqHandler(PSUPDRVSESSION pSession, uint32_t
     /*
      * The big switch.
      */
+    bool fSavedMayPanic = RTAssertSetMayPanic(false); /* Don't crash the host with strict builds! */
+    RTDBGKRNLINFO hKrnlInfo = NIL_RTDBGKRNLINFO;
     switch (uOperation)
     {
         case TSTRTR0DBGKRNLINFO_SANITY_OK:
@@ -75,7 +77,6 @@ DECLEXPORT(int) TSTR0DbgKrnlInfoSrvReqHandler(PSUPDRVSESSION pSession, uint32_t
 
         case TSTRTR0DBGKRNLINFO_BASIC:
         {
-            RTDBGKRNLINFO hKrnlInfo;
             RTR0TESTR0_CHECK_RC_BREAK(RTR0DbgKrnlInfoOpen(&hKrnlInfo, 1), VERR_INVALID_PARAMETER);
             RTR0TESTR0_CHECK_RC_BREAK(RTR0DbgKrnlInfoOpen(NULL, 0), VERR_INVALID_PARAMETER);
             RTR0TESTR0_CHECK_RC_BREAK(RTR0DbgKrnlInfoOpen(&hKrnlInfo, 0), VINF_SUCCESS);
@@ -90,6 +91,12 @@ DECLEXPORT(int) TSTR0DbgKrnlInfoSrvReqHandler(PSUPDRVSESSION pSession, uint32_t
             RTR0TESTR0_CHECK_RC_BREAK(RTR0DbgKrnlInfoQuerySymbol(NULL, "Test", "Test", &pvSymbol), VERR_INVALID_HANDLE);
             RTR0TESTR0_CHECK_RC_BREAK(RTR0DbgKrnlInfoQuerySymbol(hKrnlInfo, "TestModule", "Test", &pvSymbol), VERR_MODULE_NOT_FOUND);
             RTR0TESTR0_CHECK_RC_BREAK(RTR0DbgKrnlInfoQuerySymbol(hKrnlInfo, NULL, NULL, &pvSymbol), VERR_INVALID_PARAMETER);
+
+            RTDBGKRNLINFO hTmp = hKrnlInfo;
+            hKrnlInfo = NIL_RTDBGKRNLINFO;
+            RTR0DbgKrnlInfoRelease(hKrnlInfo);
+            uint32_t cRefs;
+            RTR0TESTR0_CHECK_MSG((cRefs = RTR0DbgKrnlInfoRelease(hKrnlInfo)) == 0, ("cRefs=%#x", cRefs));
             break;
         }
 
@@ -100,6 +107,9 @@ DECLEXPORT(int) TSTR0DbgKrnlInfoSrvReqHandler(PSUPDRVSESSION pSession, uint32_t
             RTStrPrintf(pszErr, cchErr, "!Unknown test #%d", uOperation);
             break;
     }
+    if (hKrnlInfo != NIL_RTDBGKRNLINFO)
+        RTR0DbgKrnlInfoRelease(hKrnlInfo);
+    RTAssertSetMayPanic(fSavedMayPanic);
 
     /* The error indicator is the '!' in the message buffer. */
     return VINF_SUCCESS;
diff --git a/src/VBox/Runtime/testcase/tstRTR0Timer.cpp b/src/VBox/Runtime/testcase/tstRTR0Timer.cpp
index 9bc3430..5affc65 100644
--- a/src/VBox/Runtime/testcase/tstRTR0Timer.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0Timer.cpp
@@ -446,6 +446,7 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
             if (rc == VERR_NOT_SUPPORTED)
             {
                 RTR0TestR0Info("one-shot timer are not supported, skipping\n");
+                RTR0TESTR0_SKIP();
                 break;
             }
             RTR0TESTR0_CHECK_RC_BREAK(rc, VINF_SUCCESS);
@@ -486,10 +487,10 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
             break;
         }
 
-#if !defined(RT_OS_SOLARIS) /* Not expected to work on all hosts. */
         case TSTRTR0TIMER_ONE_SHOT_RESTART:
         case TSTRTR0TIMER_ONE_SHOT_RESTART_HIRES:
         {
+#if !defined(RT_OS_SOLARIS) /* Not expected to work on all hosts. */
             /* Create a one-shot timer and restart it in the callback handler. */
             PRTTIMER pTimer;
             uint32_t fFlags = TSTRTR0TIMER_IS_HIRES(uOperation) ? RTTIMER_FLAGS_HIGH_RES : 0;
@@ -499,6 +500,7 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                 if (rc == VERR_NOT_SUPPORTED)
                 {
                     RTR0TestR0Info("one-shot timer are not supported, skipping\n");
+                    RTR0TESTR0_SKIP();
                     break;
                 }
                 RTR0TESTR0_CHECK_RC_BREAK(rc, VINF_SUCCESS);
@@ -515,14 +517,17 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                 } while (0);
                 RTR0TESTR0_CHECK_RC(RTTimerDestroy(pTimer), VINF_SUCCESS);
             }
+#else
+            RTR0TestR0Info("restarting from callback not supported on this platform\n");
+            RTR0TESTR0_SKIP();
+#endif
             break;
         }
-#endif
 
-#if !defined(RT_OS_SOLARIS) && !defined(RT_OS_WINDOWS) /* Not expected to work on all hosts. */
         case TSTRTR0TIMER_ONE_SHOT_DESTROY:
         case TSTRTR0TIMER_ONE_SHOT_DESTROY_HIRES:
         {
+#if !defined(RT_OS_SOLARIS) && !defined(RT_OS_WINDOWS) /* Not expected to work on all hosts. */
             /* Create a one-shot timer and destroy it in the callback handler. */
             PRTTIMER pTimer;
             uint32_t fFlags = TSTRTR0TIMER_IS_HIRES(uOperation) ? RTTIMER_FLAGS_HIGH_RES : 0;
@@ -532,6 +537,7 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                 if (rc == VERR_NOT_SUPPORTED)
                 {
                     RTR0TestR0Info("one-shot timer are not supported, skipping\n");
+                    RTR0TESTR0_SKIP();
                     break;
                 }
                 RTR0TESTR0_CHECK_RC_BREAK(rc, VINF_SUCCESS);
@@ -551,9 +557,12 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                 if (RT_FAILURE(State.rc))
                     RTR0TESTR0_CHECK_RC(RTTimerDestroy(pTimer), VINF_SUCCESS);
             }
+#else
+            RTR0TestR0Info("destroying from callback not supported on this platform\n");
+            RTR0TESTR0_SKIP();
+#endif
             break;
         }
-#endif
 
         case TSTRTR0TIMER_ONE_SHOT_SPECIFIC:
         case TSTRTR0TIMER_ONE_SHOT_SPECIFIC_HIRES:
@@ -576,6 +585,7 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                     if (rc == VERR_NOT_SUPPORTED)
                     {
                         RTR0TestR0Info("one-shot specific timer are not supported, skipping\n");
+                        RTR0TESTR0_SKIP();
                         break;
                     }
                     RTR0TESTR0_CHECK_RC_BREAK(rc, VINF_SUCCESS);
@@ -632,6 +642,8 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                 RTR0TESTR0_CHECK_MSG_BREAK(ASMAtomicUoReadU32(&State.cShots) == 10, ("cShots=%u\n", State.cShots));
                 if (tstRTR0TimerCheckShotIntervals(&State, uStartNsTS, u10HzAsNsMin, u10HzAsNsMax))
                     break;
+                RTThreadSleep(1); /** @todo RTTimerStop doesn't currently make sure the timer callback not is running
+                                   *        before returning on windows, linux (low res) and possible other plaforms. */
             }
             RTR0TESTR0_CHECK_RC(RTTimerDestroy(pTimer), VINF_SUCCESS);
             RTR0TESTR0_CHECK_RC(RTTimerDestroy(NULL), VINF_SUCCESS);
@@ -658,6 +670,8 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                     for (uint32_t k = 0; k < 1000 && ASMAtomicUoReadU32(&State.cShots) < 2; k++)
                         RTThreadSleep(1);
                     RTR0TESTR0_CHECK_RC_BREAK(RTTimerStop(pTimer), VINF_SUCCESS);
+                    RTThreadSleep(1); /** @todo RTTimerStop doesn't currently make sure the timer callback not is running
+                                       *        before returning on windows, linux (low res) and possible other plaforms. */
                 }
                 RTR0TESTR0_CHECK_RC(RTTimerDestroy(pTimer), VINF_SUCCESS);
             }
@@ -702,6 +716,7 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
             {
                 RTR0TestR0Info("RTTimerChangeInterval not supported, skipped");
                 RTR0TESTR0_CHECK_RC(RTTimerDestroy(pTimer), VINF_SUCCESS);
+                RTR0TESTR0_SKIP();
                 break;
             }
 
@@ -742,6 +757,7 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                     if (rc == VERR_NOT_SUPPORTED)
                     {
                         RTR0TestR0Info("specific timer are not supported, skipping\n");
+                        RTR0TESTR0_SKIP();
                         break;
                     }
                     RTR0TESTR0_CHECK_RC_BREAK(rc, VINF_SUCCESS);
@@ -758,6 +774,8 @@ DECLEXPORT(int) TSTRTR0TimerSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOpe
                         RTR0TESTR0_CHECK_MSG_BREAK(ASMAtomicReadU32(&State.cShots) > 5,
                                                    ("cShots=%u iCpu=%u i=%u iCurCpu=%u cNsElapsed=%'llu\n",
                                                     State.cShots, iCpu, i, RTMpCpuIdToSetIndex(RTMpCpuId()), cNsElapsed));
+                        RTThreadSleep(1); /** @todo RTTimerStop doesn't currently make sure the timer callback not is running
+                                           *        before returning on windows, linux (low res) and possible other plaforms. */
                         RTR0TESTR0_CHECK_MSG_BREAK(State.rc == VINF_SUCCESS, ("rc=%Rrc\n", State.rc));
                         RTR0TESTR0_CHECK_MSG_BREAK(!State.u.Specific.fFailed, ("iCpu=%u i=%u\n", iCpu, i));
                     }
diff --git a/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp b/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp
index 552158f..549695d 100644
--- a/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp
@@ -75,10 +75,8 @@ extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp)
         if (RTTestErrorCount(g_hTest) == 0)
         {
 #  if 1
-#   ifndef RT_OS_SOLARIS        /* Solaris cannot call back into cyclic subsystem from a cyclic callback. */
             RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_RESTART, "Restart one shot from callback");
             RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_DESTROY, "Destroy one shot from callback");
-#   endif
             RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_CSSD_LOOPS, "Create-start-stop-destroy loops");
             for (uint32_t i = 0; i <= 7; i++)
                 RTR3TestR0SimpleTestWithArg(TSTRTR0TIMER_PERIODIC_CHANGE_INTERVAL, i, "Change interval from callback, variation %u", i);
@@ -98,10 +96,8 @@ extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp)
         if (RTTestErrorCount(g_hTest) == 0)
         {
 #  if 1
-#   ifndef RT_OS_SOLARIS        /* Solaris cannot call back into cyclic subsystem from a cyclic callback. */
             RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_RESTART_HIRES, "Restart hires one shot from callback");
             RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_DESTROY_HIRES, "Destroy hires one shot from callback");
-#   endif
             RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_CSSD_LOOPS_HIRES, "Create-start-stop-destroy loops, hires");
             for (uint32_t i = 0; i <= 7; i++)
                 RTR3TestR0SimpleTestWithArg(TSTRTR0TIMER_PERIODIC_CHANGE_INTERVAL, i, "Change interval from callback, hires, variation %u", i);
diff --git a/src/VBox/Storage/Debug/VDDbgIoLog.cpp b/src/VBox/Storage/Debug/VDDbgIoLog.cpp
index 63d0619..1012bd8 100644
--- a/src/VBox/Storage/Debug/VDDbgIoLog.cpp
+++ b/src/VBox/Storage/Debug/VDDbgIoLog.cpp
@@ -744,7 +744,10 @@ VBOXDDU_DECL(int) VDDbgIoLogEventGetStartDiscard(VDIOLOGGER hIoLogger, uint64_t
                     *ppaRanges = paRanges;
                 }
                 else
+                {
                     pIoLogger->offReadNext -= sizeof(Entry);
+                    RTMemFree(paRanges);
+                }
             }
             else
                 rc = VERR_NO_MEMORY;
diff --git a/src/VBox/Storage/VCICache.cpp b/src/VBox/Storage/VCICache.cpp
index dd22fd0..1dade36 100644
--- a/src/VBox/Storage/VCICache.cpp
+++ b/src/VBox/Storage/VCICache.cpp
@@ -588,6 +588,8 @@ static int vciBlkMapLoad(PVCICACHE pStorage, uint64_t offBlkMap, uint32_t cBlkMa
                             pBlkMap->pRangesHead = pRangeCur;
                             pBlkMap->pRangesTail = pRangeCur;
                         }
+                        else
+                            RTMemFree(pRangeCur);
 
                         while (   RT_SUCCESS(rc)
                                && cBlocksLeft)
diff --git a/src/VBox/Storage/VD.cpp b/src/VBox/Storage/VD.cpp
index 8b4d69f..eed3638 100644
--- a/src/VBox/Storage/VD.cpp
+++ b/src/VBox/Storage/VD.cpp
@@ -675,11 +675,12 @@ static int vdAddBackends(RTLDRMOD hPlugin, PCVBOXHDDBACKEND *ppBackends, unsigne
            (g_cBackends + cBackends) * sizeof(PCVBOXHDDBACKEND));
     if (RT_UNLIKELY(!pTmp))
         return VERR_NO_MEMORY;
+    g_apBackends = pTmp;
+
     RTLDRMOD *pTmpPlugins = (RTLDRMOD*)RTMemRealloc(g_ahBackendPlugins,
            (g_cBackends + cBackends) * sizeof(RTLDRMOD));
     if (RT_UNLIKELY(!pTmpPlugins))
         return VERR_NO_MEMORY;
-    g_apBackends = pTmp;
     g_ahBackendPlugins = pTmpPlugins;
     memcpy(&g_apBackends[g_cBackends], ppBackends, cBackends * sizeof(PCVBOXHDDBACKEND));
     for (unsigned i = g_cBackends; i < g_cBackends + cBackends; i++)
@@ -705,11 +706,12 @@ static int vdAddCacheBackends(RTLDRMOD hPlugin, PCVDCACHEBACKEND *ppBackends, un
            (g_cCacheBackends + cBackends) * sizeof(PCVDCACHEBACKEND));
     if (RT_UNLIKELY(!pTmp))
         return VERR_NO_MEMORY;
+    g_apCacheBackends = pTmp;
+
     RTLDRMOD *pTmpPlugins = (RTLDRMOD*)RTMemRealloc(g_ahCacheBackendPlugins,
            (g_cCacheBackends + cBackends) * sizeof(RTLDRMOD));
     if (RT_UNLIKELY(!pTmpPlugins))
         return VERR_NO_MEMORY;
-    g_apCacheBackends = pTmp;
     g_ahCacheBackendPlugins = pTmpPlugins;
     memcpy(&g_apCacheBackends[g_cCacheBackends], ppBackends, cBackends * sizeof(PCVDCACHEBACKEND));
     for (unsigned i = g_cCacheBackends; i < g_cCacheBackends + cBackends; i++)
@@ -740,11 +742,13 @@ static int vdAddFilterBackends(RTLDRMOD hPlugin, PCVDFILTERBACKEND *ppBackends,
            (g_cFilterBackends + cBackends) * sizeof(PCVDFILTERBACKEND));
     if (RT_UNLIKELY(!pTmp))
         return VERR_NO_MEMORY;
+    g_apFilterBackends = pTmp;
+
     RTLDRMOD *pTmpPlugins = (RTLDRMOD*)RTMemRealloc(g_ahFilterBackendPlugins,
            (g_cFilterBackends + cBackends) * sizeof(RTLDRMOD));
     if (RT_UNLIKELY(!pTmpPlugins))
         return VERR_NO_MEMORY;
-    g_apFilterBackends = pTmp;
+
     g_ahFilterBackendPlugins = pTmpPlugins;
     memcpy(&g_apFilterBackends[g_cFilterBackends], ppBackends, cBackends * sizeof(PCVDFILTERBACKEND));
     for (unsigned i = g_cFilterBackends; i < g_cFilterBackends + cBackends; i++)
diff --git a/src/VBox/Storage/VMDK.cpp b/src/VBox/Storage/VMDK.cpp
index 502ec2f..40d6b5d 100644
--- a/src/VBox/Storage/VMDK.cpp
+++ b/src/VBox/Storage/VMDK.cpp
@@ -4849,7 +4849,10 @@ static int vmdkAllocGrain(PVMDKIMAGE pImage, PVMDKEXTENT pExtent, PVDIOCTX pIoCt
          * a new grain table and put the reference to it in the GDs. */
         uFileOffset = pExtent->uAppendPosition;
         if (!uFileOffset)
+        {
+            RTMemFree(pGrainAlloc);
             return VERR_INTERNAL_ERROR;
+        }
         Assert(!(uFileOffset % 512));
 
         uFileOffset = RT_ALIGN_64(uFileOffset, 512);
@@ -4859,7 +4862,10 @@ static int vmdkAllocGrain(PVMDKIMAGE pImage, PVMDKEXTENT pExtent, PVDIOCTX pIoCt
          * that support more than 32 bit sector numbers. So this shouldn't
          * ever happen on a valid extent. */
         if (uGTSector > UINT32_MAX)
+        {
+            RTMemFree(pGrainAlloc);
             return VERR_VD_VMDK_INVALID_HEADER;
+        }
 
         /* Write grain table by writing the required number of grain table
          * cache chunks. Allocate memory dynamically here or we flood the
@@ -4868,7 +4874,10 @@ static int vmdkAllocGrain(PVMDKIMAGE pImage, PVMDKEXTENT pExtent, PVDIOCTX pIoCt
         uint32_t *paGTDataTmp = (uint32_t *)RTMemTmpAllocZ(cbGTDataTmp);
 
         if (!paGTDataTmp)
+        {
+            RTMemFree(pGrainAlloc);
             return VERR_NO_MEMORY;
+        }
 
         memset(paGTDataTmp, '\0', cbGTDataTmp);
         rc = vdIfIoIntFileWriteMeta(pImage->pIfIo, pExtent->pFile->pStorage,
@@ -4880,6 +4889,7 @@ static int vmdkAllocGrain(PVMDKIMAGE pImage, PVMDKEXTENT pExtent, PVDIOCTX pIoCt
         else if (RT_FAILURE(rc))
         {
             RTMemTmpFree(paGTDataTmp);
+            RTMemFree(pGrainAlloc);
             return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: cannot write grain table allocation in '%s'"), pExtent->pszFullname);
         }
         pExtent->uAppendPosition = RT_ALIGN_64(  pExtent->uAppendPosition
diff --git a/src/VBox/Storage/testcase/tstVDIo.cpp b/src/VBox/Storage/testcase/tstVDIo.cpp
index 67e2bc1..2f27a32 100644
--- a/src/VBox/Storage/testcase/tstVDIo.cpp
+++ b/src/VBox/Storage/testcase/tstVDIo.cpp
@@ -1002,7 +1002,13 @@ static DECLCALLBACK(int) vdScriptHandlerIo(PVDSCRIPTARG paScriptArgs, void *pvUs
                 RTMemFree(paIoReq);
             }
             else
+            {
+                if (paIoReq)
+                    RTMemFree(paIoReq);
+                if RT_SUCCESS(rc)
+                    RTSemEventDestroy(EventSem);
                 rc = VERR_NO_MEMORY;
+            }
 
             tstVDIoTestDestroy(&IoTest);
         }
diff --git a/src/VBox/Storage/testcase/tstVDSnap.cpp b/src/VBox/Storage/testcase/tstVDSnap.cpp
index d32d3b5..19215fb 100644
--- a/src/VBox/Storage/testcase/tstVDSnap.cpp
+++ b/src/VBox/Storage/testcase/tstVDSnap.cpp
@@ -253,6 +253,13 @@ static int tstVDOpenCreateWriteMerge(PVDSNAPTEST pTest)
     uint64_t cbDisk = 0;
 
     paDiskSeg = (PVDDISKSEG)RTMemAllocZ(cDiskSegments * sizeof(VDDISKSEG));
+    if (!paDiskSeg)
+    {
+        RTPrintf("Failed to allocate memory for random disk segments\n");
+        g_cErrors++;
+        return VERR_NO_MEMORY;
+    }
+
     for (unsigned i = 0; i < cDiskSegments; i++)
     {
         paDiskSeg[i].off    = cbDisk;
@@ -274,6 +281,8 @@ static int tstVDOpenCreateWriteMerge(PVDSNAPTEST pTest)
         { \
             if (pbTestPattern) \
                 RTMemFree(pbTestPattern); \
+            if (paDiskSeg) \
+                RTMemFree(paDiskSeg); \
             VDDestroy(pVD); \
             g_cErrors++; \
             return rc; \
@@ -386,6 +395,8 @@ static int tstVDOpenCreateWriteMerge(PVDSNAPTEST pTest)
     VDDumpImages(pVD);
 
     VDDestroy(pVD);
+    if (paDiskSeg)
+        RTMemFree(paDiskSeg);
     if (pbTestPattern)
         RTMemFree(pbTestPattern);
 
diff --git a/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp b/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
index 503252d..3374cfb 100644
--- a/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
+++ b/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
@@ -514,7 +514,7 @@ IEM_DECL_IMPL_DEF(void, iemAImpl_test_u64,(uint64_t *puDst, uint64_t uSrc, uint3
             uTmp = uOld; \
             fEflTmp = *pfEFlags; \
             iemAImpl_ ## a_Mnemonic ## _u64(&uTmp, uSrc, &fEflTmp); \
-        } while (ASMAtomicCmpXchgExU64(puDst, uTmp, uOld, &uOld)); \
+        } while (!ASMAtomicCmpXchgExU64(puDst, uTmp, uOld, &uOld)); \
         *pfEFlags = fEflTmp; \
     } while (0)
 
@@ -581,7 +581,7 @@ IEM_DECL_IMPL_DEF(void, iemAImpl_xadd_u64_locked,(uint64_t *puDst, uint64_t *puR
         uTmpDst = uOld;
         fEflTmp = *pfEFlags;
         iemAImpl_add_u64(&uTmpDst, *puReg, pfEFlags);
-    } while (ASMAtomicCmpXchgExU64(puDst, uTmpDst, uOld, &uOld));
+    } while (!ASMAtomicCmpXchgExU64(puDst, uTmpDst, uOld, &uOld));
     *puReg    = uOld;
     *pfEFlags = fEflTmp;
 }
@@ -862,7 +862,7 @@ IEM_DECL_IMPL_DEF(void, iemAImpl_neg_u64,(uint64_t  *puDst,  uint32_t *pfEFlags)
             uTmp = uOld; \
             fEflTmp = *pfEFlags; \
             iemAImpl_ ## a_Mnemonic ## _u64(&uTmp, &fEflTmp); \
-        } while (ASMAtomicCmpXchgExU64(puDst, uTmp, uOld, &uOld)); \
+        } while (!ASMAtomicCmpXchgExU64(puDst, uTmp, uOld, &uOld)); \
         *pfEFlags = fEflTmp; \
     } while (0)
 
diff --git a/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h b/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
index f8f5599..11363b4 100644
--- a/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
+++ b/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
@@ -8736,7 +8736,7 @@ FNIEMOP_DEF(iemOp_outsb_Yb_DX)
     IEMOP_HLP_NO_LOCK_PREFIX();
     if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ))
     {
-        IEMOP_MNEMONIC("rep out DX,Yb");
+        IEMOP_MNEMONIC("rep outs DX,Yb");
         switch (pIemCpu->enmEffAddrMode)
         {
             case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_2(iemCImpl_rep_outs_op8_addr16, pIemCpu->iEffSeg, false);
@@ -8747,7 +8747,7 @@ FNIEMOP_DEF(iemOp_outsb_Yb_DX)
     }
     else
     {
-        IEMOP_MNEMONIC("out DX,Yb");
+        IEMOP_MNEMONIC("outs DX,Yb");
         switch (pIemCpu->enmEffAddrMode)
         {
             case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_2(iemCImpl_outs_op8_addr16, pIemCpu->iEffSeg, false);
diff --git a/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp b/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
index c8c9a4d..6a45b9d 100644
--- a/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
+++ b/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
@@ -1661,7 +1661,7 @@ static int iomInterpretXCHG(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCP
 #endif /* !IEM_USE_IEM_INSTEAD */
 
 /**
- * \#PF Handler callback for MMIO ranges.
+ * Common worker for the \#PF handler and IOMMMIOPhysHandler (APIC+VT-x).
  *
  * @returns VBox status code (appropriate for GC return).
  * @param   pVM         Pointer to the VM.
@@ -1672,7 +1672,8 @@ static int iomInterpretXCHG(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCP
  * @param   GCPhysFault The GC physical address corresponding to pvFault.
  * @param   pvUser      Pointer to the MMIO ring-3 range entry.
  */
-static VBOXSTRICTRC iomMMIOHandler(PVM pVM, PVMCPU pVCpu, uint32_t uErrorCode, PCPUMCTXCORE pCtxCore, RTGCPHYS GCPhysFault, void *pvUser)
+static VBOXSTRICTRC iomMmioCommonPfHandler(PVM pVM, PVMCPU pVCpu, uint32_t uErrorCode, PCPUMCTXCORE pCtxCore,
+                                           RTGCPHYS GCPhysFault, void *pvUser)
 {
     int rc = IOM_LOCK_SHARED(pVM);
 #ifndef IN_RING3
@@ -1682,7 +1683,7 @@ static VBOXSTRICTRC iomMMIOHandler(PVM pVM, PVMCPU pVCpu, uint32_t uErrorCode, P
     AssertRC(rc);
 
     STAM_PROFILE_START(&pVM->iom.s.StatRZMMIOHandler, a);
-    Log(("iomMMIOHandler: GCPhys=%RGp uErr=%#x rip=%RGv\n", GCPhysFault, uErrorCode, (RTGCPTR)pCtxCore->rip));
+    Log(("iomMmioCommonPfHandler: GCPhys=%RGp uErr=%#x rip=%RGv\n", GCPhysFault, uErrorCode, (RTGCPTR)pCtxCore->rip));
 
     PIOMMMIORANGE pRange = (PIOMMMIORANGE)pvUser;
     Assert(pRange);
@@ -1758,6 +1759,14 @@ static VBOXSTRICTRC iomMMIOHandler(PVM pVM, PVMCPU pVCpu, uint32_t uErrorCode, P
     STAM_PROFILE_STOP(&pVM->iom.s.StatRZMMIOHandler, a);
     PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));
     iomMmioReleaseRange(pVM, pRange);
+    if (RT_SUCCESS(rcStrict))
+        return rcStrict;
+    if (   rcStrict == VERR_IEM_ASPECT_NOT_IMPLEMENTED
+        || rcStrict == VERR_IEM_INSTR_NOT_IMPLEMENTED)
+    {
+        Log(("IOM: Hit unsupported IEM feature!\n"));
+        rcStrict = VINF_EM_RAW_EMULATE_INSTR;
+    }
     return rcStrict;
 
 #else
@@ -1922,7 +1931,7 @@ DECLEXPORT(VBOXSTRICTRC) iomMmioPfHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uError
 {
     LogFlow(("iomMmioPfHandler: GCPhys=%RGp uErr=%#x pvFault=%RGv rip=%RGv\n",
              GCPhysFault, (uint32_t)uErrorCode, pvFault, (RTGCPTR)pCtxCore->rip));
-    return iomMMIOHandler(pVM, pVCpu, (uint32_t)uErrorCode, pCtxCore, GCPhysFault, pvUser);
+    return iomMmioCommonPfHandler(pVM, pVCpu, (uint32_t)uErrorCode, pCtxCore, GCPhysFault, pvUser);
 }
 
 
@@ -1955,7 +1964,7 @@ VMMDECL(VBOXSTRICTRC) IOMMMIOPhysHandler(PVM pVM, PVMCPU pVCpu, RTGCUINT uErrorC
     iomMmioRetainRange(pRange);
     IOM_UNLOCK_SHARED(pVM);
 
-    VBOXSTRICTRC rcStrict = iomMMIOHandler(pVM, pVCpu, (uint32_t)uErrorCode, pCtxCore, GCPhysFault, pRange);
+    VBOXSTRICTRC rcStrict = iomMmioCommonPfHandler(pVM, pVCpu, (uint32_t)uErrorCode, pCtxCore, GCPhysFault, pRange);
 
     iomMmioReleaseRange(pVM, pRange);
     return VBOXSTRICTRC_VAL(rcStrict);
@@ -1981,6 +1990,10 @@ PGM_ALL_CB2_DECL(VBOXSTRICTRC) iomMmioHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GC
      * Validate the range.
      */
     int rc = IOM_LOCK_SHARED(pVM);
+#ifndef IN_RING3
+    if (rc == VERR_SEM_BUSY)
+        return VINF_IOM_R3_MMIO_READ_WRITE;
+#endif
     AssertRC(rc);
     Assert(pRange == iomMmioGetRange(pVM, pVCpu, GCPhysFault));
 
diff --git a/src/VBox/VMM/VMMR0/GIMR0Hv.cpp b/src/VBox/VMM/VMMR0/GIMR0Hv.cpp
index f9b9d08..e6040f7 100644
--- a/src/VBox/VMM/VMMR0/GIMR0Hv.cpp
+++ b/src/VBox/VMM/VMMR0/GIMR0Hv.cpp
@@ -98,6 +98,14 @@ VMM_INT_DECL(int) gimR0HvUpdateParavirtTsc(PVM pVM, uint64_t u64Offset)
     if (RT_UNLIKELY(!fHvTscEnabled))
         return VERR_GIM_PVTSC_NOT_ENABLED;
 
+    /** @todo this is buggy when large pages are used due to a PGM limitation, see
+     *        @bugref{7532}.
+     *
+     *        In any case, we do not ever update this page while the guest is
+     *        running after setting it up (in ring-3, see gimR3HvEnableTscPage()) as
+     *        the TSC offset is handled in the VMCS/VMCB (HM) or by trapping RDTSC
+     *        (raw-mode). */
+#if 0
     PCGIMHV          pcHv     = &pVM->gim.s.u.Hv;
     PCGIMMMIO2REGION pcRegion = &pcHv->aMmio2Regions[GIM_HV_REF_TSC_PAGE_REGION_IDX];
     PGIMHVREFTSC     pRefTsc  = (PGIMHVREFTSC)pcRegion->CTX_SUFF(pvPage);
@@ -106,7 +114,7 @@ VMM_INT_DECL(int) gimR0HvUpdateParavirtTsc(PVM pVM, uint64_t u64Offset)
     /*
      * Hyper-V reports the reference time in 100 nanosecond units.
      */
-    uint64_t u64Tsc100Ns = TMCpuTicksPerSecond(pVM) / RT_NS_10MS;
+    uint64_t u64Tsc100Ns = pcHv->cTscTicksPerSecond / RT_NS_10MS;
     int64_t i64TscOffset = (int64_t)u64Offset / u64Tsc100Ns;
 
     /*
@@ -127,6 +135,7 @@ VMM_INT_DECL(int) gimR0HvUpdateParavirtTsc(PVM pVM, uint64_t u64Offset)
 
     Assert(pRefTsc->u32TscSequence != 0);
     Assert(pRefTsc->u32TscSequence != UINT32_C(0xffffffff));
+#endif
     return VINF_SUCCESS;
 }
 
diff --git a/src/VBox/VMM/VMMR0/HMR0.cpp b/src/VBox/VMM/VMMR0/HMR0.cpp
index c37ac76..92ba5f1 100644
--- a/src/VBox/VMM/VMMR0/HMR0.cpp
+++ b/src/VBox/VMM/VMMR0/HMR0.cpp
@@ -121,8 +121,12 @@ static struct
         /** VMX MSR values */
         VMXMSRS                     Msrs;
 
-        /* Last instruction error */
+        /** Last instruction error. */
         uint32_t                    ulLastInstrError;
+
+        /** Set if we've called SUPR0EnableVTx(true) and should disable it during
+         * module termination. */
+        bool                        fCalledSUPR0EnableVTx;
     } vmx;
 
     /** AMD-V information. */
@@ -719,7 +723,14 @@ VMMR0_INT_DECL(int) HMR0Term(void)
          * Simple if the host OS manages VT-x.
          */
         Assert(g_HmR0.fGlobalInit);
-        rc = SUPR0EnableVTx(false /* fEnable */);
+
+        if (g_HmR0.vmx.fCalledSUPR0EnableVTx)
+        {
+            rc = SUPR0EnableVTx(false /* fEnable */);
+            g_HmR0.vmx.fCalledSUPR0EnableVTx = false;
+        }
+        else
+            rc = VINF_SUCCESS;
 
         for (unsigned iCpu = 0; iCpu < RT_ELEMENTS(g_HmR0.aCpuInfo); iCpu++)
         {
@@ -918,6 +929,7 @@ static DECLCALLBACK(int32_t) hmR0EnableAllCpuOnce(void *pvUser)
         rc = SUPR0EnableVTx(true /* fEnable */);
         if (RT_SUCCESS(rc))
         {
+            g_HmR0.vmx.fCalledSUPR0EnableVTx = true;
             /* If the host provides a VT-x init API, then we'll rely on that for global init. */
             g_HmR0.fGlobalInit = pVM->hm.s.fGlobalInit = true;
         }
diff --git a/src/VBox/VMM/VMMR0/HMSVMR0.cpp b/src/VBox/VMM/VMMR0/HMSVMR0.cpp
index dc0356d..fe9205e 100644
--- a/src/VBox/VMM/VMMR0/HMSVMR0.cpp
+++ b/src/VBox/VMM/VMMR0/HMSVMR0.cpp
@@ -2014,10 +2014,17 @@ static void hmR0SvmSaveGuestState(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
      * Guest TR.
      * Fixup TR attributes so it's compatible with Intel. Important when saved-states are used
      * between Intel and AMD. See @bugref{6208} comment #39.
+     * ASSUME that it's normally correct and that we're in 32-bit or 64-bit mode.
      */
     HMSVM_SAVE_SEG_REG(TR, tr);
-    if (CPUMIsGuestInLongModeEx(pMixedCtx))
-        pMixedCtx->tr.Attr.n.u4Type = X86_SEL_TYPE_SYS_386_TSS_BUSY;
+    if (pMixedCtx->tr.Attr.n.u4Type != X86_SEL_TYPE_SYS_386_TSS_BUSY)
+    {
+        if (   pMixedCtx->tr.Attr.n.u4Type == X86_SEL_TYPE_SYS_386_TSS_AVAIL
+            || CPUMIsGuestInLongModeEx(pMixedCtx))
+            pMixedCtx->tr.Attr.n.u4Type = X86_SEL_TYPE_SYS_386_TSS_BUSY;
+        else if (pMixedCtx->tr.Attr.n.u4Type == X86_SEL_TYPE_SYS_286_TSS_AVAIL)
+            pMixedCtx->tr.Attr.n.u4Type = X86_SEL_TYPE_SYS_286_TSS_BUSY;
+    }
 
     /*
      * Guest Descriptor-Table registers.
@@ -4794,13 +4801,25 @@ HMSVM_EXIT_DECL hmR0SvmExitIOInstr(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pS
         if (enmAddrMode != (IEMMODE)-1)
         {
             uint64_t cbInstr = pVmcb->ctrl.u64ExitInfo2 - pCtx->rip;
-            if (cbInstr <= 15 && cbInstr >= 2)
+            if (cbInstr <= 15 && cbInstr >= 1)
             {
+                Assert(cbInstr >= 1U + IoExitInfo.n.u1REP);
                 if (IoExitInfo.n.u1Type == SVM_IOIO_WRITE)
                 {
-                    if (pVM->hm.s.svm.u32Features & AMD_CPUID_SVM_FEATURE_EDX_NRIP_SAVE)
+                    /* Don't know exactly how to detect whether u3SEG is valid, currently
+                       only enabling it for Bulldozer and later with NRIP.  OS/2 broke on
+                       2384 Opterons when only checking NRIP. */
+                    if (   (pVM->hm.s.svm.u32Features & AMD_CPUID_SVM_FEATURE_EDX_NRIP_SAVE)
+                        && pVM->cpum.ro.GuestFeatures.enmMicroarch >= kCpumMicroarch_AMD_15h_First)
+                    {
+                        AssertMsg(IoExitInfo.n.u3SEG == X86_SREG_DS || cbInstr > 1U + IoExitInfo.n.u1REP,
+                                  ("u32Seg=%d cbInstr=%d u1REP=%d", IoExitInfo.n.u3SEG, cbInstr, IoExitInfo.n.u1REP));
                         rcStrict = IEMExecStringIoWrite(pVCpu, cbValue, enmAddrMode, IoExitInfo.n.u1REP, (uint8_t)cbInstr,
                                                         IoExitInfo.n.u3SEG);
+                    }
+                    else if (cbInstr == 1U + IoExitInfo.n.u1REP)
+                        rcStrict = IEMExecStringIoWrite(pVCpu, cbValue, enmAddrMode, IoExitInfo.n.u1REP, (uint8_t)cbInstr,
+                                                        X86_SREG_DS);
                     else
                         rcStrict = IEMExecOne(pVCpu);
                     STAM_COUNTER_INC(&pVCpu->hm.s.StatExitIOStringWrite);
@@ -4944,6 +4963,7 @@ HMSVM_EXIT_DECL hmR0SvmExitIOInstr(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pS
                   || rcStrict == VINF_EM_RAW_EMULATE_INSTR
                   || rcStrict == VINF_EM_DBG_BREAKPOINT
                   || rcStrict == VINF_EM_RAW_GUEST_TRAP
+                  || rcStrict == VINF_EM_RAW_TO_R3
                   || rcStrict == VINF_TRPM_XCPT_DISPATCHED, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
     }
 #endif
diff --git a/src/VBox/VMM/VMMR0/HMVMXR0.cpp b/src/VBox/VMM/VMMR0/HMVMXR0.cpp
index 47fd170..9fea584 100644
--- a/src/VBox/VMM/VMMR0/HMVMXR0.cpp
+++ b/src/VBox/VMM/VMMR0/HMVMXR0.cpp
@@ -8132,16 +8132,10 @@ static void hmR0VmxClearEventVmcs(PVMCPU pVCpu)
     Log4Func(("vcpu[%d]\n", pVCpu->idCpu));
 
     if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT)
-    {
         hmR0VmxClearIntWindowExitVmcs(pVCpu);
-        Assert(!pVCpu->hm.s.Event.fPending);
-    }
 
     if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT)
-    {
         hmR0VmxClearNmiWindowExitVmcs(pVCpu);
-        Assert(!pVCpu->hm.s.Event.fPending);
-    }
 
     if (!pVCpu->hm.s.Event.fPending)
         return;
diff --git a/src/VBox/VMM/VMMR0/VMMR0.cpp b/src/VBox/VMM/VMMR0/VMMR0.cpp
index 7fd3902..e07a64c 100644
--- a/src/VBox/VMM/VMMR0/VMMR0.cpp
+++ b/src/VBox/VMM/VMMR0/VMMR0.cpp
@@ -473,6 +473,7 @@ static DECLCALLBACK(void) vmmR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, void
             /** @todo r=bird: I don't believe the above. The linux code is clearly enabling
              *        preemption after doing the callout (one or two functions up the
              *        call chain). */
+            /** @todo r=ramshankar: See @bugref{5313} comment #30. */
             RTTHREADPREEMPTSTATE ParanoidPreemptState = RTTHREADPREEMPTSTATE_INITIALIZER;
             RTThreadPreemptDisable(&ParanoidPreemptState);
 
diff --git a/src/VBox/VMM/VMMR3/CFGM.cpp b/src/VBox/VMM/VMMR3/CFGM.cpp
index c2591ed..d7e35e0 100644
--- a/src/VBox/VMM/VMMR3/CFGM.cpp
+++ b/src/VBox/VMM/VMMR3/CFGM.cpp
@@ -1183,6 +1183,19 @@ VMMR3DECL(int) CFGMR3ConstructDefaultTree(PVM pVM)
     rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);
     UPDATERC();
 
+    /*
+     * VMMDev.
+     */
+    rc = CFGMR3InsertNode(pDevices, "VMMDev", &pDev);
+    UPDATERC();
+    rc = CFGMR3InsertNode(pDev,     "0", &pInst);
+    UPDATERC();
+    rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);
+    UPDATERC();
+    rc = CFGMR3InsertInteger(pInst, "Trusted",              1); /* boolean */
+    UPDATERC();
+    rc = CFGMR3InsertInteger(pCfg,  "RamSize",              128U * _1M);
+    UPDATERC();
 
 
     /*
diff --git a/src/VBox/VMM/VMMR3/GIMHv.cpp b/src/VBox/VMM/VMMR3/GIMHv.cpp
index 99c711a..a30d14b 100644
--- a/src/VBox/VMM/VMMR3/GIMHv.cpp
+++ b/src/VBox/VMM/VMMR3/GIMHv.cpp
@@ -130,14 +130,14 @@ VMMR3_INT_DECL(int) gimR3HvInit(PVM pVM)
     PGIMMMIO2REGION pRegion = &pHv->aMmio2Regions[GIM_HV_HYPERCALL_PAGE_REGION_IDX];
     pRegion->iRegion    = GIM_HV_HYPERCALL_PAGE_REGION_IDX;
     pRegion->fRCMapping = false;
-    pRegion->cbRegion   = PAGE_SIZE;
+    pRegion->cbRegion   = PAGE_SIZE;  /* Sanity checked in gimR3HvLoad(), gimR3HvEnableTscPage() & gimR3HvEnableHypercallPage() */
     pRegion->GCPhysPage = NIL_RTGCPHYS;
     RTStrCopy(pRegion->szDescription, sizeof(pRegion->szDescription), "Hyper-V hypercall page");
 
     pRegion = &pHv->aMmio2Regions[GIM_HV_REF_TSC_PAGE_REGION_IDX];
     pRegion->iRegion    = GIM_HV_REF_TSC_PAGE_REGION_IDX;
     pRegion->fRCMapping = false;
-    pRegion->cbRegion   = PAGE_SIZE;
+    pRegion->cbRegion   = PAGE_SIZE;  /* Sanity checked in gimR3HvLoad(), gimR3HvEnableTscPage() & gimR3HvEnableHypercallPage() */
     pRegion->GCPhysPage = NIL_RTGCPHYS;
     RTStrCopy(pRegion->szDescription, sizeof(pRegion->szDescription), "Hyper-V TSC page");
 
@@ -241,6 +241,7 @@ VMMR3_INT_DECL(int) gimR3HvInit(PVM pVM)
 VMMR3_INT_DECL(int) gimR3HvInitCompleted(PVM pVM)
 {
     PGIMHV pHv = &pVM->gim.s.u.Hv;
+    pHv->cTscTicksPerSecond = TMCpuTicksPerSecond(pVM);
 
     /*
      * Determine interface capabilities based on the version.
@@ -333,7 +334,12 @@ VMMR3_INT_DECL(void) gimR3HvReset(PVM pVM)
     for (unsigned i = 0; i < RT_ELEMENTS(pHv->aMmio2Regions); i++)
     {
         PGIMMMIO2REGION pRegion = &pHv->aMmio2Regions[i];
+#if 0
         GIMR3Mmio2Unmap(pVM, pRegion);
+#else
+        pRegion->fMapped    = false;
+        pRegion->GCPhysPage = NIL_RTGCPHYS;
+#endif
     }
 
     /*
@@ -438,8 +444,6 @@ VMMR3_INT_DECL(int) gimR3HvSave(PVM pVM, PSSMHANDLE pSSM)
  */
 VMMR3_INT_DECL(int) gimR3HvLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion)
 {
-    PGIMHV pHv = &pVM->gim.s.u.Hv;
-
     /*
      * Load the Hyper-V SSM version first.
      */
@@ -452,6 +456,12 @@ VMMR3_INT_DECL(int) gimR3HvLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion)
                                  GIM_HV_SAVED_STATE_VERSION);
 
     /*
+     * Update the TSC frequency from TM.
+     */
+    PGIMHV pHv = &pVM->gim.s.u.Hv;
+    pHv->cTscTicksPerSecond = TMCpuTicksPerSecond(pVM);
+
+    /*
      * Load per-VM MSRs.
      */
     SSMR3GetU64(pSSM, &pHv->u64GuestOsIdMsr);
@@ -478,6 +488,11 @@ VMMR3_INT_DECL(int) gimR3HvLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion)
     SSMR3GetGCPhys(pSSM, &pRegion->GCPhysPage);
     rc = SSMR3GetStrZ(pSSM, pRegion->szDescription, sizeof(pRegion->szDescription));
     AssertRCReturn(rc, rc);
+
+    if (pRegion->cbRegion != PAGE_SIZE)
+        return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Hypercall page region size %u invalid, expected %u"),
+                                pRegion->cbRegion, PAGE_SIZE);
+
     if (MSR_GIM_HV_HYPERCALL_IS_ENABLED(pHv->u64HypercallMsr))
     {
         Assert(pRegion->GCPhysPage != NIL_RTGCPHYS);
@@ -504,6 +519,11 @@ VMMR3_INT_DECL(int) gimR3HvLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion)
     SSMR3GetStrZ(pSSM,    pRegion->szDescription, sizeof(pRegion->szDescription));
     rc = SSMR3GetU32(pSSM, &uTscSequence);
     AssertRCReturn(rc, rc);
+
+    if (pRegion->cbRegion != PAGE_SIZE)
+        return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("TSC page region size %u invalid, expected %u"),
+                                pRegion->cbRegion, PAGE_SIZE);
+
     if (MSR_GIM_HV_REF_TSC_IS_ENABLED(pHv->u64TscPageMsr))
     {
         Assert(pRegion->GCPhysPage != NIL_RTGCPHYS);
@@ -559,6 +579,11 @@ VMMR3_INT_DECL(int) gimR3HvEnableTscPage(PVM pVM, RTGCPHYS GCPhysTscPage, bool f
      * Map the TSC-page at the specified address.
      */
     Assert(!pRegion->fMapped);
+
+    /** @todo this is buggy when large pages are used due to a PGM limitation, see
+     *        @bugref{7532}. Instead of the overlay style mapping, we just
+     *               rewrite guest memory directly. */
+#if 0
     rc = GIMR3Mmio2Map(pVM, pRegion, GCPhysTscPage);
     if (RT_SUCCESS(rc))
     {
@@ -574,7 +599,8 @@ VMMR3_INT_DECL(int) gimR3HvEnableTscPage(PVM pVM, RTGCPHYS GCPhysTscPage, bool f
         PGIMHVREFTSC pRefTsc = (PGIMHVREFTSC)pRegion->pvPageR3;
         Assert(pRefTsc);
 
-        uint64_t const u64TscKHz = TMCpuTicksPerSecond(pVM) / UINT64_C(1000);
+        PGIMHV pHv = &pVM->gim.s.u.Hv;
+        uint64_t const u64TscKHz = pHv->cTscTicksPerSecond / UINT64_C(1000);
         uint32_t       u32TscSeq = 1;
         if (   fUseThisTscSeq
             && uTscSeq < UINT32_C(0xfffffffe))
@@ -591,8 +617,44 @@ VMMR3_INT_DECL(int) gimR3HvEnableTscPage(PVM pVM, RTGCPHYS GCPhysTscPage, bool f
     }
     else
         LogRelFunc(("GIMR3Mmio2Map failed. rc=%Rrc\n", rc));
-
     return VERR_GIM_OPERATION_FAILED;
+#else
+    AssertReturn(pRegion->cbRegion == PAGE_SIZE, VERR_GIM_IPE_2);
+    PGIMHVREFTSC pRefTsc = (PGIMHVREFTSC)RTMemAllocZ(PAGE_SIZE);
+    if (RT_UNLIKELY(!pRefTsc))
+    {
+        LogRelFunc(("Failed to alloc %u bytes\n", PAGE_SIZE));
+        return VERR_NO_MEMORY;
+    }
+
+    PGIMHV pHv = &pVM->gim.s.u.Hv;
+    uint64_t const u64TscKHz = pHv->cTscTicksPerSecond / UINT64_C(1000);
+    uint32_t       u32TscSeq = 1;
+    if (   fUseThisTscSeq
+        && uTscSeq < UINT32_C(0xfffffffe))
+        u32TscSeq = uTscSeq + 1;
+    pRefTsc->u32TscSequence  = u32TscSeq;
+    pRefTsc->u64TscScale     = ((INT64_C(10000) << 32) / u64TscKHz) << 32;
+    pRefTsc->i64TscOffset    = 0;
+
+    rc = PGMPhysSimpleWriteGCPhys(pVM, GCPhysTscPage, pRefTsc, sizeof(*pRefTsc));
+    if (RT_SUCCESS(rc))
+    {
+        LogRel(("GIM: HyperV: Enabled TSC page at %#RGp - u64TscScale=%#RX64 u64TscKHz=%#RX64 (%'RU64) Seq=%#RU32\n",
+                GCPhysTscPage, pRefTsc->u64TscScale, u64TscKHz, u64TscKHz, pRefTsc->u32TscSequence));
+
+        pRegion->GCPhysPage = GCPhysTscPage;
+        pRegion->fMapped = true;
+        TMR3CpuTickParavirtEnable(pVM);
+    }
+    else
+    {
+        LogRelFunc(("GIM: HyperV: PGMPhysSimpleWriteGCPhys failed. rc=%Rrc\n", rc));
+        rc = VERR_GIM_OPERATION_FAILED;
+    }
+    RTMemFree(pRefTsc);
+    return rc;
+#endif
 }
 
 
@@ -608,8 +670,12 @@ VMMR3_INT_DECL(int) gimR3HvDisableTscPage(PVM pVM)
     PGIMMMIO2REGION pRegion = &pHv->aMmio2Regions[GIM_HV_REF_TSC_PAGE_REGION_IDX];
     if (pRegion->fMapped)
     {
+#if 0
         GIMR3Mmio2Unmap(pVM, pRegion);
         Assert(!pRegion->fMapped);
+#else
+        pRegion->fMapped = false;
+#endif
         LogRel(("GIM: HyperV: Disabled TSC-page\n"));
 
         TMR3CpuTickParavirtDisable(pVM);
@@ -630,8 +696,12 @@ VMMR3_INT_DECL(int) gimR3HvDisableHypercallPage(PVM pVM)
     PGIMMMIO2REGION pRegion = &pHv->aMmio2Regions[GIM_HV_HYPERCALL_PAGE_REGION_IDX];
     if (pRegion->fMapped)
     {
+#if 0
         GIMR3Mmio2Unmap(pVM, pRegion);
         Assert(!pRegion->fMapped);
+#else
+        pRegion->fMapped = false;
+#endif
         for (VMCPUID i = 0; i < pVM->cCpus; i++)
             VMMHypercallsDisable(&pVM->aCpus[i]);
         LogRel(("GIM: HyperV: Disabled Hypercall-page\n"));
@@ -673,6 +743,11 @@ VMMR3_INT_DECL(int) gimR3HvEnableHypercallPage(PVM pVM, RTGCPHYS GCPhysHypercall
      * Map the hypercall-page at the specified address.
      */
     Assert(!pRegion->fMapped);
+
+    /** @todo this is buggy when large pages are used due to a PGM limitation, see
+     *        @bugref{7532}. Instead of the overlay style mapping, we just
+     *               rewrite guest memory directly. */
+#if 0
     int rc = GIMR3Mmio2Map(pVM, pRegion, GCPhysHypercallPage);
     if (RT_SUCCESS(rc))
     {
@@ -710,5 +785,51 @@ VMMR3_INT_DECL(int) gimR3HvEnableHypercallPage(PVM pVM, RTGCPHYS GCPhysHypercall
 
     LogRel(("GIM: HyperV: GIMR3Mmio2Map failed. rc=%Rrc\n", rc));
     return rc;
+#else
+    AssertReturn(pRegion->cbRegion == PAGE_SIZE, VERR_GIM_IPE_3);
+    void *pvHypercallPage = RTMemAllocZ(PAGE_SIZE);
+    if (RT_UNLIKELY(!pvHypercallPage))
+    {
+        LogRelFunc(("Failed to alloc %u bytes\n", PAGE_SIZE));
+        return VERR_NO_MEMORY;
+    }
+
+    /*
+     * Patch the hypercall-page.
+     */
+    size_t cbWritten = 0;
+    int rc = VMMPatchHypercall(pVM, pvHypercallPage, PAGE_SIZE, &cbWritten);
+    if (   RT_SUCCESS(rc)
+        && cbWritten < PAGE_SIZE)
+    {
+        uint8_t *pbLast = (uint8_t *)pvHypercallPage + cbWritten;
+        *pbLast = 0xc3;  /* RET */
+
+        rc = PGMPhysSimpleWriteGCPhys(pVM, GCPhysHypercallPage, pvHypercallPage, PAGE_SIZE);
+        if (RT_SUCCESS(rc))
+        {
+            /*
+             * Notify VMM that hypercalls are now enabled for all VCPUs.
+             */
+            for (VMCPUID i = 0; i < pVM->cCpus; i++)
+                VMMHypercallsEnable(&pVM->aCpus[i]);
+
+            pRegion->GCPhysPage = GCPhysHypercallPage;
+            pRegion->fMapped = true;
+            LogRel(("GIM: HyperV: Enabled hypercalls at %#RGp\n", GCPhysHypercallPage));
+        }
+        else
+            LogRel(("GIM: HyperV: PGMPhysSimpleWriteGCPhys failed during hypercall page setup. rc=%Rrc\n", rc));
+    }
+    else
+    {
+        if (rc == VINF_SUCCESS)
+            rc = VERR_GIM_OPERATION_FAILED;
+        LogRel(("GIM: HyperV: VMMPatchHypercall failed. rc=%Rrc cbWritten=%u\n", rc, cbWritten));
+    }
+
+    RTMemFree(pvHypercallPage);
+    return rc;
+#endif
 }
 
diff --git a/src/VBox/VMM/VMMR3/GIMKvm.cpp b/src/VBox/VMM/VMMR3/GIMKvm.cpp
index bb9c7ba..15a75de 100644
--- a/src/VBox/VMM/VMMR3/GIMKvm.cpp
+++ b/src/VBox/VMM/VMMR3/GIMKvm.cpp
@@ -188,13 +188,15 @@ VMMR3_INT_DECL(int) gimR3KvmInit(PVM pVM)
  */
 VMMR3_INT_DECL(int) gimR3KvmInitCompleted(PVM pVM)
 {
+    PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
+    pKvm->cTscTicksPerSecond = TMCpuTicksPerSecond(pVM);
+
     if (TMR3CpuTickIsFixedRateMonotonic(pVM, true /* fWithParavirtEnabled */))
     {
         /** @todo We might want to consider just enabling this bit *always*. As far
          *        as I can see in the Linux guest, the "TSC_STABLE" bit is only
          *        translated as a "monotonic" bit which even in Async systems we
          *        -should- be reporting a strictly monotonic TSC to the guest.  */
-        PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
         pKvm->uBaseFeat |= GIM_KVM_BASE_FEAT_TSC_STABLE;
 
         CPUMCPUIDLEAF HyperLeaf;
@@ -207,7 +209,6 @@ VMMR3_INT_DECL(int) gimR3KvmInitCompleted(PVM pVM)
         int rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
         AssertLogRelRCReturn(rc, rc);
     }
-
     return VINF_SUCCESS;
 }
 
@@ -337,6 +338,12 @@ VMMR3_INT_DECL(int) gimR3KvmLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion)
                                  GIM_KVM_SAVED_STATE_VERSION);
 
     /*
+     * Update the TSC frequency from TM.
+     */
+    PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
+    pKvm->cTscTicksPerSecond = TMCpuTicksPerSecond(pVM);
+
+    /*
      * Load per-VCPU data.
      */
     for (uint32_t i = 0; i < pVM->cCpus; i++)
@@ -366,7 +373,6 @@ VMMR3_INT_DECL(int) gimR3KvmLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion)
     /*
      * Load per-VM data.
      */
-    PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
     SSMR3GetU64(pSSM, &pKvm->u64WallClockMsr);
     rc = SSMR3GetU32(pSSM, &pKvm->uBaseFeat);
     AssertRCReturn(rc, rc);
@@ -417,7 +423,8 @@ VMMR3_INT_DECL(int) gimR3KvmEnableSystemTime(PVM pVM, PVMCPU pVCpu, PGIMKVMCPU p
      *     tsc >>= -i8TscShift;
      * time = ((tsc * SysTime.u32TscScale) >> 32) + SysTime.u64NanoTS
      */
-    uint64_t u64TscFreq   = TMCpuTicksPerSecond(pVM);
+    PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
+    uint64_t u64TscFreq   = pKvm->cTscTicksPerSecond;
     SystemTime.i8TscShift = 0;
     while (u64TscFreq > 2 * RT_NS_1SEC_64)
     {
diff --git a/src/VBox/VMM/include/GIMHvInternal.h b/src/VBox/VMM/include/GIMHvInternal.h
index 48980b9..03a5902 100644
--- a/src/VBox/VMM/include/GIMHvInternal.h
+++ b/src/VBox/VMM/include/GIMHvInternal.h
@@ -487,6 +487,8 @@ typedef struct GIMHV
 #if HC_ARCH_BITS == 32
     uint32_t                    u32Alignment1;
 #endif
+    /** The TSC frequency (in HZ) reported to the guest. */
+    uint64_t                    cTscTicksPerSecond;
 
     /** Array of MMIO2 regions. */
     GIMMMIO2REGION              aMmio2Regions[GIM_HV_REGION_IDX_MAX + 1];
diff --git a/src/VBox/VMM/include/GIMKvmInternal.h b/src/VBox/VMM/include/GIMKvmInternal.h
index c6c93e6..8fb8764 100644
--- a/src/VBox/VMM/include/GIMKvmInternal.h
+++ b/src/VBox/VMM/include/GIMKvmInternal.h
@@ -194,14 +194,14 @@ typedef struct GIMKVM
 {
     /** Wall-clock MSR. */
     uint64_t                    u64WallClockMsr;
-
     /**  CPUID features: Basic. */
     uint32_t                    uBaseFeat;
-
     /** Whether GIM needs to trap #UD exceptions. */
     bool                        fTrapXcptUD;
     /** Disassembler opcode of hypercall instruction native for this host CPU. */
     uint16_t                    uOpCodeNative;
+    /** The TSC frequency (in HZ) reported to the guest. */
+    uint64_t                    cTscTicksPerSecond;
 } GIMKVM;
 /** Pointer to per-VM GIM KVM instance data. */
 typedef GIMKVM *PGIMKVM;
diff --git a/src/VBox/VMM/include/HMInternal.h b/src/VBox/VMM/include/HMInternal.h
index 0877a39..4c3bf4e 100644
--- a/src/VBox/VMM/include/HMInternal.h
+++ b/src/VBox/VMM/include/HMInternal.h
@@ -499,7 +499,7 @@ typedef struct HM
 
     /** HMR0Init was run */
     bool                    fHMR0Init;
-    bool                    u8Alignment1[7];
+    bool                    u8Alignment1[3];
 
     STAMCOUNTER             StatTprPatchSuccess;
     STAMCOUNTER             StatTprPatchFailure;
@@ -509,6 +509,8 @@ typedef struct HM
 /** Pointer to HM VM instance data. */
 typedef HM *PHM;
 
+AssertCompileMemberAlignment(HM, StatTprPatchSuccess, 8);
+
 /* Maximum number of cached entries. */
 #define VMCSCACHE_MAX_ENTRY                             128
 
diff --git a/src/VBox/VMM/testcase/Makefile.kmk b/src/VBox/VMM/testcase/Makefile.kmk
index 5f3d41d..2b7e48b 100644
--- a/src/VBox/VMM/testcase/Makefile.kmk
+++ b/src/VBox/VMM/testcase/Makefile.kmk
@@ -228,8 +228,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstGlobalConfigHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstGlobalConfigHardened_NAME     = tstGlobalConfig
  tstGlobalConfigHardened_DEFS     = PROGRAM_NAME_STR=\"tstGlobalConfig\"
- tstGlobalConfigHardened_SOURCES  = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstGlobalConfig_TEMPLATE = VBoxR3TstDll
+ tstGlobalConfigHardened_SOURCES  = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstGlobalConfig_TEMPLATE = VBoxR3HardenedTstDll
 else
  tstGlobalConfig_TEMPLATE = VBOXR3TSTEXE
 endif
@@ -253,8 +253,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstMMHyperHeapHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstMMHyperHeapHardened_NAME     = tstMMHyperHeap
  tstMMHyperHeapHardened_DEFS     = PROGRAM_NAME_STR=\"tstMMHyperHeap\"
- tstMMHyperHeapHardened_SOURCES  = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstMMHyperHeap_TEMPLATE = VBoxR3TstDll
+ tstMMHyperHeapHardened_SOURCES  = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstMMHyperHeap_TEMPLATE = VBoxR3HardenedTstDll
 else
  tstMMHyperHeap_TEMPLATE = VBOXR3TSTEXE
 endif
@@ -268,8 +268,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstSSMHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstSSMHardened_NAME     = tstSSM
  tstSSMHardened_DEFS     = PROGRAM_NAME_STR=\"tstSSM\"
- tstSSMHardened_SOURCES  = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstSSM_TEMPLATE        = VBoxR3TstDll
+ tstSSMHardened_SOURCES  = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstSSM_TEMPLATE        = VBoxR3HardenedTstDll
 else
  tstSSM_TEMPLATE        = VBOXR3TSTEXE
 endif
@@ -291,8 +291,8 @@ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
  tstCFGMHardened_TEMPLATE = VBoxR3HardenedTstExe
  tstCFGMHardened_NAME     = tstCFGM
  tstCFGMHardened_DEFS     = PROGRAM_NAME_STR=\"tstCFGM\"
- tstCFGMHardened_SOURCES  = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp
- tstCFGM_TEMPLATE       = VBoxR3TstDll
+ tstCFGMHardened_SOURCES  = ../../HostDrivers/Support/SUPR3HardenedMainTemplateTestcase.cpp
+ tstCFGM_TEMPLATE       = VBoxR3HardenedTstDll
 else
  tstCFGM_TEMPLATE       = VBOXR3TSTEXE
 endif
diff --git a/src/VBox/VMM/testcase/tstVMREQ.cpp b/src/VBox/VMM/testcase/tstVMREQ.cpp
index 9ce53d6..4a1d24f 100644
--- a/src/VBox/VMM/testcase/tstVMREQ.cpp
+++ b/src/VBox/VMM/testcase/tstVMREQ.cpp
@@ -211,17 +211,7 @@ static DECLCALLBACK(int)
 tstVMREQConfigConstructor(PUVM pUVM, PVM pVM, void *pvUser)
 {
     NOREF(pvUser);
-    int rc = CFGMR3ConstructDefaultTree(pVM);
-    if (RT_SUCCESS(rc))
-    {
-        /* Disable HM, otherwise it will fail on machines without unrestricted guest execution
-         * because the allocation of HM_VTX_TOTAL_DEVHEAP_MEM will fail -- no VMMDev */
-        PCFGMNODE pRoot = CFGMR3GetRoot(pVM);
-        rc = CFGMR3InsertInteger(pRoot, "HMEnabled", false);
-        if (RT_FAILURE(rc))
-            RTPrintf("CFGMR3InsertInteger(pRoot,\"HMEnabled\",) -> %Rrc\n", rc);
-    }
-    return rc;
+    return CFGMR3ConstructDefaultTree(pVM);
 }
 
 /**
diff --git a/src/VBox/ValidationKit/common/webutils.py b/src/VBox/ValidationKit/common/webutils.py
index d41097d..2b344dd 100644
--- a/src/VBox/ValidationKit/common/webutils.py
+++ b/src/VBox/ValidationKit/common/webutils.py
@@ -26,7 +26,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100880 $"
+__version__ = "$Revision: 101411 $"
 
 # Standard Python imports.
 import os;
@@ -77,7 +77,9 @@ def escapeAttrToStr(oObject):
     """
     Stringifies the object and hands it to escapeAttr.  May return unicode string.
     """
-    return escapeAttr(oObject);
+    if utils.isString(oObject):
+        return escapeAttr(oObject);
+    return escapeAttr(str(oObject));
 
 def escapeAttrJavaScriptStringDQ(sText):
     """ Escapes a javascript string that is to be emitted between double quotes. """
diff --git a/src/VBox/ValidationKit/testdriver/reporter.py b/src/VBox/ValidationKit/testdriver/reporter.py
index e19a2fe..0f1f49f 100644
--- a/src/VBox/ValidationKit/testdriver/reporter.py
+++ b/src/VBox/ValidationKit/testdriver/reporter.py
@@ -27,7 +27,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100880 $"
+__version__ = "$Revision: 101366 $"
 
 
 # Standard Python imports.
@@ -202,14 +202,14 @@ class ReporterBase(object):
         self._xmlWrite([ '<Test timestamp="%s" name="%s">' % (sTsIso, self._xmlEscAttr(sName),), ]);
         self.atTests.append((sName, self.cErrors, self.fTimedOut));
         self.fTimedOut = False;
-        return self.log(1, '%-50s: TESTING' % (self._testGetFullName()), sCaller, sTsPrf);
+        return self.log(1, ' %-50s: TESTING' % (self._testGetFullName()), sCaller, sTsPrf);
 
     def testValue(self, sName, sValue, sUnit, sCaller):
         """ Reports a benchmark value or something simiarlly useful. """
         (sTsPrf, sTsIso) = utils.getTimePrefixAndIsoTimestamp();
         self._xmlWrite([ '<Value timestamp="%s" name="%s" unit="%s" value="%s"/>'
                          % (sTsIso, self._xmlEscAttr(sName), self._xmlEscAttr(sUnit), self._xmlEscAttr(sValue)), ]);
-        return self.log(0, '  %-48s: %12s %s' % (sName, sValue, sUnit), sCaller, sTsPrf);
+        return self.log(0, '**  %-48s: %12s %s' % (sName, sValue, sUnit), sCaller, sTsPrf);
 
     def testFailure(self, sDetails, sCaller):
         """ Reports a failure. """
@@ -239,16 +239,16 @@ class ReporterBase(object):
         if cErrors == 0:
             if fSkipped is not True:
                 self._xmlWrite([ '  <Passed timestamp="%s"/>' % (sTsIso,), '</Test>' ],);
-                self.log(1, '%-50s: PASSED' % (sFullName,), sCaller, sTsPrf);
+                self.log(1, '** %-50s: PASSED' % (sFullName,), sCaller, sTsPrf);
             else:
                 self._xmlWrite([ '  <Skipped timestamp="%s"/>' % (sTsIso,), '</Test>' ]);
-                self.log(1, '%-50s: SKIPPED' % (sFullName,), sCaller, sTsPrf);
+                self.log(1, '** %-50s: SKIPPED' % (sFullName,), sCaller, sTsPrf);
         elif fTimedOut:
             self._xmlWrite([ '  <TimedOut timestamp="%s" errors="%d"/>' % (sTsIso, cErrors), '</Test>' ]);
-            self.log(0, '%-50s: TIMED-OUT - %d errors' % (sFullName, cErrors), sCaller, sTsPrf);
+            self.log(0, '** %-50s: TIMED-OUT - %d errors' % (sFullName, cErrors), sCaller, sTsPrf);
         else:
             self._xmlWrite([ '  <Failed timestamp="%s" errors="%d"/>' % (sTsIso, cErrors), '</Test>' ]);
-            self.log(0, '%-50s: FAILED - %d errors' % (sFullName, cErrors), sCaller, sTsPrf);
+            self.log(0, '** %-50s: FAILED - %d errors' % (sFullName, cErrors), sCaller, sTsPrf);
 
         # Flush buffers when reaching the last test.
         if len(self.atTests) == 0:
@@ -430,7 +430,7 @@ class LocalReporter(ReporterBase):
         self.iOtherFile += 1;
         sDstFilename = os.path.join(self.sLogDir, 'other-%d-%s.log' \
                                     % (iOtherFile, os.path.splitext(os.path.basename(sSrcFilename))[0]));
-        self.log(0, 'Other log file: %s - %s (%s)' % (sDstFilename, sDescription, sSrcFilename), sCaller, sTsPrf);
+        self.log(0, '** Other log file: %s - %s (%s)' % (sDstFilename, sDescription, sSrcFilename), sCaller, sTsPrf);
 
         # Open the destination file and copy over the data.
         fRc = True;
@@ -873,7 +873,7 @@ def logXcptWorker(iLevel, fIncErrors, sPrefix="", sText=None, cFrames=1):
                     asInfo.append('Stack:')
                     asInfo = asInfo + traceback.format_stack(oTraceback.tb_frame.f_back, cFrames);
             except:
-                g_oReporter.log(0, 'internal-error: Hit exception #2! %s' % (traceback.format_exc()), sCaller, sTsPrf);
+                g_oReporter.log(0, '** internal-error: Hit exception #2! %s' % (traceback.format_exc()), sCaller, sTsPrf);
 
             if len(asInfo) > 0:
                 # Do the logging.
@@ -886,11 +886,11 @@ def logXcptWorker(iLevel, fIncErrors, sPrefix="", sText=None, cFrames=1):
                 g_oReporter.log(iLevel, 'No exception info...', sCaller, sTsPrf);
                 rc = -3;
         except:
-            g_oReporter.log(0, 'internal-error: Hit exception! %s' % (traceback.format_exc()), None, sTsPrf);
+            g_oReporter.log(0, '** internal-error: Hit exception! %s' % (traceback.format_exc()), None, sTsPrf);
             rc = -2;
     else:
-        g_oReporter.log(0, 'internal-error: No exception! %s'
-                      % (utils.getCallerName(iFrame=3)), utils.getCallerName(iFrame=3), sTsPrf);
+        g_oReporter.log(0, '** internal-error: No exception! %s'
+                        % (utils.getCallerName(iFrame=3)), utils.getCallerName(iFrame=3), sTsPrf);
         rc = -1;
 
     g_oLock.release();
@@ -1049,7 +1049,7 @@ def error(sText):
     g_oLock.acquire();
     g_oReporter.testIncErrors();
     try:
-        g_oReporter.log(0, 'error: %s' % (sText), utils.getCallerName(), utils.getTimePrefix());
+        g_oReporter.log(0, '** error: %s' % (sText), utils.getCallerName(), utils.getTimePrefix());
     except:
         pass;
     g_oLock.release();
@@ -1065,7 +1065,7 @@ def errorXcpt(sText=None, cFrames=1):
     Always returns False for the convenience of methods returning boolean
     success indicators.
     """
-    logXcptWorker(0, True, "error: ", sText, cFrames);
+    logXcptWorker(0, True, '** error: ', sText, cFrames);
     return False;
 
 def errorTimeout(sText):
@@ -1080,7 +1080,7 @@ def errorTimeout(sText):
     g_oLock.acquire();
     g_oReporter.testSetTimedOut();
     try:
-        g_oReporter.log(0, 'timeout-error: %s' % (sText), utils.getCallerName(), utils.getTimePrefix());
+        g_oReporter.log(0, '** timeout-error: %s' % (sText), utils.getCallerName(), utils.getTimePrefix());
     except:
         pass;
     g_oLock.release();
@@ -1098,7 +1098,7 @@ def fatal(sText):
     g_oLock.acquire();
     g_oReporter.testIncErrors();
     try:
-        g_oReporter.log(0, 'fatal error: %s' % (sText), utils.getCallerName(), utils.getTimePrefix());
+        g_oReporter.log(0, '** fatal error: %s' % (sText), utils.getCallerName(), utils.getTimePrefix());
     except:
         pass
     g_oLock.release();
@@ -1115,7 +1115,7 @@ def fatalXcpt(sText=None, cFrames=1):
     Always returns False for the convenience of methods returning boolean
     success indicators.
     """
-    logXcptWorker(1, True, "fatal error: ", sText, cFrames);
+    logXcptWorker(0, True, "** fatal error: ", sText, cFrames);
     return False;
 
 def addLogFile(sFilename, sKind, sDescription = '', sAltName = None):
diff --git a/src/VBox/ValidationKit/testdriver/vbox.py b/src/VBox/ValidationKit/testdriver/vbox.py
index fb8e846..f822487 100644
--- a/src/VBox/ValidationKit/testdriver/vbox.py
+++ b/src/VBox/ValidationKit/testdriver/vbox.py
@@ -27,7 +27,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100967 $"
+__version__ = "$Revision: 101327 $"
 
 
 # Standard Python imports.
@@ -254,6 +254,28 @@ class ComError(object):
         return True;
 
     @staticmethod
+    def getXcptResult(oXcpt):
+        """
+        Gets the result code for an exception.
+        Returns COM status code (or E_UNEXPECTED).
+        """
+        if platform.system() == 'Windows':
+            # The DISP_E_EXCEPTION + excptinfo fun needs checking up, only
+            # empirical info on it so far.
+            try:
+                hrXcpt = oXcpt.hresult;
+            except AttributeError:
+                hrXcpt = ComError.E_UNEXPECTED;
+            if hrXcpt == ComError.DISP_E_EXCEPTION and oXcpt.excepinfo is not None:
+                hrXcpt = oXcpt.excepinfo[5];
+        else:
+            try:
+                hrXcpt = oXcpt.errno;
+            except AttributeError:
+                hrXcpt = ComError.E_UNEXPECTED;
+        return hrXcpt;
+
+    @staticmethod
     def equal(oXcpt, hr):
         """
         Checks if the ComException e is not equal to the COM status code hr.
diff --git a/src/VBox/ValidationKit/testdriver/vboxinstaller.py b/src/VBox/ValidationKit/testdriver/vboxinstaller.py
index 3c29a49..c543f34 100755
--- a/src/VBox/ValidationKit/testdriver/vboxinstaller.py
+++ b/src/VBox/ValidationKit/testdriver/vboxinstaller.py
@@ -30,7 +30,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100880 $"
+__version__ = "$Revision: 101367 $"
 
 
 # Standard Python imports.
@@ -49,6 +49,7 @@ sys.path.append(g_ksValidationKitDir);
 
 # Validation Kit imports.
 from common             import utils, webutils;
+from common.constants   import rtexitcode;
 from testdriver         import reporter;
 from testdriver.base    import TestDriverBase;
 
@@ -176,7 +177,7 @@ class VBoxInstallerTestDriver(TestDriverBase):
         """
         fRc = True;
         if 'execute' not in self.asActions and 'all' not in self.asActions:
-            fRc = self._executeSubDriver([ 'cleanup-after', ]);
+            fRc = self._executeSubDriver([ 'cleanup-after', ], fMaySkip = False);
 
         if not self._killAllVBoxProcesses():
             fRc = False;
@@ -198,7 +199,7 @@ class VBoxInstallerTestDriver(TestDriverBase):
         Forward this to the sub testdriver first, then do the default pid file
         based cleanup and finally swipe the scene with the heavy artillery.
         """
-        fRc1 = self._executeSubDriver([ 'abort', ]);
+        fRc1 = self._executeSubDriver([ 'abort', ], fMaySkip = False);
         fRc2 = TestDriverBase.actionAbort(self);
         fRc3 = self._killAllVBoxProcesses();
         return fRc1 and fRc2 and fRc3;
@@ -328,11 +329,13 @@ class VBoxInstallerTestDriver(TestDriverBase):
 
         return False;
 
-    def _executeSync(self, asArgs):
+    def _executeSync(self, asArgs, fMaySkip = False):
         """
         Executes a child process synchronously.
-        Returns True if the process executed successfully and returned 0,
-        otherwise False is returned.
+
+        Returns True if the process executed successfully and returned 0.
+        Returns None if fMaySkip is true and the child exits with RTEXITCODE_SKIPPED.
+        Returns False for all other cases.
         """
         reporter.log('Executing: %s' % (asArgs, ));
         reporter.flushall();
@@ -342,6 +345,8 @@ class VBoxInstallerTestDriver(TestDriverBase):
             reporter.errorXcpt();
             return False;
         reporter.log('Exit code: %s (%s)' % (iRc, asArgs));
+        if fMaySkip and iRc == rtexitcode.RTEXITCODE_SKIPPED:
+            return None;
         return iRc is 0;
 
     def _sudoExecuteSync(self, asArgs):
@@ -361,14 +366,14 @@ class VBoxInstallerTestDriver(TestDriverBase):
         reporter.log('Exit code [sudo]: %s (%s)' % (iRc, asArgs));
         return (iRc is 0, iRc);
 
-    def _executeSubDriver(self, asActions):
+    def _executeSubDriver(self, asActions, fMaySkip = True):
         """
         Execute the sub testdriver with the specified action.
         """
         asArgs = list(self._asSubDriver)
         asArgs.append('--no-wipe-clean');
         asArgs.extend(asActions);
-        return self._executeSync(asArgs);
+        return self._executeSync(asArgs, fMaySkip = fMaySkip);
 
     def _maybeUnpackArchive(self, sMaybeArchive, fNonFatal = False):
         """
diff --git a/src/VBox/ValidationKit/testmanager/core/base.py b/src/VBox/ValidationKit/testmanager/core/base.py
index 336f4d0..4f73e37 100644
--- a/src/VBox/ValidationKit/testmanager/core/base.py
+++ b/src/VBox/ValidationKit/testmanager/core/base.py
@@ -27,7 +27,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100880 $"
+__version__ = "$Revision: 101410 $"
 
 
 # Standard python imports.
@@ -637,7 +637,8 @@ class ModelDataBase(ModelBase): # pylint: disable=R0903
         return (sValue, sError);
 
     @staticmethod
-    def validateStr(sValue, cchMin = 0, cchMax = 4096, aoNilValues = tuple([None, '']), fAllowNull = True, fAllowUnicodeSymbols = False): # pylint: disable=C0301
+    def validateStr(sValue, cchMin = 0, cchMax = 4096, aoNilValues = tuple([None, '']), fAllowNull = True,
+                    fAllowUnicodeSymbols = False):
         """ Validates a string field. """
         if sValue in aoNilValues:
             return (sValue, None if fAllowNull else 'Mandatory.');
diff --git a/src/VBox/ValidationKit/testmanager/core/report.py b/src/VBox/ValidationKit/testmanager/core/report.py
index 58cf0f5..a0c1f46 100644
--- a/src/VBox/ValidationKit/testmanager/core/report.py
+++ b/src/VBox/ValidationKit/testmanager/core/report.py
@@ -26,7 +26,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100880 $"
+__version__ = "$Revision: 101412 $"
 
 
 # Validation Kit imports.
@@ -609,10 +609,9 @@ class ReportGraphModel(ReportModelBase): # pylint: disable=R0903
         self._oDb.execute('SELECT   DISTINCT *\n'
                           'FROM     BuildCategories\n'
                           'WHERE    idBuildCategory IN (\n'
-                          '   SELECT DISTINCT Builds.idBuildCategory\n'
-                          '   FROM  TestSets, Builds\n'
+                          '   SELECT DISTINCT idBuildCategory\n'
+                          '   FROM  TestSets\n'
                           '   WHERE ' + self._getEligibleTestSetPeriod(fLeadingAnd = False) +
-                          '     AND TestSets.idBuild       = Builds.idBuild\n'
                           ')\n'
                           + sSelectedBuildCats +
                           'ORDER BY sProduct,\n'
diff --git a/src/VBox/ValidationKit/testmanager/core/testresults.py b/src/VBox/ValidationKit/testmanager/core/testresults.py
index 80e8869..5a6cc41 100644
--- a/src/VBox/ValidationKit/testmanager/core/testresults.py
+++ b/src/VBox/ValidationKit/testmanager/core/testresults.py
@@ -29,7 +29,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100880 $"
+__version__ = "$Revision: 101413 $"
 # Standard python imports.
 import unittest;
 
@@ -519,37 +519,17 @@ class TestResultLogic(ModelLogicBase): # pylint: disable=R0903
     ksResultsGroupingTypeTestCase   = 'ResultsGroupingTypeTestCase'
     ksResultsGroupingTypeSchedGroup = 'ResultsGroupingTypeSchedGroup'
 
-    ksBaseTables = 'BuildCategories, Builds, TestBoxes, TestResults, TestCases, TestCaseArgs,\n' \
-                 + '       TestSets LEFT OUTER JOIN Builds AS TestSuiteBits\n' \
-                   '                ON TestSets.idBuildTestSuite = TestSuiteBits.idBuild\n';
-
-    ksBasePreCondition = 'TestSets.idTestSet         = TestResults.idTestSet\n' \
-                + '   AND TestResults.idTestResultParent is NULL\n' \
-                + '   AND TestSets.idBuild           = Builds.idBuild\n' \
-                + '   AND Builds.tsExpire            > TestSets.tsCreated\n' \
-                + '   AND Builds.tsEffective        <= TestSets.tsCreated\n' \
-                + '   AND Builds.idBuildCategory     = BuildCategories.idBuildCategory\n' \
-                + '   AND TestSets.idGenTestBox      = TestBoxes.idGenTestBox\n' \
-                + '   AND TestSets.idGenTestCase     = TestCases.idGenTestCase\n' \
-                + '   AND TestSets.idGenTestCaseArgs = TestCaseArgs.idGenTestCaseArgs\n'
     kdResultGroupingMap = {
-        ksResultsGroupingTypeNone:       (ksBaseTables,
-                                          ksBasePreCondition,),
-
-        ksResultsGroupingTypeTestGroup:  (ksBaseTables,
-                                          ksBasePreCondition + '   AND TestSets.idTestGroup',),
-
-        ksResultsGroupingTypeBuildRev:   (ksBaseTables,
-                                          ksBasePreCondition + '   AND Builds.iRevision',),
-
-        ksResultsGroupingTypeTestBox:    (ksBaseTables,
-                                          ksBasePreCondition + '   AND TestSets.idTestBox',),
-
-        ksResultsGroupingTypeTestCase:   (ksBaseTables,
-                                          ksBasePreCondition + '   AND TestSets.idTestCase',),
-
-        ksResultsGroupingTypeSchedGroup: (ksBaseTables,
-                                          ksBasePreCondition + '   AND TestBoxes.idSchedGroup',),
+        ksResultsGroupingTypeNone:       ('TestSets',            None,                      None),
+        ksResultsGroupingTypeTestGroup:  ('TestSets',            'TestSets.idTestGroup',    None),
+        ksResultsGroupingTypeTestBox:    ('TestSets',            'TestSets.idTestBox',      None),
+        ksResultsGroupingTypeTestCase:   ('TestSets',            'TestSets.idTestCase',     None),
+        ksResultsGroupingTypeBuildRev:   ('TestSets, Builds',    'Builds.iRevision',
+                                          ' AND Builds.idBuild      = TestSets.idBuild'
+                                          ' AND Builds.tsExpire     > TestSets.tsCreated'
+                                          ' AND Builds.tsEffective <= TestSets.tsCreated' ),
+        ksResultsGroupingTypeSchedGroup: ('TestSets, TestBoxes', 'TestBoxes.idSchedGroup',
+                                          ' AND TestSets.idGenTestBox = TestBoxes.idGenTestBox'),
     }
 
     def _getTimePeriodQueryPart(self, tsNow, sInterval):
@@ -574,40 +554,6 @@ class TestResultLogic(ModelLogicBase): # pylint: disable=R0903
                      sTsNow, sInterval );
         return sRet
 
-    def _getSqlQueryForGroupSearch(self, sWhat, tsNow, sInterval, enmResultsGroupingType, iResultsGroupingValue, fOnlyFailures):
-        """
-        Returns an SQL query that limits SELECT result
-        in order to satisfy @param enmResultsGroupingType.
-        """
-
-        if enmResultsGroupingType is None:
-            raise TMExceptionBase('Unknown grouping type')
-
-        if enmResultsGroupingType not in self.kdResultGroupingMap:
-            raise TMExceptionBase('Unknown grouping type')
-
-        # Get SQL query parameters
-        sTables, sCondition = self.kdResultGroupingMap[enmResultsGroupingType]
-
-        # Extend SQL query with time period limitation
-        sTimePeriodQuery = self._getTimePeriodQueryPart(tsNow, sInterval)
-
-        if iResultsGroupingValue is not None:
-            sCondition += ' = %d' % iResultsGroupingValue + '\n';
-        sCondition += '   AND ' + sTimePeriodQuery
-
-        # Extend the condition with test status limitations if requested.
-        if fOnlyFailures:
-            sCondition += '\n   AND TestSets.enmStatus != \'success\'::TestStatus_T' \
-                          '\n   AND TestSets.enmStatus != \'running\'::TestStatus_T';
-
-        # Assemble the query.
-        sQuery  = 'SELECT DISTINCT %s\n'  % sWhat
-        sQuery += 'FROM   %s\n'  % sTables
-        sQuery += 'WHERE  %s\n' % sCondition
-
-        return sQuery
-
     def fetchResultsForListing(self, iStart, cMaxRows, tsNow, sInterval, enmResultsGroupingType, iResultsGroupingValue,
                                fOnlyFailures):
         """
@@ -624,46 +570,94 @@ class TestResultLogic(ModelLogicBase): # pylint: disable=R0903
         Raises exception on error.
         """
 
-        sWhat =        'TestSets.idTestSet,\n' \
-                '       BuildCategories.idBuildCategory,\n' \
-                '       BuildCategories.sProduct,\n' \
-                '       BuildCategories.sRepository,\n' \
-                '       BuildCategories.sBranch,\n' \
-                '       BuildCategories.sType,\n' \
-                '       Builds.idBuild,\n' \
-                '       Builds.sVersion,\n' \
-                '       Builds.iRevision,\n' \
-                '       TestBoxes.sOs,\n' \
-                '       TestBoxes.sOsVersion,\n' \
-                '       TestBoxes.sCpuArch,\n' \
-                '       TestBoxes.sCpuVendor,\n' \
-                '       TestBoxes.sCpuName,\n' \
-                '       TestBoxes.cCpus,\n' \
-                '       TestBoxes.fCpuHwVirt,\n' \
-                '       TestBoxes.fCpuNestedPaging,\n' \
-                '       TestBoxes.fCpu64BitGuest,\n' \
-                '       TestBoxes.idTestBox,\n' \
-                '       TestBoxes.sName,\n' \
-                '       TestResults.tsCreated,\n' \
-                '       COALESCE(TestResults.tsElapsed, CURRENT_TIMESTAMP - TestResults.tsCreated),\n' \
-                '       TestSets.enmStatus,\n' \
-                '       TestResults.cErrors,\n' \
-                '       TestCases.idTestCase,\n' \
-                '       TestCases.sName,\n' \
-                '       TestCases.sBaseCmd,\n' \
-                '       TestCaseArgs.sArgs,\n' \
-                '       TestSuiteBits.idBuild AS idBuildTestSuite,\n' \
-                '       TestSuiteBits.iRevision AS iRevisionTestSuite,\n' \
-                '       (TestSets.tsDone IS NULL) SortRunningFirst' \
-                ;
-
-        sSqlQuery = self._getSqlQueryForGroupSearch(sWhat, tsNow, sInterval, enmResultsGroupingType, iResultsGroupingValue,
-                                                    fOnlyFailures);
-
-        sSqlQuery += 'ORDER BY SortRunningFirst DESC, TestSets.idTestSet DESC\n';
-        sSqlQuery += 'LIMIT %s OFFSET %s\n' % (cMaxRows, iStart,);
-
-        self._oDb.execute(sSqlQuery);
+        #
+        # Get SQL query parameters
+        #
+        if enmResultsGroupingType is None:
+            raise TMExceptionBase('Unknown grouping type')
+        if enmResultsGroupingType not in self.kdResultGroupingMap:
+            raise TMExceptionBase('Unknown grouping type')
+        sTables, sGroupingField, sGroupingCondition = self.kdResultGroupingMap[enmResultsGroupingType]
+
+        #
+        # Construct the query.
+        #
+        sQuery  = 'SELECT DISTINCT TestSets.idTestSet,\n' \
+                  '       BuildCategories.idBuildCategory,\n' \
+                  '       BuildCategories.sProduct,\n' \
+                  '       BuildCategories.sRepository,\n' \
+                  '       BuildCategories.sBranch,\n' \
+                  '       BuildCategories.sType,\n' \
+                  '       Builds.idBuild,\n' \
+                  '       Builds.sVersion,\n' \
+                  '       Builds.iRevision,\n' \
+                  '       TestBoxes.sOs,\n' \
+                  '       TestBoxes.sOsVersion,\n' \
+                  '       TestBoxes.sCpuArch,\n' \
+                  '       TestBoxes.sCpuVendor,\n' \
+                  '       TestBoxes.sCpuName,\n' \
+                  '       TestBoxes.cCpus,\n' \
+                  '       TestBoxes.fCpuHwVirt,\n' \
+                  '       TestBoxes.fCpuNestedPaging,\n' \
+                  '       TestBoxes.fCpu64BitGuest,\n' \
+                  '       TestBoxes.idTestBox,\n' \
+                  '       TestBoxes.sName,\n' \
+                  '       TestResults.tsCreated,\n' \
+                  '       COALESCE(TestResults.tsElapsed, CURRENT_TIMESTAMP - TestResults.tsCreated),\n' \
+                  '       TestSets.enmStatus,\n' \
+                  '       TestResults.cErrors,\n' \
+                  '       TestCases.idTestCase,\n' \
+                  '       TestCases.sName,\n' \
+                  '       TestCases.sBaseCmd,\n' \
+                  '       TestCaseArgs.sArgs,\n' \
+                  '       TestSuiteBits.idBuild AS idBuildTestSuite,\n' \
+                  '       TestSuiteBits.iRevision AS iRevisionTestSuite,\n' \
+                  '       (TestSets.tsDone IS NULL) SortRunningFirst\n' \
+                  'FROM   BuildCategories,\n' \
+                  '       Builds,\n' \
+                  '       TestBoxes,\n' \
+                  '       TestResults,\n' \
+                  '       TestCases,\n' \
+                  '       TestCaseArgs,\n' \
+                  '       (  SELECT TestSets.idTestSet AS idTestSet,\n' \
+                  '                 TestSets.tsDone AS tsDone,\n' \
+                  '                 TestSets.tsCreated AS tsCreated,\n' \
+                  '                 TestSets.enmStatus AS enmStatus,\n' \
+                  '                 TestSets.idBuild AS idBuild,\n' \
+                  '                 TestSets.idBuildTestSuite AS idBuildTestSuite,\n' \
+                  '                 TestSets.idGenTestBox AS idGenTestBox,\n' \
+                  '                 TestSets.idGenTestCase AS idGenTestCase,\n' \
+                  '                 TestSets.idGenTestCaseArgs AS idGenTestCaseArgs\n' \
+                  '          FROM  ' + sTables + '\n' \
+                  '          WHERE ' + self._getTimePeriodQueryPart(tsNow, sInterval);
+        if fOnlyFailures:
+            sQuery += '            AND TestSets.enmStatus != \'success\'::TestStatus_T' \
+                      '            AND TestSets.enmStatus != \'running\'::TestStatus_T';
+        if sGroupingField is not None:
+            sQuery += '            AND %s = %d\n' % (sGroupingField, iResultsGroupingValue,);
+        if sGroupingCondition is not None:
+            sQuery += sGroupingCondition.replace(' AND ', '            AND ');
+        sQuery += '          ORDER BY (TestSets.tsDone IS NULL) DESC, TestSets.idTestSet DESC\n' \
+                  '          LIMIT %s OFFSET %s\n' % (cMaxRows, iStart,);
+
+        sQuery += '       ) AS TestSets\n' \
+                  '       LEFT OUTER JOIN Builds AS TestSuiteBits\n' \
+                  '                    ON TestSets.idBuildTestSuite = TestSuiteBits.idBuild\n' \
+                  'WHERE  TestSets.idTestSet         = TestResults.idTestSet\n' \
+                  '   AND TestResults.idTestResultParent is NULL\n' \
+                  '   AND TestSets.idBuild           = Builds.idBuild\n' \
+                  '   AND Builds.tsExpire            > TestSets.tsCreated\n' \
+                  '   AND Builds.tsEffective        <= TestSets.tsCreated\n' \
+                  '   AND Builds.idBuildCategory     = BuildCategories.idBuildCategory\n' \
+                  '   AND TestSets.idGenTestBox      = TestBoxes.idGenTestBox\n' \
+                  '   AND TestSets.idGenTestCase     = TestCases.idGenTestCase\n' \
+                  '   AND TestSets.idGenTestCaseArgs = TestCaseArgs.idGenTestCaseArgs\n' \
+                  'ORDER BY (TestSets.tsDone IS NULL) DESC, TestSets.idTestSet DESC\n'
+
+        #
+        # Execute the query and return the wrapped results.
+        #
+        self._oDb.execute(sQuery);
 
         aoRows = [];
         for aoRow in self._oDb.fetchAll():
@@ -683,9 +677,34 @@ class TestResultLogic(ModelLogicBase): # pylint: disable=R0903
         @param iResultsGroupingValue is ignored.
         """
 
-        sSqlQuery = self._getSqlQueryForGroupSearch('COUNT(TestSets.idTestSet)', tsNow, sInterval,
-                                                    enmResultsGroupingType, iResultsGroupingValue, fOnlyFailures)
-        self._oDb.execute(sSqlQuery)
+        #
+        # Get SQL query parameters
+        #
+        if enmResultsGroupingType is None:
+            raise TMExceptionBase('Unknown grouping type')
+
+        if enmResultsGroupingType not in self.kdResultGroupingMap:
+            raise TMExceptionBase('Unknown grouping type')
+        sTables, sGroupingField, sGroupingCondition  = self.kdResultGroupingMap[enmResultsGroupingType]
+
+        #
+        # Construct the query.
+        #
+        sQuery = 'SELECT COUNT(idTestSet)\n' \
+                 'FROM   ' + sTables + '\n' \
+                 'WHERE  ' + self._getTimePeriodQueryPart(tsNow, sInterval);
+        if fOnlyFailures:
+            sQuery += '   AND TestSets.enmStatus != \'success\'::TestStatus_T' \
+                      '   AND TestSets.enmStatus != \'running\'::TestStatus_T';
+        if sGroupingField is not None:
+            sQuery += '   AND %s = %d\n' % (sGroupingField, iResultsGroupingValue,);
+        if sGroupingCondition is not None:
+            sQuery += sGroupingCondition.replace(' AND ', '   AND ');
+
+        #
+        # Execute the query and return the result.
+        #
+        self._oDb.execute(sQuery)
         return self._oDb.fetchOne()[0]
 
     def getTestGroups(self, tsNow, sPeriod):
diff --git a/src/VBox/ValidationKit/testmanager/webui/wuimain.py b/src/VBox/ValidationKit/testmanager/webui/wuimain.py
index 3474080..26af471 100644
--- a/src/VBox/ValidationKit/testmanager/webui/wuimain.py
+++ b/src/VBox/ValidationKit/testmanager/webui/wuimain.py
@@ -26,7 +26,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100880 $"
+__version__ = "$Revision: 101414 $"
 
 # Standard Python imports.
 
@@ -175,7 +175,7 @@ class WuiMain(WuiDispatcherBase):
         ( '1 year',   'One year',    365 * 24 ),
     ];
     ## The default test result period.
-    ksResultPeriodDefault = '3 hours';
+    ksResultPeriodDefault = '6 hours';
 
 
 
diff --git a/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py b/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
index 4aac2a2..d1c8d37 100755
--- a/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
+++ b/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
@@ -27,7 +27,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100056 $"
+__version__ = "$Revision: 101401 $"
 
 # Disable bitching about too many arguments per function.
 # pylint: disable=R0913
@@ -62,6 +62,10 @@ from testdriver import vbox;
 from testdriver import vboxcon;
 from testdriver import vboxwrappers;
 
+# Python 3 hacks:
+if sys.version_info[0] >= 3:
+    long = int      # pylint: disable=W0622,C0103
+
 
 class GuestStream(bytearray):
     """
@@ -90,10 +94,26 @@ class tdCtxCreds(object):
     """
     Provides credentials to pass to the guest.
     """
-    def __init__(self, sUser, sPassword, sDomain):
-        self.sUser = sUser;
-        self.sPassword = sPassword;
-        self.sDomain = sDomain;
+    def __init__(self, sUser = None, sPassword = None, sDomain = None, oTestVm = None):
+        # If no user is specified, select the default user and
+        # password for the given test VM.
+        if sUser is None:
+            assert sPassword is None;
+            assert sDomain is None;
+            assert oTestVm is not None;
+
+            ## @todo fix this so all VMs have several usable test users with the same passwords (or none).
+            sUser     = 'test';
+            sPassword = 'password';
+            if oTestVm.isWindows():
+                #sPassword = ''; # stupid config mistake.
+                sPassword = 'password';
+                sUser     = 'Administrator';
+            sDomain   = '';
+
+        self.sUser     = sUser;
+        self.sPassword = sPassword if sPassword is not None else '';
+        self.sDomain   = sDomain if sDomain is not None else '';
 
 class tdTestGuestCtrlBase(object):
     """
@@ -136,7 +156,7 @@ class tdTestGuestCtrlBase(object):
                 return (False, None);
 
             try:
-                reporter.log('Waiting for session "%s" to start within %ldms...' % (sName, self.timeoutMS));
+                reporter.log('Waiting for session "%s" to start within %dms...' % (sName, self.timeoutMS));
                 fWaitFor = [ vboxcon.GuestSessionWaitForFlag_Start ];
                 waitResult = self.oGuestSession.waitForArray(fWaitFor, self.timeoutMS);
                 #
@@ -146,13 +166,14 @@ class tdTestGuestCtrlBase(object):
                 if      waitResult != vboxcon.GuestSessionWaitResult_Start \
                     and waitResult != vboxcon.GuestSessionWaitResult_WaitFlagNotSupported:
                     # Just log, don't assume an error here (will be done in the main loop then).
-                    reporter.log('Session did not start successfully, returned wait result: %ld' \
-                                  % (waitResult));
+                    reporter.log('Session did not start successfully, returned wait result: %d' \
+                                  % (waitResult,));
                     return (False, None);
                 reporter.log('Session "%s" successfully started' % (sName,));
             except:
                 # Just log, don't assume an error here (will be done in the main loop then).
-                reporter.logXcpt('Waiting for guest session "%s" to start failed:' % (sName));
+                reporter.logXcpt('Waiting for guest session "%s" (usr=%s;pw=%s;dom=%s) to start failed:'
+                                 % (sName, self.oCreds.sUser, self.oCreds.sPassword, self.oCreds.sDomain,));
                 return (False, None);
         else:
             reporter.log('Warning: Session already set; this is probably not what you want');
@@ -381,14 +402,406 @@ class tdTestSession(tdTestGuestCtrlBase):
         aoSession = oVBoxMgr.getArray(self.oTest.oGuest, 'sessions')
         return len(aoSession);
 
-class tdTestSessionEnv(tdTestGuestCtrlBase):
+class tdTestSessionEx(tdTestGuestCtrlBase):
     """
-    Test the guest session environment.
+    Test the guest session.
     """
-    def __init__(self, sUser = "", sPassword = "", aEnv = None):
+    def __init__(self, aoSteps = None, enmUser = None):
         tdTestGuestCtrlBase.__init__(self);
-        self.oCreds = tdCtxCreds(sUser, sPassword, sDomain = "");
-        self.aEnv = aEnv or [];
+        assert enmUser == None; # For later.
+        self.enmUser = enmUser;
+        self.aoSteps = aoSteps if aoSteps is not None else [];
+
+    def execute(self, oTstDrv, oVmSession, oTxsSession, oTestVm, sMsgPrefix):
+        """
+        Executes the test.
+        """
+        #
+        # Create a session.
+        #
+        assert self.enmUser == None; # For later.
+        self.oCreds = tdCtxCreds(oTestVm = oTestVm);
+        self.setEnvironment(oVmSession, oTxsSession, oTestVm);
+        reporter.log2('%s: %s steps' % (sMsgPrefix, len(self.aoSteps),));
+        fRc, oCurSession = self.createSession(sMsgPrefix);
+        if fRc is True:
+            #
+            # Execute the tests.
+            #
+            try:
+                fRc = self.executeSteps(oTstDrv, oCurSession, sMsgPrefix);
+            except:
+                reporter.errorXcpt('%s: Unexpected exception executing test steps' % (sMsgPrefix,));
+                fRc = False;
+
+            fRc2 = self.closeSession();
+            if fRc2 is False:
+                reporter.error('%s: Session could not be closed' % (sMsgPrefix,));
+                fRc = False;
+        else:
+            reporter.error('%s: Session creation failed' % (sMsgPrefix,));
+            fRc = False;
+        return fRc;
+
+    def executeSteps(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
+        """
+        Executes just the steps.
+        Returns True on success, False on test failure.
+        """
+        fRc = True;
+        for (i, oStep) in enumerate(self.aoSteps):
+            fRc2 = oStep.execute(oTstDrv, oGstCtrlSession, sMsgPrefix + ', step #%d' % i);
+            if fRc2 is True:
+                pass;
+            elif fRc2 is None:
+                reporter.log('skipping remaining %d steps' % (len(self.aoSteps) - i - 1,));
+                break;
+            else:
+                fRc = False;
+        return fRc;
+
+    @staticmethod
+    def executeListTestSessions(aoTests, oTstDrv, oVmSession, oTxsSession, oTestVm, sMsgPrefix):
+        """
+        Works thru a list of tdTestSessionEx object.
+        """
+        fRc = True;
+        for (i, oCurTest) in enumerate(aoTests):
+            try:
+                fRc2 = oCurTest.execute(oTstDrv, oVmSession, oTxsSession, oTestVm, '%s, test %#d' % (sMsgPrefix, i,));
+                if fRc2 is not True:
+                    fRc = False;
+            except:
+                reporter.errorXcpt('Unexpected exception executing test #%d' % (i,));
+                fRc = False;
+
+        return (fRc, oTxsSession);
+
+
+class tdSessionStepBase(object):
+    """
+    Base class for the guest control session test steps.
+    """
+
+    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
+        """
+        Executes the test step.
+
+        Returns True on success.
+        Returns False on failure (must be reported as error).
+        Returns None if to skip the remaining steps.
+        """
+        reporter.error('%s: Missing execute implementation: %s' % (sMsgPrefix, self,));
+        _ = oTstDrv;
+        _ = oGstCtrlSession;
+        return False;
+
+
+class tdStepRequireMinimumApiVer(tdSessionStepBase):
+    """
+    Special test step which will cause executeSteps to skip the remaining step
+    if the VBox API is too old:
+    """
+    def __init__(self, fpMinApiVer):
+        self.fpMinApiVer = fpMinApiVer;
+
+    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
+        """ Returns None if API version is too old, otherwise True. """
+        if oTstDrv.fpApiVer >= self.fpMinApiVer:
+            return True;
+        _ = oGstCtrlSession;
+        _ = sMsgPrefix;
+        return None; # Special return value. Don't use elsewhere.
+
+
+#
+# Scheduling Environment Changes with the Guest Control Session.
+#
+
+class tdStepSessionSetEnv(tdSessionStepBase):
+    """
+    Guest session environment: schedule putenv
+    """
+    def __init__(self, sVar, sValue, hrcExpected = 0):
+        self.sVar        = sVar;
+        self.sValue      = sValue;
+        self.hrcExpected = hrcExpected;
+
+    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
+        """
+        Executes the step.
+        Returns True on success, False on test failure.
+        """
+        reporter.log2('tdStepSessionSetEnv: sVar=%s sValue=%s hrcExpected=%#x' % (self.sVar, self.sValue, self.hrcExpected,));
+        try:
+            if oTstDrv.fpApiVer >= 5.0:
+                oGstCtrlSession.environmentScheduleSet(self.sVar, self.sValue);
+            else:
+                oGstCtrlSession.environmentSet(self.sVar, self.sValue);
+        except vbox.ComException, oXcpt:
+            # Is this an expected failure?
+            if vbox.ComError.equal(oXcpt, self.hrcExpected):
+                return True;
+            reporter.errorXcpt('%s: Expected hrc=%#x (%s) got %#x (%s) instead (setenv %s=%s)'
+                               % (sMsgPrefix, self.hrcExpected, vbox.ComError.toString(self.hrcExpected),
+                                  vbox.ComError.getXcptResult(oXcpt),
+                                  vbox.ComError.toString(vbox.ComError.getXcptResult(oXcpt)),
+                                  self.sVar, self.sValue,));
+            return False;
+        except:
+            reporter.errorXcpt('%s: Unexpected exception in tdStepSessionSetEnv::execute (%s=%s)'
+                               % (sMsgPrefix, self.sVar, self.sValue,));
+            return False;
+
+        # Should we succeed?
+        if self.hrcExpected != 0:
+            reporter.error('%s: Expected hrcExpected=%#x, got S_OK (putenv %s=%s)'
+                           % (sMsgPrefix, self.hrcExpected, self.sVar, self.sValue,));
+            return False;
+        return True;
+
+class tdStepSessionUnsetEnv(tdSessionStepBase):
+    """
+    Guest session environment: schedule unset.
+    """
+    def __init__(self, sVar, hrcExpected = 0):
+        self.sVar        = sVar;
+        self.hrcExpected = hrcExpected;
+
+    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
+        """
+        Executes the step.
+        Returns True on success, False on test failure.
+        """
+        reporter.log2('tdStepSessionUnsetEnv: sVar=%s hrcExpected=%#x' % (self.sVar, self.hrcExpected,));
+        try:
+            if oTstDrv.fpApiVer >= 5.0:
+                oGstCtrlSession.environmentScheduleUnset(self.sVar);
+            else:
+                oGstCtrlSession.environmentUnset(self.sVar);
+        except vbox.ComException, oXcpt:
+            # Is this an expected failure?
+            if vbox.ComError.equal(oXcpt, self.hrcExpected):
+                return True;
+            reporter.errorXcpt('%s: Expected hrc=%#x (%s) got %#x (%s) instead (unsetenv %s)'
+                               % (sMsgPrefix, self.hrcExpected, vbox.ComError.toString(self.hrcExpected),
+                                  vbox.ComError.getXcptResult(oXcpt),
+                                  vbox.ComError.toString(vbox.ComError.getXcptResult(oXcpt)),
+                                  self.sVar,));
+            return False;
+        except:
+            reporter.errorXcpt('%s: Unexpected exception in tdStepSessionUnsetEnv::execute (%s)'
+                               % (sMsgPrefix, self.sVar,));
+            return False;
+
+        # Should we succeed?
+        if self.hrcExpected != 0:
+            reporter.error('%s: Expected hrcExpected=%#x, got S_OK (unsetenv %s)'
+                           % (sMsgPrefix, self.hrcExpected, self.sVar,));
+            return False;
+        return True;
+
+class tdStepSessionBulkEnv(tdSessionStepBase):
+    """
+    Guest session environment: Bulk environment changes.
+    """
+    def __init__(self, asEnv = None, hrcExpected = 0):
+        self.asEnv = asEnv if asEnv is not None else [];
+        self.hrcExpected = hrcExpected;
+
+    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
+        """
+        Executes the step.
+        Returns True on success, False on test failure.
+        """
+        reporter.log2('tdStepSessionBulkEnv: asEnv=%s hrcExpected=%#x' % (self.asEnv, self.hrcExpected,));
+        try:
+            if oTstDrv.fpApiVer >= 5.0:
+                oTstDrv.oVBoxMgr.setArray(oGstCtrlSession, 'environmentChanges', self.asEnv);
+            else:
+                oTstDrv.oVBoxMgr.setArray(oGstCtrlSession, 'environment', self.asEnv);
+        except vbox.ComException, oXcpt:
+            # Is this an expected failure?
+            if vbox.ComError.equal(oXcpt, self.hrcExpected):
+                return True;
+            reporter.errorXcpt('%s: Expected hrc=%#x (%s) got %#x (%s) instead (asEnv=%s)'
+                               % (sMsgPrefix, self.hrcExpected, vbox.ComError.toString(self.hrcExpected),
+                                  vbox.ComError.getXcptResult(oXcpt),
+                                  vbox.ComError.toString(vbox.ComError.getXcptResult(oXcpt)),
+                                  self.asEnv,));
+            return False;
+        except:
+            reporter.errorXcpt('%s: Unexpected exception writing the environmentChanges property (asEnv=%s).'
+                               % (sMsgPrefix, self.asEnv));
+            return False;
+        return True;
+
+class tdStepSessionClearEnv(tdStepSessionBulkEnv):
+    """
+    Guest session environment: clears the scheduled environment changes.
+    """
+    def __init__(self):
+        tdStepSessionBulkEnv.__init__(self);
+
+
+class tdStepSessionCheckEnv(tdSessionStepBase):
+    """
+    Check the currently scheduled environment changes of a guest control session.
+    """
+    def __init__(self, asEnv = None):
+        self.asEnv = asEnv if asEnv is not None else [];
+
+    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
+        """
+        Executes the step.
+        Returns True on success, False on test failure.
+        """
+        reporter.log2('tdStepSessionCheckEnv: asEnv=%s' % (self.asEnv,));
+
+        #
+        # Get the environment change list.
+        #
+        try:
+            if oTstDrv.fpApiVer >= 5.0:
+                asCurEnv = oTstDrv.oVBoxMgr.getArray(oGstCtrlSession, 'environmentChanges');
+            else:
+                asCurEnv = oTstDrv.oVBoxMgr.getArray(oGstCtrlSession, 'environment');
+        except:
+            reporter.errorXcpt('%s: Unexpected exception reading the environmentChanges property.' % (sMsgPrefix,));
+            return False;
+
+        #
+        # Compare it with the expected one by trying to remove each expected value
+        # and the list anything unexpected.
+        #
+        fRc = True;
+        asCopy = list(asCurEnv); # just in case asCurEnv is immutable
+        for sExpected in self.asEnv:
+            try:
+                asCopy.remove(sExpected);
+            except:
+                reporter.error('%s: Expected "%s" to be in the resulting environment' % (sMsgPrefix, sExpected,));
+                fRc = False;
+        for sUnexpected in asCopy:
+            reporter.error('%s: Unexpected "%s" in the resulting environment' % (sMsgPrefix, sUnexpected,));
+            fRc = False;
+
+        if fRc is not True:
+            reporter.log2('%s: Current environment: %s' % (sMsgPrefix, asCurEnv));
+        return fRc;
+
+
+#
+# File system object statistics (i.e. stat()).
+#
+
+class tdStepStat(tdSessionStepBase):
+    """
+    Stats a file system object.
+    """
+    def __init__(self, sPath, hrcExpected = 0, fFound = True, fFollowLinks = True, enmType = None):
+        self.sPath        = sPath;
+        self.hrcExpected  = hrcExpected;
+        self.fFound       = fFound;
+        self.fFollowLinks = fFollowLinks;
+        self.enmType      = enmType if enmType is not None else vboxcon.FsObjType_File;
+        self.cbExactSize  = None;
+        self.cbMinSize    = None;
+
+    def execute(self, oTstDrv, oGstCtrlSession, sMsgPrefix):
+        """
+        Execute the test step.
+        """
+        reporter.log2('tdStepStat: sPath=%s enmType=%s hrcExpected=%s fFound=%s fFollowLinks=%s'
+                      % (self.sPath, self.enmType, self.hrcExpected, self.fFound, self.fFollowLinks,));
+
+        # Don't execute non-file tests on older VBox version.
+        if oTstDrv.fpApiVer >= 5.0 or self.enmType == vboxcon.FsObjType_File or not self.fFound:
+            #
+            # Call the API.
+            #
+            try:
+                if oTstDrv.fpApiVer >= 5.0:
+                    oFsInfo = oGstCtrlSession.fsObjQueryInfo(self.sPath, self.fFollowLinks);
+                else:
+                    oFsInfo = oGstCtrlSession.fileQueryInfo(self.sPath);
+            except vbox.ComException, oXcpt:
+                ## @todo: The error reporting in the API just plain sucks! Most of the errors are
+                ##        VBOX_E_IPRT_ERROR and there seems to be no way to distinguish between
+                ##        non-existing files/path and a lot of other errors.  Fix API and test!
+                if not self.fFound:
+                    return True;
+                if vbox.ComError.equal(oXcpt, self.hrcExpected): # Is this an expected failure?
+                    return True;
+                return reporter.errorXcpt('%s: Unexpected exception for exiting path "%s" (enmType=%s, hrcExpected=%s):'
+                                          % (sMsgPrefix, self.sPath, self.enmType, self.hrcExpected,));
+            except:
+                return reporter.errorXcpt('%s: Unexpected exception in tdStepStat::execute (%s)'
+                                          % (sMsgPrefix, self.sPath,));
+            if oFsInfo is None:
+                return reporter.error('%s: "%s" got None instead of IFsObjInfo instance!' % (sMsgPrefix, self.sPath,));
+
+            #
+            # Check type expectations.
+            #
+            try:
+                enmType = oFsInfo.type;
+            except:
+                return reporter.errorXcpt('%s: Unexpected exception in reading "IFsObjInfo::type"' % (sMsgPrefix,));
+            if enmType != self.enmType:
+                return reporter.error('%s: "%s" has type %s, expected %s'
+                                      % (sMsgPrefix, self.sPath, enmType, self.enmType));
+
+            #
+            # Check size expectations.
+            # Note! This is unicode string here on windows, for some reason.
+            #       long long mapping perhaps?
+            #
+            try:
+                cbObject = long(oFsInfo.objectSize);
+            except:
+                return reporter.errorXcpt('%s: Unexpected exception in reading "IFsObjInfo::objectSize"'
+                                          % (sMsgPrefix,));
+            if    self.cbExactSize is not None \
+              and cbObject != self.cbExactSize:
+                return reporter.error('%s: "%s" has size %s bytes, expected %s bytes'
+                                      % (sMsgPrefix, self.sPath, cbObject, self.cbExactSize));
+            if    self.cbMinSize is not None \
+              and cbObject < self.cbMinSize:
+                return reporter.error('%s: "%s" has size %s bytes, expected as least %s bytes'
+                                      % (sMsgPrefix, self.sPath, cbObject, self.cbMinSize));
+        return True;
+
+class tdStepStatDir(tdStepStat):
+    """ Checks for an existing directory. """
+    def __init__(self, sDirPath):
+        tdStepStat.__init__(self, sPath = sDirPath, enmType = vboxcon.FsObjType_Directory);
+
+class tdStepStatFile(tdStepStat):
+    """ Checks for an existing file  """
+    def __init__(self, sFilePath):
+        tdStepStat.__init__(self, sPath = sFilePath, enmType = vboxcon.FsObjType_File);
+
+class tdStepStatFileSize(tdStepStat):
+    """ Checks for an existing file of a given expected size.. """
+    def __init__(self, sFilePath, cbExactSize = 0):
+        tdStepStat.__init__(self, sPath = sFilePath, enmType = vboxcon.FsObjType_File);
+        self.cbExactSize = cbExactSize;
+
+class tdStepStatFileNotFound(tdStepStat):
+    """ Checks for an existing directory. """
+    def __init__(self, sPath):
+        tdStepStat.__init__(self, sPath = sPath, fFound = False);
+
+class tdStepStatPathNotFound(tdStepStat):
+    """ Checks for an existing directory. """
+    def __init__(self, sPath):
+        tdStepStat.__init__(self, sPath = sPath, fFound = False);
+
+
+#
+#
+#
 
 class tdTestSessionFileRefs(tdTestGuestCtrlBase):
     """
@@ -496,15 +909,6 @@ class tdTestResultSession(tdTestResult):
         tdTestResult.__init__(self, fRc = fRc);
         self.cNumSessions = cNumSessions;
 
-class tdTestResultSessionEnv(tdTestResult):
-    """
-    Test result for guest session environment tests.
-    """
-    def __init__(self, fRc = False, cNumVars = 0):
-        tdTestResult.__init__(self, fRc = fRc);
-        self.cNumVars = cNumVars;
-
-
 class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
     """
     Sub-test driver for executing guest control (VBoxService, IGuest) tests.
@@ -555,6 +959,8 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
         """
         reporter.log("Active tests: %s" % (self.asTests,));
 
+        fRc = True;
+
         # Do the testing.
         reporter.testStart('Session Basics');
         fSkip = 'session_basic' not in self.asTests;
@@ -981,21 +1387,20 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                 # Compare exit status / code on successful process execution.
                 if     oTest.uExitStatus != oRes.uExitStatus \
                     or oTest.iExitCode   != oRes.iExitCode:
-                    reporter.error('Test #%d failed: Got exit status + code %d,%d, expected %d,%d' % \
-                                   (i, oTest.uExitStatus, oTest.iExitCode, \
-                                       oRes.uExitStatus,  oRes.iExitCode));
+                    reporter.error('Test #%d failed: Got exit status + code %d,%d, expected %d,%d'
+                                   % (i, oTest.uExitStatus, oTest.iExitCode, oRes.uExitStatus,  oRes.iExitCode));
                     return False;
             if fRc is True:
                 # Compare test / result buffers on successful process execution.
                 if      oTest.sBuf is not None \
                     and oRes.sBuf is not None:
                     if bytes(oTest.sBuf) != bytes(oRes.sBuf):
-                        reporter.error('Test #%d failed: Got buffer\n%s (%ld bytes), expected\n%s (%ld bytes)' %
-                                       (i, map(hex, map(ord, oTest.sBuf)), len(oTest.sBuf), \
-                                           map(hex, map(ord, oRes.sBuf)), len(oRes.sBuf)));
+                        reporter.error('Test #%d failed: Got buffer\n%s (%d bytes), expected\n%s (%d bytes)'
+                                       % (i, map(hex, map(ord, oTest.sBuf)), len(oTest.sBuf), \
+                                          map(hex, map(ord, oRes.sBuf)), len(oRes.sBuf)));
                         return False;
                     else:
-                        reporter.log2('Test #%d passed: Buffers match (%ld bytes)' % (i, len(oRes.sBuf)));
+                        reporter.log2('Test #%d passed: Buffers match (%d bytes)' % (i, len(oRes.sBuf)));
                 elif     oRes.sBuf is not None \
                      and len(oRes.sBuf):
                     reporter.error('Test #%d failed: Got no buffer data, expected\n%s (%dbytes)' %
@@ -1003,7 +1408,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     return False;
                 elif     oRes.cbStdOut > 0 \
                      and oRes.cbStdOut != oTest.cbStdOut:
-                    reporter.error('Test #%d failed: Got %ld stdout data, expected %ld'
+                    reporter.error('Test #%d failed: Got %d stdout data, expected %d'
                                    % (i, oTest.cbStdOut, oRes.cbStdOut));
                     return False;
         else:
@@ -1021,10 +1426,10 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
         ## @todo Compare execution timeouts!
         #tsStart = base.timestampMilli();
 
-        reporter.log2('Using session user=%s, sDomain=%s, session name=%s, session timeout=%ld' \
+        reporter.log2('Using session user=%s, sDomain=%s, session name=%s, session timeout=%d' \
                       % (oGuestSession.user, oGuestSession.domain, \
                          oGuestSession.name, oGuestSession.timeout));
-        reporter.log2('Executing cmd=%s, aFlags=%s, timeout=%ld, args=%s, env=%s' \
+        reporter.log2('Executing cmd=%s, aFlags=%s, timeout=%d, args=%s, env=%s' \
                       % (oTest.sCmd, oTest.aFlags, oTest.timeoutMS, \
                          oTest.aArgs, oTest.aEnv));
         try:
@@ -1032,10 +1437,10 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                                                   oTest.aArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.aArgs[1:],
                                                   oTest.aEnv, oTest.aFlags, oTest.timeoutMS);
             if curProc is not None:
-                reporter.log2('Process start requested, waiting for start (%ldms) ...' % (oTest.timeoutMS,));
+                reporter.log2('Process start requested, waiting for start (%dms) ...' % (oTest.timeoutMS,));
                 fWaitFor = [ vboxcon.ProcessWaitForFlag_Start ];
                 waitResult = curProc.waitForArray(fWaitFor, oTest.timeoutMS);
-                reporter.log2('Wait result returned: %d, current process status is: %ld' % (waitResult, curProc.status));
+                reporter.log2('Wait result returned: %d, current process status is: %d' % (waitResult, curProc.status));
 
                 if curProc.status == vboxcon.ProcessStatus_Started:
                     fWaitFor = [ vboxcon.ProcessWaitForFlag_Terminate ];
@@ -1044,7 +1449,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     if vboxcon.ProcessCreateFlag_WaitForStdErr in oTest.aFlags:
                         fWaitFor.append(vboxcon.ProcessWaitForFlag_StdErr);
                     ## @todo Add vboxcon.ProcessWaitForFlag_StdIn.
-                    reporter.log2('Process (PID %ld) started, waiting for termination (%dms), waitFlags=%s ...' \
+                    reporter.log2('Process (PID %d) started, waiting for termination (%dms), waitFlags=%s ...' \
                                   % (curProc.PID, oTest.timeoutMS, fWaitFor));
                     while True:
                         waitResult = curProc.waitForArray(fWaitFor, oTest.timeoutMS);
@@ -1056,7 +1461,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                                 reporter.log2('Reading stdout ...');
                                 buf = curProc.Read(1, 64 * 1024, oTest.timeoutMS);
                                 if len(buf):
-                                    reporter.log2('Process (PID %ld) got %ld bytes of stdout data' % (curProc.PID, len(buf)));
+                                    reporter.log2('Process (PID %d) got %d bytes of stdout data' % (curProc.PID, len(buf)));
                                     oTest.cbStdOut += len(buf);
                                     oTest.sBuf = buf; # Appending does *not* work atm, so just assign it. No time now.
                             # Try stderr.
@@ -1065,30 +1470,30 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                                 reporter.log2('Reading stderr ...');
                                 buf = curProc.Read(2, 64 * 1024, oTest.timeoutMS);
                                 if len(buf):
-                                    reporter.log2('Process (PID %ld) got %ld bytes of stderr data' % (curProc.PID, len(buf)));
+                                    reporter.log2('Process (PID %d) got %d bytes of stderr data' % (curProc.PID, len(buf)));
                                     oTest.cbStdErr += len(buf);
                                     oTest.sBuf = buf; # Appending does *not* work atm, so just assign it. No time now.
                             # Use stdin.
                             if     waitResult == vboxcon.ProcessWaitResult_StdIn \
                                 or waitResult == vboxcon.ProcessWaitResult_WaitFlagNotSupported:
-                                pass; #reporter.log2('Process (PID %ld) needs stdin data' % (curProc.pid,));
+                                pass; #reporter.log2('Process (PID %d) needs stdin data' % (curProc.pid,));
                             # Termination or error?
                             if     waitResult == vboxcon.ProcessWaitResult_Terminate \
                                 or waitResult == vboxcon.ProcessWaitResult_Error \
                                 or waitResult == vboxcon.ProcessWaitResult_Timeout:
-                                reporter.log2('Process (PID %ld) reported terminate/error/timeout: %ld, status: %ld' \
+                                reporter.log2('Process (PID %d) reported terminate/error/timeout: %d, status: %d' \
                                               % (curProc.PID, waitResult, curProc.status));
                                 break;
                         except:
                             # Just skip reads which returned nothing.
                             pass;
-                    reporter.log2('Final process status (PID %ld) is: %ld' % (curProc.PID, curProc.status));
-                    reporter.log2('Process (PID %ld) %ld stdout, %ld stderr' % (curProc.PID, oTest.cbStdOut, oTest.cbStdErr));
+                    reporter.log2('Final process status (PID %d) is: %d' % (curProc.PID, curProc.status));
+                    reporter.log2('Process (PID %d) %d stdout, %d stderr' % (curProc.PID, oTest.cbStdOut, oTest.cbStdErr));
             oTest.uExitStatus = curProc.status;
             oTest.iExitCode = curProc.exitCode;
-            reporter.log2('Process (PID %ld) has exit code: %ld' % (curProc.PID, oTest.iExitCode));
+            reporter.log2('Process (PID %d) has exit code: %d' % (curProc.PID, oTest.iExitCode));
         except KeyboardInterrupt:
-            reporter.error('Process (PID %ld) execution interrupted' % (curProc.PID,));
+            reporter.error('Process (PID %d) execution interrupted' % (curProc.PID,));
             if curProc is not None:
                 curProc.close();
         except:
@@ -1102,171 +1507,102 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
         """
         Tests the guest session environment changes.
         """
-
-        if oTestVm.isWindows():
-            sUser = "Administrator";
-        else:
-            sUser = "vbox";
-        sPassword = "password";
-
-        aaTests = [
-            # No environment set.
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword),
-              tdTestResultSessionEnv(fRc = False) ],
-            # Invalid stuff.
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ '=FOO' ]),
-              tdTestResultSessionEnv(fRc = False) ],
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ '====' ]),
-              tdTestResultSessionEnv(fRc = False) ],
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ '=BAR' ]),
-              tdTestResultSessionEnv(fRc = False) ],
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ u'ß$%ß&' ]),
-              tdTestResultSessionEnv(fRc = False) ],
-            # Key only.
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ 'FOO=' ]),
-              tdTestResultSessionEnv(fRc = True, cNumVars = 1) ],
-            # Values.
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ 'FOO' ]),
-              tdTestResultSessionEnv(fRc = True, cNumVars = 1) ],
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ 'FOO=BAR' ]),
-              tdTestResultSessionEnv(fRc = True, cNumVars = 1) ],
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ 'FOO=BAR', 'BAR=BAZ' ]),
-              tdTestResultSessionEnv(fRc = True, cNumVars = 2) ],
+        aoTests = [
+            # Check basic operations.
+            tdTestSessionEx([ # Initial environment is empty.
+                              tdStepSessionCheckEnv(),
+                              # Check clearing empty env.
+                              tdStepSessionClearEnv(),
+                              tdStepSessionCheckEnv(),
+                              # Check set.
+                              tdStepSessionSetEnv('FOO', 'BAR'),
+                              tdStepSessionCheckEnv(['FOO=BAR',]),
+                              tdStepRequireMinimumApiVer(5.0), # 4.3 can't cope with the remainder.
+                              tdStepSessionClearEnv(),
+                              tdStepSessionCheckEnv(),
+                              # Check unset.
+                              tdStepSessionUnsetEnv('BAR'),
+                              tdStepSessionCheckEnv(['BAR']),
+                              tdStepSessionClearEnv(),
+                              tdStepSessionCheckEnv(),
+                              # Set + unset.
+                              tdStepSessionSetEnv('FOO', 'BAR'),
+                              tdStepSessionCheckEnv(['FOO=BAR',]),
+                              tdStepSessionUnsetEnv('FOO'),
+                              tdStepSessionCheckEnv(['FOO']),
+                              # Bulk environment changes (via attrib) (shall replace existing 'FOO').
+                              tdStepSessionBulkEnv( ['PATH=/bin:/usr/bin', 'TMPDIR=/var/tmp', 'USER=root']),
+                              tdStepSessionCheckEnv(['PATH=/bin:/usr/bin', 'TMPDIR=/var/tmp', 'USER=root']),
+                              ]),
+            tdTestSessionEx([ # Check that setting the same value several times works.
+                              tdStepSessionSetEnv('FOO','BAR'),
+                              tdStepSessionCheckEnv([ 'FOO=BAR',]),
+                              tdStepSessionSetEnv('FOO','BAR2'),
+                              tdStepSessionCheckEnv([ 'FOO=BAR2',]),
+                              tdStepSessionSetEnv('FOO','BAR3'),
+                              tdStepSessionCheckEnv([ 'FOO=BAR3',]),
+                              tdStepRequireMinimumApiVer(5.0), # 4.3 can't cope with the remainder.
+                              # Add a little unsetting to the mix.
+                              tdStepSessionSetEnv('BAR', 'BEAR'),
+                              tdStepSessionCheckEnv([ 'FOO=BAR3', 'BAR=BEAR',]),
+                              tdStepSessionUnsetEnv('FOO'),
+                              tdStepSessionCheckEnv([ 'FOO', 'BAR=BEAR',]),
+                              tdStepSessionSetEnv('FOO','BAR4'),
+                              tdStepSessionCheckEnv([ 'FOO=BAR4', 'BAR=BEAR',]),
+                              # The environment is case sensitive.
+                              tdStepSessionSetEnv('foo','BAR5'),
+                              tdStepSessionCheckEnv([ 'FOO=BAR4', 'BAR=BEAR', 'foo=BAR5']),
+                              tdStepSessionUnsetEnv('foo'),
+                              tdStepSessionCheckEnv([ 'FOO=BAR4', 'BAR=BEAR', 'foo']),
+                              ]),
+            tdTestSessionEx([ # Bulk settings merges stuff, last entry standing.
+                              tdStepSessionBulkEnv(['FOO=bar', 'foo=bar', 'FOO=doofus', 'TMPDIR=/tmp', 'foo=bar2']),
+                              tdStepSessionCheckEnv(['FOO=doofus', 'TMPDIR=/tmp', 'foo=bar2']),
+                              tdStepRequireMinimumApiVer(5.0), # 4.3 is buggy!
+                              tdStepSessionBulkEnv(['2=1+1', 'FOO=doofus2', ]),
+                              tdStepSessionCheckEnv(['2=1+1', 'FOO=doofus2' ]),
+                              ]),
+            # Invalid variable names.
+            tdTestSessionEx([ tdStepSessionSetEnv('', 'FOO', vbox.ComError.E_INVALIDARG),
+                              tdStepSessionCheckEnv(),
+                              tdStepRequireMinimumApiVer(5.0), # 4.3 is too relaxed checking input!
+                              tdStepSessionSetEnv('=', '===', vbox.ComError.E_INVALIDARG),
+                              tdStepSessionCheckEnv(),
+                              tdStepSessionSetEnv('FOO=', 'BAR', vbox.ComError.E_INVALIDARG),
+                              tdStepSessionCheckEnv(),
+                              tdStepSessionSetEnv('=FOO', 'BAR', vbox.ComError.E_INVALIDARG),
+                              tdStepSessionCheckEnv(),
+                              tdStepRequireMinimumApiVer(5.0), # 4.3 is buggy and too relaxed!
+                              tdStepSessionBulkEnv(['', 'foo=bar'], vbox.ComError.E_INVALIDARG),
+                              tdStepSessionCheckEnv(),
+                              tdStepSessionBulkEnv(['=', 'foo=bar'], vbox.ComError.E_INVALIDARG),
+                              tdStepSessionCheckEnv(),
+                              tdStepSessionBulkEnv(['=FOO', 'foo=bar'], vbox.ComError.E_INVALIDARG),
+                              tdStepSessionCheckEnv(),
+                              ]),
             # A bit more weird keys/values.
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ '$$$=' ]),
-              tdTestResultSessionEnv(fRc = True, cNumVars = 1) ],
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ '$$$=%%%' ]),
-              tdTestResultSessionEnv(fRc = True, cNumVars = 1) ],
-            # Same stuff.
-            [ tdTestSessionEnv(sUser = sUser, sPassword = sPassword, aEnv = [ 'FOO=BAR', 'FOO=BAR' ]),
-              tdTestResultSessionEnv(fRc = True, cNumVars = 1) ]
+            tdTestSessionEx([ tdStepSessionSetEnv('$$$', ''),
+                              tdStepSessionCheckEnv([ '$$$=',]), ]),
+            tdTestSessionEx([ tdStepSessionSetEnv('$$$', '%%%'),
+                              tdStepSessionCheckEnv([ '$$$=%%%',]),
+                              ]),
+            tdTestSessionEx([ tdStepRequireMinimumApiVer(5.0), # 4.3 is buggy!
+                              tdStepSessionSetEnv(u'ß$%ß&', ''),
+                              tdStepSessionCheckEnv([ u'ß$%ß&=',]),
+                              ]),
+            # Misc stuff.
+            tdTestSessionEx([ tdStepSessionSetEnv('FOO', ''),
+                              tdStepSessionCheckEnv(['FOO=',]),
+                              ]),
+            tdTestSessionEx([ tdStepSessionSetEnv('FOO', 'BAR'),
+                              tdStepSessionCheckEnv(['FOO=BAR',])
+                              ],),
+            tdTestSessionEx([ tdStepSessionSetEnv('FOO', 'BAR'),
+                              tdStepSessionSetEnv('BAR', 'BAZ'),
+                              tdStepSessionCheckEnv([ 'FOO=BAR', 'BAR=BAZ',]),
+                              ]),
         ];
-
-        # The IGuestSession::environment attribute changed late in 5.0 development.
-        sEnvironmentChangesAttr = 'environmentChanges' if self.oTstDrv.fpApiVer >= 5.0 else 'environment';
-
-        # Parameters.
-        fRc = True;
-        for (i, aTest) in enumerate(aaTests):
-            curTest = aTest[0]; # tdTestExec, use an index, later.
-            curRes  = aTest[1]; # tdTestResult
-            curTest.setEnvironment(oSession, oTxsSession, oTestVm);
-            reporter.log('Testing #%d, user="%s", sPassword="%s", env="%s" (%d)...' \
-                         % (i, curTest.oCreds.sUser, curTest.oCreds.sPassword, curTest.aEnv, len(curTest.aEnv)));
-            curGuestSessionName = 'testGuestCtrlSessionEnvironment: Test #%d' % (i,);
-            fRc2, curGuestSession = curTest.createSession(curGuestSessionName);
-            if fRc2 is not True:
-                reporter.error('Test #%d failed: Session creation failed: Got %s, expected True' % (i, fRc2));
-                fRc = False;
-                break;
-            # Make sure environment is empty.
-            curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
-            reporter.log2('Test #%d: Environment initially has %d elements' % (i, len(curEnv)));
-            if len(curEnv) != 0:
-                reporter.error('Test #%d failed: Initial session environment has %d vars, expected 0' % (i, len(curEnv)));
-                fRc = False;
-                break;
-            try:
-                for (_, aEnv) in enumerate(curTest.aEnv):
-                    aElems = aEnv.split('=');
-                    strKey = '';  ## @todo s/Key/Var/g
-                    strValue = '';
-                    if len(aElems) > 0:
-                        strKey = aElems[0];
-                    if len(aElems) == 2:
-                        strValue = aElems[1];
-                    reporter.log2('Test #%d: Single var="%s", value="%s" (%d) ...' \
-                                  % (i, strKey, strValue, len(aElems)));
-                    try:
-                        if self.oTstDrv.fpApiVer >= 5.0:
-                            curGuestSession.environmentScheduleSet(strKey, strValue);
-                        else:
-                            curGuestSession.environmentSet(strKey, strValue);
-                    except:
-                        # Setting environment variables might fail (e.g. if empty name specified). Check.
-                        reporter.logXcpt('Test #%d failed: Setting environment variable failed:' % (i,));
-                        curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
-                        if len(curEnv) is not curRes.cNumVars:
-                            reporter.error('Test #%d failed: Session environment has %d vars, expected %d' \
-                                           % (i, len(curEnv), curRes.cNumVars));
-                            fRc = False;
-                            break;
-                        else:
-                            reporter.log('Test #%d: API reported an error (single), good' % (i,));
-                    ## @todo environmentGet() has been removed in 5.0 because it's not up to the task of returning all the
-                    ## putenv strings forms and gives the impression that the environment is something it isn't. This test
-                    ## should be rewritten using the attribute.  What's more, there should be an Unset test here, shouldn't
-                    ## there?
-                    #
-                    #reporter.log2('Getting key="%s" ...' % (strKey,));
-                    #try:
-                    #    strValue2 = curGuestSession.environmentGet(strKey);
-                    #    if      strKey.isalnum() \
-                    #        and strValue != strValue2:
-                    #        reporter.error('Test #%d failed: Got environment value "%s", expected "%s" (var: "%s")' \
-                    #                       % (i, strValue2, strValue, strKey));
-                    #        fRc = False;
-                    #        break;
-                    #    # Getting back an empty value when specifying an invalid key is fine.
-                    #    reporter.log2('Got key "%s=%s"' % (strKey, strValue2));
-                    #except UnicodeDecodeError: # Might happen on unusal values, fine.
-                    #    if strValue != strValue2:
-                    #        reporter.error('Test #%d failed: Got (undecoded) environment variable "%s", ' \
-                    #                       'expected "%s" (var: "%s")' \
-                    #                       % (i, strValue2, strValue, strKey));
-                    #        fRc = False;
-                    #        break;
-                    #except:
-                    #    if     strKey == "" \
-                    #        or not strKey.isalnum():
-                    #        reporter.log('Test #%d: API reported an error (invalid key "%s"), good' % (i, strKey));
-                    #    else:
-                    #        reporter.errorXcpt('Test #%d failed: Getting environment variable:' % (i));
-                if fRc is False:
-                    continue;
-                # Set the same stuff again, this time all at once using the array.
-                if len(curTest.aEnv):
-                    reporter.log('Test #%d: Array %s (%d)' % (i, curTest.aEnv, len(curTest.aEnv)));
-                    try:
-                        ## @todo No return (e.g. boolean) value available thru wrapper.
-                        #curGuestSession.environmentSetArray(curTest.aEnv);
-                        pass;
-                    except:
-                        # Setting environment variables might fail (e.g. if empty name specified). Check.
-                        curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
-                        if len(curEnv) is not curRes.cNumVars:
-                            reporter.error('Test #%d failed: Session environment has %d vars, expected %d (array)' \
-                                           % (i, len(curEnv), curRes.cNumVars));
-                            fRc = False;
-                            break;
-                        else:
-                            reporter.log('Test #%d: API reported an error (array), good' % (i,));
-                ## @todo Get current system environment and add it to curRes.cNumVars before comparing!
-                reporter.log('Test #%d: Environment size' % (i,));
-                curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
-                reporter.log2('Test #%d: Environment (%d) -> %s' % (i, len(curEnv), curEnv));
-                if len(curEnv) != curRes.cNumVars:
-                    reporter.error('Test #%d failed: Session environment has %d vars (%s), expected %d' \
-                                   % (i, len(curEnv), curEnv, curRes.cNumVars));
-                    fRc = False;
-                    break;
-
-                self.oTstDrv.oVBoxMgr.setArray(curGuestSession, sEnvironmentChangesAttr, []);
-                curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, sEnvironmentChangesAttr);
-                if len(curEnv) is not 0:
-                    reporter.error('Test #%d failed: Session environment has %d vars, expected 0');
-                    fRc = False;
-                    break;
-            except:
-                reporter.errorXcpt('Test #%d failed:' % (i,));
-
-            fRc2 = curTest.closeSession();
-            if fRc2 is False:
-                reporter.error('Test #%d failed: Session could not be closed' % (i,));
-                fRc = False;
-                break;
-
-        return (fRc, oTxsSession);
+        return tdTestSessionEx.executeListTestSessions(aoTests, self.oTstDrv, oSession, oTxsSession, oTestVm, 'SessionEnv');
 
     def testGuestCtrlSession(self, oSession, oTxsSession, oTestVm): # pylint: disable=R0914
         """
@@ -1391,6 +1727,9 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
             fRc = False;
 
         try:
+            # r=bird: multiSession[0].oGuestSession is None! Why don't you just use 'assert' or 'if' to check
+            #         the functioning of the __testcase__?
+
             # Make sure that accessing the first opened guest session does not work anymore because we just removed (closed) it.
             curSessionName = multiSession[0].oGuestSession.name;
             reporter.error('Accessing first removed MultiSession should not be possible, got name="%s"' % (curSessionName,));
@@ -1443,7 +1782,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
             if      waitResult != vboxcon.GuestSessionWaitResult_Start \
                 and waitResult != vboxcon.GuestSessionWaitResult_WaitFlagNotSupported:
                 # Just log, don't assume an error here (will be done in the main loop then).
-                reporter.log('Session did not start successfully, returned wait result: %ld' \
+                reporter.log('Session did not start successfully, returned wait result: %d' \
                               % (waitResult));
                 return (False, oTxsSession);
             reporter.log('Session successfully started');
@@ -1463,14 +1802,14 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     #       hanging around forever.  This can happen if the installed Guest Additions
                     #       do not support terminating guest processes.
                 except:
-                    reporter.errorXcpt('Opening stale file #%ld failed:' % (i,));
+                    reporter.errorXcpt('Opening stale file #%d failed:' % (i,));
                     fRc = False;
                     break;
 
             if fRc:
                 cFiles = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'files'));
                 if cFiles != cStaleFiles:
-                    reporter.error('Test failed: Got %ld stale files, expected %ld' % (cFiles, cStaleFiles));
+                    reporter.error('Test failed: Got %d stale files, expected %d' % (cFiles, cStaleFiles));
                     fRc = False;
 
             if fRc:
@@ -1488,13 +1827,13 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                             oCurFile = oGuestSession.fileOpen(sFile, "r", "oe", 0);
                         aaFiles.append(oCurFile);
                     except:
-                        reporter.errorXcpt('Opening non-stale file #%ld failed:' % (i,));
+                        reporter.errorXcpt('Opening non-stale file #%d failed:' % (i,));
                         fRc = False;
                         break;
             if fRc:
                 cFiles = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'files'));
                 if cFiles != cStaleFiles * 2:
-                    reporter.error('Test failed: Got %ld total files, expected %ld' % (cFiles, cStaleFiles * 2));
+                    reporter.error('Test failed: Got %d total files, expected %d' % (cFiles, cStaleFiles * 2));
                     fRc = False;
             if fRc:
                 reporter.log2('Closing all non-stale files again ...');
@@ -1502,7 +1841,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     try:
                         aaFiles[i].close();
                     except:
-                        reporter.errorXcpt('Waiting for non-stale file #%ld failed:' % (i,));
+                        reporter.errorXcpt('Waiting for non-stale file #%d failed:' % (i,));
                         fRc = False;
                         break;
                 cFiles = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'files'));
@@ -1510,7 +1849,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                 # anymore for) and the opened and then closed non-stale files (that we still keep
                 # a reference in aaFiles[] for).
                 if cFiles != cStaleFiles:
-                    reporter.error('Test failed: Got %ld total files, expected %ld' \
+                    reporter.error('Test failed: Got %d total files, expected %d' \
                                    % (cFiles, cStaleFiles));
                     fRc = False;
                 if fRc:
@@ -1522,17 +1861,17 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                         try:
                             curFilesStatus = aaFiles[i].status;
                             if curFilesStatus != vboxcon.FileStatus_Closed:
-                                reporter.error('Test failed: Non-stale file #%ld has status %ld, expected %ld' \
+                                reporter.error('Test failed: Non-stale file #%d has status %d, expected %d' \
                                        % (i, curFilesStatus, vboxcon.FileStatus_Closed));
                                 fRc = False;
                         except:
-                            reporter.errorXcpt('Checking status of file #%ld failed:' % (i,));
+                            reporter.errorXcpt('Checking status of file #%d failed:' % (i,));
                             fRc = False;
                             break;
             if fRc:
                 reporter.log2('All non-stale files closed');
             cFiles = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'files'));
-            reporter.log2('Final guest session file count: %ld' % (cFiles,));
+            reporter.log2('Final guest session file count: %d' % (cFiles,));
             # Now try to close the session and see what happens.
             reporter.log2('Closing guest session ...');
             oGuestSession.close();
@@ -1579,7 +1918,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
             if      waitResult != vboxcon.GuestSessionWaitResult_Start \
                 and waitResult != vboxcon.GuestSessionWaitResult_WaitFlagNotSupported:
                 # Just log, don't assume an error here (will be done in the main loop then).
-                reporter.log('Session did not start successfully, returned wait result: %ld' \
+                reporter.log('Session did not start successfully, returned wait result: %d' \
                               % (waitResult));
                 return (False, oTxsSession);
             reporter.log('Session successfully started');
@@ -1599,14 +1938,14 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     #       hanging around forever.  This can happen if the installed Guest Additions
                     #       do not support terminating guest processes.
                 except:
-                    reporter.logXcpt('Creating stale process #%ld failed:' % (i,));
+                    reporter.logXcpt('Creating stale process #%d failed:' % (i,));
                     fRc = False;
                     break;
 
             if fRc:
                 cProcs = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'processes'));
                 if cProcs != cStaleProcs:
-                    reporter.error('Test failed: Got %ld stale processes, expected %ld' % (cProcs, cStaleProcs));
+                    reporter.error('Test failed: Got %d stale processes, expected %d' % (cProcs, cStaleProcs));
                     fRc = False;
 
             if fRc:
@@ -1623,7 +1962,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                                                                [], [], 0); # Infinite timeout.
                         aaProcs.append(oCurProc);
                     except:
-                        reporter.logXcpt('Creating non-stale process #%ld failed:' % (i,));
+                        reporter.logXcpt('Creating non-stale process #%d failed:' % (i,));
                         fRc = False;
                         break;
             if fRc:
@@ -1633,12 +1972,12 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                         aaProcs[i].waitForArray([ vboxcon.ProcessWaitForFlag_Terminate ], 30 * 1000);
                         curProcStatus = aaProcs[i].status;
                         if aaProcs[i].status != vboxcon.ProcessStatus_TerminatedNormally:
-                            reporter.error('Test failed: Waiting for non-stale processes #%ld'
-                                           ' resulted in status %ld, expected %ld' \
+                            reporter.error('Test failed: Waiting for non-stale processes #%d'
+                                           ' resulted in status %d, expected %d' \
                                    % (i, curProcStatus, vboxcon.ProcessStatus_TerminatedNormally));
                             fRc = False;
                     except:
-                        reporter.logXcpt('Waiting for non-stale process #%ld failed:' % (i,));
+                        reporter.logXcpt('Waiting for non-stale process #%d failed:' % (i,));
                         fRc = False;
                         break;
                 cProcs = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'processes'));
@@ -1646,7 +1985,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                 # anymore for) and the started + terminated non-stale processes (that we still keep
                 # a reference in aaProcs[] for).
                 if cProcs != (cStaleProcs * 2):
-                    reporter.error('Test failed: Got %ld total processes, expected %ld' \
+                    reporter.error('Test failed: Got %d total processes, expected %d' \
                                    % (cProcs, cStaleProcs));
                     fRc = False;
                 if fRc:
@@ -1656,7 +1995,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     for i in range(0, cStaleProcs):
                         curProcStatus = aaProcs[i].status;
                         if aaProcs[i].status != vboxcon.ProcessStatus_TerminatedNormally:
-                            reporter.error('Test failed: Non-stale processes #%ld has status %ld, expected %ld' \
+                            reporter.error('Test failed: Non-stale processes #%d has status %d, expected %d' \
                                    % (i, curProcStatus, vboxcon.ProcessStatus_TerminatedNormally));
                             fRc = False;
             if fRc:
@@ -1688,10 +2027,10 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                         reporter.logXcpt('Termination of blocking process failed, skipped:');
                 cProcs = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'processes'));
                 if cProcs != (cStaleProcs * 2): # Still should be 20 processes because we terminated the 10 newest ones.
-                    reporter.error('Test failed: Got %ld total processes, expected %ld' % (cProcs, cStaleProcs * 2));
+                    reporter.error('Test failed: Got %d total processes, expected %d' % (cProcs, cStaleProcs * 2));
                     fRc = False;
             cProcs = len(self.oTstDrv.oVBoxMgr.getArray(oGuestSession, 'processes'));
-            reporter.log2('Final guest session processes count: %ld' % (cProcs,));
+            reporter.log2('Final guest session processes count: %d' % (cProcs,));
             # Now try to close the session and see what happens.
             reporter.log2('Closing guest session ...');
             oGuestSession.close();
@@ -1908,7 +2247,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                 waitResult = curGuestSession.waitForArray(fWaitFor, 30 * 1000);
                 if      waitResult != vboxcon.GuestSessionWaitResult_Start \
                     and waitResult != vboxcon.GuestSessionWaitResult_WaitFlagNotSupported:
-                    reporter.error('Session did not start successfully, returned wait result: %ld' \
+                    reporter.error('Session did not start successfully, returned wait result: %d' \
                                    % (waitResult));
                     return (False, oTxsSession);
                 reporter.log('Session successfully started');
@@ -2082,7 +2421,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                 reporter.log('Waiting for process 1 being started ...');
                 waitRes = curProc.waitForArray([ vboxcon.ProcessWaitForFlag_Start ], 30 * 1000);
                 if waitRes != vboxcon.ProcessWaitResult_Start:
-                    reporter.error('Waiting for process 1 to start failed, got status %ld');
+                    reporter.error('Waiting for process 1 to start failed, got status %d');
                     fRc = False;
                 if fRc:
                     reporter.log('Waiting for process 1 to time out within 1ms ...');
@@ -2096,7 +2435,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     reporter.log('Waiting for process 1 to time out within 5000ms ...');
                     waitRes = curProc.waitForArray([ vboxcon.ProcessWaitForFlag_Terminate ], 5000);
                     if waitRes != vboxcon.ProcessWaitResult_Timeout:
-                        reporter.error('Waiting for process 1 did not time out when it should, got wait result %ld' % (waitRes,));
+                        reporter.error('Waiting for process 1 did not time out when it should, got wait result %d' % (waitRes,));
                         fRc = False;
                     else:
                         reporter.log('Waiting for process 1 timed out (5000), good');
@@ -2113,23 +2452,23 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     reporter.log('Waiting for process 2 being started ...');
                     waitRes = curProc.waitForArray([ vboxcon.ProcessWaitForFlag_Start ], 30 * 1000);
                     if waitRes != vboxcon.ProcessWaitResult_Start:
-                        reporter.error('Waiting for process 1 to start failed, got status %ld');
+                        reporter.error('Waiting for process 1 to start failed, got status %d');
                         fRc = False;
                     if fRc:
                         reporter.log('Waiting for process 2 to get killed because it ran out of execution time ...');
                         waitRes = curProc.waitForArray([ vboxcon.ProcessWaitForFlag_Terminate ], 30 * 1000);
                         if waitRes != vboxcon.ProcessWaitResult_Timeout:
-                            reporter.error('Waiting for process 2 did not time out when it should, got wait result %ld' \
+                            reporter.error('Waiting for process 2 did not time out when it should, got wait result %d' \
                                            % (waitRes,));
                             fRc = False;
                     if fRc:
                         reporter.log('Waiting for process 2 indicated an error, good');
                         if curProc.status != vboxcon.ProcessStatus_TimedOutKilled:
-                            reporter.error('Status of process 2 wrong; excepted %ld, got %ld' \
+                            reporter.error('Status of process 2 wrong; excepted %d, got %d' \
                                            % (vboxcon.ProcessStatus_TimedOutKilled, curProc.status));
                             fRc = False;
                         else:
-                            reporter.log('Status of process 2 correct (%ld)' % (vboxcon.ProcessStatus_TimedOutKilled,));
+                            reporter.log('Status of process 2 correct (%d)' % (vboxcon.ProcessStatus_TimedOutKilled,));
                     ## @todo Add curProc.terminate() as soon as it's implemented.
                 except:
                     reporter.errorXcpt('Exception for process 2:');
@@ -2440,15 +2779,15 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                 break;
             (fRc2, cDirs, cFiles) = self.gctrlReadDir(curTest, curRes, curGuestSession);
             curTest.closeSession();
-            reporter.log2('Test #%d: Returned %ld directories, %ld files total' % (i, cDirs, cFiles));
+            reporter.log2('Test #%d: Returned %d directories, %d files total' % (i, cDirs, cFiles));
             if fRc2 is curRes.fRc:
                 if fRc2 is True:
                     if curRes.numFiles != cFiles:
-                        reporter.error('Test #%d failed: Got %ld files, expected %ld' % (i, cFiles, curRes.numFiles));
+                        reporter.error('Test #%d failed: Got %d files, expected %d' % (i, cFiles, curRes.numFiles));
                         fRc = False;
                         break;
                     if curRes.numDirs != cDirs:
-                        reporter.error('Test #%d failed: Got %ld directories, expected %ld' % (i, cDirs, curRes.numDirs));
+                        reporter.error('Test #%d failed: Got %d directories, expected %d' % (i, cDirs, curRes.numDirs));
                         fRc = False;
                         break;
             else:
@@ -2538,88 +2877,85 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
         Tests querying file information through stat.
         """
 
+        # Basic stuff, existing stuff.
+        aoTests = [
+            tdTestSessionEx([ tdStepStatDir('.'),
+                              tdStepStatDir('..'),
+                              ]),
+        ];
         if oTestVm.isWindows():
-            sUser = "Administrator";
-        else:
-            sUser = "vbox";
-        sPassword = "password";
+            aoTests += [ tdTestSessionEx([ tdStepStatDir('C:\\Windows'),
+                                           tdStepStatDir('C:\\Windows\\System32'),
+                                           tdStepStatDir('C:\\Windows\\System32\\'),
+                                           tdStepStatDir('C:\\Windows\\System32\\.'),
+                                           tdStepStatDir('C:\\Windows\\System32\\.\\'),
+                                           tdStepStatDir('C:\\Windows\\System32\\..'),
+                                           tdStepStatDir('C:\\Windows\\System32\\..\\'),
+                                           tdStepStatDir('C:\\Windows\\System32\\..\\\\'),
+                                           tdStepStatDir('C:\\Windows\\System32\\\\..\\\\'),
+                                           tdStepStatDir('C:/Windows/System32'),
+                                           tdStepStatDir('C:/Windows/System32/'),
+                                           tdStepStatDir('c:/winDowS/sYsTeM32/'),
+                                           tdStepStatDir('C:/Windows/System32/.'),
+                                           tdStepStatDir('C:/Windows/System32/./'),
+                                           tdStepStatDir('C:/Windows/System32/..'),
+                                           tdStepStatDir('C:/Windows/System32/../'),
+                                           tdStepStatDir('C:/Windows/System32/..//'),
+                                           tdStepStatDir('C:/Windows/System32//..//'),
+                                           tdStepStatFile('C:\\Windows\\System32\\kernel32.dll'),
+                                           tdStepStatFile('C:/Windows/System32/kernel32.dll')
+                                           ]) ];
+        elif oTestVm.isOS2():
+            aoTests += [ tdTestSessionEx([ tdStepStatDir('C:\\OS2'),
+                                           tdStepStatDir('C:\\OS2\\DLL'),
+                                           tdStepStatDir('C:\\OS2\\DLL\\'),
+                                           tdStepStatDir('C:/OS2/DLL'),
+                                           tdStepStatDir('c:/OS2/DLL'),
+                                           tdStepStatDir('c:/OS2/DLL/'),
+                                           tdStepStatFile('C:\\CONFIG.SYS'),
+                                           tdStepStatFile('C:\\OS2\\DLL\\DOSCALL1.DLL'),
+                                           ]) ];
+        else: # generic unix.
+            aoTests += [ tdTestSessionEx([ tdStepStatDir('/'),
+                                           tdStepStatDir('///'),
+                                           tdStepStatDir('/usr/bin/.'),
+                                           tdStepStatDir('/usr/bin/./'),
+                                           tdStepStatDir('/usr/bin/..'),
+                                           tdStepStatDir('/usr/bin/../'),
+                                           tdStepStatFile('/bin/ls'),
+                                           tdStepStatFile('/bin/cp'),
+                                           tdStepStatFile('/bin/date'),
+                                           ]) ];
+        # None existing stuff.
+        if oTestVm.isWindows() or oTestVm.isOS2():
+            aoTests += [ tdTestSessionEx([ tdStepStatFileNotFound('C:\\NoSuchFileOrDirectory', ),
+                                           tdStepStatPathNotFound('C:\\NoSuchDirectory\\'),
+                                           tdStepStatPathNotFound('C:/NoSuchDirectory/'),
+                                           tdStepStatPathNotFound('C:\\NoSuchDirectory\\.'),
+                                           tdStepStatPathNotFound('C:/NoSuchDirectory/.'),
+                                           tdStepStatPathNotFound('C:\\NoSuchDirectory\\NoSuchFileOrDirectory'),
+                                           tdStepStatPathNotFound('C:/NoSuchDirectory/NoSuchFileOrDirectory'),
+                                           tdStepStatPathNotFound('C:/NoSuchDirectory/NoSuchFileOrDirectory/'),
+                                           tdStepStatPathNotFound('N:\\'), # ASSUMES nothing mounted on N:!
+                                           tdStepStatPathNotFound('\\\\NoSuchUncServerName\\NoSuchShare'),
+                                           ]) ];
+        else: # generic unix.
+            aoTests += [ tdTestSessionEx([ tdStepStatFileNotFound('/NoSuchFileOrDirectory', ),
+                                           tdStepStatFileNotFound('/bin/NoSuchFileOrDirectory'),
+                                           tdStepStatPathNotFound('/NoSuchDirectory/'),
+                                           tdStepStatPathNotFound('/NoSuchDirectory/.'),
+                                           ]) ];
+        # Invalid parameter check.
+        aoTests += [ tdTestSessionEx([ tdStepStat('', vbox.ComError.E_INVALIDARG), ]), ];
+
+        # Some test VM specific tests.
+        if oTestVm.sVmName == 'tst-xppro':
+            aoTests += [ tdTestSessionEx([ tdStepStatFileSize('c:\\Windows\\system32\\kernel32.dll', 926720), ]) ];
 
-        aaTests = [];
-        if oTestVm.isWindows():
-            aaTests.extend([
-                # Invalid stuff.
-                [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = ''),
-                  tdTestResultFileStat(fRc = False) ],
-                [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows'),
-                  tdTestResultFileStat(fRc = False) ],
-                [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = 'C:\\Windows'),
-                  tdTestResultFileStat(fRc = False) ],
-                # More unusual stuff.
-                [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = 'z:\\'),
-                  tdTestResultFileStat(fRc = False) ],
-                [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = '\\\\uncrulez\\foo'),
-                  tdTestResultFileStat(fRc = False) ],
-                # Non-existing stuff.
-                [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Apps\\nonexisting'),
-                  tdTestResultFileStat(fRc = False) ],
-                [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Apps\\testDirRead'),
-                  tdTestResultFileStat(fRc = False) ]
-            ]);
-
-            if oTestVm.sVmName == 'tst-xppro':
-                aaTests.extend([
-                    # Directories; should fail.
-                    [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = '../../Windows/Fonts'),
-                      tdTestResultFileStat(fRc = False) ],
-                    [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Windows\\Help'),
-                      tdTestResultFileStat(fRc = False) ],
-                    [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Windows\\system32'),
-                      tdTestResultFileStat(fRc = False) ],
-                    # Regular files.
-                    [ tdTestFileStat(sUser = sUser, sPassword = sPassword, sFile = 'c:\\Windows\\system32\\kernel32.dll'),
-                      tdTestResultFileStat(fRc = False, cbSize = 926720, eFileType = vboxcon.FsObjType_File) ]
-                ]);
-        else:
-            reporter.log('No OS-specific tests for non-Windows yet!');
-
-        fRc = True;
-        for (i, aTest) in enumerate(aaTests):
-            curTest = aTest[0]; # tdTestExec, use an index, later.
-            curRes  = aTest[1]; # tdTestResult
-            reporter.log('Testing #%d, sFile="%s" ...' % (i, curTest.sFile));
-            curTest.setEnvironment(oSession, oTxsSession, oTestVm);
-            fRc, curGuestSession = curTest.createSession('testGuestCtrlFileStat: Test #%d' % (i,));
-            if fRc is False:
-                reporter.error('Test #%d failed: Could not create session' % (i,));
-                break;
-            fileObjInfo = None;
-            try:
-                if self.oTstDrv.fpApiVer >= 5.0:
-                    fileObjInfo = curGuestSession.fsObjQueryInfo(curTest.sFile, True);
-                else:
-                    fileObjInfo = curGuestSession.fileQueryInfo(curTest.sFile);
-            except:
-                if curRes.fRc is True:
-                    reporter.errorXcpt('Querying file information for "%s" failed:' % (curTest.sFile,));
-                    fRc = False;
-                    break;
-                else:
-                    reporter.logXcpt('Querying file information for "%s" failed expectedly, skipping:' % (curTest.sFile,));
-            curTest.closeSession();
-            if fileObjInfo is not None:
-                eFileType = fileObjInfo.type;
-                if curRes.eFileType != eFileType:
-                    reporter.error('Test #%d failed: Got file type %ld, expected %ld' % (i, eFileType, curRes.eFileType));
-                    fRc = False;
-                    break;
-                cbFile = long(fileObjInfo.objectSize);
-                if curRes.cbSize != cbFile:
-                    reporter.error('Test #%d failed: Got %ld bytes size, expected %ld bytes' % (i, cbFile, curRes.cbSize));
-                    fRc = False;
-                    break;
-                ## @todo Add more checks later.
-
-        return (fRc, oTxsSession);
+        #
+        # Execute the tests.
+        #
+        return tdTestSessionEx.executeListTestSessions(aoTests, self.oTstDrv, oSession, oTxsSession, oTestVm, 'FsStat');
 
     def testGuestCtrlFileRead(self, oSession, oTxsSession, oTestVm): # pylint: disable=R0914
         """
@@ -2711,7 +3047,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
         for (i, aTest) in enumerate(aaTests):
             curTest = aTest[0]; # tdTestFileReadWrite, use an index, later.
             curRes  = aTest[1]; # tdTestResult
-            reporter.log('Testing #%d, sFile="%s", cbToReadWrite=%d, sOpenMode="%s", sDisposition="%s", cbOffset=%ld ...' % \
+            reporter.log('Testing #%d, sFile="%s", cbToReadWrite=%d, sOpenMode="%s", sDisposition="%s", cbOffset=%d ...' % \
                          (i, curTest.sFile, curTest.cbToReadWrite, curTest.sOpenMode, curTest.sDisposition, curTest.cbOffset));
             curTest.setEnvironment(oSession, oTxsSession, oTestVm);
             fRc, curGuestSession = curTest.createSession('testGuestCtrlFileRead: Test #%d' % (i,));
@@ -2730,7 +3066,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     curOffset = long(curFile.offset);
                     resOffset = long(curTest.cbOffset);
                     if curOffset != resOffset:
-                        reporter.error('Test #%d failed: Initial offset on open does not match: Got %ld, expected %ld' \
+                        reporter.error('Test #%d failed: Initial offset on open does not match: Got %d, expected %d' \
                                        % (i, curOffset, resOffset));
                         fRc = False;
                 else:
@@ -2747,13 +3083,13 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     aBufRead = curFile.read(curTest.cbToReadWrite, 30 * 1000);
                     if  curRes.cbProcessed > 0 \
                     and curRes.cbProcessed is not len(aBufRead):
-                        reporter.error('Test #%d failed: Read buffer length does not match: Got %ld, expected %ld' \
+                        reporter.error('Test #%d failed: Read buffer length does not match: Got %d, expected %d' \
                                        % (i, len(aBufRead), curRes.cbProcessed));
                         fRc = False;
                     if fRc:
                         if  curRes.aBuf is not None \
                         and bytes(curRes.aBuf) != bytes(aBufRead):
-                            reporter.error('Test #%d failed: Got buffer\n%s (%ld bytes), expected\n%s (%ld bytes)' \
+                            reporter.error('Test #%d failed: Got buffer\n%s (%d bytes), expected\n%s (%d bytes)' \
                                            % (i, map(hex, map(ord, aBufRead)), len(aBufRead), \
                                               map(hex, map(ord, curRes.aBuf)), len(curRes.aBuf)));
                             reporter.error('Test #%d failed: Got buffer\n%s, expected\n%s' \
@@ -2763,7 +3099,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                 curOffset = long(curFile.offset);
                 resOffset = long(curRes.cbOffset);
                 if curOffset != resOffset:
-                    reporter.error('Test #%d failed: Final offset does not match: Got %ld, expected %ld' \
+                    reporter.error('Test #%d failed: Final offset does not match: Got %d, expected %d' \
                                    % (i, curOffset, resOffset));
                     fRc = False;
                 curFile.close();
@@ -2825,7 +3161,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
         for (i, aTest) in enumerate(aaTests):
             curTest = aTest[0]; # tdTestFileReadWrite, use an index, later.
             curRes  = aTest[1]; # tdTestResult
-            reporter.log('Testing #%d, sFile="%s", cbToReadWrite=%d, sOpenMode="%s", sDisposition="%s", cbOffset=%ld ...' % \
+            reporter.log('Testing #%d, sFile="%s", cbToReadWrite=%d, sOpenMode="%s", sDisposition="%s", cbOffset=%d ...' % \
                          (i, curTest.sFile, curTest.cbToReadWrite, curTest.sOpenMode, curTest.sDisposition, curTest.cbOffset));
             curTest.setEnvironment(oSession, oTxsSession, oTestVm);
             fRc, curGuestSession = curTest.createSession('testGuestCtrlFileWrite: Test #%d' % (i,));
@@ -2844,7 +3180,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     curOffset = long(curFile.offset);
                     resOffset = long(curTest.cbOffset);
                     if curOffset != resOffset:
-                        reporter.error('Test #%d failed: Initial offset on open does not match: Got %ld, expected %ld' \
+                        reporter.error('Test #%d failed: Initial offset on open does not match: Got %d, expected %d' \
                                        % (i, curOffset, resOffset));
                         fRc = False;
                 else:
@@ -2861,7 +3197,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                     cBytesWritten = curFile.write(curTest.aBuf, 30 * 1000);
                     if  curRes.cbProcessed > 0 \
                     and curRes.cbProcessed != cBytesWritten:
-                        reporter.error('Test #%d failed: Written buffer length does not match: Got %ld, expected %ld' \
+                        reporter.error('Test #%d failed: Written buffer length does not match: Got %d, expected %d' \
                                        % (i, cBytesWritten, curRes.cbProcessed));
                         fRc = False;
                     if fRc:
@@ -2878,13 +3214,13 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                         if  fRc \
                         and long(curFile.offset) != curTest.cbOffset:
                             reporter.error('Test #%d failed: Initial write position does not match current position, \
-                                           got %ld, expected %ld' \
+                                           got %d, expected %d' \
                                            % (i, long(curFile.offset), curTest.cbOffset));
                             fRc = False;
                     if fRc:
                         aBufRead = curFile.read(curTest.cbToReadWrite, 30 * 1000);
                         if len(aBufRead) != curTest.cbToReadWrite:
-                            reporter.error('Test #%d failed: Got buffer length %ld, expected %ld' \
+                            reporter.error('Test #%d failed: Got buffer length %d, expected %d' \
                                            % (i, len(aBufRead), curTest.cbToReadWrite));
                             fRc = False;
                         if  fRc \
@@ -2897,7 +3233,7 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase):
                 curOffset = long(curFile.offset);
                 resOffset = long(curRes.cbOffset);
                 if curOffset != resOffset:
-                    reporter.error('Test #%d failed: Final offset does not match: Got %ld, expected %ld' \
+                    reporter.error('Test #%d failed: Final offset does not match: Got %d, expected %d' \
                                    % (i, curOffset, resOffset));
                     fRc = False;
                 curFile.close();
diff --git a/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py b/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py
index 11f5910..17ec4c8 100755
--- a/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py
+++ b/src/VBox/ValidationKit/tests/unittests/tdUnitTest1.py
@@ -27,7 +27,7 @@ CDDL are applicable instead of those of the GPL.
 You may elect to license modified versions of this file under the
 terms and conditions of either the GPL or the CDDL or both.
 """
-__version__ = "$Revision: 100880 $"
+__version__ = "$Revision: 101420 $"
 
 
 # Standard Python imports.
@@ -59,13 +59,12 @@ class tdUnitTest1(vbox.TestDriver):
     ## @note This shall be empty before we release 4.3!
     kdTestCasesBuggyPerOs = {
         'darwin': {
-            'testcase/tstRTR0DbgKrnlInfoDriver': '',    # Busted testcase, probably. (VERR_SYMBOL_NOT_FOUND)
+            'testcase/tstX86-1': '',                    # 'FSTP M32R, ST0' fails; no idea why.
         },
         'solaris': {
             'testcase/tstIntNet-1': '',                 # Fails opening rge0, probably a generic issue figuring which nic to use.
             'testcase/tstIprtList': '',                 # Crashes in the multithreaded test, I think.
             'testcase/tstRTCritSect': '',               # Fairness/whatever issue here.
-            'testcase/tstRTR0DbgKrnlInfoDriver': '',    # Doesn't even load R0.
             'testcase/tstRTR0MemUserKernelDriver': '',  # Failes when kernel to kernel buffers.
             'testcase/tstRTSemRW': '',                  # line 338: RTSemRWReleaseRead(hSemRW): got VERR_ACCESS_DENIED
             'testcase/tstRTStrAlloc': '',               # VERR_NO_STR_MEMORY!
diff --git a/src/VBox/ValidationKit/utils/network/NetPerf.cpp b/src/VBox/ValidationKit/utils/network/NetPerf.cpp
index e2b24f0..886a7fd 100644
--- a/src/VBox/ValidationKit/utils/network/NetPerf.cpp
+++ b/src/VBox/ValidationKit/utils/network/NetPerf.cpp
@@ -1416,6 +1416,7 @@ static int netperfTCPClientDoLatency(NETPERFPARAMS *pParams)
         {
             while (i-- > 0)
                 RTMemFree(apPackets[i]);
+            RTMemFree(pvReadBuf);
             return RTTestIFailedRc(VERR_NO_MEMORY, "Out of memory");
         }
         RTRandBytes(apPackets[i], pParams->cbPacket);
@@ -1578,6 +1579,8 @@ static int netperfTCPClientDoLatency(NETPERFPARAMS *pParams)
     for (i = 0; i < RT_ELEMENTS(apPackets); i++)
         RTMemFree(apPackets[i]);
 
+    RTMemFree(pvReadBuf);
+
     return rc;
 }
 
@@ -1860,7 +1863,7 @@ int main(int argc, char *argv[])
                 return RTEXITCODE_SUCCESS;
 
             case 'V':
-                RTPrintf("$Revision: 100880 $\n");
+                RTPrintf("$Revision: 101402 $\n");
                 return RTEXITCODE_SUCCESS;
 
             case 'w':

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-virtualbox/virtualbox.git



More information about the Pkg-virtualbox-commits mailing list