Installation in VirtualBox VM still problematic

I’ve been having awful luck trying to install Clear Linux in VirtualBox. For reference, I’ve been using VB 6.0.6 until this morning (6.0.8 was just released), and I just tried again last night with release 29400 of Clear Linux.

The install goes pretty well (with the exception that the CL installer doesn’t believe in updating progress indicators), but installing VirtualBox Guest Additions fails.

Part of the problem is that the install-vbox-lga script suppresses any errors and gives the appearance of succeeding, but the building of kernel modules “completes” way too fast. Looking at the logs tells me there are some missing pieces, including a kernel .config

I have the kernel headers as well as flex and bison, so those errors are not present, but I am seeing errors that mention fixdep.c and messages telling me to run make oldconfig to generate the missing config. Then I realized I had no idea where the kernel sources were (pretty sure I have them somewhere because I installed bundle linux-lts-dev) and couldn’t find anywhere in the docs where this might be. (It doesn’t seem to be in the usual spots.)

Is there a way to fix this easily? The docs explaining how to install the VBox GAs are very bare-bones and seem very incomplete.

Either knowing where to go to run the make or obtaining the kernel config using an alternate mechanism would probably help me get past this issue.

A copy of the kernel config is in /usr/lib/kernel.

This document has relevant information: Home Clear Linux* Project | Clear Linux* Project

Hm… Any recommendation on where to copy that .config file when running the VBox GA installer? Clearly, the GA installer wasn’t picking it up from the location you mentioned.

The link you provided assumes that you’re pulling kernel sources and copying the config file there, but IIRC this shouldn’t be necessary just to compile kernel modules.

FYI, that page shows up in Google searches when searching for information about how to resolve these build issues, but it doesn’t seem directly applicable to this use case – or if it is, it’s confusingly enough written that I am not sure how to apply the information provided to my specific use case.

The install-vbox-lga script shouldn’t require any manual steps.

I just updated to VirtualBox 6.0.8 and downloaded the 29400 Clear Linux ISO from the downloads page. Using the instructions here: https://clearlinux.org/documentation/clear-linux/get-started/virtual-machine-install/virtualbox-cl-installer#install-vb-linux-guest-additions it worked successfully (although I had to install the bundle for which for the script to work).

Make sure you’re running the LTS kernel and mounted the VirtualBox Guest Additions ISO from the VM menu.

I can confirm I am using an LTS kernel AND I know how to select a menu entry to mount the Guest Additions ISO. I should also note that I’ve successfully installed Guest Additions on multiple other Linux OSes (Fedora and Ubuntu, mainly).

I can also tell you that the install-vbox-lga script failed quietly – everything echoed to the console looked hunky-dory, but if you actually look at the logs, you can see that the kernel modules aren’t building.

I’ll include the error logs in the next post, when I’m sitting in front of that machine again. Also, why is which not installed by default? I suppose I’ll have to go hunting down the bundle for that… If that turns out to be the problem, I’ll be flabbergasted, because the errors I saw didn’t really indicate a missing which.

I understand and am just trying to point out possibilities. I know I’ve missed that step on accident in the past or had the ISO unmount without me noticing between reboots.

There is a bundle called which so swupd bundle-add which.

The repo containing the install-vbox-lga script is here: GitHub - clearlinux/vbox-integration if you do root cause where the output/error handling could improve.

OK, so I just attempted to install the VirtualBox 6.0.8 Guest Additions under Clear Linux.

Here’s what I encountered:

When the previous “install” was detected, I chose to have the script remove it. During execution, I saw this echoed to the console:

VirtualBox Guest Additions installer
Removing installed version 6.0.8 of VirtualBox Guest Additions…
./install.sh: line 143: VBoxControl: command not found

That was a little strange. I can’t upload the setup logs here because apparently attachment types are restricted. However, here’s the very beginning of the log:>

