VBoxManage VittualBox in not accessible
Posted: 26. Aug 2020, 21:57
I am hoping someone can help. I am running a cron job script as root to backup our VMs. I am getting an error from VboxManage though and can't find my way around it. We are running Ubuntu 18.04.5 LTS and official VirtualBox not the Ubuntu package.
Edit: Looking back at my logs, the script was working up until mid March. The script has not been altered.
Here is my script, User name is obfuscated:
Here is my generated output log with error:
Edit: Looking back at my logs, the script was working up until mid March. The script has not been altered.
Here is my script, User name is obfuscated:
Code: Select all
#!/bin/bash
######################
#
# Shut down and back up select VMs
#
#####################
#make new date formatted directory
sudo mkdir /mnt/md1/VirtualMachines/bak/$(date +%Y_%m_%d) |& tee -a /mnt/md1/Scripts/log_vboxBak_$(date +%Y_%m_%d).txt;
sudo chown bvserv /mnt/md1/VirtualMachines/bak/$(date +%Y_%m_%d) |& tee -a /mnt/md1/Scripts/log_vboxBak_$(date +%Y_%m_%d).txt;
#Read array of virtual machines from file
readarray -t VM < /mnt/md1/VirtualMachines/auto-start_list.txt
#loop through array of VMs
for i in "${VM[@]}"
do
# Shut down virtual machine
sudo -u bvserv VBoxManage controlvm "$i" poweroff |& tee -a /mnt/md1/Scripts/log_vboxBak_$(date +%Y_%m_%d).txt;
# Export virtual machine to dated file
sudo -u USER VBoxManage export "$i" -o /mnt/md1/VirtualMachines/bak/$(date +%Y_%m_%d)/"$i".ova |& tee -a /mnt/md1/Scripts/log_vboxB$
# Restart virtual machine
sudo -u USER VBoxManage startvm "$i" --type headless |& tee -a /mnt/md1/Scripts/log_vboxBak_$(date +%Y_%m_%d).txt
#echo "$i"
done
Code: Select all
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!
VBoxManage: error: Failed to initialize COM because the global settings directory '/root/.config/VirtualBox' is not accessible!