@samitouri / QOSamiQemu / commits / aac1599820

qemu-options: Improve description for -smb option

Add #PRE and #NOFNR flags to LMHOSTS example line. Include information about LMHOSTS path on Windows 3.x. Windows NT 3.1 requires #NOFNR flag for successful hostname resolving as described in MS article Q103765 because qemu/smbd does not respond to netbios name verification queries. #PRE is suggested in that article too and decrease delay on Windows 3.x for the first connection. Signed-off-by: Pali Rohár <pali@kernel.org> [PMM: Expand documentation to note what these flags do, and clarify Windows LMHOSTS paths for different Windows versions, based on discussion in patch review, fix existing grammar nit] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Pali Rohár committed May 5, 2026 at 09:25 UTC aac1599820a127a8869bf86da26c2a1cc05ec260
1 file changed +14 -5
qemu-options.hx
+14 -5
@@ -3415,7 +3415,7 @@ SRST
3415
3416 ``smb=dir[,smbserver=addr]``
3417 When using the user mode network stack, activate a built-in SMB
3418 - server so that Windows OSes can access to the host files in
3418 + server so that Windows OSes can access the host files in
3419 ``dir`` transparently. The IP address of the SMB server can be
3420 set to addr. By default the 4th IP in the guest network is used,
3421 i.e. x.x.x.4.
@@ -3424,11 +3424,20 @@ SRST
3424
3425 ::
3426
3427 - 10.0.2.4 smbserver
3427 + 10.0.2.4 smbserver #PRE #NOFNR
3428
3429 - must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows
3430 - 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows
3431 - NT/2000).
3429 + must be added in the ``LMHOSTS`` file. In this line, ``#PRE``
3430 + requests pre-caching of the mapping, which speeds up the initial
3431 + connection on some Windows versions. ``#NOFNR`` is necessary for
3432 + Windows NT 3.1 to tell it not to send NBNS query packets that
3433 + QEMU does not handle, and is harmlessly ignored on other versions.
3434 +
3435 + The ``LMHOSTS`` file may be in different locations depending on
3436 + the Windows version:
3437 +
3438 + - ``C:\WINDOWS\LMHOSTS`` for Windows 3x/9x/Me
3439 + - ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` for Windows NT/2000
3440 + - ``C:\WINDOWS\SYSTEM32\DRIVERS\ETC\LMHOSTS`` for Windows XP and newer
3441
3442 Then ``dir`` can be accessed in ``\\smbserver\qemu``.
3443