Skip to content

Commit f9ebd20

Browse files
committed
Move WSL2 guide to its own section at the end
1 parent 99f7a02 commit f9ebd20

File tree

1 file changed

+73
-71
lines changed

1 file changed

+73
-71
lines changed

content/guides/getting-started/installing-cypress.md

Lines changed: 73 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -65,77 +65,6 @@ container with the Node.js process.
6565
`cypress/base` is a drop-in replacement for
6666
[base docker node images](https://hub.docker.com/_/node/).
6767

68-
#### WSL2
69-
70-
First, install the prerequisite packages using the command that relates to your
71-
linux distribution ([Ubuntu/Debian](#Ubuntu-Debian) or [CentOS](#CentOS)).
72-
73-
We need to have an [X-server](https://en.wikipedia.org/wiki/X.Org_Server) to
74-
display the Cypress UI from the linux subsystem. There are a variety of
75-
X-servers available, here we are going to use VcXsrv, you can use any other
76-
similar tool.
77-
78-
Download [VcXsrv](https://sourceforge.net/projects/vcxsrv/) and install. You can
79-
set the settings to your preference ("Multiple windows" and "Start no client"
80-
are recommended), but on the page that lets you enable extra settings, be sure
81-
to select "Disable access control" which is required as WSL2 has its own IP
82-
address, which changes often.
83-
84-
<DocsImage src="/img/guides/vcxsrv-extra-settings.png" alt="Disable access control in vcxsrv" ></DocsImage>
85-
86-
In your `.bashrc` (or equivalent such as `.zshrc`) set the `DISPLAY` environment
87-
variable.
88-
89-
```shell
90-
# set DISPLAY variable to the IP automatically assigned to WSL2
91-
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
92-
```
93-
94-
To confirm `DISPLAY` variable has been set, print it out in the terminal. You
95-
may need to restart your terminal to see this change.
96-
97-
```shell
98-
echo $DISPLAY
99-
# something like 172.17.224.1:0.0
100-
```
101-
102-
The VcXsrv GUI uses [D-Bus](https://www.freedesktop.org/wiki/Software/dbus/) to
103-
internally communicate. After the `export DISPLAY` line in your `.bashrc`, add
104-
the following:
105-
106-
```shell
107-
sudo /etc/init.d/dbus start &> /dev/null
108-
```
109-
110-
Now your user needs to be granted access to run `sudo dbus` without needing to
111-
enter a password. To do so, use the `visido` command:
112-
113-
```shell
114-
sudo visudo -f /etc/sudoers.d/dbus
115-
```
116-
117-
In the editor that launches, add the following line, replacing `<your_username>`
118-
with your username (you can use the `whoami` command to print your username if
119-
you don't know it).
120-
121-
```
122-
<your_username> ALL = (root) NOPASSWD: /etc/init.d/dbus
123-
```
124-
125-
Go to Control Panel > System and Security > Windows Defender Firewall > Inbound
126-
Rules > New Rule.
127-
128-
<DocsImage src="/img/guides/windows-firewall-disable-vcxsrv.png" alt="Add rule to allow connections for vcxsrv" ></DocsImage>
129-
130-
Select Program and click on next. On the This program path, browse and select
131-
path to VcxSrv. On the next page select allow the connection and click next. On
132-
the next page, select all three options (Domain, Private, Public).
133-
134-
<DocsImage src="/img/guides/rule-application-selection.png" alt="Select inbound rule application cases for vcxsrv" ></DocsImage>
135-
136-
Give the rule a suitable name and description and click finish. WSL2 should now
137-
be able to open a GUI from shell.
138-
13968
## Installing
14069

14170
### <Icon name="terminal"></Icon> `npm install`
@@ -587,3 +516,76 @@ Notes on pre-releases:
587516
release over a pre-release - if you have a pre-release of Cypress vX.Y.Z
588517
installed, the official release of Cypress vX.Y.Z will not install until you
589518
do `cypress cache clear`.
519+
520+
### Windows Subsystem for Linux
521+
522+
#### WSL2
523+
524+
First, install the prerequisite packages using the command that relates to your
525+
linux distribution ([Ubuntu/Debian](#Ubuntu-Debian) or [CentOS](#CentOS)).
526+
527+
We need to have an [X-server](https://en.wikipedia.org/wiki/X.Org_Server) to
528+
display the Cypress UI from the linux subsystem. There are a variety of
529+
X-servers available, here we are going to use VcXsrv, you can use any other
530+
similar tool.
531+
532+
Download [VcXsrv](https://sourceforge.net/projects/vcxsrv/) and install. You can
533+
set the settings to your preference ("Multiple windows" and "Start no client"
534+
are recommended), but on the page that lets you enable extra settings, be sure
535+
to select "Disable access control" which is required as WSL2 has its own IP
536+
address, which changes often.
537+
538+
<DocsImage src="/img/guides/vcxsrv-extra-settings.png" alt="Disable access control in vcxsrv" ></DocsImage>
539+
540+
In your `.bashrc` (or equivalent such as `.zshrc`) set the `DISPLAY` environment
541+
variable.
542+
543+
```shell
544+
# set DISPLAY variable to the IP automatically assigned to WSL2
545+
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
546+
```
547+
548+
To confirm `DISPLAY` variable has been set, print it out in the terminal. You
549+
may need to restart your terminal to see this change.
550+
551+
```shell
552+
echo $DISPLAY
553+
# something like 172.17.224.1:0.0
554+
```
555+
556+
The VcXsrv GUI uses [D-Bus](https://www.freedesktop.org/wiki/Software/dbus/) to
557+
internally communicate. After the `export DISPLAY` line in your `.bashrc`, add
558+
the following:
559+
560+
```shell
561+
sudo /etc/init.d/dbus start &> /dev/null
562+
```
563+
564+
Now your user needs to be granted access to run `sudo dbus` without needing to
565+
enter a password. To do so, use the `visido` command:
566+
567+
```shell
568+
sudo visudo -f /etc/sudoers.d/dbus
569+
```
570+
571+
In the editor that launches, add the following line, replacing `<your_username>`
572+
with your username (you can use the `whoami` command to print your username if
573+
you don't know it).
574+
575+
```
576+
<your_username> ALL = (root) NOPASSWD: /etc/init.d/dbus
577+
```
578+
579+
Go to Control Panel > System and Security > Windows Defender Firewall > Inbound
580+
Rules > New Rule.
581+
582+
<DocsImage src="/img/guides/windows-firewall-disable-vcxsrv.png" alt="Add rule to allow connections for vcxsrv" ></DocsImage>
583+
584+
Select Program and click on next. On the This program path, browse and select
585+
path to VcxSrv. On the next page select allow the connection and click next. On
586+
the next page, select all three options (Domain, Private, Public).
587+
588+
<DocsImage src="/img/guides/rule-application-selection.png" alt="Select inbound rule application cases for vcxsrv" ></DocsImage>
589+
590+
Give the rule a suitable name and description and click finish. WSL2 should now
591+
be able to open a GUI from shell.

0 commit comments

Comments
 (0)