Virtual machines not starting after virt-manager installed

Discussions related to using VirtualBox on Linux hosts.
Post Reply
leprekon69
Posts: 4
Joined: 10. May 2023, 15:57

Virtual machines not starting after virt-manager installed

Post by leprekon69 »

I recently install by recommends virt-manager on Lubuntu 20.04.6
At this time 2 VM's from virtualbox runned.
4 days later I try to start 3rd. Have this error:
The virtual machine 'Atlant-2-Home' has terminated unexpectedly during startup with exit code 1 (0x1).
Error Code:
NS_ERROR_FAILURE (0X80004005)
Component:
MachineWrap
Interface:
IMachine {300763af-5d6b-46e6-aa96-273eac15538a}
Tried to start other VM's, create new, remove all of virt-manager and libvirt*, change virtualization types in settings, rename ~/.Virtualbox folder, reboot, sudo virtualbox, install 6th version, again 7, strace, google, nothing helps.
No machine logs because it's not started. VirtualBox logs in attachments.

Vmware works, so virtualization available.
Attachments
VBoxSVC-1.7z
(2.98 KiB) Downloaded 4 times
selectorwindow-1.7z
(963 Bytes) Downloaded 1 time
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtual machines not starting after virt-manager installed

Post by fth0 »

The VM terminated after ~500 ms, which looks like a timeout waiting for some component like the vboxdrv kernel module. Start the VM from within a terminal using VirtualBoxVM --startvm Atlant-2-Home, which might give additional information about the problem.
leprekon69
Posts: 4
Joined: 10. May 2023, 15:57

Re: Virtual machines not starting after virt-manager installed

Post by leprekon69 »

fth0 wrote:The VM terminated after ~500 ms, which looks like a timeout waiting for some component like the vboxdrv kernel module. Start the VM from within a terminal using VirtualBoxVM --startvm Atlant-2-Home, which might give additional information about the problem.

Code: Select all

XXXXXXX@warp:~$ sudo VirtualBoxVM --startvm Atlant-2-Home
VirtualBoxVM --startvm Atlant-2-Home
VirtualBoxVM: Error -610 in supR3HardenedMainInitRuntime!
VirtualBoxVM: dlopen("/usr/lib/virtualbox/VBoxRT.so",) failed: <NULL>

VirtualBoxVM: Tip! It may help to reinstall VirtualBox.
=======

root@warp:~# touch /usr/lib/virtualbox/VBoxRT.so
root@warp:~# dpkg -S /usr/lib/virtualbox/VBoxRT.so
virtualbox-7.0: /usr/lib/virtualbox/VBoxRT.so

root@warp:~# apt remove virtualbox-7.0
root@warp:~# apt install virtualbox-7.0
root@warp:~# ls -la /usr/lib/virtualbox/VBoxRT.so
-rw-r--r-- 1 root root 3448904 апр 18 01:02 /usr/lib/virtualbox/VBoxRT.so
===========
XXXXXXX@warp:~$ sudo VirtualBoxVM --startvm Atlant-2-Home
VirtualBoxVM: Error -610 in supR3HardenedMainInitRuntime!
VirtualBoxVM: dlopen("/usr/lib/virtualbox/VBoxRT.so",) failed: <NULL>
==========
root@warp:~# chmod 775 /usr/lib/virtualbox/VBoxRT.so
==========
XXXXXXX@warp:~$ VirtualBoxVM --startvm Atlant-2-Home
VirtualBoxVM: supR3HardenedVerifyFileInternal: Cannot trust the file "/usr/lib/virtualbox/VBoxRT.so": group and/or other writable (st_mode=0100775)
==========
root@warp:~# chmod 644 /usr/lib/virtualbox/VBoxRT.so
==========
XXXXXXX@warp:~$ VirtualBoxVM --startvm Atlant-2-Home
VirtualBoxVM: Error -610 in supR3HardenedMainInitRuntime!
VirtualBoxVM: dlopen("/usr/lib/virtualbox/VBoxRT.so",) failed: <NULL>

VirtualBoxVM: Tip! It may help to reinstall VirtualBox.
==========
root@warp:~# VirtualBoxVM --startvm Atlant-2-Home
VirtualBoxVM: Error -610 in supR3HardenedMainInitRuntime!
VirtualBoxVM: dlopen("/usr/lib/virtualbox/VBoxRT.so",) failed: <NULL>

VirtualBoxVM: Tip! It may help to reinstall VirtualBox.
==========
XXXXXXX@warp:~$ strace -e open,stat,access VirtualBoxVM --startvm Atlant-2-Home
====================
in attachment

What is SUPR3HardenedMain / supR3HardenedVerifyFileInternal and how to disable it?
Attachments
strace-1.7z
(1.31 KiB) Downloaded 2 times
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtual machines not starting after virt-manager installed

Post by fth0 »

leprekon69 wrote:-rw-r--r-- 1 root root 3448904 апр 18 01:02 /usr/lib/virtualbox/VBoxRT.so
The permissions and ownership of VBoxRT.so seem to be correct, and the date, too. But what about VirtualBoxVM:
strace-1.txt wrote:VirtualBoxVM: Effective UID is not root (euid=1000 egid=1000 uid=1000 gid=1000)
Please check if /usr/lib/virtualBox/VirtualBoxVM has the setuid flag set (e.g. "-r-s--x--x"). You should start it without sudo and let the setuid flag do the privilege elevation.
leprekon69 wrote:What is SUPR3HardenedMain / supR3HardenedVerifyFileInternal and how to disable it?
Those are functions of the VirtualBox hardening implementation. You can only disable them when building VirtualBox from its sources yourself.
leprekon69
Posts: 4
Joined: 10. May 2023, 15:57

Re: Virtual machines not starting after virt-manager installed

Post by leprekon69 »

fth0 wrote:
strace-1.txt wrote:VirtualBoxVM: Effective UID is not root (euid=1000 egid=1000 uid=1000 gid=1000)
Please check if /usr/lib/virtualBox/VirtualBoxVM has the setuid flag set (e.g. "-r-s--x--x"). You should start it without sudo and let the setuid flag do the privilege elevation.
It's already has SUID bit.
And I always start VB from current user. From sudo just for demonstration, what access is full.
Attachments
Virtualbox-suid.png
Virtualbox-suid.png (126.12 KiB) Viewed 1200 times
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Virtual machines not starting after virt-manager installed

Post by Martin »

Maybe virt-manager did activate the KVM kernel module in the background which now blocks VT-x?
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtual machines not starting after virt-manager installed

Post by fth0 »

Searching with Google ("site:forums.virtualbox.org VBoxRT.so") reminded me of a well-known cause for the error:

VirtualBox verifies that the parent folders /usr, /usr/lib and /usr/lib/virtualbox are owned by the root user and group.
leprekon69
Posts: 4
Joined: 10. May 2023, 15:57

Re: Virtual machines not starting after virt-manager installed

Post by leprekon69 »

fth0 wrote: VirtualBox verifies that the parent folders /usr, /usr/lib and /usr/lib/virtualbox are owned by the root user and group.
Maaaannn!!!!
I embrace you! You super! It's amazing!
/usr had my_username ownership.
How this can be, I don't understand. I not changed it recently. May be long time ago, when experiment with something.
Now all works fine.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtual machines not starting after virt-manager installed

Post by fth0 »

Thanks for reporting back! :)
Post Reply