Automated Linux and UNIX Guest Logins

Discussions about using Linux guests in VirtualBox.

Automated Linux and UNIX Guest Logins

Postby MAnantharaman » 12. May 2021, 18:26

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   Expand viewCollapse view
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?
MAnantharaman
 
Posts: 6
Joined: 12. May 2021, 18:05

Re: Automated Linux and UNIX Guest Logins

Postby scottgus1 » 12. May 2021, 19:18

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.
scottgus1
Site Moderator
 
Posts: 12001
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Automated Linux and UNIX Guest Logins

Postby MAnantharaman » 12. May 2021, 20:12

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 ...
MAnantharaman
 
Posts: 6
Joined: 12. May 2021, 18:05

Re: Automated Linux and UNIX Guest Logins

Postby fth0 » 13. May 2021, 12:36

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.
fth0
Volunteer
 
Posts: 1969
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: Automated Linux and UNIX Guest Logins

Postby MAnantharaman » 13. May 2021, 18:31

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
Attachments
VBox.zip
(52.57 KiB) Downloaded 4 times
MAnantharaman
 
Posts: 6
Joined: 12. May 2021, 18:05

Re: Automated Linux and UNIX Guest Logins

Postby fth0 » 13. May 2021, 20:30

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.
fth0
Volunteer
 
Posts: 1969
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: Automated Linux and UNIX Guest Logins

Postby MAnantharaman » 14. May 2021, 13:47

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 :)
MAnantharaman
 
Posts: 6
Joined: 12. May 2021, 18:05

Re: Automated Linux and UNIX Guest Logins

Postby fth0 » 14. May 2021, 14:07

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.
fth0
Volunteer
 
Posts: 1969
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: Automated Linux and UNIX Guest Logins

Postby MAnantharaman » 17. May 2021, 16:08

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.
Attachments
ArchLinux-2021-05-16-17-27.journal.zip
VirtualBox Manager log-file
(10 KiB) Downloaded 1 time
ArchLinux-2021-05-16-17-23-14.log.zip
Guest ArchLinux journal
(25.09 KiB) Downloaded 1 time
MAnantharaman
 
Posts: 6
Joined: 12. May 2021, 18:05

Re: Automated Linux and UNIX Guest Logins

Postby fth0 » 17. May 2021, 17:17

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.
fth0
Volunteer
 
Posts: 1969
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: Automated Linux and UNIX Guest Logins

Postby MAnantharaman » 17. May 2021, 19:21

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 ...
MAnantharaman
 
Posts: 6
Joined: 12. May 2021, 18:05

Re: Automated Linux and UNIX Guest Logins

Postby fth0 » 17. May 2021, 21:06

Ok, understood (the EFI partition probably starts right at the 1 MB border). Thanks for the explanation. :)
fth0
Volunteer
 
Posts: 1969
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 9 guests