vboxautostart will not start on Linux Mint 21

Discussions related to using VirtualBox on Linux hosts.
Post Reply
ElementZero
Posts: 2
Joined: 6. Aug 2022, 06:15

vboxautostart will not start on Linux Mint 21

Post by ElementZero »

I have messed with this dumb thing for two days now, it's extremely aggravating at this point.

First off - the virtualbox install by apt DOES NOT install the vboxautostart service. There is a post online where somebody gives you a script to add the missing services, I tried that - it does add the service but then they seem to fail at load.

Next, I tried just installing the deb from Ubuntu 22 off the VirtualBox website but that caused problems booting the guest with something about a key missing. I found a few hints on that around but basically it all revolved around virtualbox not being installed correctly - I removed it and reinstalled it, remade the guest OS - all no good, it doesn't work.

FINALLY I found this guys post [sorry, I can't post links yet so just google linuxcapable virtualbox mint 21] where he shows you how to install it with the gpg. It seemingly installs everything, everything seems to work as it should (at least, no errors on startup by vboxautostart) excepttt.....the vm doesn't turn on. SO! Either I'm doing something wrong or I have no idea, I see no errors in the log now so I'm hoping somebody can help me out.

I did all this

Code: Select all

1. Create a virtualbox configuration file.
sudo nano /etc/default/virtualbox

2. Add the following entries
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg

3. Provide Access to your user in the autostart configuration.
sudo nano /etc/vbox/autostart.cfg
default_policy = deny
mydude = {
allow = true
}

4. Ensure correct access is present
sudo chgrp vboxusers /etc/vbox
sudo chmod 1775 /etc/vbox
sudo usermod -aG vboxusers mydude

5. Set the virtualbox VM properties
VBoxManage setproperty autostartdbpath /etc/vbox
VBoxManage modifyvm Win --autostart-enabled on

6. Restart virtualbox auto start service
sudo service vboxautostart-service restart
I added in a "sleep 10" to the top of my default/virtualbox as well so it looks like this now

Code: Select all

$ cat /etc/default/virtualbox
sleep 10

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

Code: Select all

$ ls -al /etc/vbox
total 24
drwxrwxr-t   2 root      vboxusers  4096 Aug  5 23:46 .
drwxr-xr-x 150 root      root      12288 Aug  5 23:32 ..
-rw-r--r--   1 root      root         51 Aug  5 23:46 autostart.cfg
-rw-------   1 mydude mydude     1 Aug  5 23:32 mydude.start

syslog

Code: Select all

Aug  6 00:26:55 PlexServer vboxautostart-service.sh[1054]: vboxautostart-service.sh: Starting VirtualBox VMs configured for autostart.
Aug  6 00:26:55 PlexServer systemd[1]: Started vboxballoonctrl-service.service.
Aug  6 00:26:55 PlexServer vboxautostart-service.sh: Starting VirtualBox VMs configured for autostart.
Aug  6 00:26:55 PlexServer systemd[1]: Started vboxautostart-service.service.

Code: Select all

$ systemctl status vboxautostart-service
● vboxautostart-service.service
     Loaded: loaded (/usr/lib/virtualbox/vboxautostart-service.sh; enabled; vendor preset: enabled)
     Active: active (exited) since Sat 2022-08-06 00:26:55 EDT; 8min ago
    Process: 1054 ExecStart=/usr/lib/virtualbox/vboxautostart-service.sh start (code=exited, status=0/SUCCESS)
        CPU: 32ms

Aug 06 00:26:45 PlexServer systemd[1]: Starting vboxautostart-service.service...
Aug 06 00:26:55 PlexServer vboxautostart-service.sh[1054]: vboxautostart-service.sh: Starting VirtualBox VMs configured for autostart.
Aug 06 00:26:55 PlexServer vboxautostart-service.sh[1245]: Starting VirtualBox VMs configured for autostart.
Aug 06 00:26:55 PlexServer systemd[1]: Started vboxautostart-service.service.

Code: Select all

$ dmesg | grep "vbox"
[   38.251737] vboxdrv: module verification failed: signature and/or required key missing - tainting kernel
[   38.256810] vboxdrv: Found 4 processor cores
[   38.280350] vboxdrv: TSC mode is Invariant, tentative frequency 2594103728 Hz
[   38.280367] vboxdrv: Successfully loaded version 6.1.36 r152435 (interface 0x00320000)
and this works fine

Code: Select all

$ VBoxAutostart --start --config /etc/vbox/autostart.cfg
Oracle VM VirtualBox Autostart 6.1.36
(C) 2022 Oracle Corporation
All rights reserved.

00:00:00.008691 main     VirtualBox Autostart 6.1.36 r152435 linux.amd64 (Jul 19 2022 22:20:57) release log
00:00:00.008695 main     Log opened 2022-08-06T04:39:13.325818000Z
00:00:00.008696 main     Build Type: release
00:00:00.008700 main     OS Product: Linux
00:00:00.008701 main     OS Release: 5.15.0-43-generic
00:00:00.008702 main     OS Version: #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022
00:00:00.008781 main     DMI Product Name: 23595JU
00:00:00.008803 main     DMI Product Version: ThinkPad T530
00:00:00.008824 main     Firmware type: BIOS
00:00:00.008884 main     Host RAM: 11671MB (11.3GB) total, 11210MB (10.9GB) available
00:00:00.008887 main     Executable: /usr/lib/virtualbox/VBoxAutostart
00:00:00.008888 main     Process ID: 1689
00:00:00.008888 main     Package type: LINUX_64BITS_UBUNTU_22_04
00:00:00.096126 main     IPC socket path: /tmp/.vbox-mydude-ipc/ipcd
Let me know what other files or logs you want to see and I appreciate any help!!!!!
ElementZero
Posts: 2
Joined: 6. Aug 2022, 06:15

Re: vboxautostart will not start on Linux Mint 21

Post by ElementZero »

Still cannot get this to work. There doesn't appear to be a log (or I don't know where it is) so I can't tell why. Since this command works

