Phpvirtualbox-5.2 needs testers

Hi mates

Something new to play with : nethserver-phpvirtualbox-5.2

It aims to install belong VirtualBox-5.2 a web interface to manage your virtual machine.

Virtualbox compile its modules on the most updated kernel, so be sure to update first your virtual-machine or your server if you want to test it. In fact the kernel-headers and the kernel-devel are not provided for all kernels in the centOS repository, they are removed from time to time.

Once done:

yum install nethserver-phpvirtualbox-5.2 --enablerepo=nethforge-testing

after that go to

https://YourServer/phpvirtualbox

login: admin
passwd: admin

you have three authentication modes

internal (default)
LDAP (openldap)
AD (active directory)

these can be modified with the property Authentication

all is restricted by default to the local network, phpvirtualbox web application and the consoleRDP (to display the VM over the RDP protocol inside phpvirtualbox web application)

you could modify them with properties

access (private/public)
accessRDP (green/red)

you could modify either the apache path (https://IP/path) or use phpvirtualbox with a domain name

URL (change the default https://IP/phpvirtualbox)
DomainName (specify a FQDN to use phpvirtualbox)

the full readme of nethserver-phpvirtualbox-5.2
the documentation of the project

the sources of these rpm are available on my github, I propose to push them to nethserver once we could validate them

nethserver-phpvirtualbox-5.2
nethserver-virtualbox-5.2
phpvirtualbox-5.2

config show phpvirtualbox

phpvirtualbox=configuration
    AdminGroup=vboxadmin
    AdminUser=admin
    AdvancedSettings=false
    Authentication=internal
    DomainName=
    QuotaPerUser=5
    TCPPortsRDP=9000-9100
    URL=
    UserGroup=vboxuser
    VMOwnerShip=true
    access=private
    accessRDP=green
    ipaddrRDP=
    status=enabled
config setprop phpvirtualbox accessRDP red AdvancedSettings enabled
signal-event nethserver-phpvirtualbox-5.2-update
8 Likes

Great Stéphane !

Any possibility to migrate existing VM from Webvritmgr to Virtualbox ?

I think it is feasible, not sure about the difficulty

this is an example, libvirt kvm migration to virtualbox could give a lot of hints

I tested on a vmware VM (only 32 bit guest) and it works like a charm:

After installing adobe flash I could use the web console in browser (using Firefox and Windows 10):

Remote desktop is working too:

I only had a green interface in my VM and there was an error when expanding templates because $red is not set, after setting up a red interface it worked.

[root@testserver ~]# expand-template /usr/share/phpvirtualbox-5.2/config.php
ERROR in /etc/e-smith/templates//usr/share/phpvirtualbox-5.2/config.php/20SettingsRDP: Program fragment delivered error <<Can't call method "prop" on an undefined value at /etc/e-smith/templates//usr/share/phpvirtualbox-5.2/config.php/20SettingsRDP line 21.>> at template line 5
ERROR: Template processing failed for //usr/share/phpvirtualbox-5.2/config.php: 1 fragment generated errors
 at /sbin/e-smith/expand-template line 45.

It seems like virtualbox supports QEMU file format and more virtual disks, so maybe it’s enough to copy the qcow file and just put it in a virtualbox VM:

grafik

3 Likes

we could set up a failback to green but in this case you could not be aware that you must have a red nic :-?

thank for the test :smiley:

I use it only in a virtualbox VM, I need to test on a real hardware because I have had only 32 bit guests, I hope this is a limitation to use virtualbox in another virtualbox :slight_smile:

If someone beat me, please shoot

1 Like

a new way to handle the source code

The purpose is to handle the repository of VirtualBox and phpvirtualbox in one repository instead of three.

It should ease the maintenance for us about virtualbox, indeed we must stick to a particular release, for example I developed for VirtualBox-5.2, but VirtualBox-6.0 is just released, so the only change to do is in the specfile

- %define virtualboxversion 5.2
+ %define virtualboxversion 6.0

Like this we could manage with the same repository, we just need to create a new branch.

if you want to play

yum install nethserver-virtualbox-5.2-phpvirtualbox --enablerepo=nethforge-testing

the documentation

Not sure whether to star a new topic


Anyway. I tried to install phpvirtualbox on a fresh nethserver (dedicated hardware) for the third time without success.

I install on cli with

yum install nethserver-virtualbox-5.2-phpvirtualbox

and get a “complete!” message. But back on the webinterface I always run into the yum metadata caching error. This is can be reproduced.

After

yum clean all
rm -rf /var/log/cache
yum update
yum clean all

this looks better, maybe it’s o-kay now.

Yet I still can’t log in. Log-in is cacelled wth an error message:

Could not connect to host (http://127.0.0.1:18083/)

Exception Object
(
    [message:protected] => Could not connect to host (http://127.0.0.1:18083/)
    [string:Exception:private] => 
    [code:protected] => 64
    [file:protected] => /usr/share/phpvirtualbox/endpoints/api.php
    [line:protected] => 134
    [trace:Exception:private] => Array
        (
        )

    [previous:Exception:private] => 
)

I am on an VPN connection with a local IP. Assuming this is regarded as a public connection, I tried to change the access settings:

config setprop phpvirtualbox access public
signal-event phpvirtualbox-update

This shows error message: Can’t open directory /etc/e-smith/events/phpvirtualbox-update

I also don’t know if the vboxsrv service is configured to run. And theres no phpvirtualbox menu on the web interface.

On my last installation I tried a lot of things I found on the different support sites, completely loosing all connections to my machine for good (e.g. no ping to it even in ‘real’ local network).

Maybe this can help improving the installer, and any help regarding my issues is very welcome of course.

disclaimer: I am no developer nor pro admin.

1 Like

this is not a related issue between phpvirtalbox and metadata caching

my best advice is that your server is not updated and you do not match the good version between the kernel and the kernel-headers

so

yum update -y
reboot

and try again at

https://YourIP/phpvirtualbox

login admin
passwd admin

I think you faced a bug, gcc is not installed

so

yum install gcc make
/sbin/vboxconfig
reboot

this bug is reproducible when I install the rpm with a server not fully updated, after that gcc is well required by my rpm, this is something odd but like I stated here : PhpVirtualBox — NethServer 7 Final

your server must be fully upgraded before to install it

before upgrade this is what I require to install

Installing:
 nethserver-virtualbox-5.2-phpvirtualbox
                                    noarch 1.0.0-1.ns7         nethforge  3.0 M
Installing for dependencies:
 SDL                                x86_64 1.2.15-14.el7       ce-base    204 k
 VirtualBox-5.2                     x86_64 5.2.22_126460_el7-1 nethforge   76 M
 devtoolset-4-gcc                   x86_64 5.3.1-6.1.el7       ce-sclo-rh  26 M
 devtoolset-4-runtime               x86_64 4.1-3.sc1.el7       ce-sclo-rh  26 k
 dkms                               noarch 2.6.1-1.el7         epel        75 k
 elfutils-libelf-devel              x86_64 0.172-2.el7         ce-base     39 k
 glibc-devel                        x86_64 2.17-260.el7_6.3    ce-updates 1.1 M
 glibc-headers                      x86_64 2.17-260.el7_6.3    ce-updates 683 k
 kernel-devel                       x86_64 3.10.0-957.10.1.el7 ce-updates  17 M
 kernel-headers                     x86_64 3.10.0-957.10.1.el7 ce-updates 8.0 M
 libICE                             x86_64 1.0.9-9.el7         ce-base     66 k
 libSM                              x86_64 1.2.2-2.el7         ce-base     39 k
 libXcursor                         x86_64 1.1.15-1.el7        ce-base     30 k
 libXinerama                        x86_64 1.1.3-2.1.el7       ce-base     14 k
 libXmu                             x86_64 1.1.2-2.el7         ce-base     71 k
 libXpm                             x86_64 3.5.12-1.el7        ce-base     55 k
 libXt                              x86_64 1.1.5-3.el7         ce-base    173 k
 libjpeg-turbo                      x86_64 1.2.90-6.el7        ce-base    134 k
 libmpc                             x86_64 1.0.1-3.el7         ce-base     51 k
 libvpx                             x86_64 1.3.0-5.el7_0       ce-base    498 k
 mpfr                               x86_64 3.1.1-4.el7         ce-base    203 k
 nethserver-virtualbox-5.2-VirtualBox
                                    noarch 1.0.0-1.ns7         nethforge   15 k
 opus                               x86_64 1.0.2-6.el7         ce-base    630 k
 php-gd                             x86_64 5.4.16-46.el7       ce-base    128 k
 php-ldap                           x86_64 5.4.16-46.el7       ce-base     53 k
 php-soap                           x86_64 5.4.16-46.el7       ce-base    159 k
 scl-utils                          x86_64 20130529-19.el7     ce-base     24 k
 t1lib                              x86_64 5.1.2-14.el7        ce-base    166 k
 zlib-devel                         x86_64 1.2.7-18.el7        ce-base     50 k

after the upgrade and reboot

Installing:
 nethserver-virtualbox-5.2-VirtualBox                                 noarch                                 1.0.0-1.ns7                                          nethforge                                   15 k
Installing for dependencies:
 SDL                                                                  x86_64                                 1.2.15-14.el7                                        ce-base                                    204 k
 VirtualBox-5.2                                                       x86_64                                 5.2.22_126460_el7-1                                  nethforge                                   76 M
 cpp                                                                  x86_64                                 4.8.5-36.el7_6.1                                     ce-updates                                 5.9 M
 dkms                                                                 noarch                                 2.6.1-1.el7                                          epel                                        75 k
 elfutils-libelf-devel                                                x86_64                                 0.172-2.el7                                          ce-base                                     39 k
 gcc                                                                  x86_64                                 4.8.5-36.el7_6.1                                     ce-updates                                  16 M
 glibc-devel                                                          x86_64                                 2.17-260.el7_6.3                                     ce-updates                                 1.1 M
 glibc-headers                                                        x86_64                                 2.17-260.el7_6.3                                     ce-updates                                 683 k
 kernel-devel                                                         x86_64                                 3.10.0-957.10.1.el7                                  ce-updates                                  17 M
 kernel-headers                                                       x86_64                                 3.10.0-957.10.1.el7                                  ce-updates                                 8.0 M
 libICE                                                               x86_64                                 1.0.9-9.el7                                          ce-base                                     66 k
 libSM                                                                x86_64                                 1.2.2-2.el7                                          ce-base                                     39 k
 libXcursor                                                           x86_64                                 1.1.15-1.el7                                         ce-base                                     30 k
 libXinerama                                                          x86_64                                 1.1.3-2.1.el7                                        ce-base                                     14 k
 libXmu                                                               x86_64                                 1.1.2-2.el7                                          ce-base                                     71 k
 libXt                                                                x86_64                                 1.1.5-3.el7                                          ce-base                                    173 k
 libmpc                                                               x86_64                                 1.0.1-3.el7                                          ce-base                                     51 k
 libvpx                                                               x86_64                                 1.3.0-5.el7_0                                        ce-base                                    498 k
 mpfr                                                                 x86_64                                 3.1.1-4.el7                                          ce-base                                    203 k
 opus                                                                 x86_64                                 1.0.2-6.el7                                          ce-base                                    630 k
 zlib-devel                                                           x86_64                                 1.2.7-18.el7                                         ce-base                                     50 k

it seems that before the upgrade we have installed gcc from ce-sclo-rh

devtoolset-4-gcc                   x86_64 5.3.1-6.1.el7       ce-sclo-rh  26 M
 devtoolset-4-runtime               x86_64 4.1-3.sc1.el7       ce-sclo-rh  26 k

Thank you! I give it a try and step-by-step feedback


I started with a clean install of nethserver, and, of course completed all updates on the gui before installing any additional modules.

yum update -y
--> No packages marked for update

So I skipped the reboot command. Log-in fails “Error logging in to vboxwebsrv.”

yum install gcc make
--> Package gcc-4.8.5-36.el7_6.1.x86_64 already installed and latest version
--> Package 1:make-3.82-23.el7.x86_64 already installed and latest version
--> Nothing to do
/sbin/vboxconfig
reboot

Login still fails, same error “Error logging in to vboxwebsrv.” Details:

Exception Object
(
    [message:protected] => Error logging in to vboxwebsrv.
    [string:Exception:private] => 
    [code:protected] => 64
    [file:protected] => /usr/share/phpvirtualbox/endpoints/api.php
    [line:protected] => 134
    [trace:Exception:private] => Array
        (
        )

    [previous:Exception:private] => 
)

In GUI Tab “services” there is vboxweb-service running.

Strange effect: After this failed log-in, I again lost mostly all connectivity to the machine
via VPN: I can’t access any web interface and I can’t ping the server instance, but I can still ping the AD container.
via local client (screen sharing) I can access it, but still no log-in to phpvirtualbox.

check in /var/log/messages you should have some clues

In GUI diagnostics I cannot resolve or ping nethserver.org.

Now I am at the horizon of my skills :slight_smile:

firewall.log stopped logging at the very time of the reboot.

‘messages’ is exhausting. Please help me understand. On startup I see:

Mar 29 18:39:42 neth kernel: *BAD*gran_size: 64K #011chunk_size: 32M #011num_reg: 10 #011lose cover RAM: -24M

and more of it

Mar 29 18:39:42 neth kernel: mtrr_cleanup: can not find optimal value Mar 29 18:39:42 neth kernel: please specify mtrr_gran_size/mtrr_chunk_size Mar 29 18:39:42 neth kernel: e820: last_pfn = 0xdae01 max_arch_pfn = 0x400000000 Mar 29 18:39:42 neth kernel: found SMP MP-table at [mem 0x000fd910-0x000fd91f] mapped at [ffffffffff200910] Mar 29 18:39:42 neth kernel: RAMDISK: [mem 0x35560000-0x36aa7fff] Mar 29 18:39:42 neth kernel: Early table checksum verification disabled

Should I remove RAM? I ran Memtest without issues after adding a second bank.

Aside, many entries, not many errors

Mar 29 18:39:49 neth systemd-nspawn: Failed to create directory /var/lib/machines/nsdc//sys/fs/selinux: Read-only file system
...
Mar 29 18:39:51 neth vboxweb-service.sh: VirtualBox web service started. Mar 29 18:39:51 neth systemd: Started vboxweb-service.service. Mar 29 18:39:51 neth fail2ban-client: 2019-03-29 18:39:51,536 fail2ban.server [5849]: INFO Starting Fail2ban v0.9.7 Mar 29 18:39:51 neth fail2ban-client: 2019-03-29 18:39:51,536 fail2ban.server [5849]: INFO Starting in daemon mode Mar 29 18:39:51 neth sssd: tkey query failed: GSSAPI error: Major = Unspecified GSS failure. Minor code may provide more information, Minor = Server not found in Kerberos database. Mar 29 18:39:51 neth sssd: tkey query failed: GSSAPI error: Major = Unspecified GSS failure. Minor code may provide more information, Minor = Server not found in Kerberos database.

hard to read for me, without clue what to look for 


I installed your update on the GUI, and again I ran into the yum cache error. Are you sure, this is not related?

Unfortunately, I still cannot log-in to phpvirtualbox.

PS: connectivity to the server awakes some hours after lost (over night). Maybe some watchdog restarts broken services?

I did a yum list installed to check your installation dependencies an got a few colored results. Does this help?

VirtualBox-5.2.x86_64               5.2.26_128414_el7-1   # yellow
dokuwiki.noarch                     20180422b-1.ns7.sdl  # red
nethserver-dokuwiki.noarch          1.2.6-1.ns7.sdl # red
nethserver-stephdl.noarch           1.0.7-1.ns7.sdl # red

missing:

devtoolset-4-gcc
devtoolset-4-runtime

Don’t know but the yum cache errror is unrelated, your server seems to get some issues.

If you lost internet connectivity then the yum cache error could come from this

Please forgive me for replying to an old topic
Joined just to reply
found the fix to the problem
login to the server on root
go to the terminal and run “vboxwebsrv”
open another tab and go to the phpvirtualbox ip
login.
running vboxwebsrv in terminal and leaving it running fixed the problem
after that just exit that tab and continue

1 Like