phpvirtualbox / phpvirtualbox

A web interface to manage and access Virtualbox machines.
Other
1.09k stars 273 forks source link

Support for Virtualbox 6.1 #210

Open klukaszczyk opened 4 years ago

klukaszczyk commented 4 years ago

Hi, Please add support for VirtualBox 6.1. Currently released version is RC1. More information here: https://forums.virtualbox.org/viewtopic.php?f=15&t=95711

Polve commented 4 years ago

6.1 is now out... Support would be veeery welcome :-)

borisneubert commented 4 years ago

Clicking on any virtual machine in the web UI gives following error with VirtualBox 6.1:

Method 'ns1:IMachine_getVRAMSize' not implemented: method name or namespace not recognized

Thus, phpvirtualbox is currently unusable with VirtualBox 6.1

cesium147 commented 4 years ago

Changed WSDL. In new SDK VRAMSize is property of Class IGraphicsAdapter. it's need to modify endpoints/lib/vboxconnector.php to work.

Some code ``` user@test:~/src/phpvirtualbox$ grep -A5 -re '::VRAMSize' endpoints/lib/vboxweb-6.0.wsdl: endpoints/lib/vboxweb-6.0.wsdl- endpoints/lib/vboxweb-6.0.wsdl- endpoints/lib/vboxweb-6.0.wsdl- endpoints/lib/vboxweb-6.0.wsdl- endpoints/lib/vboxweb-6.0.wsdl- -- endpoints/lib/vboxweb-6.0.wsdl: endpoints/lib/vboxweb-6.0.wsdl- endpoints/lib/vboxweb-6.0.wsdl- endpoints/lib/vboxweb-6.0.wsdl- endpoints/lib/vboxweb-6.0.wsdl- endpoints/lib/vboxweb-6.0.wsdl- -- endpoints/lib/vboxweb-6.1.wsdl: endpoints/lib/vboxweb-6.1.wsdl- endpoints/lib/vboxweb-6.1.wsdl- endpoints/lib/vboxweb-6.1.wsdl- endpoints/lib/vboxweb-6.1.wsdl- endpoints/lib/vboxweb-6.1.wsdl- -- endpoints/lib/vboxweb-6.1.wsdl: endpoints/lib/vboxweb-6.1.wsdl- endpoints/lib/vboxweb-6.1.wsdl- endpoints/lib/vboxweb-6.1.wsdl- endpoints/lib/vboxweb-6.1.wsdl- endpoints/lib/vboxweb-6.1.wsdl- -- ``` ``` Exception Object ( [message:protected] => Attribute does not exist [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/phpvirtualbox/endpoints/lib/vboxServiceWrappers.php [line:protected] => 56 [trace:Exception:private] => Array ( [0] => Array ( [file] => /var/www/phpvirtualbox/endpoints/lib/vboxconnector.php [line] => 4221 [function] => __get [class] => VBox_ManagedObject [type] => -> [args] => Array ( [0] => VRAMSize ) ) [1] => Array ( [file] => /var/www/phpvirtualbox/endpoints/lib/vboxconnector.php [line] => 3564 [function] => _machineGetDetails [class] => vboxconnector [type] => -> [args] => Array ( [0] => IMachine Object ( [connection:protected] => SoapClient Object ( [location] => http://127.0.0.1:18083/ [_features] => 5 [_connection_timeout] => 20 [_stream_context] => Resource id #5 [_soap_version] => 1 [sdl] => Resource id #6 [httpsocket] => Resource id #7 [_use_proxy] => 0 [httpurl] => Resource id #23 ) [handle:protected] => 7064513922de91d4-0000000000000002 ) ) ) [2] => Array ( [file] => /var/www/phpvirtualbox/endpoints/lib/vboxconnector.php [line] => 951 [function] => remote_machineGetDetails [class] => vboxconnector [type] => -> [args] => Array ( [0] => Array ( [vm] => ce858e0e-1592-4dc5-bae7-9a6ee756b2b9 ) ) ) [3] => Array ( [file] => /var/www/phpvirtualbox/endpoints/api.php [line] => 316 [function] => __call [class] => vboxconnector [type] => -> [args] => Array ( [0] => machineGetDetails [1] => Array ( [0] => Array ( [vm] => ce858e0e-1592-4dc5-bae7-9a6ee756b2b9 ) [1] => Array ( [0] => Array ( [data] => Array ( [responseData] => Array ( ) ) [errors] => Array ( ) [persist] => Array ( ) [messages] => Array ( ) ) ) ) ) ) ) [previous:Exception:private] => ) ```
cesium147 commented 4 years ago

instruction from here How to update to 6.0.10 - SharedFolder #185

current sdk - https://download.virtualbox.org/virtualbox/6.1.0/VirtualBoxSDK-6.1.0-135406.zip

