Hypervisor for Dummies
1. To begin, after installing ubuntu, you should update all the packages and the kernel:
sudo apt-get -y update && sudo apt-get -y dist-upgrade2. Then reboot:
sudo reboot now3. Now we will recreate sources.list with the addition of necessary repositories (for 14.04, if you have a higher version, you will have to edit trusty handles on your code name (except webmin, it is always sarge)). For convenience, log in as root:
suor
sudo -i4. Then backup sources.list and create a clean one:
cd /root
mv /etc/apt/sources.list /etc/apt/sources.list.bak
touch /etc/apt/sources.list
nano /etc/apt/sources.list5. Paste this into the new sources.list file:
#
deb http://ru.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://ru.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://ru.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty universe
deb http://ru.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://ru.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://ru.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://ru.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner
## deb http://extras.ubuntu.com/ubuntu trusty main
## deb-src http://extras.ubuntu.com/ubuntu trusty main
deb https://download.webmin.com/download/repository sarge contrib
deb http://download.virtualbox.org/virtualbox/debian trusty contrib
6. Download and install the keys:
wget http://www.webmin.com/jcameron-key.asc
wget https://www.virtualbox.org/download/oracle_vbox_2016.asc
wget https://www.virtualbox.org/download/oracle_vbox.asc
apt-key add jcameron-key.asc
apt-key add oracle_vbox.asc
apt-key add oracle_vbox_2016.asc
apt-get update7. Install the necessary packages:
apt-get install mysql-server apache2 php-soap webmin mc unzip traceroute
apt-get install virtualbox-5.28. Add a user:
usermod -aG vboxusers {имя пользователя}Important! Use the name of the user present in the system, because it is from him that the virtual machines will be launched.
9. Next, download and install the Extension Pack:
wget https://download.virtualbox.org/virtualbox/5.2.26/Oracle_VM_VirtualBox_Extension_Pack-5.2.26.vbox-extpack
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.26.vbox-extpack10. It remains the case for webmord, download and install:
wget https://github.com/phpvirtualbox/phpvirtualbox/archive/5.2-1.zip
mv phpvirtualbox-5.2-1 /var/www/html/phpvirtualbox11. Assign the owner and rights:
chown -R www-data:www-data /var/www/html/phpvirtualbox
chmod -R 755 /var/www/html/phpvirtualbox12. Now copy and edit the config:
cp /var/www/html/phpvirtualbox/config.php-example /var/www/html/phpvirtualbox/config.php
nano /var/www/html/phpvirtualbox/config.php13. In the opened config we are only interested in 2 lines, namely
var $username = 'user';
var $password = 'password';here we enter the real username and password from the account specified in clause 8.
14. Create and edit the / etc / default / virtualbox file:
nano /etc/default/virtualboxand add there
VBOXWEB_USER={имя пользователя из пункта 8}15. Reboot:
reboot now16. On guest OS, you need to install Guest additions, download the image and mount it in the virtual machine's drive:
wget https://download.virtualbox.org/virtualbox/5.2.26/VBoxGuestAdditions_5.2.26.iso For * nix machines, install the necessary packages:
sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)Mount the drive:
sudo mount /dev/sr0/ /media/cdrom and we start from the superuser cd /media/cdrom
./VBoxLinuxAdditions.runFor machines on Windows, we simply run Autorun or Setup.exe.
If everything went well, then after rebooting, the
http://{ip адрес сервера}/phpvirtualboxvirtual machine management interface will be available at the address , and https://{ip адрес сервера}:10000webmin will be available at the address - a powerful server management interface. To log in to the virtual machine management interface, use the standard username and password admin: admin (changes in the interface itself), and for authorization in webmin, use the real user account with root privileges (you can directly root if you unblocked it).