Building the main Guest Additions module for kernel 4.19.42-31.lts2018.
Error building the module. Build output follows.
make V=1 CONFIG_MODULE_SIG= -C /lib/modules/4.19.42-31.lts2018/build M=/tmp/vbox
.0 SRCROOT=/tmp/vbox.0 -j1 modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (

echo >&2;
echo >&2 " ERROR: Kernel configuration is invalid.“;
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are
missing.”;
echo >&2 " Run ‘make oldconfig && make prepare’ on kernel src to fix it.
";
echo >&2 ;
/bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/tmp/vbox.0
(cat /dev/null; echo kernel//tmp/vbox.0/vboxguest.ko;) > /tmp/vbox.0/modules.order

Doing a uname -r gives the following string: 4.19.42-31.lts2018
It’s my understanding that this is a legit LTS kernel and should work.

I’m really not sure what the next steps are for fixing this and moving forward. I tried installing which, but that seems to already be present. I’ve got linux-lts-dev installed, and I made sure to install flex and bison just in case.

Any ideas?

1 Like

I should also mention I tried copying the config from /usr/lib/kernel to /usr/include/config/auto.conf to no avail. I also found a copy of autoconf.h deep under /usr/lib/modules, so I tried copying that to /usr/include/generated, but that didn’t work either. Wherever the wrapper script or the VBox script expect the includes to be, it’s not in some common spot. If the build is being done in a tempdir, these includes need to be copied there.

1 Like

OT here a little but for what its worth I got this running w/ QEMU on an Arch host with no issues at all. I have gotten away from virtual box over the last few years whenever I can due to lots of strange issues and performance problems. The guest additions is also a pia to deal with many times.

1 Like

Can you post the full logs and your output of swupd bundle-list somewhere like hastebin?

I tried lots of different things to get into the state that you are but can’t. I am curious what’s going on though. The install-vbox-lg script is really just a wrapper to call the VirtualBox install scripts with some guardrails to make it conform to CL’s stateless principles.

In the mean time try making sure your /tmp is clean manually before trying again or even a separate install of CL in a new VM to test.

1 Like

I’ll try to provide those logs and list of installed bundles tonight after my day job. :wink:
I’m aware that the install-vbox-lga script is a wrapper around the install script(s) provided by VirtualBox – my experience in the past has been that this approach is brittle at best.

But what’s really bothering me is your claim that everything is working perfectly for you. This suggests to me that there’s some unspoken assumption being made, for example some step that is considered so “obvious” that nobody bothers to write it down. Reminds me of when a QA resource keeps finding bugs that I miss because I prefer keyboard navigation, and they use the mouse for everything.

Point well taken about cleaning /tmp since I know a lot of intermediate files are being dumped there.

I can also try doing yet another fresh install of Clear Linux and focus on getting VBox GAs installed there. But one thing I wanted to mention from the installation guide – it tells you to check if the extensions are running after reboot by doing a lsmod | grep ^vbox. The only problem is, I have gotten into a state where I saw all 3 of the expected services running, but I know for example that the folder sharing isn’t working; shared folders fail to mount in CL. So I’m not sure I trust the output of lsmod to tell me the whole story.

1 Like

I’m tracking doc revisions in GH issues now: Update VirtualBox Guest Additions · Issue #492 · clearlinux/clear-linux-documentation · GitHub

OK, the full logs are here, and the output of swupd bundle-list is here.

About to cleanse /tmp and try again.

EDIT: Same problems as before after purging /tmp:

Building the main Guest Additions module for kernel 4.19.43-32.lts2018.
Error building the module. Build output follows.
make V=1 CONFIG_MODULE_SIG= -C /lib/modules/4.19.43-32.lts2018/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j1 modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (
echo >&2;
echo >&2 " ERROR: Kernel configuration is invalid.“;
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.”;
echo >&2 " Run ‘make oldconfig && make prepare’ on kernel src to fix it.";
echo >&2 ;
/bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/tmp/vbox.0
(cat /dev/null; echo kernel//tmp/vbox.0/vboxguest.ko;) > /tmp/vbox.0/modules.order

So I’m going to spin up another VM with a clean base install of Clear Linux and see what happens when I try to install guest additions. Will report back after I get some sleep.

Thanks for posting that.

Searching around, those echo lines about not finding config seem to be common enough and shouldn’t cause the failure.

This line gives me more pause than anything:

mkdir -p /lib/modules/4.19.43-32.lts2018/misc 
mkdir: cannot create directory ‘/lib/modules/4.19.43-32.lts2018/misc’: Read-only file system make[1]: *** [Makefile:1536: _emodinst_] Error 1

Can you try creating the directory manually and check the output of the mount command?

I hadn’t tried with all those bundles installed before trying to install the LGA. I have been starting from a minimal installation. This may be part of our gap in assumptions.

In our current implementation, we provide the vbox drivers pre-built with the LTS2018 kernel. Meanwhile, the Guest Additions installer adds some system services to start the support daemons (for clipboard sharing, etc.), but the very large script it uses to launch all that also attempts to build the modules on startup, as well as writing files in /usr.

Consequently, install-vbox-lga jumps through some hoops to keep the installer from building the modules itself, including patching some of the scripts, and modifying the systemd unit that launches the init script to restrict it from writing to protected paths. This generates a lot of warning messages, including the read-only filesystem warning, but overall still should work.

At this time, though, we last updated our installation script and the patched-in modules from Virtual Box 6.0.5. I notice that several updates have been released in the last couple of weeks, so we need to incorporate the driver updates, and make sure our installation script is still working correctly.

1 Like

Thanks for the info. That’s very enlightening, and now I realize why the script seemed to complete so fast – the modules are not being (re)built.

I was already running VirtualBox 6.0.6 when I first tried ClearLinux, and the installer was failing for me even then. Now I’m running 6.0.8. I don’t think 6.0.5 was considered a stable release – I went from 6.0.4 directly to 6.0.6. I know 6.0.5 incorporated some fixes for Linux kernel 5.x, necessary for Fedora 29/30, so I was waiting for that release at the time.

Anything I can to do help? Testing, etc.

If it’s interesting to you, feel free to tinker with the script (vbox-integration/install-vbox-lga at master · clearlinux/vbox-integration · GitHub). We do a lot of search/replace in the installer scripts instead of patches, so they’re less likely to break with updates, but obviously they still can :slight_smile:. It’s on our list to update the drivers themselves; it’s just being juggled with other tasks.

You could also check the journal (sudo journalctl) to see whether the daemons failed to start, or have other errors.

1 Like

When it’s working, it should look like this:

clrlinux@clr ~ $ ps axuw | grep -i vbox
root       212  0.0  0.0      0     0 ?        I<   18:09   0:00 [iprt-VBoxWQueue]
root       370  0.0  0.0  90160   116 ?        S    18:09   0:00 VBoxClient --vmsvga
root       371  0.0  0.0  90160   332 ?        S    18:09   0:00 VBoxClient --vmsvga
clrlinux   707  0.0  0.0  19320   304 ?        S    18:10   0:00 /usr/bin/VBoxClient --clipboard
clrlinux   708  0.0  0.0  85656   540 ?        Sl   18:10   0:00 /usr/bin/VBoxClient --clipboard
clrlinux   718  0.0  0.0  19320   304 ?        S    18:10   0:00 /usr/bin/VBoxClient --display
clrlinux   719  0.0  0.0  19460   380 ?        S    18:10   0:00 /usr/bin/VBoxClient --display
clrlinux   725  0.0  0.0  19320   304 ?        S    18:10   0:00 /usr/bin/VBoxClient --seamless
clrlinux   726  0.0  0.0  85504   352 ?        Sl   18:10   0:00 /usr/bin/VBoxClient --seamless
clrlinux   735  0.0  0.0  19320   308 ?        S    18:10   0:00 /usr/bin/VBoxClient --draganddrop
clrlinux   736  0.0  0.0 151560   492 ?        Sl   18:10   0:02 /usr/bin/VBoxClient --draganddrop
clrlinux  1335  0.0  0.0   6472   896 pts/0    S+   18:58   0:00 grep -i vbox

Out of curiosity, is there a good reason to be using VirtualBox’s vmsvga graphics as opposed to vboxvga?

I’m not sure what the difference is or how to configure it otherwise. We did have to shuffle around the video driver options a bit to find a combination that works, but haven’t explored beyond that.

I’ve updated a guest to Clear Linux 29460, under VirtualBox 6.0.8, cleaned up with sudo swupd verify --fix --picky, and run sudo install-vbox-lga. After a reboot, it’s working as expected again, including shared clipboard and drag/drop.