Skip to content

Windows: fonts on shared folders can't be loaded by DirectWrite/WPF (Z: not registered with Mount Manager) #51

Closed

Description

@kgarner99

Description

In a Windows guest, fonts stored on a VMPal shared folder (Z:) can't be loaded by DirectWrite, so WPF apps that ship their own font files can't use them when run from the share. Text falls back to a generic font, and any element that references the font file directly (e.g. WPF Glyphs) throws an unhandled FileNotFoundException and crashes the app. The same files copied to C:\ work fine.

The cause appears to be that the VirtIO-FS volume isn't registered with the Windows Mount Manager. GetFinalPathNameByHandle fails with ERROR_UNRECOGNIZED_VOLUME (1005) for every file on Z: unless VOLUME_NAME_NT is requested, and DirectWrite's local font file loader depends on that call. Ordinary reads and memory-mapping of the same files succeed.

Steps to Reproduce

  1. Share a Mac folder with a Windows 11 VM (it mounts as Z:) and put any .ttf in it, e.g. Z:\Fonts\Roboto-Regular.ttf.
  2. In the guest, open PowerShell (powershell.exe -STA) and run:
    Add-Type -AssemblyName PresentationCore
    New-Object System.Windows.Media.GlyphTypeface([Uri]'Z:\Fonts\Roboto-Regular.ttf')
  3. Copy the same file to C:\Temp\ and run the same command against that path.
  4. Optionally run mountvol and look for Z:.

Current Behavior

  • Step 2 fails with FileNotFoundException: Unable to find the specified file. Calling DirectWrite directly, IDWriteFactory::CreateFontFileReference succeeds but IDWriteFontFile::Analyze returns 0x88985003 (DWRITE_E_FILENOTFOUND).

  • Step 3 succeeds.

  • mountvol doesn't list Z:, and GetVolumeNameForVolumeMountPoint("Z:\") fails with error 1005.

  • GetFinalPathNameByHandle on an open handle to a file on Z:

    • VOLUME_NAME_DOS: error 1005
    • VOLUME_NAME_GUID: error 1005
    • VOLUME_NAME_NT: \Device\Volume{…}\Fonts\Roboto-Regular.ttf

    For a file on C:, all three return a path.

In a real WPF app (.NET 10, run from Z:), the crash looks like this in the Application event log:

System.IO.FileNotFoundException: Unable to find the specified file.
   at MS.Internal.Text.TextInterface.DWriteUtil.ConvertHresultToException(Int32 hr)
   at MS.Internal.Text.TextInterface.Factory.CreateFontFace(Uri filePathUri, UInt32 faceIndex, FontSimulations fontSimulationFlags)
   at System.Windows.Media.GlyphTypeface.Initialize(Uri typefaceSource, StyleSimulations styleSimulations)
   at System.Windows.Documents.Glyphs.ParseGlyphRunProperties()
   ...

Expected Behavior

Files on a shared folder should behave like files on a local disk for path-resolution APIs, so DirectWrite and WPF can load fonts from them. Registering the volume with the Mount Manager would probably fix it; WinFsp does this when the mount point is given as \\.\Z: rather than Z:. virtiofs.exe currently accepts only X: or *, and the VMPal Shared Folders service starts it without options, so there's no way to change this from inside the guest.

Environment

  • App version: VMPal 0.80, VMPal Tools 0.54 (also seen on the previous version)
  • Mac: MacBook Air, Apple M5, 32 GB
  • macOS version: macOS 27.0.1 (26A434)
  • VM's OS: Windows 11 24H2 ARM64 (build 26100.4349); WinFsp 2025 (2.1.25156); Z: reported as a fixed disk (DriveType 3), file system VirtIO-FS

Log

No VMPal crash. The guest app crash is shown above.

Activity

  1. sonswift commented on Oct 17, 2026

    @sonswift
    Collaborator

    We couldn’t reproduce this with VMPal 0.86 (86), VMPal Tools 0.56, and Windows 11 ARM64 24H2 build 26100.9457.

    The minimal WPF GlyphTypeface test succeeded in three matched pairs using identical font files on the shared drive and C:\Temp. The path-resolution APIs also succeeded, and mountvol listed Z:.

    Could you retest with the latest VMPal and Tools builds and let us know whether it still occurs? These results don’t establish whether the suspected underlying cause has been fixed.

  2. kgarner99 commented on Oct 19, 2026

    @kgarner99
    Author

    Confirmed that it's fixed in the latest builds. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions