The continuing challenges of getting a workable server continue. The latest spins of VirtualBox seem to have solved the issues of DKMS auto compiles of the driver being aborted. The yum updates work as expected, provided one stops the running vms manually first. However, trying to get systemd to start the vms is proving to be a PITA. I have extensively googled and found that there are no specific instructions for Fedora/Redhat/CentOS and VirtualBox setups for systemd. After many trials and errors I have this systemd service file: filename - /etc/systemd/system/vboxstarter at .service [Unit] Description=VBox Virtual Machine %i Service Requires=systemd-modules-load.service vboxballoonctrl-service.service After=systemd-modules-load.service vboxballoonctrl-service.service Conflicts=shutdown.target [Service] User=<username> Group=vboxusers Restart=on-failure TimeoutSec=5min Environment="VBOX_USER_HOME=/home/rkampen/VirtualBox VMs/%i" ExecStart=/usr/bin/VBoxHeadless -s %i ExecStop=/usr/bin/VBoxManage controlvm %i savestate [Install] WantedBy=multi-user.target and on occasions the invocation systemctl start vboxvmstarter at Windoze10_2.service will work, although recently it is failing always with >$ systemctl status vboxvmstarter at Windoze10_2.service ? vboxvmstarter at Windoze10_2.service - VBox Virtual Machine Windoze10_2 Service Loaded: loaded (/etc/systemd/system/vboxvmstarter at .service; enabled; vendor preset: disabled) Active: deactivating (stop-sigterm) (Result: exit-code) since Tue 2016-05-17 03:25:02 EDT; 4s ago Process: 1987 ExecStop=/usr/bin/VBoxManage controlvm %i savestate (code=exited, status=1/FAILURE) Process: 1906 ExecStart=/usr/bin/VBoxHeadless -s %i (code=exited, status=1/FAILURE) Main PID: 1906 (code=exited, status=1/FAILURE) CGroup: /system.slice/system-vboxvmstarter.slice/vboxvmstarter at Windoze10_2.service ??1940 /usr/lib/virtualbox/VBoxSVC --auto-shutdown May 17 03:25:02 media.pcol.org systemd[1]: Started VBox Virtual Machine Windoze10_2 Service. May 17 03:25:02 media.pcol.org systemd[1]: Starting VBox Virtual Machine Windoze10_2 Service... May 17 03:25:02 media.pcol.org systemd[1]: vboxvmstarter at Windoze10_2.service: main process exited, code=exited, status=1/FAILURE May 17 03:25:02 media.pcol.org VBoxManage[1987]: VBoxManage: error: Could not find a registered machine named 'Windoze10_2' May 17 03:25:02 media.pcol.org VBoxManage[1987]: VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), com...pports May 17 03:25:02 media.pcol.org VBoxManage[1987]: VBoxManage: error: Context: "FindMachine(Bstr(a->argv[0]).raw(), machine.a...VM.cpp May 17 03:25:02 media.pcol.org systemd[1]: vboxvmstarter at Windoze10_2.service: control process exited, code=exited status=1 Hint: Some lines were ellipsized, use -l to show in full. as <username> a vboxmanage list vms "Windoze10_2" {51c8f956-9aba-4d2a-942c-8f46889d5bc0} shows the required vm. as root or using sudo it returns nothing. thus my only conclusion is that systemd actually runs this as root and ignores the User= line of the [Service] stanza. No idea where to from here, so if there is anyone that has a working systemd autostart VirtualBox setup on a headless CentOS 7 server - please advise what you have done to get it working. Or any systemd gurus that can point me at the specific foo required to beat this deamon into submission. TIA Rob P.S. I deliberately set up the VirtualBox vms under a non privileged user account. I have tried setting up a symbolic link from /root to the ~/username/VirtualBox\ VMs folder and made root a member of the virtualboxusers group - no difference, as expected, but getting desperate.
On Tue, 17 May 2016, Rob Kampen wrote:> No idea where to from here, so if there is anyone that has a working systemd > autostart VirtualBox setup on a headless CentOS 7 server - please advise what > you have done to get it working.I deliberately bailed on VirtualBox when we moved to C7, as KVM offered everything I needed with less hassle. I take it you've considered switching? jh
On 17/05/16 19:58, John Hodrien wrote:> On Tue, 17 May 2016, Rob Kampen wrote: > >> No idea where to from here, so if there is anyone that has a working >> systemd autostart VirtualBox setup on a headless CentOS 7 server - >> please advise what you have done to get it working. > > I deliberately bailed on VirtualBox when we moved to C7, as KVM offered > everything I needed with less hassle. > > I take it you've considered switching? >Considered, very briefly. I have had great success and stability with running VirtualBox on both CentOS 5 & 6 for the few Windoze apps that my clients need to run and have up on a server 24x7. The set ups I am using have been running reliably for over 8 years and remote manged with zero issues - HUGE thanks to the CentOS team for an awesome OS system delivery Thus, I have simply installed the latest VirtualBox on CentOS 7 and gone from there. I was aware that systemd existed and deliberately waited until this year to upgrade the hardware and OS, thinking issues like this should have been sorted by now. Are there any good tutorial / howtos for KVM? Although at this point I am back on another continent and reluctant to shift to KVM when over 20 hours fly time away from the server.> jh > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos
On Tue, May 17, 2016 at 08:58:16AM +0100, John Hodrien wrote:> On Tue, 17 May 2016, Rob Kampen wrote: > > >No idea where to from here, so if there is anyone that has a > >working systemd autostart VirtualBox setup on a headless CentOS 7 > >server - please advise what you have done to get it working. > > I deliberately bailed on VirtualBox when we moved to C7, as KVM offered > everything I needed with less hassle. > > I take it you've considered switching? > > jhI don't understand the issue... I've installed Centos-7 on Virtualbox without hassle. it just runs. what problem are you trying to solve? -- ---- Fred Smith -- fredex at fcshome.stoneham.ma.us ----------------------------- "And he will be called Wonderful Counselor, Mighty God, Everlasting Father, Prince of Peace. Of the increase of his government there will be no end. He will reign on David's throne and over his kingdom, establishing and upholding it with justice and righteousness from that time on and forever." ------------------------------- Isaiah 9:7 (niv) ------------------------------
On 05/17/2016 12:55 AM, Rob Kampen wrote:> May 17 03:25:02 media.pcol.org VBoxManage[1987]: VBoxManage: error: > Could not find a registered machine named 'Windoze10_2'http://karim-ouda.blogspot.com/2011/07/errors-solutions-19.html This seems to be a common problem with VirtualBox, and doesn't appear to be systemd related. (Like others, I'd encourage you to move toward KVM.)
On 17/05/16 17:55, Rob Kampen wrote:> No idea where to from here, so if there is anyone that has a working > systemd autostart VirtualBox setup on a headless CentOS 7 server - > please advise what you have done to get it working.I'm running CentOS7 as my host and when I was using Virtualbox, I had my VM's autostarting for a while. I simply followed this answer [0] on "askubuntu.com" and it worked flawlessly. However, I've since migrated all my VM's to KVM once performance on KVM surpassed that of Virtualbox (most of my VM's are Linux servers). My $0.02, ak. [0] https://askubuntu.com/questions/404665/how-to-start-virtual-box-machines-automatically-when-booting/548134
On 28/05/16 12:43, Anthony K wrote:> On 17/05/16 17:55, Rob Kampen wrote: >> No idea where to from here, so if there is anyone that has a working >> systemd autostart VirtualBox setup on a headless CentOS 7 server - >> please advise what you have done to get it working. > I'm running CentOS7 as my host and when I was using Virtualbox, I had > my VM's autostarting for a while. I simply followed this answer [0] > on "askubuntu.com" and it worked flawlessly. However, I've since > migrated all my VM's to KVM once performance on KVM surpassed that of > Virtualbox (most of my VM's are Linux servers). > >thanks for the pointer which of the 9 answers did you use - there are four with [0] points. I did see this some time ago and got a variant working under CentOS 6. I was hoping to use the new-fangled systemd, partly as a learning exercise, but also to avoid having bespoke config files and methods of starting daemons proliferating which the methods described on askubuntu.com seem to be. rob> My $0.02, > ak. > > [0] > https://askubuntu.com/questions/404665/how-to-start-virtual-box-machines-automatically-when-booting/548134 > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos