The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Discussions about using Linux guests in VirtualBox.
Post Reply
esteban_stafford
Posts: 4
Joined: 16. Feb 2023, 11:24

The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Post by esteban_stafford »

Hello,

after installing Ubuntu 22.04.1 LTS on my new Dell Latitude 5430, I installed VirtualBox Version 6.1.38_Ubuntu r153438 though the apt package manager.

Neither old nor new virtual machines start. The error I receive is:
Failed to open a session for the virtual machine Test.

The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1 (0x1).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {85632c68-b5bb-4316-a900-5eb28d3413df}
I have tried rebooting, reinstalling, I checked the virtualisation settings in the BIOS.
I have tried removing my configuration files ($HOME .config VirtualBox).
I have tried installing VirtualBox 7.0 from download virtualbox org virtualbox debian jammy contrib
And have also tried all the fixes I could find online. I always get the same error.

Can anyone help me find what mistake I am making?

Thanks!

Esteban
Last edited by scottgus1 on 16. Feb 2023, 15:23, edited 1 time in total.
Reason: changed topic title
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: NS_ERROR_FAILURE (0x80004005) Component: MachineWrap

Post by scottgus1 »

I'm a bit fuzzy on the details, but I think this is because you have a mix of Virtualbox versions on your host, or a mix of kernel headers and executables, or some such.

What you'd do depends on this:
esteban_stafford wrote:VirtualBox Version 6.1.38_Ubuntu
This is Ubuntu's fork of Virtualbox. Ubuntu supports their fork, and we support Official Virtualbox from www.virtualbox.org. If you want to keep using Ubuntu's fork, you'd have to ask them for the fix.

If you want to use Official, then purge everything related to the Virtualbox install (you can keep the VMs and the configuration files in $HOME/.config/VirtualBox). Then run the prerequisites https://www.virtualbox.org/manual/ch02. ... nux-prereq then the Virtualbox installer https://www.virtualbox.org/wiki/Linux_Downloads
esteban_stafford
Posts: 4
Joined: 16. Feb 2023, 11:24

Re: The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Post by esteban_stafford »

Thank you very much for your reply. Sadly I was unable to get it running. I detail you the steps I took to use the Official Virtual Box.

1.- Cleaning. I removed old kernel packages and all the versions of the linux headers and modules that did not correspond to the running kernel. Right now it looks like this:

Code: Select all

$ uname -r
5.19.0-32-generic
$ dpkg -l \*linux*5* | grep ii
ii  linux-headers-5.19.0-32-generic        5.19.0-32.33~22.04.1 amd64        Linux kernel headers for version 5.19.0 on 64 bit x86 SMP
ii  linux-hwe-5.19-headers-5.19.0-32       5.19.0-32.33~22.04.1 all          Header files related to Linux kernel version 5.19.0
ii  linux-image-5.19.0-32-generic          5.19.0-32.33~22.04.1 amd64        Signed kernel image generic
ii  linux-modules-5.19.0-32-generic        5.19.0-32.33~22.04.1 amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.19.0-32-generic  5.19.0-32.33~22.04.1 amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
I also removed anything that had to do with virtualbox from the Ubuntu repositories:

Code: Select all

apt purge dctrl-tools dkms virtualbox virtualbox-dkms virtualbox-qt
2.- Pre-requisites. I ensured that the versions of sdl, qt, gcc and make were adequate. Secure boot is disabled.

Code: Select all

$ dpkg -l libqt\* | grep ii
ii  libqt5core5a:amd64              5.15.3+dfsg-2ubuntu0.2 amd64        Qt 5 core module
ii  libqt5dbus5:amd64               5.15.3+dfsg-2ubuntu0.2 amd64        Qt 5 D-Bus module
ii  libqt5gui5:amd64                5.15.3+dfsg-2ubuntu0.2 amd64        Qt 5 GUI module
[...]
$ dpkg -l libsdl\* | grep ii
ii  libsdl1.2debian:amd64      1.2.15+dfsg2-6 amd64        Simple DirectMedia Layer
$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
[...]
$ make --version
GNU Make 4.3
[...]