Code: Select all

VBoxAutostart --start --config /etc/vbox/autostart.cfg
and if it errors it doesn't cause any issues, I've set it to run every five minutes on cron. Not ideal as it means that the system will not boot immediately (although five minutes isn't bad) and if I shut the machine down it will just start back up again, but a good enough workaround for now since this is seemingly broken
ayrus02
Posts: 1
Joined: 11. Aug 2022, 04:26

Re: vboxautostart will not start on Linux Mint 21

Post by ayrus02 »

Hi,

I've encounter the same problem with you, but I've running on AlmaLinux v9.1. After investigation and checking log file /var/log/messages and /var/log/audit/audit.log the problem is because SELinux denied access on certain file.
So the solution is to make an audit2allow SELinux Module and below are the module script generated by audit2allow:

Code: Select all

module vboxautostarts 1.0;

require {
	type init_t;
	type su_exec_t;
	type xauth_exec_t;
	class file { execute open read execute_no_trans map };
	class passwd rootok;
}

#============= init_t ==============
allow init_t self:passwd rootok;
allow init_t su_exec_t:file { execute open read execute_no_trans map };
allow init_t xauth_exec_t:file execute;
Run these command to create SELinux Module and Package:

Code: Select all

# Create the SELinux Module with
sudo checkmodule -M -m -o vboxautostarts.mod vboxautostarts.te

# Create SELinux Package
sudo semodule_package -o vboxautostarts.pp -m vboxautostarts.mod

# Install the SELinux Package
sudo semodule -i vboxautostarts.pp

# List the SELinux Package
sudo semodule -l | grep vboxautostarts
After creating and installing this SELinux Package, I've been able to run selected VritualBox Machine to auto start when the host system boot up.
Post Reply