Virtualbox Drag and Drop not working, freezes at "Dropping Data 0%"

I've enabled Drag & Drop in Virtualbox, and I tried dragging a small file from host to guest (both are win7).

I get this dialog:

enter image description here

And it stays at 0% forever.

How can I fix this and make Drag and Drop work?


Solution 1:

Ok, after restarting the VM, and also killing and restarting Explorer, drag&drop was working again. I have no idea why it stopped working or why the restart helped.

Solution 2:

Make a new file with a *.ps1 extension, and save the following PowerShell script to that file. Then when this issue occurs, click cancel(the red X), then run the script, and try the copy again. Script obtained from this answer:

echo "Trying to restart VBoxClient"

$vbox_process = Get-Process VBoxTray
Write-verbose $vbox_process
$procID = $vbox_process.id

if ($procID  -gt 0)
{    
    $cmdline = (Get-WMIObject Win32_Process -Filter "Handle=$procID").CommandLine
    Write-Verbose $cmdline

    Write-Verbose "Stopping VBoxTray"
    $vbox_process.Kill()
    $vbox_process.WaitForExit()
    Write-Verbose "VBoxTray stopped"

    Write-Verbose "Starting VBoxTray"
    Start-Process -FilePath $cmdline.Split(' ')[0]
    echo "VBoxTray Restarted. All Done"
} else {    
    Write-Warning 'Could not find existing vboxTray process. Launching direct?'
    Start-Process -FilePath "C:\Windows\System32\VBoxTray.exe"     
}