quickfix patch v0.4 ``` diff ../sdk-6.1.0/bindings/webservice/vboxwebService.wsdl endpoints/lib/vboxwebService-6.1.wsdl 8c8 < --- > diff --git a/endpoints/lib/config.php b/endpoints/lib/config.php index 192d829..0a2eb24 100644 --- a/endpoints/lib/config.php +++ b/endpoints/lib/config.php @@ -14,7 +14,7 @@ /* * This version of phpVirtualBox */ -define('PHPVBOX_VER', '6.0-0'); +define('PHPVBOX_VER', '6.1-0'); class phpVBoxConfigClass { diff --git a/endpoints/lib/vboxconnector.php b/endpoints/lib/vboxconnector.php index 2224d32..2043740 100644 --- a/endpoints/lib/vboxconnector.php +++ b/endpoints/lib/vboxconnector.php @@ -1912,11 +1912,11 @@ class vboxconnector { if(@$this->settings->enableCustomIcons) $m->setExtraData('phpvb/icon', $args['customIcon']); - $m->VRAMSize = $args['VRAMSize']; + $m->GraphicsAdapter->VRAMSize = $args['VRAMSize']; // Video - $m->accelerate3DEnabled = $args['accelerate3DEnabled']; - $m->accelerate2DVideoEnabled = $args['accelerate2DVideoEnabled']; + $m->GraphicsAdapter->accelerate3DEnabled = $args['accelerate3DEnabled']; + $m->GraphicsAdapter->accelerate2DVideoEnabled = $args['accelerate2DVideoEnabled']; // VRDE settings try { @@ -3253,7 +3254,7 @@ class vboxconnector { } /* @var $progress IProgress */ - $progress = $machine->launchVMProcess($this->session->handle, "headless", ""); + $progress = $machine->launchVMProcess($this->session->handle, "headless", NULL); } catch (Exception $e) { // Error opening session @@ -3850,7 +3851,8 @@ class vboxconnector { $this->session->machine->firmwareType = (string)$defaults->recommendedFirmware; $this->session->machine->chipsetType = (string)$defaults->recommendedChipset; $this->session->machine->ClipboardMode = 'Disabled'; - if(intval($defaults->recommendedVRAM) > 0) $this->session->machine->VRAMSize = intval($defaults->recommendedVRAM); + if(intval($defaults->recommendedVRAM) > 0) $this->session->machine->GraphicsAdapter->setVRAMSize(intval($defaults->recommendedVRAM)); $this->session->machine->setCpuProperty('PAE',$defaults->recommendedPAE); // USB input devices @@ -4218,11 +4218,11 @@ class vboxconnector { 'CPUCount' => $m->CPUCount, 'HPETEnabled' => $m->HPETEnabled, 'memorySize' => $m->memorySize, - 'VRAMSize' => $m->VRAMSize, + 'VRAMSize' => $m->GraphicsAdapter->VRAMSize, 'pointingHIDType' => (string)$m->pointingHIDType, 'keyboardHIDType' => (string)$m->keyboardHIDType, - 'accelerate3DEnabled' => $m->accelerate3DEnabled, - 'accelerate2DVideoEnabled' => $m->accelerate2DVideoEnabled, + 'accelerate3DEnabled' => $m->GraphicsAdapter->accelerate3DEnabled, + 'accelerate2DVideoEnabled' => $m->GraphicsAdapter->accelerate2DVideoEnabled, 'BIOSSettings' => array( 'ACPIEnabled' => $m->BIOSSettings->ACPIEnabled, 'IOAPICEnabled' => $m->BIOSSettings->IOAPICEnabled, @@ -4231,7 +4231,7 @@ class vboxconnector { 'firmwareType' => (string)$m->firmwareType, 'snapshotFolder' => $m->snapshotFolder, 'ClipboardMode' => (string)$m->ClipboardMode, - 'monitorCount' => $m->monitorCount, + 'monitorCount' => $m->GraphicsAdapter->monitorCount, 'pageFusionEnabled' => $m->pageFusionEnabled, 'VRDEServer' => (!$m->VRDEServer ? null : array( 'enabled' => $m->VRDEServer->enabled, @@ -5842,4 +5842,4 @@ class vboxconnector { return @$rcodes['0x'.strtoupper(dechex($c))] . ' (0x'.strtoupper(dechex($c)).')'; } -} \ No newline at end of file +} ```
klukaszczyk commented 4 years ago

Hi cesium147, Thx for patch, but it doesn't seem to work for me. I get an error : Function ("IMachine_getGraphicsAdapter") is not a valid method for this service

Details in attached file.

details.txt

cesium147 commented 4 years ago

I get an error : Function ("IMachine_getGraphicsAdapter") is not a valid method for this service

@klukaszczyk

