Page 1 of 1

Automated Linux and UNIX Guest Logins

Posted: 12. May 2021, 18:26
by MAnantharaman
After managing to get Arch Linux to run in VirtualBox under Windows 10 there's one funtion that baffles me, viz. Automated Linux and UNIX Guest Logins. I set things up more or less as described in section 9.1.2. of the manual (can't post URLs yet :roll: ) and in the guest's journal I can see that pam_vbox (currently with "debug" argument) is working - but it never obtains any credentials, emitting the following messages (taken from the host's manager) ...
  • 00:03:59.510292 VMMDev: Guest Log: pam_vbox: pam_vbox_init: guest lib initialized
    00:03:59.511604 VMMDev: Guest Log: pam_vbox: pam_vbox_init: rhost=<none>, tty=:0, prompt=<none>
    00:03:59.514200 VMMDev: Guest Log: pam_vbox: pam_vbox_read_prop: read key "/VirtualBox/GuestAdd/PAM/CredsWait"="1"
    00:03:59.516808 VMMDev: Guest Log: pam_vbox: pam_vbox_read_prop: read key "/VirtualBox/GuestAdd/PAM/CredsWait" with rc=VINF_SUCCESS
    00:03:59.520276 VMMDev: Guest Log: pam_vbox: pam_vbox_read_prop: read key "/VirtualBox/GuestAdd/PAM/CredsWaitTimeout" with rc=VERR_NOT_FOUND
    00:03:59.522561 VMMDev: Guest Log: pam_vbox: pam_vbox_read_prop: read key "/VirtualBox/GuestAdd/PAM/CredsMsgWaiting" with rc=VERR_NOT_FOUND
    00:03:59.525426 VMMDev: Guest Log: pam_vbox: Showing message "Waiting for credentials ..." (type 4)Denying userspace vmm call type 0x000064 through vboxuser device node
    00:03:59.527151 VMMDev: Guest Log: pam_vbox: Error: pam_vbox_check_creds: could not query for credentials! rc=VERR_ACCESS_DENIED. Aborting
Note that trailing "Denying userspace vmm call type 0x000064 through vboxuser device node" in the befor-last line - which was the only thing that seemed to lead on to anything - but Google didn't find it.
I did also ask myself how credentials were supposed to arrive in pam_vbox and kinda doubt that the virtual-machine (manager) can access the Windows credential-store - and noticed that the preceding procedure for Windows guest included a command ...

Code: Select all

VBoxManage controlvm "Windows XP" setcredentials "John Doe" "secretpassword" "DOMTEST
... to set credentials, implying that they have to be set. Sooo , I did just that (even though mine is a Linux VM) - but still pam_vbox just sat there waiting for credentials :( ... and emitting those messages to the logs ...

What did I miss?

Re: Automated Linux and UNIX Guest Logins

Posted: 12. May 2021, 19:18
by scottgus1
I have not played around with this, but the manual shows detailed configuration for this setup. Are you sure you got everything?

FWIW the one-day URL filter really cuts down spam. Most first-time posters can skip posting a link. Zipped logs and screenshots can be posted using the forum's Upload Attachment tab from first day first post. That covers almost all new posters' needs.

Re: Automated Linux and UNIX Guest Logins

Posted: 12. May 2021, 20:12
by MAnantharaman
Well, I did it all to the best of my understanding - and do get messages in the guests journal and the host manager's log - as well as the standard waiting-message on the lightdm-greeter. Hopefully someone has done this already and chimes in ...

Re: Automated Linux and UNIX Guest Logins

Posted: 13. May 2021, 12:36
by fth0
MAnantharaman wrote:What did I miss?
A version number mismatch perhaps?

The error message can be found when googling for "Denying userspace vmm call type". One of the results leads to a patch of a function called vbg_req_allowed, which seems to belong to an old version of the VirtualBox Guest Additions (VBoxGuest.sys, vboxguest.ko). Which version of VirtualBox and the VirtualBox Guest Additions do you use? Please provide a zipped VBox.log file of a VM run.

Re: Automated Linux and UNIX Guest Logins

Posted: 13. May 2021, 18:31
by MAnantharaman
Thanks for asking - can't be ruled out as I installed VirtualBox via winget on Windows 10 and the guest-additions by Arch Linux's package-manager - but they seemed to have the same version 6.1.22. Be that as it may, I am attaching the log-file of the last runs - where you can search for the messages I had pasted into the first post.
BR, Martin

Re: Automated Linux and UNIX Guest Logins

Posted: 13. May 2021, 20:30
by fth0
Please re-install the VirtualBox Guest Additions 6.1.22, and especially pay attention to any error messages displayed during the installation. Most probably you didn't provide the Linux kernel headers or the necessary tools. Afterwards, search the new VBox.log file for the last occurrence of "VMMDev: Guest Additions information report: Version " and check the version number displayed. If the version number shows "6.1.22", start the VM from power-off state, reproduce your automated login problem and provide a new VBox.log file.

Re: Automated Linux and UNIX Guest Logins

Posted: 14. May 2021, 13:47
by MAnantharaman
As I had said, I installed the guest-additions via the Arch Linux package-manager, so the issue of kernel-headers doesn't arise - OTOH, I will do as you suggest shortly - after it's begining to dawn on me that the crucial issue is probably the vboxguest kernel-module - that comes ready-to-use with Arch Linux kernel-package (not the guest-additions package!) - so there might indeed be a type mismatch for the kernerl-module even though the distributions's guest-additions are otherwise OK. That seems to also be suggested by the one similar bug I found in the bug-tracker - which needed the distribution to fix the kernel(-module): https://www.virtualbox.org/ticket/19788. So thanks for putting me on a plausible track - I'll report back :)

