Install PhpVirtualbox with virtualbox 6.1 on Ubuntu Desktop 20.04





sudo -i


Install Virtualbox

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
apt-get update
apt-get install virtualbox

Optional extension pack for virtual box
wget https://download.virtualbox.org/virtualbox/6.1.12/Oracle_VM_VirtualBox_Extension_Pack-6.1.12.vbox-extpack

VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.12.vbox-extpack

Install  vboxweb-service 

cd /etc/init.d/
services=(vboxautostart-service vboxweb-service vboxballoonctrl-service)
base_url="https://www.virtualbox.org/svn/vbox/trunk/src/VBox/Installer/linux"
for service in "${services[@]}"
    do
      wget "${base_url}/${service}".sh -O "${service}" \
      && chmod +x "$service"  \
      && update-rc.d "$service" defaults 90 10
    done

Install  Apache and PHP

sudo apt install apache2 php php-mysql libapache2-mod-php php-soap php-xml

Install  PHPVirtualbox

wget https://github.com/phpvirtualbox/phpvirtualbox/archive/develop.zip
unzip develop.zip
mv phpvirtualbox-develop /var/www/html/phpvirtualbox

chmod 777 /var/www/html/phpvirtualbox/
cp /var/www/html/phpvirtualbox/config.php-example /var/www/html/phpvirtualbox/config.php


nano /var/www/html/phpvirtualbox/config.php


nano /etc/default/virtualbox
VBOXWEB_USER=vbox
VBOXWEB_HOST=127.0.0.1

 /lib/systemd/systemd-sysv-install enable vboxweb-service
systemctl restart vboxweb-service
systemctl restart apache2
ufw allow in "Apache Full"

You caould access virtualbox via http://192.168.56.178/phpvirtualbox/
Default Login : admin
Default Password :  admin 





Configure Auto Start VM

nano /etc/default/virtualbox
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostartvm.cfg

mkdir /etc/vbox/
nano /etc/vbox/autostartvm.cfg
default_policy = deny
vbox= {
    allow = true
    startup_delay = 10
}




usermod -aG vboxusers vbox
chgrp vboxusers /etc/vbox
chmod g+w /etc/vbox
chmod +t /etc/vbox
VBoxManage setproperty autostartdbpath /etc/vbox/

Define which VM to Auto Start

vboxmanage list vms


vboxmanage modifyvm "UUID" --autostart-enabled on

Allow Console View in phpVirtualbox web.

VBoxManage modifyvm 2086997f-f991 --vrdeport 3389-4000

 VBoxManage modifyvm 2086997f-f991-40cf-b9e7 --vrde on 

Comments

Popular posts from this blog

Sample Code for jstree Ajax Call and Search

Key Value pair html UI with select 2 integration