Virtualbox Virtualization system, currently one of the best free virtualization software products. Personally tested the work of guests: XP, Windows 2003, 2008, Debian, Ubuntu is stable.
phpVirtualBox AJAX is an implementation of the VirtualBox user interface written in PHP. This is a web interface for remote access to virtual machines.
This instruction is fully operational and thiswebsite It works on a virtual machine raised on Virtualbox according to this instruction, or rather I picked up the virtual server and then reworked the work records into a detailed working manual.
To install Virtualbox, use Debian or Ubuntu.
You need to configure a repository from the official Virtualbox website.
Add to source.list repository
vi /etc/apt/sources.list
For Squeeze:
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free
For Lenny:
deb http://archive.debian.org/debian/ lenny main contrib non-free
For Ubuntu (select your distribution):
deb http://download.virtualbox.org/virtualbox/debian oneiric contrib deb http://download.virtualbox.org/virtualbox/debian natty contrib deb http://download.virtualbox.org/virtualbox/debian maverick contrib non-free deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free deb http://download.virtualbox.org/virtualbox/debian karmic contrib non-free deb http://download.virtualbox.org/virtualbox/debian hardy contrib non-free
Add the virtualbox repository public key with the command:
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add -
Update the repository and start installing virtualbox commands:
aptitude update aptitude install virtualbox-4.1
In order for us to have access to RDP through the web interface and USB2 for a virtual machine, you need to download and install an additional virtualbox package.
But before you install the add-on package, you need to find out the version of the installed virtualbox command:
vboxwebsrv -V Oracle VM VirtualBox web service version 4.1.22 (C) 2005-2012 Oracle Corporation All rights reserved. 4.1.22r80657
So we've got a version. 4.1.22r80657So we go to the page. http://download.virtualbox.org/virtualbox/ And we open the directory. 4.1.18 And at the top, we see the file. Oracle_VM_VirtualBox_Extension_Pack-4.1.8-75467.vbox-extpackIt’s the last one, so we need to download it and install it.
To do this, download an additional package with the team:
wget http://download.virtualbox.org/virtualbox/4.1.22/Oracle_VM_VirtualBox_Extension_Pack-4.1.22-80657.vbox-extpack
And install the downloaded package for rdp and usb2 by the command:
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.*.vbox-extpack
After installation, the service must be restarted. vboxweb-service by teams:
/etc/init.d/vboxweb-service stop /etc/init.d/vboxweb-service start
For Virtualbox to work, you need to create a user under which virtual machines will work.
Adding a user vbox to the system by command:
adduser vbox
Indicate the user password vbox, pre-write it in your notebook for passwords.
Installation of phpvirtualbox
In order for phpvirtualbox to work through a web interface, you need to install a PHP-enabled web server.
Install the software by the team:
aptitude install apache2 php5 mc unzip unrar
Then we swing it ourselves. phpvirtualbox team:
wget http://freefr.dl.sourceforge.net/project/phpvirtualbox/Older%20versions/phpvirtualbox-4.1-11.zip
Unpacking the contents of the archive phpvirtualbox-4.1-11.zip folder /var/www/ Remove everything in the program beforehand. mc.
Change the rights to phpvirtualbox files for a web server by the command:
chown -R www-data:www-data /var/www/*
We overload the web server with a command:
/etc/init.d/apache2 restart
Next we go to the folder. /var/www/ team:
cd /var/www/
Create a configuration file from the default command:
mv config.php-example config.php
changeable config.php:
/* Username / Password for system user that runs VirtualBox */ var $username = 'vbox'; var $password = 'pass';
wherein pass Your password entered when creating a user vbox
Modify further:
was:
/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */ var $location = 'http://127.0.0.1:18083/';
Attention!! In order for rdp to work through the web interface, it is necessary to specify not 127.0.0.1 but internal or external IP, such as 192.168.0.1 (internal server address).
became:
/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */ var $location = 'http://192.168.0.1:18083/';
was:
// Host / ip to use for console connections #var $consoleHost = '192.168.1.40';
became:
// Host / ip to use for console connections var $consoleHost = '192.168.0.1';
Create a file that answers which IP and port will work on virtualbox
vi /etc/default/virtualbox VBOXWEB_USER=vbox VBOXWEB_HOST=192.168.0.1 VBOXWEB_PORT=18083
Attention!! IP 127.0.0.1 can be specified, but in order for rdp to work through a web interface, it is necessary to specify not 127.0.0.1 but internal or external IP, such as 192.168.0.1 (internal server address)
Reboot virtualbox with the command:
/etc/init.d/vboxweb-service restart
We open the address of our server in the browser:
http://192.168.0.1/
inject
login: admin
Password: admin
The web interface will open in English, which can be changed in the settings into Russian, by the way, I strongly recommend changing the user's password, but it is better to create an administrator with a not typical name and a complex password, and the current one should be deleted, then if you have an interface looking at the Internet (which is not recommended for security), the password and login will be much more difficult (almost impossible) to pick up.
The interface of the web interface is almost no different from the desktop version of Virtualbox.
We create a virtual machine with the help of the wizard by clicking on the button to create, and connecting the image of the desired disk and selecting an image in the dashboard, we install the operating system.
Auto-start virtual machines when the server is turned on, save the current state of the guest machine (not turn off) when the physical server is turned off with the restoration of the current state when the server is turned on.
Auto-Start Virtualbox Guest Machine:
Create a script that will start and save guest machines when the server is turned on or off:
vi /etc/init.d/virtualbox
#!/bin/bash
START="/bin/bash"
#if [ ! -f /etc/rc.vm ]; then
# echo "/etc/rc.vm does not exist"
# exit 0
#fi
VBOXDIR="/etc/vbox"
VM_USER="vbox"
SU="su - $VM_USER -c"
VBOXMANAGE="VBoxManage -nologo"
VM="Gateway"
case "$1" in
start)
echo -n "Starting up virtual maschine $VM"
$SU "VBoxHeadless --startvm $VM > /dev/null 2>&1 &"
echo "done."
;;
restart)
$SU "VBoxManage controlvm $VM reset"
;;
stop)
$SU "VBoxManage controlvm $VM savestate"
;;
stopacpi)
$SU "VBoxManage controlvm $VM acpipowerbutton"
exit 0
;;
*)
echo "Usage: $N {start|restart|stop}" >&2
exit 1
;;
esac
exit 0
In this file, only the variable needs to be changed. VMIn it you need to specify the name of your virtual machine, which is displayed in the web interface. phpvirtualbox.
Make the file executable and add it to the autoload commands:
chmod +x /etc/init.d/virtualbox update-rc.d virtualbox defaults
For each guest machine, you need to make your own file that starts and saves the virtual machine when the server is turned on and off.
Mistakes!!
If you open the web interface with an error:
Error logging in to vboxwebsrv
It is necessary to run the command under the user vbox:
su vbox VBoxManage setproperty websrvauthlibrary null Ctrl+d
Then reboot. virtualbox team:
/etc/init.d/vboxweb-service restart
If this error occurs when connecting to RDP:
Disconnect reason: I: MCS: Disconnect Request I: RDPCLIENT: The server has dropped connection.
It is necessary to: Properties of a virtual machine - Display. - Remote display - Additional opportunities - check the box Allow multiple connections
Video instructions for this article:
Part 1:
Part 2:



comment