VirtualBox App doesn't open folder list for import VM

Just about everything is virtual these days. Topics relating to virutalization go here.

Moderator: Lillian.W@AST

Post Reply
Throntorus
Posts: 12
youtube meble na wymiar Warszawa
Joined: Sun Sep 25, 2022 1:12 am

VirtualBox App doesn't open folder list for import VM

Post by Throntorus »

Hello,

I am trying to import a VM to virtual box (app installed via adm app manager). But the app wont open the folder list, where i can choose a ova-file. It seems to be stuck while loading (please see screenshot in the attachement).

At this point I am not able to import VMs on my Asustor NAs - I would appreciate your support.

Thanks!
Attachments
virtualbox.png
virtualbox.png (20.54 KiB) Viewed 3492 times
Throntorus
Posts: 12
Joined: Sun Sep 25, 2022 1:12 am

Re: VirtualBox App doesn't open folder list for import VM

Post by Throntorus »

I found a solution, perhaps it helps somebody in the future:

https://github.com/phpvirtualbox/phpvir ... issues/273

https://github.com/phpvirtualbox/phpvir ... a8b31ad8c2

Yust edit the file ".../endpoints/jqueryFileTree.php" in the virtualbox folder as shown in the second link.

Below ist the full functions code if the above links won't work anymore:

Code: Select all

/*
 * Get directory entries
 */
function getdir($dir, $dirsOnly=false, $recurse=array()) {

	global $allowed_exts;

	if(!$dir) $dir = DSEP;

	$entries = getDirEntries($dir, $dirsOnly);

    if(!count($entries))
    	return array();

    $dirents = array();
    foreach($entries as $path => $type) {

        if($type == 'folder' && count($recurse) && (strcasecmp($recurse[0],vbox_basename($path)) == 0)) {

        	$entry = folder_entry($path, false, true);

            $entry['children'] = getdir($dir.DSEP.array_shift($recurse), $dirsOnly, $recurse);

            array_push($dirents, $entry);

        } else {

        	// Push folder on to stack
        	if($type == 'folder') {

        	   array_push($dirents, folder_entry($path));

        	// Push file on to stack
        	} else {

        		$ext = strtolower(preg_replace('/^.*\./', '', $path));

                if(count($allowed_exts) && !$allowed_exts['.'.$ext]) continue;

                array_push($dirents, file_entry($path));
        	}
        }

    }

    return $dirents;

}
mc1457
Posts: 5
Joined: Sun Nov 13, 2022 9:10 pm

Re: VirtualBox App doesn't open folder list for import VM

Post by mc1457 »

Changing back to PHP 7.3 fixed it for me (had updated to PHP 8.1)
Post Reply

Return to “Virtualization”