3.- Instalation. I chose the virtualbox-7.0_7.0.6-155176~Ubuntu~jammy_amd64.deb from virtualbox-7.0_7.0.6-155176~Ubuntu~jammy_amd64.deb and upon installation there were no errors, but I recompiled the drivers again anyway.

Code: Select all

$ sudo dpkg -i virtualbox-7.0_7.0.6-155176~Ubuntu~jammy_amd64.deb
$ sudo rcvboxdrv setup
4.- Execution. Sadly after all these steps I still get the error.

Code: Select all

$ vboxmanage startvm test
Waiting for VM "test" to power on...
VBoxManage: error: The virtual machine 'test' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
I hope this information can give you more insight into my problem.
Thanks again!

Esteban
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Post by fth0 »

Please reproduce the issue and check the contents of $HOME/.config/VirtualBox/VBoxSVC.log.
esteban_stafford
Posts: 4
Joined: 16. Feb 2023, 11:24

Re: The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Post by esteban_stafford »

Hello,

I removed the .config/VirtualBox folder to start afresh. Then I launched VirtualBox and VBoxSVC.log received the following lines:

Code: Select all

00:00:00.000111 main     VirtualBox XPCOM Server 7.0.6 r155176 linux.amd64 (Jan 11 2023 17:07:39) release log
00:00:00.000114 main     Log opened 2023-02-28T18:07:16.055769000Z
00:00:00.000115 main     Build Type: release
00:00:00.000116 main     OS Product: Linux
00:00:00.000117 main     OS Release: 5.19.0-32-generic
00:00:00.000117 main     OS Version: #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2
00:00:00.000133 main     DMI Product Name: Latitude 5430
00:00:00.000136 main     DMI Product Version: 
00:00:00.000140 main     Firmware type: UEFI
00:00:00.001373 main     Secure Boot: Disabled
00:00:00.001404 main     Host RAM: 15685MB (15.3GB) total, 14253MB (13.9GB) available
00:00:00.001406 main     Executable: /usr/lib/virtualbox/VBoxSVC
00:00:00.001407 main     Process ID: 749724
00:00:00.001407 main     Package type: LINUX_64BITS_UBUNTU_22_04
00:00:00.002186 main     IPC socket path: /tmp/.vbox-esteban-ipc/ipcd
00:00:00.106937 nspr-2   VirtualBox: object creation starts
00:00:00.107540 nspr-2   Home directory: '/home/esteban/.config/VirtualBox'
00:00:00.110497 nspr-2   USB: Unknown USB device detected (idVendor: 0x8087, idProduct: 0x0033)
00:00:00.110874 nspr-2   Successfully initialised host USB using sysfs
00:00:00.120723 nspr-2   NetIfAdpCtlOut: VBoxNetAdpCtl: Error while retrieving link speed for wlp0s20f3: VBoxNetAdpCtl: ioctl failed: Operation not supported
00:00:00.121954 nspr-2   HostDnsMonitor: initializing
00:00:00.122624 nspr-2   NAT: resolv.conf: nameserver 127.0.0.53
00:00:00.122662 nspr-2   NAT: resolv.conf: ignoring "options edns0 trust-ad"
00:00:00.122679 nspr-2   HostDnsMonitor: updating information
00:00:00.122730 nspr-2   HostDnsMonitor: old information
00:00:00.122735 nspr-2     no server entries
00:00:00.122739 nspr-2     no domain set
00:00:00.122741 nspr-2     no search string entries
00:00:00.122744 nspr-2   HostDnsMonitor: new information
00:00:00.122747 nspr-2     server 1: 127.0.0.53
00:00:00.122750 nspr-2     domain: .
00:00:00.122753 nspr-2     search string 1: .
00:00:00.126382 nspr-2   VD: VDInit finished with VINF_SUCCESS
00:00:00.127665 nspr-2   VirtualBox: object created
00:00:00.166344 nspr-4   Saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml" with version "1.12-linux"
00:00:00.169713 nspr-4   Finished saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml"
00:00:00.169866 nspr-4   Saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml" with version "1.12-linux"
00:00:00.172209 nspr-4   Finished saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml"
00:00:00.172318 nspr-4   Saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml" with version "1.12-linux"
00:00:00.176185 nspr-4   Finished saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml"
00:00:00.405449 nspr-4   Saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml" with version "1.12-linux"
00:00:00.408989 nspr-4   Finished saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml"
00:00:00.439493 nspr-2   Saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml" with version "1.12-linux"
00:00:00.443672 nspr-2   Finished saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml"
00:00:00.805256 nspr-4   Saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml" with version "1.12-linux"
00:00:00.809246 nspr-4   Finished saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml"
Then I created a very simple virtual machine (test). Every thing is set to default except the disk which is left empty.

