Posts by roru69

    This is how it is configured in my case:


    As you can see I selected a Virtual Machine. I can change the resolution and have set the IP address to the machine Virtualbox is installed on.



    Changed the resolution to 1024x768



    Clicked the Connect button and my login screen appears. (Had to click once in the black window to wake the machine)



    I Logged in as root and I'm in.



    These are my Remote Display settings (You can only change some of the settings when the machine is in Powered Off state).



    These are my network settings.


    If I understand correctly your Ubuntu virtual machine is asking for credentials. When you installed Ubuntu on the VM you had to supply a new username and password. These are the credentials you must use to gain access to that machine.


    Regards, Roru69

    Hi,


    Try:


    chown -R 998:996 /var/www/phpvirtualbox

    chmod -R 755 /var/www/phpvirtualbox/


    I forgot to make the chmod recursive, I already changed the guide. After doing above everything should work.


    Regards,


    Roru69

    For RDP to work you will have to change the port range in PHPVirtualbox -> Settings of the virtualboxmachine -> Display and choose the Remote Display tab. change the port range to 9100 - 9200. The machine has to be powered down to do this.


    For the console to work: Change the Net Address in the Remote Display tab from 127.0.0.1 to the real IP Address of the Hostmachine, then you can use the Console.


    To use the "vboxmanage list vms" command in CLI you first have to change user to vbox. eg. "su vbox". Then use the command "vboxmanage list vms". You should be able to see the machines that you have added in PHPVirtualbox. Virtualbox is running under user "vbox"


    Regards, Roru69

    Question: Did you setup portainer before installing virtualbox? I did't experience these errors during install. Just the fact that i couldn't connect to the VRDE's. I always could login to PHPVirtualbox, just remote desktopping to a virtual machine didn't work.


    I wil add your findings in the Guide, So if other people run into it they are aware that this could happen..

    I run an OMV5 System on the AMD 3700X CPU with 8 cores and a total of 16 thrreads (32GB of RAM) . The Asus Pro X570 Ace mainboard supports ECC should you need that.


    On OMV5 i have 6 virtual machines active and at this moment 2 docker images running.


    My last server (from 2011) had an intel Core I7 and 16GB of ram, and I can say that in the 5 months that the 3700X is running now, i never had any problem. it runs cool, stable and fast!!


    Regards Roru69



    Server Hardware:

    Case = Chieftec

    MB =ASUS Pro WS X570-ACE

    CPU = AMD 3700X

    RAM = Corsair Vengance 32GB

    SSD - System =Samsung 970 EVO Plus 250GB (OMV System)

    PSU = 850W Corsair Gold

    Raid = LSI 9260 4i

    HDD - Data = 4x WD RED 3TB raid 5 onLSI controller

    SSD - Data1 = Crucial MX500 - 500GB - Virtualbox Machines

    SSD - Data2 = Crucial mX500 - 500GB - Docker machines


    UPS:

    APC Smart UPS 1500


    Software (system)


    Debian 10 (Buster )(Installed from guide in OMV Forum)

    Openmediavault 5.4.0.1 (Installed from guide in OMV Forum)

    Virtualbox 6.1.6 (Installed from guide in OMV Forum)


    Virtualmachines:

    Virtualmachine 1 - Debian 9 - Nextcloud 16 - OnlyOffice

    Virtualmachine 2 - Ubuntu 18.04 LTS - TVHeadend - Oscam - Emby

    Virtualmachine 3 - Ubuntu 18.04 LTS - SABNZBD - Transmission - Radarr - Sonarr - Lidarr - Jackett - Spotweb

    Virtualmachine 4 - Windows Server 2012 R2 - Domain Controller

    Virtualmachine 5 - Windows Server 20212 R2 Terminal Server RDP

    Virtualmachine 6 - Zentyal 6.1 mailserver

    Virtualmachine 7 - Piehole


    Dockers:

    Duplicati

    Watchtower


    This is an updated configuration. My Previous server was a Core I7 (16GB) from 2011. The only thing I reused was the Raid5 controller and Raid 5 set. I backuped the virtualboxes to the raid set and build a new server around it. From there restored the virtualboxes and I was up and running within a day.


    The new Server is now running for about 6 months. We had a power outage for 6 hours and when the UPS was running low on power the Virtualboxes went in to saved state and OMV did a clean shut down after that. When the power returned the Server booted, OMV started and all Virtual Machines were started automaticly.

    Hi,


    I wrote the guide for installing Virtualbox 6 on OMV5, and I had no problems installing it using the guide. I'm curious what went wrong, if there is something missing in the guide i would like to add it offcourse.


    Oracle supports Virtualbox on Debian 10 Buster so i don't think that there will be any problem. When installed, the OMV updater wil recognise that and updates are shown and installable. I just updated from 6.1.2 to 6.14 without any problems.


    PHP-Virtualbox has to be updated manually indeed, but that is nothing more than stopping the service, updating the files and starting the service again.


    When i installed Virtualbox 5 on OMV 4 with the plugin it gave me al sorts of problems. The one I wanted to resolve is when I shutdown OMV, the virtualmachines have to be in Saved State before OMV shuts down. This was not the case in OMV4 with the Virtualbox plugin. With Virtualbox 6 and OMV 5 installed according to the guide, the machines are all in saved state before OMV shuts down, and get started when OMV boots again.


    Again, if you have a problem installing Virtualbox 6 or PHPVirtualbox please let me know, I am happy to assist.


    Regards,


    Roru69

    Continued - Backup Virtual Machine Bash script with OMV5.

    Code
    nano /var/lib/vbox/vmbackup.sh


    (Change the variables in below scipt, copy and paste bash scipt below, save with "[CTRL] X Y [Enter]")
    The "declare -a REBOOT" part is for machines which need a reboot after Saving State. In some cases that is needed to initialize USB hardware which is connected.





    Code
    chown -R vbox:vboxusers /var/lib/vbox
    Code
    chmod +x /var/lib/vbox/vmbackup.sh


    Create a scheduled job within the OMV5 Webgui
    Time of execution: Certain Date
    Minute: 0
    Hour: 4
    Day of month: *
    Day of week: Wednesday
    User: vbox
    Command: /var/lib/vbox/vmbackup.sh
    Comment: Backup of Virtualbox Machines



    Enable and save the job.
    Above is an example of a job that backups the Virtualbox Machines every Wednesday at 04:00.


    The script is initially made by Vorkbaard. I edited the script to add more logging and introduced a reboot because i noticed that i had a machine where the USB Cardreader didn't work when it was started from "Saved State".


    Regards RoRu69

    Install Debian 10.x – Openmediavault 5.X – Virtualbox 6.X - PHPVirtualbox



    This is walktrough for installing OMV5 in combination with Virtualbox 6. When using OMV-Extras you have the possibility to use Cockpit for your Virtual Machines.
    After working with Virtualbox for the last 5 years I find that Cocpit lacks the features that Virtualbox has.
    I'm fairly new to Linux so use this at own risk. I find that everything is just running fine!


    I did the installation as root, so i didn't ran into any permission problems.



    Install debian 10.1 including SSH


    Network config: (set static ip in interfaces - This is later adopted by OMV)
    nano /etc/network/interfaces


    ----------example-------------

    iface enp0s17 inet static

    address 192.168.X.X

    netmask 255.255.255.0

    gateway 192.168.X.X

    dns-nameservers 192.168.X.X

    ----------example-------------


    "[CTRL] X Y [Enter]" - Save the file.


    SSH permit root login
    nano /etc/ssh/sshd_config
    PermitRootLogin yes
    "[CTRL] X Y [Enter]" - Save the file.



    Install OMV5.X
    apt-get install build-essential


    nano /etc/apt/sources.list.d/openmediavault.list
    deb https://packages.openmediavault.org/public usul main
    "[CTRL] X Y [Enter]" - Save the file.


    export LANG=C
    export DEBIAN_FRONTEND=noninteractive
    export APT_LISTCHANGES_FRONTEND=none
    wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key
    apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc"
    apt update
    apt install postfix openmediavault
    omv-confdbadm populate


    Login to Openmediavault (admin - openmediavault)
    Enable all networkcards in OMV5 (if more than one)
    Mount all your disks in OMV5



    Install Virtualbox 6.x
    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 -
    echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian buster contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
    sudo apt update
    sudo apt install linux-headers-$(uname -r) dkms
    sudo apt install virtualbox-6.1


    Install Virtualbox extension pack
    cd ~/
    wget https://download.virtualbox.org/virtualbox/6.1.0/Oracle_VM_VirtualBox_Extension_Pack-6.1.0.vbox-extpack
    sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.0.vbox-extpack


    Create user "vbox" and make this user a member of "vboxusers"
    adduser vbox
    sudo usermod -aG vboxusers vbox
    sudo systemctl status vboxdrv
    (see if vboxservices are running - should be "active (exited)")


    Install phpvirtualbox


    sudo apt-get install php7.3-soap
    (next on a client PC/Laptop)
    download: https://github.com/phpvirtualb…albox/archive/develop.zip
    Extract and rename folder to: "phpvirtualbox"


    open config.php-example in folder "phpvirtualbox" with notepad(++)

    Code
    var $username = 'vbox';
    var $password = 'vbox'; (or the password supplied by you)
    var $enableAdvancedConfig = true;

    save file as config.php
    copy folder "phpvirtualbox" to /var/www


    On the OMV machine:

    chown -R 998:996 /var/www/phpvirtualbox

    chmod -R 755 /var/www/phpvirtualbox/


    sudo nano /etc/default/virtualbox
    VBOXWEB_USER=vbox
    "[CTRL] X Y [Enter]" - Save the file.


    Restart vbox services
    sudo systemctl restart vboxdrv
    sudo systemctl restart vboxweb-service


    Create user "phpvirtualbox-webgui" for NGINX


    adduser phpvirtualbox-webgui
    (password: phpvirtualbox)



    Create configfifle for website "phpvirtualbox-webgui" that runs in NGINX
    nano /etc/nginx/sites-available/phpvirtualbox-webgui


    "[CTRL] X Y [Enter]" - Save the file.


    Create configuration file for "php-fpm"
    nano /etc/php/7.3/fpm/pool.d/phpvirtualbox-webgui.conf

    "[CTRL] X Y [Enter]" - Save the file.


    Activate PHPVirtualbox website
    sudo ln -s /etc/nginx/sites-available/phpvirtualbox-webgui /etc/nginx/sites-enabled/
    systemctl restart nginx
    systemctl restart php7.3-fpm


    Check if you can reach phpvirtualbox by entering the following URL: "http://[your-OMV5-server]:8080/" in for instance "Firefox"

    The default username and password for phpvirtualbox is admin/admin


    Start and Stop VM’s automaticly on boot and shutdown
    nano /etc/default/virtualbox

    Code
    VBOXAUTOSTART_DB=/etc/vbox
    VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg

    "[CTRL] X Y [Enter]" - Save the file.


    nano /etc/vbox/autostart.cfg

    Code
    default_policy = deny
    # Create an entry for each user allowed to use autostart
    vbox = {
    allow = true
    }

    "[CTRL] X Y [Enter]" - Save the file.


    sudo chgrp vboxusers /etc/vbox
    sudo chmod 1775 /etc/vbox


    Choose VMs to automatically start and stop


    The first time a user configures autostart, the command: VBoxManage setproperty autostartdbpath /etc/vbox needs to be run.
    Note: The autostart options are stored in the /etc/vbox file, and the VM itself. If moving the vm, the options may need to be set again.
    VBoxManage modifyvm <uuid|vmname> --autostart-enabled <on|off>
    You can also: VBoxManage modifyvm <uuid|vmname> --autostop-type <disabled|savestate|poweroff|acpishutdown>


    su vbox
    VBoxManage setproperty autostartdbpath /etc/vbox


    VBoxManage modifyvm [servername 1] --autostart-enabled on
    VBoxManage modifyvm [servername 2] --autostart-enabled on --autostart-delay 120
    VBoxManage modifyvm [servername 3] --autostart-enabled on --autostart-delay 300


    VBoxManage modifyvm [servername 1] --autostop-type savestate
    VBoxManage modifyvm [servername 2] --autostop-type savestate
    VBoxManage modifyvm [servername 3] --autostop-type savestate


    Restart VirtualBox autostart service

    su root

    sudo service vboxautostart-service restart


    Notes:
    Virtualbox uses port 9000 to 9100 for VRDP, when you want to use Portainer in OMV you have to change these ports to another range for example 9100-9200. You can find these settings in phpvirtualbox, under settings of the VM, display -> remote display tab.

    You can also change the parameter in the config.php of phpvirtualbox to reflect the correct ports:

    Code
    var $vrdeports = '9100-9200';


    Tested autoshutdown, now OMV waits until the machines are in "Saved State" before shutting the machine down. This works now. In OMV4 with the OMV-Extra's Virtualbox plugin installed the machines get aborted.


    Good luck!!!


    Regards, Roru69