Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find Chrome and Edge from the host Windows as fallback when WSL 2 is mirrored network mode #604

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Oct 3, 2024

Marp CLI has been already supported out of the box conversion in WSL 1, but WSL 2 is not yet supported. (marp-team/marp#113) This PR introduces the out of the box conversion in WSL 2 with "mirrored network mode".

WSL 1 shares the network with Windows. Puppeteer can communicate with browser's remote debug that is binding to the localhost port. On the other hand, WSL 2 has a separated NAT network from Windows by default, so it is difficult to communicate WSL 2 with Windows.

If configured WSL 2 to enable "mirroed network mode", WSL 2 will become to share the network interface with Windows as same as WSL 1. In this mode, we have confirmed that Puppeteer for Chrome can communicate with the process on the Windows host.

# %USERPROFILE%\.wslconfig
[wsl2]
networkingMode=mirrored

Marp CLI's browser finder will become to resolve the Chrome/Edge from the host if the mirrored networking mode was enabled and the suitable browser was not found in WSL Linux.

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.

1 participant