VirtualBox : problem with Leap 15.2 guest running on Leap 15.2 host

Hi,

In my daily work, I’m running OpenSUSE Leap on all my desktop clients and CentOS on all my servers. I’m using VirtualBox and Vagrant to test various setups on my workstation.

Until two days ago, my workstation was running OpenSUSE Leap 15.1 with VirtualBox 5.2.44 installed manually. This setup worked perfectly.

Yesterday I upgraded this machine to OpenSUSE Leap 15.2. I wiped VirtualBox 5.2.44 from /opt and decided to give the VirtualBox 6.1.14 packages from the OpenSUSE Leap repositories a spin.

Currently I need three different virtual machines for testing purposes: OpenSUSE Leap 15.2, CentOS 7.8 (headless) and CentOS 8.2 (headless).

I installed the OpenSUSE Leap 15.2 guest in VirtualBox, but after rebooting I only managed to get the basic 800x600 resolution. On a side note, my workstation has a dual monitor, each with 1280x1024 resolution.

The next step consists in installing the virtualbox-guest-x11 package in my guest system. After rebooting it, I still can’t set the correct resolution.

I tried to replaced VirtualBox 6.1.14 provided by OpenSUSE with VirtualBox 6.1.16 provided by VirtualBox.org. Installation went fine, but unfortunately the problem persists. There’s no way I can display my guest OpenSUSE Leap KDE desktop in a better resolution than 800x600.

My next attempt consisted in deleting the virtualbox-guest-x11 package and building the Guest Additions manually. Same result.

From there, I went to replace the VirtualBox 6.1 branch by a lower branch. This solution has worked well in the past (see my blog article on the subject), since on OpenSUSE Leap 15.1 VirtualBox 5.2.x worked perfectly. Probably due to the fact that Leap uses an older kernel based on SLES.

I downloaded the installers for VirtualBox 5.2.44 and 6.0.24 and tried to install them, but unfortunately I got kernel module build errors on both of these.

So it looks like in the current state of things, there’s no way to install an OpenSUSE Leap 15.2 desktop guest on an OpenSUSE Leap 15.2 host with VirtualBox with a proper resolution.

Any suggestions?

Cheers from the locked down South of France.

Although each time you install Virtualbox files are supposed to be overwritten, that might not be happening.
After you uninstall Virtualbox (whatever version),
I recommend you run an application like locate (provided by the package mlocate) to find every file on your system that has “Virtual” and “virtual” in the name, and if it looks like it is a virtualbox file, delete it manually.

When your system is fully purged of those files, you can then be assured that your new install won’t have vestiges of the old version.
Also…
You may not need to re-install and/or purge your Virtualbox app on your HostOS.
Your display resolution problems are almost certainly related only to the Guest Additions (including the x11 virtualbox kernel module provided by the package you installed), so you might not need to do anything else but locate that kernel module and remove it before installing new Guest Additions.

Also, be aware that version mis-matches can have unpredictable results.
For instance, it’s unclear whether the Guest Additions that automatically install in an openSUSE guest from the OSS functions properly in an Oracle Virtualbox 6.1.16 (The OSS Guest Additions target 6.1.14 currently).
And, of course other distros like CentOS will have to have Guest Additions installed manually, they won’t install Guest Additions automatically like in openSUSE.

Misc other info…
Yes, when using Virtualbox from the OSS, the precompiled kernel modules are matched to the kernel that is provided at that time, you cannot use OSS virtualbox packages with a different kernel.
If you had to, you should be able to build old, outdated Virtualbox versions without a problem, but it’s not recommended. If you find yourself needing to do this, post your errors and it’s likely you’ll get an answer.

TSU

The 15.2 OpenSUSE has VirtualBox guest code built in it - the add on does not work as expected - you get a lot of black screens unless you do this.

zypper rm virtualbox\* 

on the guest - and reboot - you do need to use VMSVGA as the video.
You have to do that every time the guest reinstalls the guest additions.

To install the server additions on the Host use this script with VirtualBox not running.

LLR1:~ # cat bin/addvbext
vbv=`/usr/bin/VBoxManage --version | tr "r" "_"`
echo update VirtualBox
VBOX_VERSION=`/usr/bin/VBoxManage --version | awk -F_ {'print $1'}`
VBOX_EXT_VERSION=`/usr/bin/VBoxManage --version | awk -F_ {'print $1'}`
# echo Virtualbox version installed is $VBOX_VERSION and $VBOX_EXT_VERSION
VBOX_EXT=`echo Oracle_VM_VirtualBox_Extension_Pack-${VBOX_EXT_VERSION}.vbox-extpack`
# echo File is $VBOX_EXT
cd /tmp
/usr/bin/wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/$VBOX_EXT
echo y | /usr/bin/VBoxManage extpack install --replace $VBOX_EXT
rm -f $VBOX_EXT
LLR1:~ # 

