Problem caused by emerging virtualbox-guest-additions into gentoo "host"

I made a mistake to emerge virtualbox-guest-additions into gentoo host. This package is designed to be used on gentoo guest. After removing this package, I had a problem that user account startx failed.

This problem is due to the design of this package. In emerging this package, D-bus is removed at the default run-level and virtualbox-guest-additions is added at the default run-level instead. This setting is left after the package is removed. Then D-bus is disabled and startx causes an error "Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory".

The mechanism of D-bus socket is as follows:

As soon as D-bus gets start, it creates a socket. The default location is  /run/dbus/system_bus_socket. Other processes use that socket to communicate with D-bus and with each other. The D-bus service  is replaced by the service of virtualbox-guest-additions when the latter package is emerged. If the package is removed, the service setting should be recovered as that before the package emerged, but this problematic package leaves the setting as it modified.

 

Also this package leaves two modules and a vboxguest  account and group.

 

So if you remove this package,  you should do following commands:

rc-update del virtualbox-guest-additions default

rc-update add dbus default

rm /lib/modules/5.4.66-gentoo-x86_64/misc/vboxguest.ko

rm /lib/modules/5.4.66-gentoo-x86_64/misc/vboxsf.ko

userdel vboxguest