mkdir ~/src
cd ~/src
wget https://download.virtualbox.org/virtualbox/6.1.0/VirtualBoxSDK-6.1.0-135406.zip
unzip VirtualBoxSDK-6.1.0-135406.zip
mv sdk sdk-6.1.0
git clone https://github.com/phpvirtualbox/phpvirtualbox.git
cd phpvirtualbox
cp -v ../sdk-6.1.0/bindings/webservice/vboxweb.wsdl endpoints/lib/vboxweb-6.1.wsdl
cp -v ../sdk-6.1.0/bindings/webservice/vboxwebService.wsdl endpoints/lib/vboxwebService-6.1.wsdl

after these apply my quickfix patch v0.3

Polve commented 4 years ago

Can you please create a fork with all the necessary patches correctly applied? I think that would help many people, thanks!

klukaszczyk commented 4 years ago

@cesium147 Unfortunately it didn't help. I'm still have the same error. Could you as suggest @Polve create a fork with all patched files ?

klukaszczyk commented 4 years ago

Hi, I found the problem. In addition to the instructions sent by @cesium147 you need to modify variable PHPVBOX_VER in file /endpoints/lib/config.php as follows: define('PHPVBOX_VER', '6.1-0'); After that everything work like a charm

KrakenTyio commented 4 years ago

Rewrite PHPVBOX_VER not help bc /endpoints/lib/vboxwebService-6.1.wsdl is not present Oh i see now, this sdk is need to be downloaded

Polve commented 4 years ago

Thanks @cesium147 for your PR, I hope it will be merged soon!

tasteeeeee commented 4 years ago

I get an error : Function ("IMachine_getGraphicsAdapter") is not a valid method for this service

@klukaszczyk

mkdir ~/src
cd ~/src
wget https://download.virtualbox.org/virtualbox/6.1.0/VirtualBoxSDK-6.1.0-135406.zip
unzip VirtualBoxSDK-6.1.0-135406.zip
mv sdk sdk-6.1.0
git clone https://github.com/phpvirtualbox/phpvirtualbox.git
cd phpvirtualbox
cp -v ../sdk-6.1.0/bindings/webservice/vboxweb.wsdl endpoints/lib/vboxweb-6.1.wsdl
cp -v ../sdk-6.1.0/bindings/webservice/vboxwebService.wsdl endpoints/lib/vboxwebService-6.1.wsdl

after these apply my quickfix patch v0.3