to fix the video set up a script like this and add to your startup script

llrainey@VM1:~> cat bin/fixvideo
D=`xrandr --verbose | head -2 | tail -1 | awk '{print $1}'`
/usr/bin/xrandr --newmode "1752x980_60.00"  141.75  1752 1856 2040 2328  980 983 993 1017 -hsync +vsync
/usr/bin/xrandr --addmode $D 1752x980_60.00
/usr/bin/xrandr -s 1752x980

To get the correct entries use this (this is what I needed)

llrainey@VM1:~> cvt 1752 980
# 1752x980 59.87 Hz (CVT) hsync: 60.89 kHz; pclk: 141.75 MHz
Modeline "1752x980_60.00"  141.75  1752 1856 2040 2328  980 983 993 1017 -hsync +vsync
llrainey@VM1:~> 

I can confirm the required change of used GPU mode as the same issue happens running vbox 6.1 on windows host with leap 15.2 as guest. About have the guest stuff installed from repo - I don’T know - but not use them doesn’t hurt if you can live without some of the “convenience” stuff like mouse integration or shared clip board.

The problem with just the “rm” command is that it will leave the configuration files on your machine… I assume so that if your intention is to re-install, your settings would be retained. Problem of course is if the problem is in your configuration files. Normally this can be addressed with a force re-install but to be very sure, you should search for, and remove the files manually.

TSU

All VirtualBox OpenSUSE 15.2 and Tumbleweed guests have built-in guest additions - no convenience is missing right out of the box without any installation of guest additions. the VB Home Key and N show 6.0.0 guest additions are already installed and cannot be removed with zipper. the clipboard and mouse show in the VB Input and Devices menus.

I have not figured out how to delete the VirtualBox guest stuff from zypper - I would think that any removing any package from zypper would keep it from being reinstalled on an upgrade. To prevent re-installation of the unwanted VB Guest Additions, I locked them so they would not update when OpenSUSE’s VirtualBox gets an update.

Have you inspected the output of “VBoxManage list --long vms”?
[ul]
[li]Please check the following entry: “Graphics Controller: VBoxSVGA” – there was a fairly recent change to the minimum value of the Virtual Graphics Controller supported. <Oracle® VM VirtualBox®; [/li][/ul]

[ul]
[li]Graphics Controller: Specifies the graphics adapter type used by the guest VM. Note that you must install the Guest Additions on the guest VM to specify the VBoxSVGA or VMSVGA graphics controller. The following options are available:[/li]> [LIST]
[li]VBoxSVGA: The default graphics controller for new VMs that use Windows 7 or later. [/li]> [/ul]

[/LIST]
[INDENT=2]This graphics controller improves performance and 3D support when compared to the legacy VBoxVGA option.[/INDENT]

[LIST=|INDENT=2]
[li]VBoxVGA: Use this graphics controller for legacy guest OSes. This is the default graphics controller for Windows versions before Windows 7 and for Oracle Solaris. [/li]> [/LIST]
[INDENT=2]3D acceleration is not supported for this graphics controller.[/INDENT]

[LIST=|INDENT=2]
[li]VMSVGA: Use this graphics controller to emulate a VMware SVGA graphics device. This is the default graphics controller for Linux guests. [/li]> [/LIST]
[INDENT=2]None: Does not emulate a graphics adapter type.
[/INDENT]

Thanks for all your numerous and detailed replies.

In the meantime I found a workaround that works perfectly.

https://blog.microlinux.fr/opensuse-leap-15-2-virtualbox/

Cheers,

Niki

I don’t know that “rpm remove” is any different than “zypper rm” in this case (could be wrong), so may not remove the kernel modules that may be causing the problem.
This is why after removing virtualbox files as much as possible, if I had reason to <really> purge the system of virtualbox files, I have gone beyond the package manger and manually searched for and then removed the files.

The other flaw in the referenced article is that it recommend installing and activating dkms.
Fairly recently, if you install Virrtualbox downloaded from the Oracle website (is that what he’s doing? Else, why is he compiling the kernel modules?) Virtualbox now packages dkms as part of the download so there is no need to do more.

TSU

