Changes

From SME Server
Jump to navigationJump to search
4,716 bytes added ,  00:11, 13 July 2023
added current Bugs for this contrib
Line 1: Line 1:  
{{Languages}}
 
{{Languages}}
 +
 +
{{#vardefine:contribname| {{lc: {{#titleparts:  {{BASEPAGENAME}} |1}} }} }}
 +
{{#vardefine:smecontribname| smeserver-{{lc: {{#titleparts:  {{BASEPAGENAME}} |1}} }} }}
 +
<!-- we define the language -->
 +
{{#vardefine:lang| {{lc:  {{#titleparts:    {{PAGENAME}} | | -1}}  }} |en }}
 +
 +
 +
{{Infobox contribs
 +
|name={{#var:contribname}}
 +
|image= contrib.png
 +
|description_image= {{#var:contribname}} logo
 +
|maintainer=
 +
|licence= GPL v3
 +
|url= https://github.com/phpvirtualbox/phpvirtualbox
 +
|category= virtualization
 +
|tags=virtualbox
 +
}}
 
== Phpvirtualbox for SME Server ==
 
== Phpvirtualbox for SME Server ==
 
{{Level|Medium}}
 
{{Level|Medium}}
 
=== Maintainer ===
 
=== Maintainer ===
[mailto:stephdl@de-labrusse.fr[[User:stephdl|Stephane de Labrusse aka stephdl]]]<br />
+
[mailto:stephdl@de-labrusse.fr][[User:stephdl|Stephane de Labrusse aka stephdl]]<br />
 +
 
 +
===Version===
 +
{{#smeversion: smeserver-phpvirtualbox}}
 +
{{#smeversion: phpvirtualbox}}
 +
[[Version::contrib9|stephdl]][[Has SME9::true| ]]
 +
{{#smeversion: smeserver-virtualbox}}
    
=== Description ===
 
=== Description ===
 
An open source, AJAX implementation of the VirtualBox user interface written in PHP. As a modern web interface, it allows you to access and control remote VirtualBox instances. phpVirtualBox is designed to allow users to administer VirtualBox in a headless environment - mirroring the VirtualBox GUI through its web interface.<br />
 
An open source, AJAX implementation of the VirtualBox user interface written in PHP. As a modern web interface, it allows you to access and control remote VirtualBox instances. phpVirtualBox is designed to allow users to administer VirtualBox in a headless environment - mirroring the VirtualBox GUI through its web interface.<br />
{{Note box|msg='''Please you should help this project''' as Ian Moore develops [https://sourceforge.net/projects/phpvirtualbox/ phpVirtualBox] in his spare time, free of charge. If you find this program useful, He asks that [https://sourceforge.net/p/phpvirtualbox/donate/?source=navbar/ you please donate].<br />}}
     −
{{Tip box|You can find more informations directly on the [http://sourceforge.net/p/phpvirtualbox/wiki/Home/ phpvirtualbox wiki], please Take a look to the documentation.}}
+
=== Requirements ===
 +
 
 +
<tabs container=""><tab name="5.2 For SME 10">
 +
{{Note box|work in progress, alpha, use at your own risks}}
 +
Please make sure you have the latest kernel installed (i.e. do a yum update) before installing, so that we use the right kernel headers for compiling the driver
   −
=== Requirements ===
+
This will install phpvirtualbox and the appropriate version of smeserver-virtualbox and VirtualBox, which will compile it's drivers, so we need to install a few development components as well
 +
yum install smeserver-extrarepositories-epel smeserver-extrarepositories-virtualbox
 +
yum --enablerepo=smedev,smecontribs,epel,virtualbox  install smeserver-phpvirtualbox
 +
The install will prompt you to accept the VirtualBox GPG key
 +
</tab><tab name="4.3 For SME 8 and 9">
 
You need to install the [[VirtualBox_Repository]], the [[stephdl|Stephdl_repository]] And the [[Epel|Epel Repository]]
 
You need to install the [[VirtualBox_Repository]], the [[stephdl|Stephdl_repository]] And the [[Epel|Epel Repository]]
    
{{Note box|VirtualBox is a real professional solution to virtualise Operating Systems in Linux, please Read the [https://www.virtualbox.org/manual/ virtualbox manual] if you want to  use entirely all features of this software}}
 
{{Note box|VirtualBox is a real professional solution to virtualise Operating Systems in Linux, please Read the [https://www.virtualbox.org/manual/ virtualbox manual] if you want to  use entirely all features of this software}}
   −
=== Installation phpvirtualbox-4.3 For SME8 and SME9===
+
# Installation phpvirtualbox-4.3 For SME8 and SME9
 +
First install the required repos<syntaxhighlight lang="bash">
 +
yum install smeserver-extrarepositories-virtualbox smeserver-extrarepositories-epel smeserver-extrarepositories-stephdl
 +
signal-even yum-modify
 +
</syntaxhighlight>
 +
 
 
You have to be sure that your server  has '''the kernel up-to-date''' before to install virtualbox, else the installation will fail. You must first configure the [[epel]] repository
 
You have to be sure that your server  has '''the kernel up-to-date''' before to install virtualbox, else the installation will fail. You must first configure the [[epel]] repository
   −
  yum install --enablerepo=epel dkms kernel
+
  yum install --enablerepo=epel dkms kernel-devel
 
  signal-event post-upgrade;  signal-event reboot
 
  signal-event post-upgrade;  signal-event reboot
   Line 35: Line 70:  
  signal-event post-upgrade;  signal-event reboot
 
  signal-event post-upgrade;  signal-event reboot
   −
Go to the phpvirtualbox panel at the url https://your-sme-ip/phpvirtualbox on your local-network. '''You can not reach this contrib trought internet'''.
+
</tab><tab name="5.0 For SME 8 and 9">
Your credentials are the user admin of the SME Server and its password but you can add more users by the [[Phpvirtualbox#DB_Configuration|DB Configuration]].
  −
=== Installation phpvirtualbox-5.0 For SME8 and SME9===
   
{{warning box| You have to remove first all old rpm before to install phpvirtualbox-5.0 and VirtualBox-5.0, this is done by the different version of virtualbox (the version 5.0 doesn't obsolete the 4.3 version)
 
{{warning box| You have to remove first all old rpm before to install phpvirtualbox-5.0 and VirtualBox-5.0, this is done by the different version of virtualbox (the version 5.0 doesn't obsolete the 4.3 version)
  yum remove smeserver-phpvirtualbox smeserver-virtualbox VirtualBox-4.3 phpvirtualbox}}
+
  yum remove smeserver-phpvirtualbox\* smeserver-virtualbox\* VirtualBox\* phpvirtualbox\* dkms }}
   −
You have to be sure that your server  has '''the kernel up-to-date''' before to install virtualbox, else the installation will fail. You must first configure the [[epel]] repository
+
First install the required repos<syntaxhighlight lang="bash">
 
+
yum install smeserver-extrarepositories-virtualbox smeserver-extrarepositories-epel smeserver-extrarepositories-stephdl
  yum install --enablerepo=epel dkms kernel
+
signal-even yum-modify
 +
</syntaxhighlight>You have to be sure that your server  has '''the kernel up-to-date''' before to install virtualbox, else the installation will fail. You must first configure the [[epel]] repository
 +
  yum install --enablerepo=epel dkms kernel-devel
 
  signal-event post-upgrade;  signal-event reboot
 
  signal-event post-upgrade;  signal-event reboot
   Line 58: Line 93:     
  signal-event post-upgrade;  signal-event reboot
 
  signal-event post-upgrade;  signal-event reboot
 +
</tab>
 +
</tabs>
 +
 +
Go to the phpvirtualbox panel at the url https://your-sme-ip/phpvirtualbox on your local-network. '''You can not reach this contrib trought the internet'''.
 +
 +
The only user with access at this stage is your SME Server admin user. See Authentication below on how to change this.
   −
Go to the phpvirtualbox panel at the url https://your-sme-ip/phpvirtualbox on your local-network. '''You can not reach this contrib trought internet'''.
  −
Your credentials are the user admin of the SME Server and its password but you can add more users by the [[Phpvirtualbox#DB_Configuration|DB Configuration]].
   
{{Tip box|You can see [[VirtualBox_4.0_on_SME_Server_v8_beta_6|the Tutorial]] hosted on our Wiki in order to learn :   
 
{{Tip box|You can see [[VirtualBox_4.0_on_SME_Server_v8_beta_6|the Tutorial]] hosted on our Wiki in order to learn :   
 
*how to create [[VirtualBox_4.0_on_SME_Server_v8_beta_6#Creating_a_Virtual_Machinecreate| your first VM]]
 
*how to create [[VirtualBox_4.0_on_SME_Server_v8_beta_6#Creating_a_Virtual_Machinecreate| your first VM]]
 
*how to automatically [[VirtualBox_4.0_on_SME_Server_v8_beta_6#Automatically_Start_Virtual_Machine|start VM with the server]] }}
 
*how to automatically [[VirtualBox_4.0_on_SME_Server_v8_beta_6#Automatically_Start_Virtual_Machine|start VM with the server]] }}
 +
 +
===Authentication===
 +
{{Note box|Authentication is still being worked on, but mostly works as advertised.}}
 +
you can allow authentication to phpvirtualbox via number of methods. At install, default is WebAuth with admin defined as the adminUser.
 +
 +
config setprop phpvirtualbox authtype <none/Builtin/LDAP/WebAuth/AD>
 +
signal-event smeserver-phpvirtualbox-update
 +
{| class="wikitable"
 +
|+config setprop phpvirtualbox authtype <none/Builtin/LDAP/WebAuth/AD>
 +
!Property
 +
!Description
 +
!adminUser
 +
!Users
 +
!userGroups
 +
|-
 +
|none
 +
|everyone on your local network has access, without needing to log in
 +
|ignored
 +
|ignored
 +
|ignored
 +
|-
 +
|BuiltIn
 +
|will use the phpvirtualbox builtin authentication which lets you manage users within phpvirtualbox ONLY.
 +
Default admin user is admin with password admin (this is a phpvirtualbox thing....)
 +
 +
It does '''NOT''' have any interface/interaction with smeserver users
 +
|ignored
 +
|ignored
 +
|ignored
 +
|-
 +
|LDAP
 +
|will allow any smeserver user access, with whomever is defined in the phpvirtualbox adminUser config item as the administrator
 +
|administrative rights
 +
|ignored
 +
|ignored
 +
|-
 +
|'''WebAuth'''
 +
|<u>Default, with adminUser defined as admin</u>
 +
will allow any user defined in the phpvirtualbox Users config item, or belonging to groups defined in the phpvirtualbox userGroups config items
 +
 +
Admin access is defined by the phpvirtualbox adminUser config item
 +
 +
('''''Note:''''' using group access will generate lots of errors in the /var/log/httpd/error.log file ATM).
 +
|administrative rights
 +
|user rights
 +
|user rights
 +
|-
 +
|AD
 +
|is defined, but has not been tested.
 +
will allow any user defined in the phpvirtualbox Users config item, or belonging to AD groups defined in the phpvirtualbox userGroups config items access.
 +
 +
Admin access is defined by the phpvirtualbox adminUser config item
 +
|administrative rights
 +
|user rights
 +
|user rights
 +
|}
 +
 +
=====Allow Specific Users=====
 +
Works with WebAuth and AD
 +
 +
The users must be declared  and a password must be set in the server-manager.
 +
 +
config setprop phpvirtualbox Users user1,user2,user3
 +
signal-event smeserver-phpvirtualbox-update
 +
 +
=====Allow Specific Groups=====
 +
Works with WebAuth and AD
 +
 +
These groups must be declared in the server-manager and users need to be members of the group/s
 +
 +
config setprop phpvirtualbox userGroups Group1,Group2,Group3
 +
signal-event smeserver-phpvirtualbox-update
 +
 +
=== Access the ISO share directory via samba ===
 +
This is where ISOs used for building/installing VMs are stored.
 +
 +
By default, anyone defined in adminUser, Users or userGroups will have write access to the /opt/vbox/ISOs directory (share name virtualbox), regardless of the authtype.
 +
 +
You can control whether the share is available/visible and who has access via the phpvirtualbox samba configuration item.
 +
{| class="wikitable"
 +
|+config setprop phpvirtualbox samba <none/adminUser/all>
 +
!Property
 +
!Description
 +
|-
 +
|none
 +
|No share created or visible
 +
|-
 +
|adminUser
 +
|ONLY user defined in adminUser, has write access to virtualbox share
 +
|-
 +
|'''all'''
 +
|<u>Default:</u> Any user defined in adminUser, Users or userGroups has write access to the virtualbox share
 +
|}
 +
 +
=== Restart the vboxweb-service ===
 +
phpvirtualbox controls a virtualbox service (vboxweb-service), you may need to restart it if you can't connect to phpvirtualbox
 +
 +
systemctl restart vboxweb-service
 +
 +
you can check that the port 18083 is opened to the service
 +
nmap localhost -p 18083
 +
....
 +
PORT      STATE SERVICE
 +
18083/tcp open  unknown
 +
or
 +
netstat -a | grep vboxweb-service
 +
tcp        0      0 localhost:vboxweb-service  *:*                        LISTEN
    
===Kernel Upgrade===
 
===Kernel Upgrade===
   −
After a kernel upgrade and the  "signal-event post-upgrade;  signal-event reboot", the vboxdrv need to be compiled with the new kernel, a script is launched at the boot time to test if the compilation is needed.
+
After a kernel upgrade and the  "signal-event post-upgrade;  signal-event reboot", the vboxdrv needs to be compiled with the new kernel, a script is launched at startup of the driver, to test if the compilation is needed and will compile it for you.
   −
{{Tip box|If you want to launch manually the compilation of virtualbox module you can do these command lines in a root terminal.}}
+
You can see if all the kernel modules are compiled and loaded, if you issue :
 +
# /usr/lib/virtualbox/vboxdrv.sh status
 +
VirtualBox kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) are loaded.
   −
/etc/init.d/vboxdrv setup; /etc/init.d/vboxweb-service start
+
{{Tip box|Restarting the vboxdrv service will trigger a driver compile if it is not present.
 +
If you want to manually launch the compilation of virtualbox module you can run the driver setup script.}}
   −
Stopping VirtualBox kernel modules                        [  OK  ]
+
Run the driver setup script and restart the vbox web service
Uninstalling old VirtualBox DKMS kernel modules            [  OK  ]
+
  /usr/lib/virtualbox/vboxdrv.sh setup; systemctl restart vboxweb-service
Trying to register the VirtualBox kernel modules using DKMS[  OK  ]
  −
  Starting VirtualBox kernel modules                        [  OK  ]
      
===Installation of Extension Pack===
 
===Installation of Extension Pack===
   −
Support for USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards. See this chapter [https://www.virtualbox.org/manual/ch01.html#intro-installing from the User Manual] for an introduction to this Extension Pack. See this page to [https://www.virtualbox.org/wiki/Downloads download the extension pack] if the url below is no longer good.
+
{{Note box|The Extension Pack provides support for USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards. See this chapter from the User Manual for an introduction to this Extension Pack.
 +
See this page (https://www.virtualbox.org/wiki/Downloads) to download the extension pack if the url below is no longer good.}}
   −
For example :
+
The Extension Pack is now automatically installed with VirtualBox.
   −
  wget http://dlc.sun.com.edgesuite.net/virtualbox/4.3.0/Oracle_VM_VirtualBox_Extension_Pack-4.3.0-89960.vbox-extpack
+
You can trigger a re-check, and possible install. This will also check the installed driver and recompile if required (e.g. after a kernel upgrade).<syntaxhighlight lang="bash">
  vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.0-89960.vbox-extpack
+
signal-event smeserver-virtualbox-update
 +
</syntaxhighlight>If you still want to install it yourself...
 +
 
 +
  wget https://download.virtualbox.org/virtualbox/5.2.44/Oracle_VM_VirtualBox_Extension_Pack-5.2.44.vbox-extpack
 +
  vboxmanage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.44.vbox-extpack
    
see [https://www.virtualbox.org/manual/ch08.html#vboxmanage-extpack vboxmanage-extpack] for a complete list of commands
 
see [https://www.virtualbox.org/manual/ch08.html#vboxmanage-extpack vboxmanage-extpack] for a complete list of commands
Line 94: Line 246:     
* The '''VBoxManage extpack cleanup''' command can be used to remove temporary files and directories that may have been left behind if a previous install or uninstall command failed.
 
* The '''VBoxManage extpack cleanup''' command can be used to remove temporary files and directories that may have been left behind if a previous install or uninstall command failed.
      
===BridgeInterface===
 
===BridgeInterface===
Line 124: Line 275:  
  # config show phpvirtualbox  
 
  # config show phpvirtualbox  
 
  phpvirtualbox=configuration
 
  phpvirtualbox=configuration
    Group=
+
    Name=phpvirtualbox
    Name=phpvirtualbox
+
    adminUser=admin
    User=
+
    authtype=WebAuth
    status=enabled
+
    status=enabled
    webauth=enabled
+
    userGroups=vboxusers
 +
 
 +
# config show vboxweb-service
 +
vboxweb-service=service
 +
    TCPPort=18083
 +
    access=localhost
 +
    password=<generated password>
 +
    status=enabled
 +
    user=vbox
    
====Add a different URL====
 
====Add a different URL====
Line 154: Line 313:  
  signal-event console-save
 
  signal-event console-save
   −
====Web authentication====
+
====Access The Web Interface Remotely====
 
  −
you can allow web authentication to phpvirtualbox by doing the command line below. This feature is the default behaviour since the bug opened is solved http://sourceforge.net/p/phpvirtualbox/bugs/7/.
  −
 
  −
config setprop phpvirtualbox webauth enabled
  −
signal-event console-save
  −
 
  −
and you have to modify manually the file config.php
  −
 
  −
nano /opt/phpvirtualbox/config.php
  −
 
  −
// Authentication library.
  −
var $authLib = 'Builtin';
  −
#var $authLib = 'WebAuth';
  −
#var $authConfig = array('adminUser' => 'admin');
  −
 
  −
to
  −
  −
// Authentication library.
  −
#var $authLib = 'Builtin';
  −
var $authLib = 'WebAuth';
  −
var $authConfig = array('adminUser' => 'admin');
  −
 
  −
 
  −
=====Allow Specific Users=====
  −
The users must be declared  and a password must be set in the server-manager.
  −
 
  −
config setprop phpvirtualbox User user1,user2,user3
  −
signal-event console-save
  −
 
  −
=====Allow Specific Groups=====
  −
These groups must be declared in the server-manager and users need to be included
  −
 
  −
config setprop phpvirtualbox Group Group1,Group2,Group3
  −
signal-event console-save
  −
 
  −
=== Access The Web Interface Remotely ===
   
{{Warning box|Instructions below could be a flaw in Phpvirtualbox, you should remotely access trough [[SME_Server:Documentation:FAQ:booklet#Server-Manager|SSH]] or with [[OpenVPN_Bridge|openvpn]]}}
 
{{Warning box|Instructions below could be a flaw in Phpvirtualbox, you should remotely access trough [[SME_Server:Documentation:FAQ:booklet#Server-Manager|SSH]] or with [[OpenVPN_Bridge|openvpn]]}}
 
Create the following folder if it doesn't exist.
 
Create the following folder if it doesn't exist.
Line 253: Line 376:  
Then, set your desired virtual machines to start automatically, with an optional delay, and optionally to suspend (rather than power down) when your SME server shuts down or reboots.  You can specify the virtual machine by name or by UUID:
 
Then, set your desired virtual machines to start automatically, with an optional delay, and optionally to suspend (rather than power down) when your SME server shuts down or reboots.  You can specify the virtual machine by name or by UUID:
 
  [root@e-smith ~]# '''VBoxManage modifyvm "IncrediblePBX 12" --autostart-enabled on --autostart-delay 15'''
 
  [root@e-smith ~]# '''VBoxManage modifyvm "IncrediblePBX 12" --autostart-enabled on --autostart-delay 15'''
  [root@e-smith ~]# '''VBoxManage modifyvm df3d3440-3113-4c91-9890-5323f99d755c --autostart-enabled on --autostop-type savestate
+
  [root@e-smith ~]# '''VBoxManage modifyvm df3d3440-3113-4c91-9890-5323f99d755c --autostart-enabled on --autostop-type savestate'''
    
Finally, start the vboxautostart-service service:
 
Finally, start the vboxautostart-service service:
 
  [root@e-smith ~]# '''service vboxautostart-service start'''
 
  [root@e-smith ~]# '''service vboxautostart-service start'''
 +
or
 +
[root@e-smith ~]# '''/etc/init.d/vboxautostart-service start'''
    
Confirm that the desired virtual machines are running in the phpVirtualBox web interface.
 
Confirm that the desired virtual machines are running in the phpVirtualBox web interface.
Line 270: Line 395:  
To optimize and/or fine-tune your SME guest server running on your phpvirtualbox host, please see our [[Virtual_SME_Server#SME_Server_configuration_settings|Virtual SME Server wiki page]]
 
To optimize and/or fine-tune your SME guest server running on your phpvirtualbox host, please see our [[Virtual_SME_Server#SME_Server_configuration_settings|Virtual SME Server wiki page]]
   −
For general information on how to configure phpvirtualbox guests please visit the [https://www.virtualbox.org/manual/ch03.html phpvirtualbox documentation]
+
For general information on how to configure phpvirtualbox guests please visit the [https://www.virtualbox.org/manual/ch03.html phpvirtualbox documentation]
    +
===Bugs===
 +
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
 +
and select the smeserver-phpvirtualbox component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-phpvirtualbox|title=this link}}
    +
Below is an overview of the current issues for this contrib:{{#bugzilla:columns=id,product,version,status,summary|sort=id|order=desc|component=smeserver-phpvirtualbox|noresultsmessage=No open bugs found.}}
    
[[Category: Contrib]]
 
[[Category: Contrib]]
 
[[Category:Virtualisation]]
 
[[Category:Virtualisation]]

Navigation menu