Disable vboxadd.service & vboxadd-service.service after guest additions included in 4.15?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Disable vboxadd.service & vboxadd-service.service after guest additions included in 4.15?

David C. Rankin
All,

  I use vitrualbox-bin (AUR) along with ext-oracle extension pack referenced
in https://wiki.archlinux.org/index.php/VirtualBox#Extension_pack. I have
followed the addition of the guest-addition kernel modules to the 4.15 kernel,
but I do not know how to handle that addition regarding what changes are
needed in my arch guests.

  Specifically, since the guest additions are included in 4.15, but not in
LTS, how do I disable the load the guest additions modules when booting the VM
on 4.15, but not when booting LTS?

  Currently on boot with 4.15, errors are generated when vboxadd attempts to
load the guest addition modules since, presumably, they are already in the
kernel, e.g.

22:23 vl1:~> sc status vboxadd-service
● vboxadd-service.service
   Loaded: loaded (/opt/VBoxGuestAdditions-5.2.6/init/vboxadd-service;
enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2018-02-09 22:16:33 CST; 7min ago
  Process: 1056 ExecStart=/opt/VBoxGuestAdditions-5.2.6/init/vboxadd-service
start (code=exited, status=1/FAILURE)

Feb 09 22:16:33 vl1 systemd[1]: Starting vboxadd-service.service...
Feb 09 22:16:33 vl1 vboxadd-service[1056]: vboxadd-service.sh: Starting
VirtualBox Guest Addition service.
Feb 09 22:16:33 vl1 vboxadd-service.sh[1059]: Starting VirtualBox Guest
Addition service.
Feb 09 22:16:33 vl1 vboxadd-service[1056]: VirtualBox Additions module not loaded!
Feb 09 22:16:33 vl1 systemd[1]: vboxadd-service.service: Control process
exited, code=exited status=1
Feb 09 22:16:33 vl1 systemd[1]: vboxadd-service.service: Failed with result
'exit-code'.
Feb 09 22:16:33 vl1 systemd[1]: Failed to start vboxadd-service.service.
22:24 vl1:~> sc status vboxadd
● vboxadd.service
   Loaded: loaded (/opt/VBoxGuestAdditions-5.2.6/init/vboxadd; enabled; vendor
preset: disabled)
   Active: failed (Result: exit-code) since Fri 2018-02-09 22:16:33 CST; 7min ago
  Process: 288 ExecStart=/opt/VBoxGuestAdditions-5.2.6/init/vboxadd start
(code=exited, status=1/FAILURE)
 Main PID: 288 (code=exited, status=1/FAILURE)

Feb 09 22:16:23 vl1 vboxadd[288]: VirtualBox Guest Additions: Building the
VirtualBox Guest Additions kernel modules.
Feb 09 22:16:33 vl1 vboxadd[288]: VirtualBox Guest Additions: Look at
/var/log/vboxadd-setup.log to find out what went w
Feb 09 22:16:33 vl1 useradd[1042]: failed adding user 'vboxadd', data deleted
Feb 09 22:16:33 vl1 useradd[1043]: failed adding user 'vboxadd', data deleted
Feb 09 22:16:33 vl1 vboxadd[288]: groupadd: group 'vboxadd' already exists
Feb 09 22:16:33 vl1 vboxadd[288]: modprobe vboxguest failed
Feb 09 22:16:33 vl1 vboxadd[288]: The log file /var/log/vboxadd-setup.log may
contain further information.
Feb 09 22:16:33 vl1 systemd[1]: vboxadd.service: Main process exited,
code=exited, status=1/FAILURE
Feb 09 22:16:33 vl1 systemd[1]: vboxadd.service: Failed with result 'exit-code'.
Feb 09 22:16:33 vl1 systemd[1]: Failed to start vboxadd.service.

  The guest additions in the 4.15 kernel work fine, so my first thought was to
disable both vboxadd.service and vboxadd-service.service, but then what do I
do for LTS?

  I've checked the wiki and there are no notes related to handling this issue.
Any suggestions?

--
David C. Rankin, J.D.,P.E.
Reply | Threaded
Open this post in threaded view
|

Re: Disable vboxadd.service & vboxadd-service.service after guest additions included in 4.15?

arch general mailing list-2
So you want to have

vboxadd-service and vboxadd systemd services not starting on Linux kernel
versions 4.15 and above?

You can manage this by creating a template systemd unit

/etc/systemd/system/kernel-version-less-then@.service
-----------------------------------
[Unit]
Description=Check if currently installed kernel version is less than target

[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c '[[ "$(/usr/bin/vercmp %i %v)" = "1" ]]'
Restart=no
CollectMode=inactive-or-failed

[Install]
WantedBy=multi-user.target

Then create the directories

/etc/systemd/system/vboxadd.service.d/
/etc/systemd/system/vboxadd-service.service.d/

Then for each service


/etc/systemd/system/vboxadd.service.d/kerver.conf
-------------------------------------------------
[Unit]
After=[hidden email]
Requires=[hidden email]

/etc/systemd/system/vboxadd-service.service.d/kerver.conf
---------------------------------------------------------
[Unit]
After=[hidden email]
Requires=[hidden email]

In this way, if my bash-fu is correct, the version compare will fail the
[hidden email] and vboxadd and vboxadd-service will
not start

Giacomo Longo
Reply | Threaded
Open this post in threaded view
|

Re: Disable vboxadd.service & vboxadd-service.service after guest additions included in 4.15?

arch general mailing list-2
On 11 February 2018 at 13:47, Giacomo Longo via arch-general
<[hidden email]> wrote:

> So you want to have
>
> vboxadd-service and vboxadd systemd services not starting on Linux kernel
> versions 4.15 and above?
>
> You can manage this by creating a template systemd unit
>
> /etc/systemd/system/kernel-version-less-then@.service
> -----------------------------------
> [Unit]
> Description=Check if currently installed kernel version is less than target
>
> [Service]
> Type=oneshot
> ExecStart=/usr/bin/sh -c '[[ "$(/usr/bin/vercmp %i %v)" = "1" ]]'
> Restart=no
> CollectMode=inactive-or-failed
>
> [Install]
> WantedBy=multi-user.target
>
> Then create the directories
>
> /etc/systemd/system/vboxadd.service.d/
> /etc/systemd/system/vboxadd-service.service.d/
>
> Then for each service
>
>
> /etc/systemd/system/vboxadd.service.d/kerver.conf
> -------------------------------------------------
> [Unit]
> After=[hidden email]
> Requires=[hidden email]
>
> /etc/systemd/system/vboxadd-service.service.d/kerver.conf
> ---------------------------------------------------------
> [Unit]
> After=[hidden email]
> Requires=[hidden email]
>
> In this way, if my bash-fu is correct, the version compare will fail the
> [hidden email] and vboxadd and vboxadd-service will
> not start



there is ConditionKernelVersion=
man systemd.unit

--
damjan
Reply | Threaded
Open this post in threaded view
|

Re: Disable vboxadd.service & vboxadd-service.service after guest additions included in 4.15?

arch general mailing list-2
In reply to this post by arch general mailing list-2
You can also use ConditionKernelVersion like so

/etc/systemd/system/{vboxadd,vboxadd-service}.service.d/kerver.conf
-------------------------------------------------
[Unit]
ConditionKernelVersion=<4.15


Giacomo Longo

2018-02-11 13:47 GMT+01:00 Giacomo Longo <[hidden email]>:

> So you want to have
>
> vboxadd-service and vboxadd systemd services not starting on Linux kernel
> versions 4.15 and above?
>
> You can manage this by creating a template systemd unit
>
> /etc/systemd/system/kernel-version-less-then@.service
> -----------------------------------
> [Unit]
> Description=Check if currently installed kernel version is less than target
>
> [Service]
> Type=oneshot
> ExecStart=/usr/bin/sh -c '[[ "$(/usr/bin/vercmp %i %v)" = "1" ]]'
> Restart=no
> CollectMode=inactive-or-failed
>
> [Install]
> WantedBy=multi-user.target
>
> Then create the directories
>
> /etc/systemd/system/vboxadd.service.d/
> /etc/systemd/system/vboxadd-service.service.d/
>
> Then for each service
>
>
> /etc/systemd/system/vboxadd.service.d/kerver.conf
> -------------------------------------------------
> [Unit]
> After=[hidden email]
> Requires=[hidden email]
>
> /etc/systemd/system/vboxadd-service.service.d/kerver.conf
> ---------------------------------------------------------
> [Unit]
> After=[hidden email]
> Requires=[hidden email]
>
> In this way, if my bash-fu is correct, the version compare will fail the
> [hidden email] and vboxadd and vboxadd-service
> will not start
>
> Giacomo Longo
>
Reply | Threaded
Open this post in threaded view
|

Re: Disable vboxadd.service & vboxadd-service.service after guest additions included in 4.15?

David C. Rankin
On 02/11/2018 08:14 AM, Giacomo Longo via arch-general wrote:
> You can also use ConditionKernelVersion like so
>
> /etc/systemd/system/{vboxadd,vboxadd-service}.service.d/kerver.conf
> -------------------------------------------------
> [Unit]
> ConditionKernelVersion=<4.15
>
>
> Giacomo Longo

Yes! Thank you Giacomo and Damjan.

This is exactly what I was looking for but knew not what it was or where it
lived in systemd. This should allows an if (kernelver < 4.15) load the
vboxguest modules.

--
David C. Rankin, J.D.,P.E.
Reply | Threaded
Open this post in threaded view
|

Re: Disable vboxadd.service & vboxadd-service.service after guest additions included in 4.15?

David C. Rankin
In reply to this post by David C. Rankin
On 02/09/2018 10:55 PM, David C. Rankin wrote:
>   The guest additions in the 4.15 kernel work fine, so my first thought was to
> disable both vboxadd.service and vboxadd-service.service, but then what do I
> do for LTS?

And that indeed is the answer (from the #vbox IRC tonight). If you run a Arch
guest with 4.15+, you can just disable the systemd vboxadd and vboxadd-service
services (or install the vbox guest additions altogether) and auto
capture/release of the mouse, X, etc.. continues to work fine. I'd add this to
the wiki, but it would just be removed...

--
David C. Rankin, J.D.,P.E.
Reply | Threaded
Open this post in threaded view
|

Re: Disable vboxadd.service & vboxadd-service.service after guest additions included in 4.15?

arch general mailing list-2
-------- Original Message --------
 On February 18, 2018 9:57 AM, David C. Rankin <[hidden email]> wrote:
> ... I'd add this to the wiki, but it would just be removed...


You must be fun at parties.

cheers!
mar77i


Sent with ProtonMail Secure Email.