How to install VirtualBox 6.x with phpVirtualbox web interface on Debian 11 bullseye/openmediavault 6
The new Open Media Vault 6 uses Debian 11 as the base system. And for a long time, Virtual Box didn't support it. After it did, everyone whose using OMV6 has gone to the KVM platform for virtualization needs. And for the cause of that, everything related to this topic is either fractions or incomplete. I have tried KVM for a short time, and the overall experience of that is just something off for me. So I am doing this with Virtual Box again and writing this down for later use, or maybe it just helps someone who's in flavoured with me in Virtual Box.
1. Prerequisites:
A working system could be either a Debian 11 bullseye or the open media vault 6, which is essentially Debian 11.
2. Plans:
- Install Virtual Box 6 headless version.
- Install Docker to containerize the web interface coming from the project phpvirtualbox.
- Setting up phpvirtualbox using Docker/Docker Compose.
3. Installations:
3.1 Install Virtual Box
First, before we install the Virtual Box itself, we need to tackle the dependencies for it to run without errors.
Use this command line to install them.
sudo apt install wget build-essential python2
Next, we need to download the installer. There're many ways to install Virtual Box on a Linux system. But for the sake of this tutorial, I'll go with the installer one.
Here's a list of all the releases: https://download.virtualbox.org/virtualbox/
Because the PHP program for the web interface is only supporting up to 6.x, so we'll go with 6.1.40, which is the last version before 7.
Use wget to download the files straight into the file system. And then, add the execute permission for the installer and run it.
# download file
wget https://download.virtualbox.org/virtualbox/6.1.40/VirtualBox-6.1.40-154048-Linux_amd64.run
# grant permission
chmod u+x VirtualBox-6.1.40-154048-Linux_amd64.run
# execute it
sudo ./VirtualBox-6.1.40-154048-Linux_amd64.run
Virtual Box extension pack is a binary package that extends the functionality of Virtual Box. It provides extensions like USB support and hardware pass-through. But for the most important ones, we need it for RDP, which stands for Remote Desktop Protocol. Because it is headless, we can't exactly see anything unless we use another system to connect to it. That's why we have to install it.
# download
wget https://download.virtualbox.org/virtualbox/6.1.40/Oracle_VM_VirtualBox_Extension_Pack-6.1.40.vbox-extpack
# installation
sudo vboxmanage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-6.1.40.vbox-extpack
Next, we need to create a user and a user group for Virtual Box.
# create user with a home directory
sudo useradd -m username
# change its password
sudo passwd username
Log in as that user and add a user group for yourself.
sudo usermod -aG vboxusers $(id -un)
You can verify it by typing id -nG
. It will show all your groups like this:
users www-data vboxusers home
Then we reboot for things to kick in.
reboot
Up to this point, you should be able to verify the installation by this.
virtualbox -h
If nothing goes wrong, then it will output something like this:
Oracle VM VirtualBox VM Selector v6.1.40
(C) 2005-2022 Oracle Corporation
All rights reserved.
No special options.
If you are looking for --startvm and related options, you need to use VirtualBoxVM.
But of course, it goes wrong on my side...
See if you're having the same issues I have:
3.1.1 Common errors:
1. Header problem:
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (6.0.0-0.deb11.2-amd64) or it failed to
load. Please recompile the kernel module and install it by
sudo /sbin/vboxconfig
You will not be able to start VMs until this problem is fixed.
And we do as it says:
sudo /sbin/vboxconfig
Output something like this:
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-amd64 linux-headers-6.0.0-0.deb11.2-amd64
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-amd64 linux-headers-6.0.0-0.deb11.2-amd64
...
This is caused by not having the headers lib installed. Follow what it suggests and install them all.
sudo apt install linux-headers-amd64 linux-headers-6.0.0-0.deb11.2-amd64
Then try these two again:
sudo /sbin/vboxconfig
virtualbox -h
2. GL problem:
If it shows something like:
/opt/VirtualBox/VirtualBox: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory
That's because it lacks OpenGL support. Install this:
apt install libglu1-mesa
If it works, congratulations!
标签:11,web,openmediavault,--,sudo,Virtual,install,Box,VirtualBox From: https://www.cnblogs.com/pulsgarney/p/omv-6-vbox-6.html