Hi i got same error. i try your phpvirtualbox-a84a1ea251d999da605baa06e9440a1b62e2fa14 from 15.12.i try modify in connector. $m->createSharedFolder($s['name'],$s['hostPath'],(bool)$s['writable'],(bool)$s['autoMount']); to $m->createSharedFolder($s['name'],$s['hostPath'],(bool)$s['writable'],(bool)$s['autoMount'],$s['autoMountPoint']); not work for me. fix v0.3 it`s correct name or you mean v0.4? where i watch v0.3 fix thanks.

log.txt

klukaszczyk commented 4 years ago

Hi @tasteeeeee You need to apply quickfix patch v0.4 by @cesium147 or use complete solution from fork https://github.com/cesium147/phpvirtualbox

tasteeeeee commented 4 years ago

Work well thanks, but after install extend puck for vrde, vms cant start :)

TheOneWithTheBraid commented 4 years ago

Could you merge then/create a pull request?

tasteeeeee commented 4 years ago

its not a problem phpvirtualbox , its a problem virtualbox, vms cant start from console too

VBoxManage: error: Invalid entry in the device registration structure. (VERR_PDM_INVALID_DEVICE_REGISTRATION) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

borisneubert commented 4 years ago

Have been successfully working with solution by @cesium147 using the 6.1-0 branch. Just noticed that taking snapshots in phpvirtualbox do not work. Taking a snapshot shows the dialog asking for name and description, then briefly the spinning wheel, and that's all. No snapshot taken. Web developer console remains silent about potential reason, no error thrown either. Taking snapshots with VBoxManage on the command line works, though.

uschindler commented 4 years ago

I can confirm, snapshooting does not work. it's just a no-op.

When taking a snapshot with command line, it promptly appears in the GUI under snapshots. Restoring the snapshot also works. It looks like just taking a snapshot does not work. How to debug this?

pessotti5 commented 4 years ago

Hi @tasteeeeee You need to apply quickfix patch v0.4 by @cesium147 or use complete solution from fork https://github.com/cesium147/phpvirtualbox

Hello people. I apologize for my ignorance. How do I apply the patch? I am confused by the post. Doesn't the "complete solution" have the files updated? I've tried several ways but I get: SoapFault Object ( [message: protected] => Method 'ns1: IMachine_getVRAMSize' not implemented: method name or namespace not recognized

Thanks in advance!

finger65 commented 4 years ago

... How do I apply the patch?

I'm stuck in the same situation ... Is it enough replacing (old)/adding (new) files in the same path where I find old ones?

chotaire commented 4 years ago

As of today the current develop branch will give you working VirtualBox 6.1 support. @klukaszczyk, I think this issue can be closed. Happy testing.

Please send all your ♥ to @cesium147.

ensemblebd commented 4 years ago

WOW! it works. Extreme <3 @cesium147 Thank you guys!!!!!!! I no longer must xterm xorg over ssh putty to manage the system. You've made a major difference in my life, thank you!

p.s. had to reboot vboxwebsrv, then works instantly.

finger65 commented 4 years ago

I updated all requested files but now, when I try to access phpVirtualbox from browser (Chrome, as usual), I get this error:

There was an error obtaining the list of registered virtual machines from VirtualBox. Make sure vboxwebsrv is running and that the settings in config.php are correct. ------------------------------- Details: readyState: "4" responseText: "" status: "500" statusText: "Internal Server Error"

Any suggestion?

chotaire commented 4 years ago

@finger65 How do you mean update all requested files? Make a backup of your existing phpvirtualbox installation and thereby empty the web folder. You download current develop branch at https://github.com/phpvirtualbox/phpvirtualbox/archive/develop.zip and unpack it into your web folder. Copy the config from your old phpvirtualbox installation into this directory. You also need to update VirtualBox to Version 6.1 and make sure that vboxwebsrv is running properly.

chotaire commented 4 years ago

And please ignore instructions to update whatever files from this ticket. The current develop branch of phpvirtualbox perfectly supports VirtualBox 6.1. Someone please close this issue. @h6w? There's also dozens of other issues that could be closed because they're obsolete.

finger65 commented 4 years ago

And please ignore instructions to update whatever files from this ticket. Got it!

Now it works fine, thanx!!

uschindler commented 4 years ago

One general recommendation is to clear browser cache. phpvirtualbox does not correctly set last-modified headers for all resources, so in most cases this happens after any update.

uschindler commented 4 years ago

I think we should close this issue. I can't do this.

h6w commented 4 years ago

@uschindler Can you open another issue regarding the last-modified headers? That sounds like a bug to me.

This issue will be closed once the 6.1 version is released which will be Feb 14 if we don't see any more major issues before then. :-)

remlei commented 4 years ago

the latest development release works almost, except that shared folder is causing a issue

readyState: "4" responseText: "" status: "500" statusText: "Internal Server Error"

chotaire commented 4 years ago

@maxcalandrelli is this something you could look into?

TudorHulban commented 4 years ago

Any plans for a formal release for supporting VB 6.1?

h6w commented 4 years ago

@TudorHulban https://github.com/phpvirtualbox/phpvirtualbox/issues/210#issuecomment-583162275

cegepgim1001 commented 4 years ago

Hello Everyone, I hope all is ok ! What about the support for the latest VirtualBox version - 6.1.6 r137129 (Qt5.6.2) for Win 10 ? Best, cegepgim1001

uschindler commented 4 years ago

There's no release, but just download the master branch as zip. Works fine since several months.

cegepgim1001 commented 4 years ago

There's no release, but just download the master branch as zip. Works fine since several months.

Thank you very much for your prompt reply Uwe, and I am sorry to be late with mine. Now it is working fine ! Best, Asen

cegepgim1001 commented 4 years ago

Hello again everyone, After installing the newest version from github, the phpvirtualbox is on, working, and I see a preview of the pcs started. My "console"'s icon is blured though, and cannot really open a virtual pc. Could you give a hand with this one, please? Best, Asen

jeritiana commented 4 years ago

There's no release, but just download the master branch as zip. Works fine since several months.

@uschindler you mean the develop (or the default) branch, right?

h6w commented 4 years ago

Yes, the develop branch. It does have a couple of known faults with Shared Folders and Private Networks that have kept back the release but it otherwise works.

ulfw commented 4 years ago

@cegepgim1001

Hello again everyone, After installing the newest version from github, the phpvirtualbox is on, working, and I see a preview of the pcs started. My "console"'s icon is blured though, and cannot really open a virtual pc. Could you give a hand with this one, please? Best, Asen

You should use a dedicated terminal to connect to the virtual machine. If its not possible, because of network connections, configure the vm to use the rdp server of virtualbox and connect to the vm using "microsoft remote desktop" or any other rdp client.

andyzu2020 commented 4 years ago

The problem is because of the extension pack, uninstall it, as root or as a normal user, depending on the case, and then lift the virtual machine, you will see that it does not happen again.

If another error occurs, reinstall VirtualBox and it will not cause more problems.

Greetings of Uruguay

andyzu2020 commented 4 years ago

And remember to install the extension pack that is the same version as your virtualbox

andyzu2020 commented 4 years ago

Example: VirtualBox 6.1.10 = Adition Extension Pack 6.1.0