Skip to content

[Bug]: 7.1.12 r169651 host Oracle Linux 9.6 vboxautostart-service.service after boot or manually fails to start/stop VM #309

Description

@lmapnunes

Version

7.1.12

Host OS Type

Linux

Host OS name + version

Linux ols8001.localdomain.pt 6.12.0-102.36.5.2.el9uek.x86_64 (OL9.6)

Host Architecture

x86

Guest OS Type

Linux

Guest Architecture

x86

Guest OS name + version

Linux olservice01.localdomain.pt 5.15.0-204.147.6.2.el9uek.x86_64 (OL9.3)

Component

Other

What happened?

  1. Host was running OL8u9 UEK7 and Virtualbox 6.1.48, without the reported issue, VM autostart working fine.
  2. Host was upgraded using leapp to OL9u6 UEK8u1, Virtualbox 7.1.12 installed after using DNF ol9_developer repo.
  3. VM autostart fails always after boot. I have verified same issue on another testing OL9 host.
  4. VM starts manually using VBoxHeadless --startvm olservice01
  5. After troubleshooting I came to conclusion the script /usr/lib/virtualbox/vboxautostart-service.sh is not working when calling "start_daemon "$user" "$binary" $PARAMS > /dev/null 2>&1"

How can we reproduce this?

I hacked the script to workaround the situation:

# vi /usr/lib/virtualbox/vboxautostart-service.sh

start() {
...
        # Commented this line, is not working, does not start VM.
        # Added "echo" to debug variables show correct values in /var/log/messages (attached).
        # start_daemon "$user" "$binary" $PARAMS > /dev/null 2>&1

        # Added below line, may start or not VM manually from cmd line, but does not start VM when invoked at boot 
        su - $user -c "/usr/lib/virtualbox/VBoxAutostart $PARAMS" > /dev/null 2>&1

        # Finally, added below line, starts VM both manually from cmd line and when invoked on boot.
        su - $user -c "/usr/lib/virtualbox/VBoxHeadless --startvm olservice01 --comment olservice01 --vrde on &" > /dev/null 2>&1		
...
stop() {
...
        # Commented this line, is not working, does not stop VM, upon boot the status as if killed and not by poweroff.
        # start_daemon "$user" "$binary" $PARAMS > /dev/null 2>&1

        # Added below line, may stop or not VM manually from cmd line, may not stop VM on host shutdown.
        su - $user -c "/usr/lib/virtualbox/VBoxAutostart $PARAMS" > /dev/null 2>&1

        # Added below line, stops VM manually from cmd line and may stop VM on host shutdown.
	su - $user -c "/usr/lib/virtualbox/VBoxManage controlvm olservice01 poweroff" > /dev/null 2>&1
...

I also added echo command with "debug" prefix to display variables, seen in /var/log/messages.
I haven't added the Guest VM log, because it is not touched if not started by the service.

This is the HOST output from dmesg
host_dmesg.log
This is the HOST /var/log/message file
host_var_log_messages.log

The oracle.start file was created by oracle user which belongs to vboxusers, using this command.
[oracle@ols8001 ~]$ VBoxManage modifyvm olservice01 --autostart-enabled on

And for the attempt to have it stopped used this command, though does not have any change to autostart service results.
[oracle@ols8001 ~]$ VBoxManage setextradata olservice01 autostop poweroff
[oracle@ols8001 ~]$ VBoxManage getextradata olservice01 autostop
Value: poweroff

[root@ols8001 ~]# ls -la /etc/vbox/
total 24
drwxrwxr-t.   2 root   vboxusers    51 Oct  2 13:38 .
drwxr-xr-x. 171 root   root      12288 Oct 23 19:13 ..
-rw-------    1 oracle oinstall      1 Oct  2 13:33 oracle.start
-rw-------    1 oracle oinstall      1 Oct  2 13:35 oracle.stop 
-rw-r--r--.   1 root   root        189 Mar 18  2021 vboxautostart.cfg

[root@ols8001 ~]# ls -la /etc/default/virtualbox
-rw-r--r-- 1 root root 143 Oct  2 13:48 /etc/default/virtualbox

[root@ols8001 ~]# cat /etc/default/virtualbox
# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/vboxautostart.cfg
SHUTDOWN_USERS=oracle
SHUTDOWN=poweroff

[root@ols8001 ~]# cat /etc/vbox/oracle.start
1
[root@ols8001 ~]# cat /etc/vbox/oracle.stop
1

[root@ols8001 ~]# cat /etc/vbox/vboxautostart.cfg
# Default policy is to deny starting a VM, the other option is "allow"
default_policy = deny

## As root create an entry for each user allowed to run autostart
oracle = {
   allow = true
}

Did you upload all of your necessary log files, screenshots, etc.?

  • Yes, I've uploaded all pertinent files to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions