Page 1 of 1
[HOWTO] Use phpVirtualBox and noVNC
Posted: 09 Oct 2015 16:13
by daoyama
NAS4free support VirtualBox on 10.2.0.2.1870 and later.
(Both x86 and x64 should work, but ARM version cannot run VirtualBox.)
10.2 serie Guest Additions 4.3.32:
http://download.virtualbox.org/virtualb ... 4.3.32.iso
10.3 serie Guest Additions 5.0.24:
http://download.virtualbox.org/virtualb ... 5.0.24.iso
10.3 serie User Manual(PDF):
http://download.virtualbox.org/virtualb ... Manual.pdf
Enable VitualBox:
You can enable and access the pages from menu vm in weggui.
Note:
phpVitualBox's default user is admin, default password is admin.
Configure VNC port on VM setting:
You need VNC port and password for noVNC to work.
20151009A.png
Note:
If you have multiple VMs, you need different port on the VMs.
VitualBox Open Source Edition have no RDP support.
VNC on VirtualBox only supports US keyboard layout.
Use builtin noVNC (browser based VNC client):
You can control VM by phpVirtualBox and noVNC.
You can open the noVNC page from the link:
20151009B.png
20151009C.png
Enter the password configured by above step at the password field:
20151009D.png
20151009F.png
Example, now running NAS4Free in VirtualBox on NAS4Free:
20151009G.png
Note:
It is not only limited to NAS4Free but also you can connect any server that support WebSocket.
edit done:
2016-07-12 updated links
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 14 Oct 2015 08:47
by Parkcomm
Pretty slick daoyama
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 07 Nov 2015 23:16
by Onichan
Thanks for incorporating VirtualBox into NAS4Free. I noticed that it doesn't have an option to auto start VMs so I added this to the PostInit
Code: Select all
sudo -H -b -u vboxusers /usr/local/lib/virtualbox/VBoxHeadless --startvm vmname
It seems to work, but should I not do that or is there a better way? It does looks like the code will auto suspend VMs on shutdown, but I like shutdown my VMs and not suspend them.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 08 Nov 2015 14:19
by daoyama
Onichan wrote:I noticed that it doesn't have an option to auto start VMs
At this time, no option to do that. It's next step todo.
Update: auto start/stop features are added in r2006.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 19 Nov 2015 02:38
by ov10fac
Ok,
I am in the dark on this. I use VBox all the time, but under different OSs. I am not able to determine how to set the password for noVNC from the above discussion. I can find nothing in Nas4Free that matches.
Thanks.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 19 Nov 2015 07:54
by sea1150
ov10fac wrote:Ok,
I am in the dark on this. I use VBox all the time, but under different OSs. I am not able to determine how to set the password for noVNC from the above discussion. I can find nothing in Nas4Free that matches.
Thanks.
Machine Settings In phpVirtualBox:
noVNC Passwd.jpg
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 19 Nov 2015 16:39
by ov10fac
Thank you for your quick reply. However I can find nothing that looks like the screen you have provided? How do I get to that point?
I have checked the users Guide and the display it shows I should have when I open VirtualBox tab under advanced looks nothing like what I get. All I get is a box for the home directory, and two boxes with links to phpVirtualBox and noVNC. Both links open a web browser page that just ask for user id and password???
Thanks
John
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 19 Nov 2015 17:01
by sea1150
ov10fac wrote:How do I get to that point?
Web Interface NAS4Free -> Advanced -> VirtualBox -> click phpVirtualBox URL (/phpvirtualbox/index.html) -> LogIn phpVirtualBox -> select Your VirtualMachine -> Settings -> Display -> Remote Display.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 20 Nov 2015 00:54
by ov10fac
When I click phpVirtualBox URL I get a login screen asking for a User and Password which I never set or created. I have no idea what to enter so I can't get past the phpVirtualBox first screen??
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 20 Nov 2015 03:32
by zoon01
ov10fac wrote:When I click phpVirtualBox URL I get a login screen asking for a User and Password which I never set or created. I have no idea what to enter so I can't get past the phpVirtualBox first screen??
phpVitualBox's default user is admin, default password is admin.
Do not forget to change passwords!
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 20 Nov 2015 15:09
by ov10fac
Ok.
Thank you for your patience. That worked, but then it threw an exception. Here are the "Details"
Exception Object
(
[message:protected] => Could not connect to host (
http://127.0.0.1:18083/)
[string:Exception:private] =>
[code:protected] => 64
[file:protected] => /usr/local/www/phpvirtualbox/lib/ajax.php
[line:protected] => 123
[trace:Exception:private] => Array
(
)
[previous:Exception:private] =>
)
I looked at the code on line 123 of the ajax.php file and it appears the exception is being thrown at a point where the login credentials are being hidden. Can't tell a lot as the code is pretty austere.
Thanks for any help.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 20 Nov 2015 23:32
by kfnas
daoyama wrote:Onichan wrote:I noticed that it doesn't have an option to auto start VMs
At this time, no option to do that. It's next step todo.
Update: auto start/stop features are added in r2006.
please add some description regarding how to autostart autostop by reboot/shut the VM's
thankyou
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 21 Nov 2015 05:31
by sea1150
kfnas wrote:please add some description regarding how to autostart autostop by reboot/shut the VM's
thankyou
Auto start VM's:
Auto stop VM's: don't need anything. The system will shut down VM's.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 21 Nov 2015 09:00
by kfnas
sea1150 wrote:kfnas wrote:please add some description regarding how to autostart autostop by reboot/shut the VM's
thankyou
Auto start VM's:
Auto stop VM's: don't need anything. The system will shut down VM's.
then I have some issues with autostop (my VM config is from your version, have recursively changed the ownership to 920:920)... after reboot via webgui, both VM's has been killed, have to test it via console for error msg during reboot
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 21 Nov 2015 16:52
by sea1150
what is your revision NAS4Free? If latest (2067), maybe you don't have enough time to complete the process at shutdown!? Try increasing rcshutdown_timeout option in System -> Advanced -> rc.conf. For me rcshutdown_timeout=120 ... 2 VM's autostop complete.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 22 Nov 2015 17:45
by sherman
I ran into the same issue as ov10fac. I can not login.
Looking for the error I find several topics relating to this and VirtualBoxPhp.
But I have still no clue how to get rid of that error

Best would be if some one would tell me or us how to reinstall the VirtualBox that comes with the lates Nas4Free.

Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 23 Nov 2015 21:53
by daoyama
sea1150 wrote:what is your revision NAS4Free? If latest (2067), maybe you don't have enough time to complete the process at shutdown!? Try increasing rcshutdown_timeout option in System -> Advanced -> rc.conf. For me rcshutdown_timeout=120 ... 2 VM's autostop complete.
What kind of OS do you use on VMs?
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 24 Nov 2015 09:03
by sea1150
daoyama wrote:What kind of OS do you use on VMs?
WindowsXP (rarely) + FreeBSD10.2 (no graphics) + pfSense (based FreeBSD 10.1)
PS: I think to don't "auto stop" the VM's. better to do "auto save state". It will be faster.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 24 Nov 2015 09:37
by kfnas
sea1150 wrote:daoyama wrote:What kind of OS do you use on VMs?
WindowsXP (rarely) + FreeBSD10.2 (no graphics) + pfSense (based FreeBSD 10.1)
PS: I think to don't "auto stop" the VM's. better to do "auto save state". It will be faster.
auto save state finger UP (that was how we used it before...)
anyway.. how should the memory allocation work in conjuction with vbox? I have 32GB and
Code: Select all
Mem: 370M Active, 6472M Inact, 24G Wired, 124M Cache, 1654M Buf, 116M Free
ARC: 14G Total, 2927M MFU, 8305M MRU, 2667M Anon, 111M Header, 285M Other
Swap:
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
5266 vboxusers 25 20 0 3335M 3095M uwait 3 33.9H 100.00% VBoxHeadless
92595 vboxusers 22 20 0 4329M 4106M uwait 4 676:21 100.00% VBoxHeadless
94518 root 1 33 0 12356K 3064K getblk 0 23:55 18.36% cp
and during intensive ZFS operation (cp from one pool to another) the vboxes crashes (blue screen)
Code: Select all
vfs.zfs.arc_min: 14990127104
vfs.zfs.arc_max: 29980254208
hw.physmem: 34275221504
hw.usermem: 8314511360
hw.realmem: 34359738368
vm.kmem_map_size: 15072026624
vm.kmem_size: 33379856384
any hint for smooth cooperation?
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 24 Nov 2015 09:45
by sea1150
kfnas wrote:any hint for smooth cooperation?
Please note that the
free memory will be: Full RAM minus RAM allocated VM's (count for yourself, don't forget to count all used VM's).
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 24 Nov 2015 10:29
by kfnas
sea1150 wrote:kfnas wrote:any hint for smooth cooperation?
Please note that the
free memory will be: Full RAM minus RAM allocated VM's (count for yourself, don't forget to count all used VM's).
I guess you mean all running VM. as can be seen in my top output
Code: Select all
5266 vboxusers 25 20 0 3335M 3095M uwait 3 33.9H 100.00% VBoxHeadless
92595 vboxusers 22 20 0 4329M
3335M + 4329M = 7664M + 12M running user copying from one pool to other = 7676MB. ARC cache, which should be dynamically allocated but with minimum size is 14G according arc max parameter, then there is kernel mem for IO (also net IO) and ZFS should be part of this memory - wired 24G
hmm at least here it is overbooked, but should not matter, if it is just reserved and can be kept back to pool, same as happen with cache and inactive memory.. but I'm not sure
update: forgot to mention, that the
vfs.zfs.zio.use_uma: 1 is enabled... so the part of wired mem 24GB already contain the arc 14GB+7,7GB VBOX + network stack kernel mem (81MB) and ZFS - don't know how to detail dump
so from my understanding is, that at least 5,9GB of mem is free.. and during those intensive IO the VBOXes are crashing.... and should have no reason to do that...
and just to keep the post complete the vbox crash or stays in guru meditation and only, when on background intensive IO transfer happen...
Code: Select all
emR3Debug: rc=VINF_EM_TRIPLE_FAULT
Changing the VM state from 'RUNNING' to 'GURU_MEDITATION'.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 21 Dec 2015 18:23
by spy0r
daoyama wrote:
VNC on VirtualBox only supports US keyboard layout.
pretty sick, i got everything to work now, but the thing with the keyboard layout - is there any chance to get that thing work with a german/european keyboard layout?
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 22 Dec 2015 13:59
by lux
spy0r wrote:...but the thing with the keyboard layout - is there any chance to get that thing work with a german/european keyboard layout?
+1
please add different Keyboard Layout if possible!
THX!
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 12 Jul 2016 02:25
by icecappacino
When I go to either phpvirtualbox/index.html or /novnc/vnc.html?host=192.168.0.9
I get
404 Page Not Found
does Nas4Free 10.3 come with VirtualBox installed?
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 12 Jul 2016 06:53
by zoon01
icecappacino wrote:When I go to either phpvirtualbox/index.html or /novnc/vnc.html?host=192.168.0.9
I get
404 Page Not Found
does Nas4Free 10.3 come with VirtualBox installed?
It seems you use a 32-bits version!
As of 10.3.0.3 its a 64-bits feature and removed from 32-bits as I think those systems runs too short on ram anyway.
This was made clear on readme.text and Release Notes.
Permanent restrictions:
- It is not possible to use virtualbox-ose on 32-bits nas4free, 64-bits only feature.
- It is not possible to format a SoftRAID disk with MSDOS FAT16/32.
- It is not possible to encrypt a disk partition, only complete disks are supported.
- AFP shares with TimeMachine support are limited to max. 4 shares.
- iperf3 is not backwards compatible with iperf2.x. so you might also upgrade your client.
Re: [HOWTO] Use phpVirtualBox and noVNC
Posted: 21 Aug 2020 12:32
by kidalabama
when will be ingrated novnc phpvirtualbox xigmanas ?