VirtualBox Startup Mode no automatic start of VMs

  • Hi everybody,


    After Upgrade from OMV2 to OMV4 (fresh install) everythings works as expected, except startup of the VMs in VirtualBox.


    To move the VMs I exported and imported the aplliances for every VM, which seemed to be succesful. All VMs work and I can start them from the OMV-GUI as well as from phpVirtualbox.
    But at time of booting the OMV, they don't start automatically, independently of the settings of Startup Mode.


    Any idea how to fix this or to use a workaround is highly appreciated.


    Of course Proxmoxx, Docker, a.s.o. would be the better concept, but as long as I am on OMV4, it would be nice to have the VM in autstart.

  • Any idea how to fix this or to use a workaround is highly appreciated.

    There have been many threads about this. Some even have "fixes" that seem to work for some. I tried to replicate it back then but never could and I'm not maintaining this plugin anymore.

    omv 5.5.17-3 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.4.2
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • There have been many threads about this. Some even have "fixes" that seem to work for some. I tried to replicate it back then but never could and I'm not maintaining this plugin anymore.


    Did read a lot about VNC/RDP and other issues mostly related to virtualbox-extension-pack. But I found nothing about the start issue.
    Do you have a link?


    Would it be possible to start a VM from the CLI, which I could then use as scheduled job?


    VBoxManage startvm xxxxxx --type headless


    does not work:


    VBoxManage: error: Could not find a registered machine named 'xxxxxx'



    Also


    VBoxManage list vms


    does not show any VM

  • Do you have a link?

    Nope. I just remember them from over the years. You will have to find them with google or something.


    Would it be possible to start a VM from the CLI, which I could then use as scheduled job?

    Yep. Pretty sure that is what most people were using for their scripts.


    VBoxManage startvm xxxxxx --type headless


    does not work:

    VBoxManage is dependent on the user you run it as. Depending on how you install virtualbox, you need to run them as the vbox user.

    omv 5.5.17-3 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.4.2
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • VBoxManage is dependent on the user you run it as. Depending on how you install virtualbox, you need to run them as the vbox user.

    OMV4 installed baremetal and VirtualBox from OMV-extras. No special installation.
    Same behaviour on two different systems (primar: HP Gen8 microServer; test rig: AMD Phenom II on Asus Board). And the hardware is ok., no issues last week with the HP Gen8 and OMV2.


    I understand that it doesn't make sense to invest time in a dead end road,
    On the other hand very sad, OMV4 failes (on my system) in this issues, whereas two generations ago everything run smoothly.


    Next year I will have a deeper look into Docker, Portainer.

  • OMV4 installed baremetal and VirtualBox from OMV-extras. No special installation.
    Same behaviour on two different systems (primar: HP Gen8 microServer; test rig: AMD Phenom II on Asus Board). And the hardware is ok., no issues last week with the HP Gen8 and OMV2.


    I understand that it doesn't make sense to invest time in a dead end road,

    I wasn't asking how you installed it. I was just saying that not all virtualbox packages may use the vbox user. The command should work fine on a omv 4.x system. VBoxManage HAS to be run as the vbox user.

    On the other hand very sad, OMV4 failes (on my system) in this issues, whereas two generations ago everything run smoothly.

    Sad that you assume this is the fault of OMV and/or the plugin

    Next year I will have a deeper look into Docker, Portainer.

    Even in the corporate world where things are supported for a long time, software needs to be replaced. Resistance to change is the hardest part.

    omv 5.5.17-3 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.4.2
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • If its a fault, then of VirtualBox/Buster what I mentioned several times before.



    The difference between OMV4 and OMV2 on my system regarding start of VMs is just a result. Take it as a user experience.

    My bad. You were comparing OMV 2 and 4 and it seemed like you were thinking it was something OMV4 was doing. Have you tried virt-manager? qemu-img could easily convert your virtualbox images to kvm images.

    omv 5.5.17-3 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.4.2
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • In the end I found a workaround:


    'VBoxManage startvm xxxxxx --type headless' as a 'Scheduled Jobs' wih user 'vbox' and set to a 'certain time'.


    It took me some time to understand that '...you need to run them as the vbox user.' means to run as user 'vbox'. English is not my mother tongue.


    For me problem solved.
    As I start the OMV-server on a scheduled time, I can also start the VM on a scheduled certain time (server start time plus 5 min).


    Some findings:
    - This works only on 'certain time'. When setting 'Scheduled Jobs' to 'At reboot', start of the VM fails.
    - Reproducable on two different hardware platforms. One of them formerly used with OMV2 without start problem of VMs.
    - I wasn't able to start a VM from the CLI, even with su vbox.


    Would be interesting to know whether other installations also cannot start a VirtualBox VM directly on boot or whether I have my personal problem.
    As this seems to be just a starting problem at boot (but beyound my expertise), maybe it can easily fixed for the actual OMV4, even as VirtaulBox will ceased on OMV5.


    But again, I can live with this. Everything else (Docker, virt-masnager, KVM, Proxmox,...) next year.
    Thanks for the fruitful conversation.

  • This works only on 'certain time'. When setting 'Scheduled Jobs' to 'At reboot', start of the VM fails.

    Probably you could use a script that is run at startup with a delay at the beginning


    Code
    sleep 5m
    VBoxManage startvm xxxxxx --type headless
  • Would be interesting to know whether other installations also cannot start a VirtualBox VM directly on boot or whether I have my personal problem.
    As this seems to be just a starting problem at boot (but beyound my expertise), maybe it can easily fixed for the actual OMV4, even as VirtaulBox will ceased on OMV5.

    I haven't been able to re-produce it and it doesn't seem to happen to everyone. It might just be storage is not ready when the VMs are supposed to be started.


    If you really want virtualbox on omv5, just install the package from the virtualbox repos. Then you can use x-forwarding via ssh to run the virtualbox client. No need for phpvirtualbox and web server setup then.

    omv 5.5.17-3 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.4.2
    omv-extras.org plugins source code and issue tracker - github


    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • If you really want virtualbox on omv5, ...

    No, not for its own sake.


    More or less I finished the upgrade to OMV4 and the server works the way I like it.
    This is ok for me as long as OMV4 will be supported (Debian 9 until 2022; OMV4, even without updates, of course in this forum unlimited :) )


    Again, thanks for the help.


    Next year I'll dive deeper into Proxmox, KVM, OMV5 with or without VirtualBox and especially into btrfs and ZFS.
    Maybe the next uograde of the main system comes earlier than expected.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!