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

[Question] Can't run Safari in Ubuntu (WSL) #6339

Closed
Semigradsky opened this issue Apr 27, 2021 · 3 comments
Closed

[Question] Can't run Safari in Ubuntu (WSL) #6339

Semigradsky opened this issue Apr 27, 2021 · 3 comments

Comments

@Semigradsky
Copy link

Semigradsky commented Apr 27, 2021

Ubuntu 20.04.1 LTS
playwright 1.10.0

I see that it possible by system requirements but I didn't find any specific steps.

I installed playwright and browsers locally by PLAYWRIGHT_BROWSERS_PATH=0 npm i playwright.
After this I tries run it via PLAYWRIGHT_BROWSERS_PATH=0 npx playwright wk https://webkit.org/. There were messages about missed packages, I installed them by apt-get install.

After this I get this error message:

> safari@1.0.0 start /home/dmitry/P/safari
> PLAYWRIGHT_BROWSERS_PATH=0 DEBUG=pw:api npx playwright wk https://webkit.org/

  pw:api => browserType.launch started +0ms
  pw:api <= browserType.launch failed +239ms
browserType.launch: Protocol error (Playwright.enable): Browser closed.
==================== Browser output: ====================
<launching> /home/dmitry/P/safari/node_modules/playwright/.local-browsers/webkit-1446/pw_run.sh --inspector-pipe --no-startup-window
<launched> pid=20707
[pid=20707][err] Unable to init server: Could not connect: Connection refused
[pid=20707][err]
[pid=20707][err] (MiniBrowser:20712): Gtk-WARNING **: 21:06:44.413: cannot open display:
[pid=20707] <process did exit: exitCode=1, signal=null>
=========================== logs ===========================
<launching> /home/dmitry/P/safari/node_modules/playwright/.local-browsers/webkit-1446/pw_run.sh --inspector-pipe --no-startup-window
<launched> pid=20707
[pid=20707][err] Unable to init server: Could not connect: Connection refused
[pid=20707][err]
[pid=20707][err] (MiniBrowser:20712): Gtk-WARNING **: 21:06:44.413: cannot open display:
[pid=20707] <process did exit: exitCode=1, signal=null>
============================================================
@Semigradsky
Copy link
Author

Error message looks similar to error in #2621

@yury-s
Copy link
Member

yury-s commented Apr 27, 2021

npx playwright wk runs in headed mode but there is no display by default in linux running under WSL. You need to configure X server so that it forwards traffic from WSL to the host system or just run playwright in the host system.

If you want to stick with WSL2 you can try to use VcXsrv and configure it following instructions from this post.

@yury-s yury-s closed this as completed Apr 27, 2021
@Semigradsky
Copy link
Author

Semigradsky commented Apr 28, 2021

Thankyou for your response! Also this tutorial helped me.

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

No branches or pull requests

2 participants