Fixing/Improving Virtual Machine support

Right now launching Manjaro using the default Virtualbox settings will make Manjaro install video-vmware instead of video-virtualbox. This happens because Virtualbox uses Vmware's svga display controller (known as vmsvga) by default. Of course that results in copy/paste, drag/drop and window resizing not working.

I've attempted to tackle some of these problems by using systemd-detect-virt to properly detect the correct hypervisor. Here's a list of what I've done:

  • Combine video-virtualbox and video-vmware into video-virtualmachine. This is necessary because mhwd can't dynamically determine the hypervisor outside of using vendor- and device ids.
  • Make video-virtualmachine run different commands for each hypervisor.
  • Fix copy/paste not working using Vmware because gtkmm3 wasn't installed. (This caused an interesting problem, I'll talk about it below)
  • Fix Virtualbox getting detected as Vmware when in vmsvga mode. Fixes clock sync, copy/paste, etc.
  • Fix Virtualbox modules and service not getting loaded directly after install. (Important for live systems)

Gtkmm3 is actually used by other programs (like gparted) which causes an interesting problem. When mhwd tries to remove packages, it removes all packages using the expression ${PACMAN} -Rs ${PACKAGES}. This command fails whenever mhwd tries to remove a package that is needed by other packages (like gparted). The -u pacman flag fixes that problem easily.

One thing I still need to take care of is window resizing, although this is actually an upstream archlinux issue (affects virtualbox-guest-dkms on which the manjaro extra modules are based on). Basically, upstream doesn't build vboxvideo and vboxguest (the important one). This means that /usr/bin/VBoxClient --vmsvga errors out.
I've introduced a temporary "fix" that informs users about how to enable screen resizing:
image

Patch files and prebuilt packages are available here. The .diff files can easily be applied using git apply.

10 Likes

This is an issue that is frequently reported since Virtualbox changed the default display adapter.

Thanks for taking the time to research the issue and propose a fix.

1 Like

Trying to build an ISO with this, code in manjaro-tools doesn't match up with the files shipped to testing...


image

How did that even happen??

Edit:
How old is this manjaro-tools version in the repo?

Edit 2: The -git version has this fixed. Would you look at that!

3 Likes

For anybody interested, I've uploaded an ISO with these virtual machine fixes and prime support. Nvidia users with GPUs unsupported by driver 440 should avoid this ISO, mhwd will probably try to install a driver that's not in the ISO and fail to do so.

I've replaced the mhwd packages with mhwd-tne and mhwd-db-tne, so please only use this ISO for testing. The packages are being hosted by chaotic-aur thanks to @Librewish.

https://sourceforge.net/projects/tne-manjaro-mhwd/files/manjaro-kde-18.1.5-minimal-200103-linux54-mhwdfix.iso/download

Thanks for testing the patches!

Please use the git version of our tools as all our developers do. I've to double-check your patches.

Patches for Virtualbox support added. We have to see how VMWare products work ...



2 Likes

Great! I did testing on VMWare too (of course).

I've found two problems with an XFCE ISO I just built tho:

The virtualbox screen resizing alert doesn't show for some reason and even if it did the notification would be too small.

In VMWare, a Virtualbox popup shows up when logging in. It says that the vbox kernel service isn't running (of course not). Mhwd simply has to delete /etc/xdg/autostart/vboxclient.desktop when running in vmware to prevent that.

Gnome build is running right now, I'll let you know. I don't expect to face any more issues tho.

The question is more: why got the file created? Based on the MHWDCONFIG it shouldn't, only when Oracle was detected ...

The file is a part of the vbox guest utils package.

@TotallyNotElite I added some needed dependens to mhwd-db. Now the notification should work.

That didn't fix it. Libnotify is already installed basically everywhere. I fixed it tho:

image
image

Tested on KDE, XFCE and Gnome. I'm convinced this should work everywhere now. The problem was ... weird. KDE ran a file desktop-file-validate deemed as ok no problem, but xfce and gnome only ran said file when I added another layer of escape characters. This made desktop-file-validate fail on the file and KDE refused to run it. A separate script file has to be created now.

Please note that you applied the mhwd commit incorrectly. The -Rsu part is supposed to be in the remove section. I addressed this (in a better way) in these patches.

I also added support for QEMU/KVM/Virt Manager/Gnome Boxes (basically anything that uses spice). (link)

Would be great if you could take a look at this before that bug gets into stable.

(random text here because I forgot to reply to you before and the forum won't let me send a similar message)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by