Not willing to steal this thread, but since the 15.2 / VBox 6.1 snags are preventing me from switching to 15.2 in my daily systems I tried what is suggested here.

You don’t need guest additions for most functions, but e.g. shared folders are missing unless you install virtualbox-guest-tools, which brings in virtualbox-guest-x11 and virtualbox-kmp-default as needed dependencies.
Mouse integration works without any additions though.

Using VMSVGA, no guest additions and the default Plasma session in the guest, any attempt at resizing the display doesn’t stick, including that in the fixvideo script above.
The fixvideo script works though if you use the IceWM or TWM sessions, so it looks like something in the Plasma session is at odds with the X11 settings.
Wayland sessions can resize video but still have minor kinks in Plasma; wayland appears to behave well with Gnome in current TW live images.
Of course the fixvideo script or xrandr have no effect in wayland sessions.

The suggestion to not use VMSVGA but stick with VBoxVGA or VBoxSVGA for the time being appears as the only viable workaround if you need everything that worked in Leap 15.1 / VBox 6.0.
If I missed something obvious, I’m ready to test other use cases that I might have overlooked.

From the Virtualbox User Manual:

https://www.virtualbox.org/manual/ch03.html#emul-hardware

When running a Linux guest, there are no options, you are running a graphics driver that emulates a VMware SVGA device(VMSVGA)…
If you are running a Windows Guest, you are running a Virtualbox SVGA device unless you’re running a very old version of Windows… in which case you might be using a VGA device

My Virtualbox installation is a download and install from the Oracle website… I haven’t seen any problems with any Linux Guests (I don’t run Windows Guests so won’t have personal experience with them) and have not had any issues with Guest Additions or graphics displays.

TSU

I understand the recent changes and the VMSVGA default for Linux guests, still I confirm the OP’s finding that there is apparently no way to change the resolution on a Leap 15.2 KDE guest using VBox 6.1.14 provided by openSUSE and VMSVGA adapter.
I have not tried VBox 6.1.16 from Oracle though.

Graphics Controller: Specifies the graphics adapter type used by the guest VM. Note that you must install the Guest Additions on the guest VM to specify the VBoxSVGA or VMSVGA graphics controller. The following options are available:

VBoxSVGA: The default graphics controller for new VMs that use Windows 7 or later.
This graphics controller improves performance and 3D support when compared to the legacy VBoxVGA option.
VBoxVGA: Use this graphics controller for legacy guest OSes. This is the default graphics controller for Windows versions before Windows 7 and for Oracle Solaris.
3D acceleration is not supported for this graphics controller.
VMSVGA: Use this graphics controller to emulate a VMware SVGA graphics device. This is the default graphics controller for Linux guests.
None: Does not emulate a graphics adapter type. 

https://www.virtualbox.org/manual/ch03.html#settings-screen

Here are running Windows-, openSUSE, openwrt-, Debian- and Kali-guest without any problems.

Only thing I do is to delete the guest packages delivered by the running guest (if avaible) and install the Virtualbox-Guest by inserting the ISO as DVD.
My Virtualbox is the one delivered from the Virtualization Repo and build by myself in my OBS, because I run kernel from kernel:stable.

  1. Running with VMSVGA, which is the now “normal” way, it is easy to choose your resolution. You just go in the guest system user’s system settings, -> “workspace”, -> “startup and shutdown”, -> “background services”, and there you CHECK OFF the “KScreen 2” button. Restart with this user and you have full screen resolution. You have to do this for every user on your guest system. Thee you are, the resolution problem is solved.
  2. It could be you run into another issue with Leap 15.2 as guest on VirtualBox: you start it up, you log in, and … you see just a black screen beneath your cursor. Your guest system is running but you don’t see anything. So you have to do this, when your mouse appears on a black screen: go with your mouse to the VirtualBox menu, → “Keyboard simulate”, → “Simulate Ctrl-Alt-Del” and click this last one; now wait 30 seconds (or a bit less if you do “Enter” after ten seconds or so) and you can again login, but this time your full screen appears. :wink:
    Have fun!

I haven’t seen a problem but I rarely run KDE Plasma so if there is a problem specifically with that DE, that may be why I haven’t seen it.
.
My HostOS is a laptop with a default display 1600x900.
When I open any Linux guest, it will open by default at whatever I have set in the Guest, but I can either drag the Guest console’s window larger or smaller (or fullscreen) and the DE resizes to fill the graphical screen.

I’m not experiencing the problem I’d expect to see when the screen resolution stays the same size even when I enlarge the console window (eg go fullscreen).

TSU