Re: Automated Linux and UNIX Guest Logins

Posted: 14. May 2021, 14:07
by fth0
Yes, you're perfectly right on track. :)

If you apply my previous instructions to your previously posted VBox.log file, you'll discover that the Arch Linux vboxguest.ko module is version 6.0.0.

Re: Automated Linux and UNIX Guest Logins

Posted: 17. May 2021, 16:08
by MAnantharaman
So I did as suggested, i.e. uninstalled Arch Linux guest-additions package, built the guest additions from the mounted ISO, moved the pam_vbox.so module to /lib/security, re-started everything (starting with the VirtualBox Manager), tried to follow my understanding of providing credentials (as described for Windows guests) - to get the attached Manager-log and linux-journal. My findings:
  • The "VMMDev: Guest Additions information report: Version " message now shows a kernel-module version compatible with the VirtualBox-installation.
  • Automated login doesn't work, i.e. the login-greeter shows the message "Waiting for credentials" but adding them then or before (on another login-attempt) on the Windos 10 host with "VBoxManage controlvm ... setcredentials ..." makes no difference. Conspicuously, the pam_vbox module emits an error-message to the journal ...
    pam_vbox pam_vbox_check_creds: could not query for credentials! rc=VERR_PERMISSION_DENIED. Aborting
    pam_vbox pam_vbox_authenticate: overall result rc=VERR_PERMISSION_DENIED
    ... but this time around not in the manager-log, so no further pointers like the first time.
  • Everything else works as expected
Honestly, this is not a "mission-critical" function - and I tend to just let it rest - but am grateful for your support.

Re: Automated Linux and UNIX Guest Logins

Posted: 17. May 2021, 17:17
by fth0
MAnantharaman wrote:my understanding of providing credentials (as described for Windows guests)
FWIW, this also matches my understanding of the VirtualBox User Manual and the VirtualBox source code, but I haven't tried this feature myself yet. That would be the next step, but probably not today ...

PS: In the ArchLinux-2021-05-16-17-23-14.log file, there are messages indicating that the virtual disk image is not writable.

Re: Automated Linux and UNIX Guest Logins

Posted: 17. May 2021, 19:21
by MAnantharaman
You are right - and there are other harmless (IMO) errors, too :wink: Those hard-disk errors are a result of my setting up the virtual machine to run an ArchLinux distribution on disk for dual-boot with a specially crafted VMDK. Now, that has to contain the EFI-partition - but that's also in use by Windows, and I think that explains those errors. If I have to access it rw I'll just re-boot into ArchLinux normally ...

Re: Automated Linux and UNIX Guest Logins

Posted: 17. May 2021, 21:06
by fth0
Ok, understood (the EFI partition probably starts right at the 1 MB border). Thanks for the explanation. :)