You are not logged in.

#1 2023-06-22 16:22

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,350

Q4OS Virtualbox sessions hanging on shutdown

This is something that has annoyed me on and off over recent years. It's not limited to Q4OS, but as it comes with virtualbox-guest-X11 and virtualbox-guest-utils pre-installed I thought this may be useful.

I have found that Q4OS, and other distros with the above VBox stuff installed often hang on shutdown the interminable time that they do with some cryptic message like 'A stop job is running for User Manager for UID 1000' or 'A stop job is running for session 1 of user'....

It turns out this is the vboxadd service hanging.

The solution is to check which version of Vbox you are running on your host, make sure you have the exact same version of virtualbox guest additions ISO image - for example my host is on Vbox 6.1.40_Debian r154048 so I make sure I have the corresponding Additions iso from https://www.virtualbox.org/wiki/Download_Old_Builds_6_1


Next check your kernel version

uname -r

- in my case with TDE testing it's 6.1.0-9-amd64
Then

sudo apt install linux-headers-6.1.0-9-amd64

Next

sudo apt remove virtualbox-guest-X11 virtualbox-guest-utils

Next

sudo apt install gcc perl make

Reboot

In Vbox host window for the VM click Devices>Insert Guest Additions CD Image>Open>Right click and Open Konsole so you have a terminal session in the root of the CD Image files.

sudo ./VBoxLinuxAdditions.run

Let it run.
After it has finished

sudo usermod -a -G vboxsf <yourusername>

Eject CD
Reboot.

You'll now have the Guest Additions and Host on the same vBox versions and it will no longer hang on shutdown.

Last edited by bin (2023-06-24 07:24)

Offline

#2 2023-06-23 12:11

Senas Komunistas
Member
From: Lithuania
Registered: 2016-04-17
Posts: 52

Re: Q4OS Virtualbox sessions hanging on shutdown

Hello. You can use KVM. KVM works great.

Last edited by Senas Komunistas (2023-06-23 12:12)

Offline

#3 2023-06-23 15:33

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,535
Website

Re: Q4OS Virtualbox sessions hanging on shutdown

@bin
We are not sure about updates. If Debian kernel is updated along with regular Debian updates, are Virtualbox modules updated automatically ? If not so, the Virtualbox additions would stop to work as soon as rebooted to the new kernel. Would you know, how these Vbox additions take care about the updated kernel ?

Offline

#4 2023-06-23 16:18

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,350

Re: Q4OS Virtualbox sessions hanging on shutdown

Never had any problems with kernel updates. The main functionality which is sharing with the the host and full screen display seems to carry over. If I install a different kernel - as opposed to an update - then yes it does require re-installation of the Additions along with the relevant headers.

The point I'm making is more about making sure the Guest Additions and Host are both the same version of Virtualbox in order to prevent issues with the vboxadd service shut down on the guest system.

Obviously if the guest additions are bundled with the ISO then there's no way of guaranteeing it - and it may be unimportant for most people. It's just one of those little problems that annoy me as I never know if the shutdown hanging is a bug or just vbox. This way I can be sure.

Offline

#5 2023-06-23 16:21

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,350

Re: Q4OS Virtualbox sessions hanging on shutdown

Senas Komunistas wrote:

Hello. You can use KVM. KVM works great.

I also use Quemu KVM as it's a bit faster especially with some old Windows qcows, but struggling with sharing with the host machine time after time is just too much hassle! smile

Offline

#6 2023-06-23 17:16

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,535
Website

Re: Q4OS Virtualbox sessions hanging on shutdown

bin wrote:

Never had any problems with kernel updates. The main functionality which is sharing with the the host and full screen display seems to carry over.

So it seems the Vbox additions modules as installed using procedure above are compatible across regular Debian kernel and Linux-headers updates.

Offline

#7 2023-06-24 07:38

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,350

Re: Q4OS Virtualbox sessions hanging on shutdown

That's correct.
So, for example:-
Fresh install of TDE 4.12.
Remove virtualbox-guest-X11 virtualbox-guest-utils (which also removes q4os-vboxgutils whatever that is)
Reboot
Install Guest Additions 6.1.40 = same as host.
Configure sharing etc
Reboot
Update/Upgrade which brings in a minor kernel update 5.10.0-22 > 5.10.0-23 plus headers.
Reboot
Sharing and screen continue as before.
Remove kernel 5.10.22
Reboot
Sharing etc still OK

From here on it gets a bit odd.
Install backports kernel 6.1.0-0.deb11.7-amd64
Reboot
Everything OK
Remove any 5.10.x kernels, headers and associated files and reboot
Everything OK

Now, on other Debian based distros I have found the last bit to be a bit inconsistent. Installing a much later kernel did cause problems with sharing and display with a beta release (not Q4OS) Bookworm base so in itself may have had other factors.

With Q4OS experience shows that the virtualbox additions settings survive both kernel updates and upgrades. I have had issues with Bookworm betas of other Debian based distros where this has not been the case.

Final point - Virtualbox stores the Virtualbox Guest Additions settings in the machine data. So, a different distro then installed in the same VM will inherit those settings once Virtualbox Guest Additions is installed (or if the distro ISO includes a version of Virtualbox Guest Additions)

Offline

#8 2023-06-24 08:41

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,535
Website

Re: Q4OS Virtualbox sessions hanging on shutdown

Thanks for sharing this. We will look at a possibility to improve Q4OS Virtualbox support.

Offline

#9 2023-06-26 13:14

Midas
Member
Registered: 2017-12-15
Posts: 197

Re: Q4OS Virtualbox sessions hanging on shutdown

While apparently related, I reckon it isn't even remotely similar to the problem I reported a while back at https://www.q4os.org/forum/viewtopic.php?id=3925 and which is still present in my setups.

It's worth pointing it out once more, though, just in case someone figured a solution...

Offline

Board footer

Powered by FluxBB