Code: Select all

00:00:26.600726 nspr-3   Saving settings file "/home/esteban/VirtualBox VMs/test/test.vbox" with version "1.19-linux"
00:00:26.636371 nspr-3   Finished saving settings file "/home/esteban/VirtualBox VMs/test/test.vbox"
00:00:26.636735 nspr-3   Saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml" with version "1.12-linux"
00:00:26.641698 nspr-3   Finished saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml"
00:00:26.650081 nspr-2   Saving settings file "/home/esteban/VirtualBox VMs/test/test.vbox" with version "1.19-linux"
00:00:26.653476 nspr-2   Finished saving settings file "/home/esteban/VirtualBox VMs/test/test.vbox"
00:00:26.677840 nspr-2   Saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml" with version "1.12-linux"
00:00:26.682869 nspr-2   Finished saving settings file "/home/esteban/.config/VirtualBox/VirtualBox.xml"
00:00:27.058930 nspr-4   ERROR [COM]: aRC=VBOX_E_INVALID_VM_STATE (0x80bb0002) aIID={300763af-5d6b-46e6-aa96-273eac15538a} aComponent={MachineWrap} aText={The machine is not mutable (state is PoweredOff)}, preserve=false aResultDetail=0
I noticed the last line saying that the machine created is not mutable. Googling this did not bring anything usable.
Then launching the machine brought the dreaded error 0x80004005.

Code: Select all

00:01:12.403577 nspr-4   Launched VM: 603989968 pid: 751189 (0xb7655) frontend: GUI/Qt name: test
00:01:12.416868 nspr-5   ERROR [COM]: aRC=VBOX_E_INVALID_VM_STATE (0x80bb0002) aIID={300763af-5d6b-46e6-aa96-273eac15538a} aComponent={MachineWrap} aText={The machine is not mutable (state is PoweredOff)}, preserve=false aResultDetail=0
00:01:12.904068 Watcher  ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={300763af-5d6b-46e6-aa96-273eac15538a} aComponent={MachineWrap} aText={The virtual machine 'test' has terminated unexpectedly during startup with exit code 1 (0x1)}, preserve=false aResultDetail=0
00:01:12.938830 nspr-5   ERROR [COM]: aRC=VBOX_E_INVALID_VM_STATE (0x80bb0002) aIID={300763af-5d6b-46e6-aa96-273eac15538a} aComponent={MachineWrap} aText={The machine is not mutable (state is PoweredOff)}, preserve=false aResultDetail=0
00:01:46.911404 main     VirtualBox: object deletion starts
00:01:46.912476 main     HostDnsMonitor: shutting down ...
00:01:46.912917 main     HostDnsMonitor: shut down
00:01:46.917688 Watcher  ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={7682d5eb-f00e-44f1-8ca2-99d08b1cd607} aComponent={VirtualBoxWrap} aText={The object is not ready}, preserve=false aResultDetail=0
00:01:46.924897 main     VirtualBox: object deleted
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Post by fth0 »

Thanks for your thorough investigation. Unfortunately, it still doesn't give enough information to discover the root cause:

Code: Select all

