openSUSE 笔记本安装 VirtualBox 后新建的虚拟机无法启动

使用 zypper 安装了 vbox,新建虚拟机后点击启动按钮报错,无法启动。

我的华硕笔记本型号如图


:安装了 opensuse15.5leap,GNOME41.8 桌面。 VirtualBox 图形用户界面 版本 7.0.18_SUSE r162988
© 2004-2024 Oracle and/or its affiliates (Qt5.15.8)
Copyright © 2024 Oracle and/or its affiliates.

按照提示执行了 * $ /usr/sbin/vboxconfig
Sources for building host modules are not present,
Use ‘sudo zypper install virtualbox-host-source kernel-devel kernel-default-devel’ to install them. Quitting …

显示要我执行下面的命令安装这些东西。

  • $ sudo zypper install virtualbox-host-source kernel-devel kernel-default-devel

安装完重启后依然无法启动虚拟机,再次执行显示:

  • $ /usr/sbin/vboxconfig
    Building kernel modules…

Build of VirtualBox host kernel modules failed.
Look at /var/log/virtualbox.log to find reasons.
切换 root 执行显示:
bash: /var/log/virtualbox.log: 权限不够

然而此时依然无法启动新建的虚拟机,弹出来的提示和最上面的那个一样 (内容都一样,这里放个文本版)

Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing

‘/usr/sbin/vboxconfig’

as root.

If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system’s documentation for more information.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.

之前使用自带的 win10 安装运行 vbox 可以正常启动虚拟机,想问下各位大佬这是什么原因,这台笔记本还能装虚拟机吗?如果上面的信息不够回复我,我接着补充。

参考 第三方内核模块签名小工具

很早就有现成的答案了,直接粘贴过来的行了

二、在 openSUSE-Leap-15.5-DVD-x86_64 中安装 VirtualBox-7.0.8
应用程序——工具——终端
ruhong@localhost:~> su -
密码:
localhost:~ #
由普通用户 ruhong 切换到 root 用户
localhost:~ # zypper search VirtualBox
localhost:~ # zypper install VirtualBox virtualbox-guest-desktop-icons virtualbox-kmp-default virtualbox-host-source virtualbox-guest-source virtualbox-guest-tools virtualbox-vnc
localhost:~ # usermod -a -G vboxusers ruhong
重启 opensuse15.5

我把每一步敲了但不知为何还是无法启动,和原来同样的报错。

一 * # zypper se VirtualBox

Retrieving repository 'Update repository with updates from SUSE Linux Enterpr[|] Retrieving repository 'Update repository with updates from SUSE Linux Enterpr[/] Retrieving repository 'Update repository with updates from SUSE Linux Ent[error]
Repository ‘Update repository with updates from SUSE Linux Enterprise 15’ is invalid.
[repo-sle-update|/update/leap/15.5/sle - openSUSE Download] Valid metadata not found at specified URL
History:

Please check if the URIs defined for this repository are pointing to a valid repository.
Warning: Skipping repository ‘Update repository with updates from SUSE Linux Enterprise 15’ because of the above error.
Some of the repositories have not been refreshed because of an error.
Loading repository data…
Reading installed packages…

S | Name | Summary | Type
—±-------------------------------±------------------------------±----------
| python3-VirtualBox | Python bindings for virtual-> | package
i+ | VirtualBox | VirtualBox is an Emulator | package
略…

二 * # zypper install VirtualBox virtualbox-guest-desktop-icons virtualbox-kmp-default virtualbox-host-source virtualbox-guest-source virtualbox-guest-tools virtualbox-vnc

Retrieving repository 'Update repository with updates from SUSE Linux Ent[error]
Repository ‘Update repository with updates from SUSE Linux Enterprise 15’ is invalid.
[repo-sle-update|/update/leap/15.5/sle - openSUSE Download] Valid metadata not found at specified URL
History:

Please check if the URIs defined for this repository are pointing to a valid repository.
Warning: Skipping repository ‘Update repository with updates from SUSE Linux Enterprise 15’ because of the above error.
Some of the repositories have not been refreshed because of an error.
Loading repository data…
Reading installed packages…
‘virtualbox-guest-desktop-icons’ is already installed.
No update candidate for ‘virtualbox-guest-desktop-icons-7.0.18-lp155.2.24.1.noarch’. The highest available version is already installed.
‘virtualbox-guest-source’ is already installed.
No update candidate for ‘virtualbox-guest-source-7.0.18-lp155.2.24.1.noarch’. The highest available version is already installed.
‘virtualbox-guest-tools’ is already installed.
No update candidate for ‘virtualbox-guest-tools-7.0.18-lp155.2.24.1.x86_64’. The highest available version is already installed.
‘virtualbox-host-source’ is already installed.
No update candidate for ‘virtualbox-host-source-7.0.18-lp155.2.24.1.noarch’. The highest available version is already installed.
‘virtualbox-kmp-default’ is already installed.
No update candidate for ‘virtualbox-kmp-default-7.0.18_k5.14.21_150500.55.59-lp155.2.24.1.x86_64’. The highest available version is already installed.
‘virtualbox-vnc’ is already installed.
No update candidate for ‘virtualbox-vnc-7.0.18-lp155.2.24.1.x86_64’. The highest available version is already installed.
‘VirtualBox’ not found in package names. Trying capabilities.
No provider of ‘VirtualBox’ found.

  • Did you mean virtualbox?
    Resolving package dependencies…
    Nothing to do.

三 groups

users vboxusers

对于我的笔记本来说好像没有上面说的那么复杂,总之我先运行了提示里说的/usr/sbin/vboxconfig 然后按照提示用 zypper 安装了它说的东东 (这个可能是必要的),然后又用 zypper 安装了软件仓库里所有叫 VirtualBox 略的软件 (这一步我感觉或许不是必要的),既然不行我就看了第二段的提示,虽然看不懂但里面提到了 uefi 的安全 boot,所以我就按照华硕官网的说明关掉了 bios/uefi 设置里的 Secure Boot,成功启动 vbox 啦!不过目前刚开始在虚拟机里安装系统还不知道会不会出问题

你的操作方法有问题,最好不要在命令行运行/usr/sbin/vboxconfig,当你安装好 VirtualBox 软件后,就是图形界面顶端的设备菜单设置虚拟机硬件;当新建一个虚拟机时的向导对话框就有提示 “勾选启用 EFI(只针对某些操作系统)”,勾选就有 Secure Boot,不勾选就没有涉及 Secure Boot;
在虚拟机安装新版的 Linux 或者 windows 10 就要勾选 EFI,旧版的 Linux 或者 windows XP 就不勾选 EFI
保险起见就预装一大堆 “软件仓库里所有叫 VirtualBox 略的软件 ”,减少报错的可能了

原来是这样。。。