On 2026-03-03 01:26, Aurélien Couderc via Cygwin wrote:
On Mon, Mar 2, 2026 at 8:19 PM Martin Wege via Cygwin <[email protected]> wrote:
Hello,
we use HYPER-V virtual machines on Windows 10 and Windows 11. It seems
they use a "special" kind of group called 'Virtual Machines', which
Cygwin (3.6.5) /bin/getent cannot lookup:
getent group 'Virtual Machines'
<nothing>
Does anyone have ideas or clues how to get getent group to work with
this kind of Windows group?
We want the Cygwin gid for that group, and use Cygwin commands to work
with those files...
Déjà vu
1. Please read https://cygwin.com/pipermail/cygwin/2025-July/258505.html
2. Try this:
getent group "NT VIRTUAL MACHINE+Virtual Machines"
For me, with default (empty, except comments) /etc/nsswitch.conf, it
does not work. Which I consider a bug.
The defaults are chosen so that required system components work.
If you have additional requirements, such as interactive lookup, or your own
scripts, you may add to the defaults, which adds to the overhead on every
lookup, reduced if you run the `cygserver` cache.
This is the default installed conf file:
# /etc/nsswitch.conf
#
# This file is read once by the first process in a Cygwin process tree.
# To pick up changes, restart all Cygwin processes. For a description
# see https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
#
# Defaults:
# passwd: files db
# group: files db
# db_enum: cache builtin
# db_home: /home/%U
# db_shell: /bin/bash
# db_gecos: <empty>
to which I have added in my own copy all `local` SAM accounts on a non-domain
system, to which you may wish to add `primary`, or `all` to be sure:
# db_enum: cache builtin
db_enum: cache local builtin
# db_enum - getpwent or getgrent database search depth
# db_enum: source1 source2 ...
# Sources:
# none No output from getpwent/getgrent at all.
# all The opposite. Enumerates accounts from all known sources,
# including all trusted domains.
# cache Enumerate all accounts currently cached in memory.
# builtin
# Enumerate the predefined builtin accounts for backward compatibility.
# These are five passwd accounts (SYSTEM, LocalService, NetworkService,
# Administrators, TrustedInstaller)
# and two group accounts (SYSTEM and TrustedInstaller).
# files Enumerate the accounts from /etc/passwd or /etc/group.
# local Enumerate all accounts from the local SAM.
# primary
# Enumerate all accounts from the primary domain.
# alltrusted
# Enumerate all accounts from all trusted domains.
# some.domain
# Enumerate all accounts from the trusted domain some.domain.
# Examples:
# db_enum: none
# No output from getpwent/getgrent at all.
# db_enum: cache files
# Enumerate all accounts cached by the current process,
# plus all entries from either the /etc/passwd or /etc/group file.
# db_enum: cache local primary
# Enumerate all accounts cached by the current process,
# all accounts from the SAM of the local machine,
# and all accounts from the primary domain of the machine.
# db_enum: local primary alltrusted
# Enumerate the accounts from the machine's SAM,
# from the primary domain of the machine, and from all trusted domains.
# db_enum: primary domain1.corp sub.domain.corp domain2.net
# Enumerate the accounts from the primary domain and from the domains
# domain1.corp, sub.domain.corp and domain2.net.
# db_enum: all
# Enumerate everything and the kitchen sink.
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple