Saturday 21 March 2015

phpvirtualbox on FreeBSD

Install these:

pkg install virtualbox-ose
pkg install nginx
pkg install php5-soap
pkg install php5-json
pkg install php5-mysqlpkg install php5-sessionpkg install php5-socketspkg install php5-xmlpkg install php5-xmlrpc
pkg install php5-simplexml
pkg install unzip
pkg install virtualbox-ose

You cannot login directly with root over ssh

You will need to create a user and place that user in the wheel group.
Then login with that user and do a su - to become root.

adduser vbox
mkdir /usr/home/vbox
pw usermod vbox -G wheel

You need to load the vboxdrv kernel module via /boot/loader.conf: vboxdrv_load="YES" You also have to add all users to your vboxusers group in order to use vbox. pw groupmod vboxusers -m vbox
chown vbox:vboxusers /usr/home/vbox
Reboot the machine to load the needed kernel modules. Please add the following line to your /etc/rc.conf: vboxnet_enable="YES"
nginx_enable="YES" devfs_system_ruleset="system" 
vboxwebsrv_enable="YES" vboxwebsrv_user="vbox"
vboxheadless_user="vbox" vboxheadless_machines="vm0" vboxheadless_vm0_name="win7" vboxheadless_vm0_user="vbox"
vboxwebsrv_flags="-P /home/ptijo/ -F /home/ptijo/vboxwebsrv.log -R 5" USB Support: For USB support your user needs to be in the operator group and needs read and write permissions to the USB device. pw groupmod operator -m vbox Add the following to /etc/devfs.rules (create if it doesn't exist): [system=10] add path 'usb/*' mode 0660 group operator Then restart devfs to load the new rules:
/etc/rc.d/devfs restart

chown -R vbox:vboxusers /usr/local/lib/virtualbox
# /usr/local/etc/rc.d/vboxwebsrv start


user www;
worker_processes 1;

events {
worker_connections 1024;

http {
include mime.types;
default_type application/octet-stream;

server {
listen 80;
server_name localhost;

charset utf-8;

location / {
root /usr/local/www/nginx;
index index.php index.html index.htm;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;

location ~ \.php$ {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/nginx$fastcgi_script_name;
include fastcgi_params;

VBoxManage setproperty websrvauthlibrary null