00:00:27.058930 nspr-4   ERROR [COM]: aRC=VBOX_E_INVALID_VM_STATE (0x80bb0002) aIID={300763af-5d6b-46e6-aa96-273eac15538a} aComponent={MachineWrap} aText={The machine is not mutable (state is PoweredOff)}, preserve=false aResultDetail=0
I've seen the error messages of type "The machine is not mutable" also in other user's log files where they didn't play a role, so they could very well be a sort of red herring. They indicate that some part of VirtualBox is trying to modify the VM configuration before locking the VM for exclusive access within a session.

Code: Select all

00:01:12.403577 nspr-4   Launched VM: 603989968 pid: 751189 (0xb7655) frontend: GUI/Qt name: test
00:01:12.416868 nspr-5   ERROR [COM]: aRC=VBOX_E_INVALID_VM_STATE (0x80bb0002) aIID={300763af-5d6b-46e6-aa96-273eac15538a} aComponent={MachineWrap} aText={The machine is not mutable (state is PoweredOff)}, preserve=false aResultDetail=0
00:01:12.904068 Watcher  ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={300763af-5d6b-46e6-aa96-273eac15538a} aComponent={MachineWrap} aText={The virtual machine 'test' has terminated unexpectedly during startup with exit code 1 (0x1)}, preserve=false aResultDetail=0
The Watcher thread usually recognizes an unexpected termination less than 500 ms after it really happened, so I assume that the termination happened in the first 500 milliseconds after the launch.

Please try and start the VM once with "VirtualBoxVM --startvm test" and once with "VBoxHeadless --startvm test". Using those commands sometimes gives more detailed error messages than "VBoxManage startvm test".
esteban_stafford
Posts: 4
Joined: 16. Feb 2023, 11:24

Re: The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Post by esteban_stafford »

It works!!!!

Thank you so much. This has been strongly impacting my performance at work.

As you said, starting the virtual machine with VirtualBoxVM --startvm test, gave a new error:

Code: Select all

$ VirtualBoxVM --startvm test
VirtualBoxVM: Error -610 in supR3HardenedMainInitRuntime!
VirtualBoxVM: dlopen("/usr/lib/virtualbox/VBoxRT.so",) failed: <NULL>

VirtualBoxVM: Tip! It may help to reinstall VirtualBox.
I looked this up and found the following tip:
Like described at https://www.virtualbox.org/ticket/16759. This fixed my problem (virtualbox 5.1.26r117224, kernel 4.10.0-33)

sudo chown root:root /usr
sudo chown root:root /usr/lib
sudo chown root:root /usr/lib/virtualbox
I could not believe this could be the solution to the problem. But when I used ls:

Code: Select all

$ ls -ld /usr/lib/virtualbox /usr/lib /usr
drwxrwxr-x  14 esteban esteban  4096 nov  4  2018 /usr
drwxr-xr-x 122 root    root     4096 feb 27 14:50 /usr/lib
drwxr-xr-x   6 root    root    12288 feb 27 14:56 /usr/lib/virtualbox
OMG! How can this be possible! /usr belongs to my user. After doing the chown the virtual machine started.

Thanks again for your help!

Regards,

Esteban
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Post by fth0 »

Thanks for reporting back! :)
esteban_stafford wrote:/usr belongs to my user.
Not really. Several decades ago (~1971), /home was moved out of /usr, for disk space reasons. ;) Since then, /usr is usually owned by root:root.
nbanba
Posts: 16
Joined: 27. Feb 2023, 10:48

Re: The virtual machine 'Test' has terminated unexpectedly during startup with exit code 1

Post by nbanba »

Hello

Yes, it makes me white hair, it had happened at a time I was not born ... You can find information about in the "UNIX PROGRAMMER'S MANUAL" written by Dennis Ritchie and Ken Tompson and publish in November 1971 !

And on a modern install of linux it will really be a problem to have /usr owned by someone else than the user which is launching systemD (ie root:root)
Never change /usr owner to something else than root:root

Kind regards
nbanba
Post Reply