Skip to content

Conversation

benhillis
Copy link
Member

While experimenting with the new --fixed-vhd support I realized we do not correctly handle all cases where a distro might be stored as a .vhd. This resolves those issues and clarifies usage that we support both .vhd and .vhdx.

@benhillis
Copy link
Member Author

Considering adding some tests, need to convert some vhdx to vhd.

@benhillis benhillis force-pushed the user/benhill/vhd_extension branch from 29798aa to 6373f25 Compare June 6, 2025 02:47
Copy link
Collaborator

@OneBlue OneBlue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good. Regarding test coverage, looks like https://learn.microsoft.com/en-us/powershell/module/hyper-v/convert-vhd?view=windowsserver2025-ps can convert from vhdx to vhd

@benhillis benhillis force-pushed the user/benhill/vhd_extension branch from 963ddba to ca0729a Compare June 11, 2025 20:43
@benhillis benhillis requested a review from a team as a code owner June 11, 2025 20:43
@benhillis
Copy link
Member Author

Change looks good. Regarding test coverage, looks like https://learn.microsoft.com/en-us/powershell/module/hyper-v/convert-vhd?view=windowsserver2025-ps can convert from vhdx to vhd

Done.

@benhillis benhillis force-pushed the user/benhill/vhd_extension branch from ca0729a to 1b2a143 Compare June 30, 2025 22:35
@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 21:02
@benhillis benhillis force-pushed the user/benhill/vhd_extension branch from 9c544b0 to 7d86240 Compare October 20, 2025 21:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves VHD (Virtual Hard Disk) support in WSL by fixing edge cases and clarifying that both .vhd and .vhdx file formats are supported. The changes address issues discovered while testing the --fixed-vhd feature.

Key Changes

  • Updated error messages and documentation to reflect support for both .vhd and .vhdx file extensions
  • Added validation logic to prevent export/import of VHD files to/from stdin/stdout
  • Implemented dynamic VHD filename handling in move and registration operations to preserve file extensions

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/windows/common/wslutil.h Added new IsVhdFile() helper function declaration
src/windows/common/wslutil.cpp Implemented IsVhdFile() to check for both .vhd and .vhdx extensions
src/windows/common/WslClient.cpp Removed client-side file extension validation (moved to service)
src/windows/service/exe/LxssUserSession.cpp Added service-side validation for VHD export/import operations and dynamic filename handling
src/windows/service/exe/WslCoreFilesystem.cpp Simplified assertion to use new IsVhdFile() helper
localization/strings/en-US/Resources.resw Updated error messages and help text to clarify .vhd/.vhdx support
test/windows/UnitTests.cpp Updated test assertions and added comprehensive ExportImportVhd test
test/windows/SimpleTests.cpp Updated test assertions for consistency

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants