The process of installing, configuring, and customizing Visual Studio to support development workflows across languages, platforms, and workloads.
Hi @Subbu Ayyanar ,
Thanks for laying out the details so clearly. The difference comes down to MobaXterm having its own built-in X server and setting things up for you automatically. VS Code Remote - SSH doesn't do that on its own, so nothing gets set for the display and Playwright reports there's none available. This is a known limitation of the extension, tracked in vscode-remote-release#267.
To get the same behaviour as MobaXterm:
1. Run an X server on your Windows machine — https://sourceforge.net/projects/vcxsrv/ or Xming. In XLaunch, tick "Disable access control".
2. Set DISPLAY on Windows before launching VS Code. This step is easy to miss, and the connection won't reach your X server without it:
Close and reopen VS Code afterwards.
3. Add forwarding to your local ~/.ssh/config:
4. Check it on the remote side. In the VS Code terminal, run echo $DISPLAY. You should see something like localhost:10.0 — forwarded displays start at 10, not 0. If it comes back empty, open a normal ssh -X session to the same server, run echo $DISPLAY there, and export that same value in your VS Code terminal:
If you'd rather not do this by hand, the Remote X11 and Remote X11 (SSH) extensions handle the forwarding and set DISPLAY for you. They only work with public key authentication, so that may or may not fit your setup.
A couple of things worth knowing: X11 over SSH will feel slower than what you're used to, and you may need to re-export $DISPLAY in new terminal tabs.
One question before you go further — are the tests running directly on the RHEL host, or inside the Playwright container? You mentioned both, and the answer changes things. If it's the container, X11 forwarding won't reach inside it, and xvfb-run npx playwright test --headed is a much simpler route since it creates a virtual display with no forwarding needed.
If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.
Thank you