From 061395077f1b3fba0c4c6915927c30af58a98975 Mon Sep 17 00:00:00 2001 From: hubisan Date: Thu, 7 Jan 2021 01:33:14 +0100 Subject: [PATCH 01/31] first new version of readme --- README-new.org | 154 +++++++++++++++++++++ img/vcxsrv-windows-defender-firewall.png | Bin 0 -> 56886 bytes img/vcxsrv-wsl1-firewall-inbound-rules.png | Bin 0 -> 9460 bytes img/vcxsrv-wsl2-firewall-inbound-rules.png | Bin 0 -> 6510 bytes 4 files changed, 154 insertions(+) create mode 100644 README-new.org create mode 100644 img/vcxsrv-windows-defender-firewall.png create mode 100644 img/vcxsrv-wsl1-firewall-inbound-rules.png create mode 100644 img/vcxsrv-wsl2-firewall-inbound-rules.png diff --git a/README-new.org b/README-new.org new file mode 100644 index 0000000..85f7415 --- /dev/null +++ b/README-new.org @@ -0,0 +1,154 @@ +* Emacs-WSL + +This guide shows you how to run Emacs with the Windows Subsystem for Linux WSL +(Version 1 and 2) on Windows 10 using Ubuntu 18.04 LTS as Linux distribution and +VcXsrv as X server to run Emacs in a graphical display. + +#+caption: Graphical Emacs in Windows 10 with WSL +[[./img/emacs-wsl.png]] + +* TODO Contents + +* TODO Install WSL 1 or WSL 2 + +* TODO Install Ubuntu + +* TODO Install Emacs + +... + +To try out if Emacs is working just run it directly in the terminal with ~emacs +-nw~. + +* Install Windows X-Server VcXsrv + +An X-server lets you access a Linux application or desktop environment’s graphic +user interface (GUI). This guide is [[https://sourceforge.net/projects/vcxsrv/][VcXsrv]] (free, open source, GPLv3). + +** Installation + +Download VcXsrv from [[https://sourceforge.net/projects/vcxsrv/]] and install it. +Check out the next section about the firewall configuration before launching it. + +** Windows Defender Firewall Configuration + +The first time you launch VcXsrv you are notified that Windows Defender Firewall +has blocked some features. + +#+caption: Windows Defend Firewall Dialog +[[./img/vcxsrv-windows-defender-firewall.png]] + +You have to allow VcXsrv to communicate on: + +- *WSL 1*: Private networks +- *WSL 2*: Private and public networks. + +The following inbound rules are added: + +- *WSl 1* :: [[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] +- *WSL 2* :: [[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] + +If you missed this step or are not sure what you've chosen or if you are +switching from WSL 1 to WSL 2 you can retrigger this dialog by deleting the +inbound rules (admin rights needed) and restart VcXsrv. The inbound rules shown +above can be found at @@html:@@WIN@@html:@@ Windows Defender Wall > +Advanced Settings (or @@html:@@WIN-r wf.msc RET@@html:@@). + +*** WSL 2 Additional Firewall Configuration + +To make the VcXsrv work with WSL 2 you have to disable access control. Disabling +the user access control with the ~-ac~ flag has some [[https://www.xfree86.org/current/Xserver.1.html][security issues]]: + +#+BEGIN_QUOTE +-ac disables host-based access control mechanisms. Enables access by any host, +and permits any host to modify the access control list. Use with extreme +caution. This option exists primarily for running test suites remotely. +#+END_QUOTE + +Therefore we want to restrict the access as much as possible. + +Unfortunately you can't modify the firewall rules if you have *no admin rights*. +In that case you have to live with the security issue (not sure how severe it +is) or use WSL 1 or use Emacs in the terminal. + +If you have *admin rights* you can add an inbound firewall rule to restrict +access as much as possible. As the IP used by WSL 2 is dynamic a powershell +script is provided to create/update the rule. + +Make sure that you disable the existing inbound rules: + +1. Go to the inbound rule settings with @@html:@@WIN@@html:@@ Windows + Defender Wall > Advanced Settings (or @@html:@@WIN-r wf.msc + RET@@html:@@). +2. Search for VcXsrv entries (there should be 2) and disable all. + +**** TODO + +Then run the powershell script to create/update the firewall rule. + +If VcXsrv was running before the firewall rules was updated it has to be +restarted. + +** Run VcXsrv + +To run VcXsrv use the batch-script provided. If you haven't used the default installation path +you have to adapt the script: + +*** TODO + +- WSL 1 + + #+BEGIN_SRC bat + start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl + #+END_SRC + +- WSL 2 + + #+BEGIN_SRC bat + start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac + #+END_SRC + + If you are using the additional firewall rule make sure to update the rule + before launching VcXsrv. + +If VcXsrv is already running it will show an error message. + +* Run Emacs in Graphical Display + +* TODO Optional Additions + +* TODO FAQ + +** Where is the root folder located? + +The root is accessible as ~\\wsl$~ in file explorer followed by the +distribution. You can show the current distribution name by running ~wsl -l -q~ +in cmd. + +** How to access Linux files from Windows? + +Run ~explorer.exe .~ in WSL to open the Windows File Explorer at the current +location. The path will start with ~\\wsl$~ unless it is a mounted drive. In the +File Explorer the files and folders can be copied, moved and edited as usual +(see this blog [[https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/][post]]). + +** How start WSL from File Explorer in the current folder? + +To start WSL from Windows File Explorer just type ~wsl~ into the location input +box or hold down ~Shift~ while right-clicking and select ~Open Linux shell here~ +from the context menu. If it's a network drive it has to be mounted else this +will not work. + +#+caption: WSL from windows explorer +[[./img/wsl-from-windows-explorer.png]] + +** What ways are there to run WSL? + +See [[https://docs.microsoft.com/en-us/windows/wsl/wsl-config#ways-to-run-wsl]]. + +* TODO Troubleshooting + +** The GUI is not loading + +Check your firewall settings. + diff --git a/img/vcxsrv-windows-defender-firewall.png b/img/vcxsrv-windows-defender-firewall.png new file mode 100644 index 0000000000000000000000000000000000000000..220f9807fbc30767c905f6eb8c8a4795ec9e8081 GIT binary patch literal 56886 zcmcG#1yCGa*Z7%0fB?bW-Q8iZV1w)6?(XgccemgUAuzaWaCi6M?(WO;yu0sLE4B5n z+S*gqGu6{wx2w-RcJKU7xPqKG0vs;fr%#^{BqcPXh5q(EnbJ3;p6e3zhh+$zJ+!{wH z-0mmV35F;nX!KTMug)PeGSb{kT|Z>q!^{L7N#G%ug_#){C#^GMeqJ?6ih`4q^VGLq zGg>&0`B6SZu7s_KM+YAVC(SQAGZP>EdVhjzJcDZjm7MG!xgOwqIw<%V8o>Im_@Qd} z5B?*W7&Q>_{|FD=TOEXjt%b>4N?;qaA5LULF-U#MJpSLiUi`MAFv8aL_1%O3PMGa| z!}I(n*SGs4I=F<7XP+cJim;=B(lR(7lJ<_284nTf++(-&++4bYXxlm%s`WfZQm$sl zu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@2$YUxrp8$NaBbB&aA|)w%x@u8N1Dr@9_%rKdesrGMfK` OIbJHgR;-n`2>&1XElE-U literal 0 HcmV?d00001 diff --git a/img/vcxsrv-wsl1-firewall-inbound-rules.png b/img/vcxsrv-wsl1-firewall-inbound-rules.png new file mode 100644 index 0000000000000000000000000000000000000000..da0cb2eac3f1f94677abff5eb37edd8db4ad993e GIT binary patch literal 9460 zcmbVycQBma+qZlrNJN)N^enL?dhaEATQxznh~5cS-IWMdiB6DJq6=YlqHSV{-s@UR zSiQF;`os4(&&>P#4ndj)L;0)omo(sQdj*ZI31Y9?L;1mvij?^dUK zu?+zMd!)LOf}x+qR%YOLTO;#MMDjl6n%2_rK7SMm$)SWn;b{83rI+~>wep&0sVdxd z!o$5(cc^>YOAKS!tsUO>{FeYDEs&0WdNX&ZGvgy)6y)tEXvwHr%OOQsb-569Ar zH%HPrcU$+=U~G?=jZ z?UiIcZ*XbmO1JB?G^7np20k~Qd{!)cS|aYhpPx{Uo|&o9#9BQUd6|^1kE<1_trIPb zA4vNWr0UFO5dJ0n1g_D~;UxGvk1XJa2CQ~iDW(Xl+}~`Q3)aLd$MMvf*`$2g!q`HG z6O(+r!@j+qys&L9Zz5`p*?zduXsTsbSLP%3dK4Rl)9ayKg>EFPDr9go+I~lj{?_m5 zF^ZytFe>TiS~4&SGqr)NZ>gnIit_WM^;NK-@3t}{b`#@l6)W6 zQ1D3RRb_!FqNVM-Rwvi<_0RL4ryttr9i`Jg+W+w>z&3$}u0tdxU~~ThoN|vfL(t@{ zkg={<&i0CL)511vTY@>ybgeusVxmUhS=#SGybrQTbXyeJ`~KV5xMhP{CS=#U`c`=8 z(@!t)JBFrH#vL^yQ}+vhqpM{Iqg1&JhUBgGYs(mg;NR^D+ikvV=RWCjePz5b!lYAH zaO6Q}q80XYVp!1*^(0W&Ha722fOdk4=sZ+0Wy$%8^{Irey*s1lxu4HS+PxUOCz%Sx zrx!lUp&Wf2Z0-Y|)=7vNo6!ARD$4da!?3R#YWB+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H6`}!dvTKQgPt`5AVJY507|s1F@lOC`yTMW z81_y(Mm+C=>2JWybs8&D2_$nHdMW~3LC$;&48~~zguRRL%nD4^P&F^OCE(75w28e2U-rG@ z$W7PX`hqr`Kxr`_1-!@kTGd^@$L&^bfUg0Cs81Fa<|RHJX$?QNx>!#3+?i8jz13Ir zI-z7Ee6+Tw1}y#4gIcFn7`r2q>50KnOWySZ#ivy<->ge4Y@)s8_)4lZG~#yg{DD84=eeFuNwC)#(2_xBaiR=~8a2JySku=ec8MqP;r6=G*J6 zj&W_$;g+4pntqy_ESReY+M=d@LoH)EJH&%Lr}Ml4i8^8KFhhIlaLpMDNbTIh5h?UG z>lMidOW@k^mO8qk?f0+0^e{dUJQ;Me!brkZnfrX&f9-A=5sjqEsoJ2{SO0XXhn(jS zU%gITqwK5(_OL5|iZuggOrQ~Vr(ta0Qyr0;5z^&wy80oIEOgdN;s?Gjix7q38hbu3 z1P#NZ-bF)^Rqc@5wCJ?GY#&k-s#V%WOV literal 0 HcmV?d00001 diff --git a/img/vcxsrv-wsl2-firewall-inbound-rules.png b/img/vcxsrv-wsl2-firewall-inbound-rules.png new file mode 100644 index 0000000000000000000000000000000000000000..e2e82aae3067b53babc493f081037a4f768c8301 GIT binary patch literal 6510 zcmZ8`cTf|~^EOIvp(#a5q$mhdMOr8yYA8yPjshZr6ho65I-yq)6i`AjNa#&!D4|G^ z-dm)GNC_PgNGLCUXWoB)J9Bfpb8|Ph&)hw?yBBAu52mNNLqkGBLa(E(@r;DzhUvBb zl8WM5n;#fszBX>Wdj?h`sTk(kyf(<*s6JICA*oKGJ+~vjwy8a|E#Hxl0J{FQ8@=vD zuSrNaNOd$+P5f|_hNzPx*_aYcdu^R z@knV`S@P%zaM6-V-sR)2xtCtXG)=DAcL1;UjGUX5)8CIG!?0JQy_lG(t}HznE${w! zE`&m%98rN#$2YrEly9=~FOy%3#itW?o&q<}qk=jx_ zoe5?#=@PM0HTLTQlbW?PJ{>}sa9_5($K#XF#JHVa;i8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.org | 182 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 159 insertions(+), 23 deletions(-) diff --git a/README-new.org b/README-new.org index 85f7415..2ae4809 100644 --- a/README-new.org +++ b/README-new.org @@ -11,7 +11,17 @@ VcXsrv as X server to run Emacs in a graphical display. * TODO Install WSL 1 or WSL 2 -* TODO Install Ubuntu +* TODO Install & Configure Ubuntu + +** User? Looks like this is done but still mention it. + +** Update + +Make sure everything is up to date: + +#+BEGIN_SRC shell + sudo apt update && sudo apt upgrade -y +#+END_SRC * TODO Install Emacs @@ -40,13 +50,13 @@ has blocked some features. You have to allow VcXsrv to communicate on: -- *WSL 1*: Private networks -- *WSL 2*: Private and public networks. +- ~WSL 1~ Private networks +- ~WSL 2~ Private and public networks. -The following inbound rules are added: +After allowing access the following inbound rules are added: -- *WSl 1* :: [[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] -- *WSL 2* :: [[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] +- ~WSl 1~ [[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] +- ~WSL 2~ [[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] If you missed this step or are not sure what you've chosen or if you are switching from WSL 1 to WSL 2 you can retrigger this dialog by deleting the @@ -67,11 +77,11 @@ caution. This option exists primarily for running test suites remotely. Therefore we want to restrict the access as much as possible. -Unfortunately you can't modify the firewall rules if you have *no admin rights*. +Unfortunately you can't modify the firewall rules if you have _*no admin rights*_. In that case you have to live with the security issue (not sure how severe it is) or use WSL 1 or use Emacs in the terminal. -If you have *admin rights* you can add an inbound firewall rule to restrict +If you have _*admin rights*_ you can add an inbound firewall rule to restrict access as much as possible. As the IP used by WSL 2 is dynamic a powershell script is provided to create/update the rule. @@ -84,39 +94,165 @@ Make sure that you disable the existing inbound rules: **** TODO -Then run the powershell script to create/update the firewall rule. - -If VcXsrv was running before the firewall rules was updated it has to be -restarted. +Then run the powershell script to create/update the firewall rule. If VcXsrv was +running before the firewall rules was updated it has to be restarted. ** Run VcXsrv -To run VcXsrv use the batch-script provided. If you haven't used the default installation path -you have to adapt the script: +To run VcXsrv use the batch-script provided in the ~scripts~ folder (just +double-click it). If you haven't used the default installation path you have to +adapt the script: *** TODO -- WSL 1 - +- ~WSL 1~ link #+BEGIN_SRC bat start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl #+END_SRC - -- WSL 2 - +- ~WSL 2~ link #+BEGIN_SRC bat start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac #+END_SRC - - If you are using the additional firewall rule make sure to update the rule - before launching VcXsrv. + If you are using the additional firewall rule make sure to create/update the + rule before launching VcXsrv. If VcXsrv is already running it will show an error message. -* Run Emacs in Graphical Display +* TODO Run Emacs in Graphical Display * TODO Optional Additions +** TODO Use Windows Terminal + +Install [[https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab][Windows Terminal]] from Microsoft from the Microsoft Store. + +#+BEGIN_QUOTE +The Windows Terminal is a modern, fast, efficient, powerful, and productive +terminal application for users of command-line tools and shells like Command +Prompt, PowerShell, and WSL. +#+END_QUOTE + +To make it open WSL by default: + +- Open the Windows Terminal. +- Open the settings by clicking on the dropdown button in the tab bar and then + select settings (bound to @@html:@@Ctrl-,@@html:@@). +- Copy the GUID for WSL (example: {12345678-1234-1234-1234-1234567890AB}). +- Set the default profile to the one copied from WSL: + #+BEGIN_SRC js + { + ... + "defaultProfile": "{12345678-1234-1234-1234-1234567890AB}", + ... + #+END_SRC + +To change the default path to =~=: + +- Go to the settings (@@html:@@Ctrl-,@@html:@@). +- Add a line in the WSL part at the end: + #+BEGIN_SRC js + { + ... + "source": "Windows.Terminal.Wsl", + "startingDirectory": "//wsl$/Ubuntu-18.04/home//" + }, + #+END_SRC + +** TODO User + +Instead of using root user it's better to add a user and use that as default +user. + +*** Add user + +#+BEGIN_SRC shell + sudo adduser +#+END_SRC + +*** Make it a sudo user + +Make that user be a sudo user: + +#+BEGIN_SRC shell + sudo usermod -a -G sudo +#+END_SRC + +*** Change default user + +Change the default user which is used when starting the WSL. + +Open ~cmd.exe~ and run: + +#+BEGIN_SRC shell + ubuntu config --default-user +#+END_SRC + +Restart WSL. + +You can change the default back to root by using ~root~ as username. To change +to root inside WSL temporarily use ~sudo su -~. + +** TODO Ssh key + +Generate a new ED25519 SSH key pair: + +#+BEGIN_SRC shell + ssh-keygen -t ed25519 -C "email@example.com" +#+END_SRC + +A dialog will ask you to: + +- input a file path: use the suggested path by pressing ~Enter~ +- enter a password: enter your password + +To copy the generated ssh key into the clipboard use: + +#+BEGIN_SRC shell + clip.exe < ~/.ssh/id_ed25519.pub +#+END_SRC + +** TODO Use en_US Language + +Bash on Ubuntu on Windows starts on the language defined in your Country or +Region settings. If you want to change the default language to en_US you may +need to follow these steps: + +#+BEGIN_SRC shell + sudo apt install -y language-pack-en language-pack-en-base manpages + sudo locale-gen en_US.UTF-8 + sudo update-locale LANG=en_US.UTF8 +#+END_SRC + +** TODO Mount network drives + +To do so the fstab file needs to be configured. + +For instance to mount ~H:~ add this to "/etc/fstab" (the directory has to exist to +make this work, so in this case ~sudo mkdir /mnt/h~ is needed beforehand): + +#+BEGIN_SRC text + H: /mnt/h drvfs defaults 0 0 +#+END_SRC + +From now on that network drive is automatically mounted. + + +** TODO Zsh + +If you want to use [[https://en.wikipedia.org/wiki/Z_shell][zsh]] and [[https://ohmyz.sh/][oh-my-zsh]]: + +#+BEGIN_SRC shell + sudo apt install zsh + chsh -s $(which zsh) + sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +#+END_SRC + +Restart WSL. + +*** TODO +In some scripts you need to change bash to zsh to be able to use it when +emulating a terminal in Emacs. + * TODO FAQ ** Where is the root folder located? From 4d71b5bdd2f0258ea9943e96f176d285328e90ca Mon Sep 17 00:00:00 2001 From: hubisan Date: Thu, 7 Jan 2021 02:17:58 +0100 Subject: [PATCH 03/31] fix --- README-new.org | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README-new.org b/README-new.org index 2ae4809..891b913 100644 --- a/README-new.org +++ b/README-new.org @@ -33,7 +33,7 @@ To try out if Emacs is working just run it directly in the terminal with ~emacs * Install Windows X-Server VcXsrv An X-server lets you access a Linux application or desktop environment’s graphic -user interface (GUI). This guide is [[https://sourceforge.net/projects/vcxsrv/][VcXsrv]] (free, open source, GPLv3). +user interface (GUI). This guide is using [[https://sourceforge.net/projects/vcxsrv/][VcXsrv]] (free, open source, GPLv3). ** Installation @@ -55,14 +55,16 @@ You have to allow VcXsrv to communicate on: After allowing access the following inbound rules are added: -- ~WSl 1~ [[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] -- ~WSL 2~ [[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] +- ~WSl 1~ [[ + ./img/vcxsrv-wsl1-firewall-inbound-rules.png]] +- ~WSL 2~ [[ + ./img/vcxsrv-wsl2-firewall-inbound-rules.png]] If you missed this step or are not sure what you've chosen or if you are switching from WSL 1 to WSL 2 you can retrigger this dialog by deleting the inbound rules (admin rights needed) and restart VcXsrv. The inbound rules shown -above can be found at @@html:@@WIN@@html:@@ Windows Defender Wall > -Advanced Settings (or @@html:@@WIN-r wf.msc RET@@html:@@). +above can be found at @@html:@@WIN@@html:@@ Windows Defender Firewall +> Advanced Settings (or @@html:@@WIN-r wf.msc RET@@html:@@). *** WSL 2 Additional Firewall Configuration @@ -77,18 +79,18 @@ caution. This option exists primarily for running test suites remotely. Therefore we want to restrict the access as much as possible. -Unfortunately you can't modify the firewall rules if you have _*no admin rights*_. +Unfortunately you can't modify the firewall rules if you have _no admin rights_. In that case you have to live with the security issue (not sure how severe it is) or use WSL 1 or use Emacs in the terminal. -If you have _*admin rights*_ you can add an inbound firewall rule to restrict +If you have _admin rights_ you can add an inbound firewall rule to restrict access as much as possible. As the IP used by WSL 2 is dynamic a powershell script is provided to create/update the rule. Make sure that you disable the existing inbound rules: 1. Go to the inbound rule settings with @@html:@@WIN@@html:@@ Windows - Defender Wall > Advanced Settings (or @@html:@@WIN-r wf.msc + Defender Firewall > Advanced Settings (or @@html:@@WIN-r wf.msc RET@@html:@@). 2. Search for VcXsrv entries (there should be 2) and disable all. From 590dfaabd18f5a5a3769b71997587736e49a0026 Mon Sep 17 00:00:00 2001 From: hubisan Date: Thu, 7 Jan 2021 02:19:24 +0100 Subject: [PATCH 04/31] fixed link to image --- README-new.org | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README-new.org b/README-new.org index 891b913..211e270 100644 --- a/README-new.org +++ b/README-new.org @@ -55,10 +55,10 @@ You have to allow VcXsrv to communicate on: After allowing access the following inbound rules are added: -- ~WSl 1~ [[ - ./img/vcxsrv-wsl1-firewall-inbound-rules.png]] -- ~WSL 2~ [[ - ./img/vcxsrv-wsl2-firewall-inbound-rules.png]] +- ~WSl 1~ + [[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] +- ~WSL 2~ + [[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] If you missed this step or are not sure what you've chosen or if you are switching from WSL 1 to WSL 2 you can retrigger this dialog by deleting the From 1e235081e95be97f3357b2aa15d5c06105e6d03f Mon Sep 17 00:00:00 2001 From: hubisan Date: Thu, 7 Jan 2021 02:20:35 +0100 Subject: [PATCH 05/31] hope it works now --- README-new.org | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README-new.org b/README-new.org index 211e270..7ec8a7c 100644 --- a/README-new.org +++ b/README-new.org @@ -55,10 +55,11 @@ You have to allow VcXsrv to communicate on: After allowing access the following inbound rules are added: -- ~WSl 1~ - [[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] -- ~WSL 2~ - [[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] +~WSl 1~ +[[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] + +~WSL 2~ +[[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] If you missed this step or are not sure what you've chosen or if you are switching from WSL 1 to WSL 2 you can retrigger this dialog by deleting the From a2afefbc6aad90bd4884120c31620b3c52045547 Mon Sep 17 00:00:00 2001 From: hubisan Date: Thu, 7 Jan 2021 02:21:52 +0100 Subject: [PATCH 06/31] so ne kacke --- README-new.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README-new.org b/README-new.org index 7ec8a7c..6eb1dad 100644 --- a/README-new.org +++ b/README-new.org @@ -56,9 +56,11 @@ You have to allow VcXsrv to communicate on: After allowing access the following inbound rules are added: ~WSl 1~ + [[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] ~WSL 2~ + [[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] If you missed this step or are not sure what you've chosen or if you are From a0173f6797dc8daa355c04f3d42785f6a98a2789 Mon Sep 17 00:00:00 2001 From: hubisan Date: Thu, 7 Jan 2021 02:25:45 +0100 Subject: [PATCH 07/31] wt. --- README-new.org | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README-new.org b/README-new.org index 6eb1dad..b864cad 100644 --- a/README-new.org +++ b/README-new.org @@ -71,8 +71,8 @@ above can be found at @@html:@@WIN@@html:@@ Windows Defender Firewall *** WSL 2 Additional Firewall Configuration -To make the VcXsrv work with WSL 2 you have to disable access control. Disabling -the user access control with the ~-ac~ flag has some [[https://www.xfree86.org/current/Xserver.1.html][security issues]]: +To make VcXsrv work with WSL 2 you have to disable access control. Disabling the +user access control with the ~-ac~ flag has some [[https://www.xfree86.org/current/Xserver.1.html][security issues]]: #+BEGIN_QUOTE -ac disables host-based access control mechanisms. Enables access by any host, @@ -82,11 +82,11 @@ caution. This option exists primarily for running test suites remotely. Therefore we want to restrict the access as much as possible. -Unfortunately you can't modify the firewall rules if you have _no admin rights_. +Unfortunately you can't modify the firewall rules if you have ~no admin rights~. In that case you have to live with the security issue (not sure how severe it is) or use WSL 1 or use Emacs in the terminal. -If you have _admin rights_ you can add an inbound firewall rule to restrict +If you have ~admin rights~ you can add an inbound firewall rule to restrict access as much as possible. As the IP used by WSL 2 is dynamic a powershell script is provided to create/update the rule. From f192cf14c1af2afa5dd54f6cbee665261123532a Mon Sep 17 00:00:00 2001 From: hubisan Date: Sun, 10 Jan 2021 20:56:59 +0100 Subject: [PATCH 08/31] small change --- README-new.org | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README-new.org b/README-new.org index b864cad..f576e0d 100644 --- a/README-new.org +++ b/README-new.org @@ -80,11 +80,9 @@ and permits any host to modify the access control list. Use with extreme caution. This option exists primarily for running test suites remotely. #+END_QUOTE -Therefore we want to restrict the access as much as possible. - -Unfortunately you can't modify the firewall rules if you have ~no admin rights~. -In that case you have to live with the security issue (not sure how severe it -is) or use WSL 1 or use Emacs in the terminal. +Therefore we want to restrict the access as much as possible. Unfortunately you +can't modify the firewall rules if you have ~no admin rights~. In that case you +have to live with the security issue (not sure how severe it is). If you have ~admin rights~ you can add an inbound firewall rule to restrict access as much as possible. As the IP used by WSL 2 is dynamic a powershell @@ -95,7 +93,7 @@ Make sure that you disable the existing inbound rules: 1. Go to the inbound rule settings with @@html:@@WIN@@html:@@ Windows Defender Firewall > Advanced Settings (or @@html:@@WIN-r wf.msc RET@@html:@@). -2. Search for VcXsrv entries (there should be 2) and disable all. +2. Search for VcXsrv entries (there should be two) and disable all found. **** TODO From d92c4fef3cd20448b1690762ca8d80bea9c63712 Mon Sep 17 00:00:00 2001 From: hubisan Date: Mon, 11 Jan 2021 00:04:46 +0100 Subject: [PATCH 09/31] dum de dum --- README-new.org | 107 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 95 insertions(+), 12 deletions(-) diff --git a/README-new.org b/README-new.org index f576e0d..15dab43 100644 --- a/README-new.org +++ b/README-new.org @@ -1,31 +1,109 @@ * Emacs-WSL This guide shows you how to run Emacs with the Windows Subsystem for Linux WSL -(Version 1 and 2) on Windows 10 using Ubuntu 18.04 LTS as Linux distribution and -VcXsrv as X server to run Emacs in a graphical display. +(Version 1 and 2) on Windows 10 using Ubuntu 20.04 LTS as Linux distribution +(tested with Ubuntu 18.04 as well) and VcXsrv as X server to run Emacs in a +graphical display. #+caption: Graphical Emacs in Windows 10 with WSL [[./img/emacs-wsl.png]] * TODO Contents -* TODO Install WSL 1 or WSL 2 +* Enable WSL 1 or WSL 2 -* TODO Install & Configure Ubuntu +Open PowerShell as Administrator and run: -** User? Looks like this is done but still mention it. +#+BEGIN_SRC fundamental + dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart +#+END_SRC + +For WSL 2 (see requirements) you have to enable another feature: + +#+BEGIN_SRC fundamental + dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart +#+END_SRC + +Restart the computer. + +Download and install the [[https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi][Linux kernel update package]]. + +If you use WSL 2 you have to set it as default before intstalling Ubuntu: + +#+BEGIN_SRC fundamental + wsl --set-default-version 2 +#+END_SRC -** Update +* Install Ubuntu 20.04 -Make sure everything is up to date: +To install Ubuntu 20.04 open PowerShell and run: + +#+BEGIN_SRC text + curl.exe -L -o ubuntu-1804.appx https://aka.ms/wsl-ubuntu-1804 + Add-AppxPackage .\ubuntu-1804.appx +#+END_SRC + +After installation open Start (@@html:WIN@@) and launch ~Ubuntu 20.04 +LTS~. After a while you have to enter a username and a password. This user will +be your default user for the distribution and is considered the Linux +administrator with the ability to run sudo commands. + +Make sure everything is up to date by running: #+BEGIN_SRC shell sudo apt update && sudo apt upgrade -y #+END_SRC -* TODO Install Emacs - -... +* Install Emacs 27.1 + +Run the following commands in Ubuntu 20.04 or download and use (double-click) +the Batch Scripts from the ~install-emacs~ folder: + +1. Install all dependencies (taken from the [[https://github.com/alexmurray/emacs-snap/blob/master/snapcraft.yaml][snap]]): + #+BEGIN_SRC shell + sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev \ + libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev \ + libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev \ + libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev \ + libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt \ + sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 \ + libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 \ + libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module \ + libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a \ + libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 \ + libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 \ + libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 \ + libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 \ + libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 \ + libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd \ + libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 \ + libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 \ + libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 \ + libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 \ + libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 \ + libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 \ + libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 \ + libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 \ + libyajl2 + #+END_SRC + +2. Download Emacs: + #+BEGIN_SRC shell + cd ~ + wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz + tar -xzvf emacs-27.1.tar.gz + #+END_SRC + +3. Configure and install Emacs: + #+BEGIN_SRC shell + cd ~/emacs-27.1 + ./configure --with-cairo + make + sudo make install + rm ~/emacs-27.1.tar.gz + #+END_SRC + Keeps the directory where Emacs was cloned to in case any step fails (to + clean or reinstall) or to be able to reconfigure. To try out if Emacs is working just run it directly in the terminal with ~emacs -nw~. @@ -285,9 +363,14 @@ will not work. See [[https://docs.microsoft.com/en-us/windows/wsl/wsl-config#ways-to-run-wsl]]. -* TODO Troubleshooting +* Troubleshooting + +Check out the Microsoft docs: + +- [[https://docs.microsoft.com/en-us/windows/wsl/install-win10#troubleshooting-installation][WSL troubleshooting installation]] +- [[https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#common-issues][WSL troubleshooting page]] -** The GUI is not loading +** The GUI is not loading/showing at all Check your firewall settings. From 4d9054f633a44e32cc8cc15b1660009d40dcc4c1 Mon Sep 17 00:00:00 2001 From: hubisan Date: Mon, 11 Jan 2021 00:16:40 +0100 Subject: [PATCH 10/31] update with the scripts --- batch-scripts/wsl1-emacs.bat | 3 ++ batch-scripts/wsl2-emacs.bat | 22 +++++++++ batch-scripts/wsl2-run-all.bat | 26 +++++++++++ batch-scripts/wsl2-vcxsrv.bat | 13 ++++++ .../install-emacs-01-dependencies.bat | 2 + ps-scripts/test.bat | 2 + ps-scripts/works.bat | 3 ++ ps-scripts/wsl2-emacs.ps1 | 14 ++++++ ps-scripts/wsl2-firewall-rule.ps1 | 45 +++++++++++++++++++ ps-scripts/wsl2-run-all.ps1 | 19 ++++++++ ps-scripts/wsl2-vcxsrv.ps1 | 18 ++++++++ 11 files changed, 167 insertions(+) create mode 100644 batch-scripts/wsl1-emacs.bat create mode 100644 batch-scripts/wsl2-emacs.bat create mode 100644 batch-scripts/wsl2-run-all.bat create mode 100644 batch-scripts/wsl2-vcxsrv.bat create mode 100644 install-emacs-batch-scripts/install-emacs-01-dependencies.bat create mode 100644 ps-scripts/test.bat create mode 100644 ps-scripts/works.bat create mode 100644 ps-scripts/wsl2-emacs.ps1 create mode 100644 ps-scripts/wsl2-firewall-rule.ps1 create mode 100644 ps-scripts/wsl2-run-all.ps1 create mode 100644 ps-scripts/wsl2-vcxsrv.ps1 diff --git a/batch-scripts/wsl1-emacs.bat b/batch-scripts/wsl1-emacs.bat new file mode 100644 index 0000000..89c3432 --- /dev/null +++ b/batch-scripts/wsl1-emacs.bat @@ -0,0 +1,3 @@ +@echo off +wsl bash -c "export DISPLAY=:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" +@REM wsl zsh -c "export DISPLAY=:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" \ No newline at end of file diff --git a/batch-scripts/wsl2-emacs.bat b/batch-scripts/wsl2-emacs.bat new file mode 100644 index 0000000..8f5f738 --- /dev/null +++ b/batch-scripts/wsl2-emacs.bat @@ -0,0 +1,22 @@ +@REM WSL2 - Launch Emacs + +@echo off + +SETLOCAL +@REM Get the IP to use from wsl and set to a variable. +for /F "tokens=* USEBACKQ" %%F IN (`wsl bash -c "ip route | awk '/default via /' | cut -d ' ' -f3"`) DO ( +set mywslip=%%F +) +@REM Run Emacs. +wsl bash -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" + +@REM If you want to change the keyboard layout to US. +@REM x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). +@REM wsl bash -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" + +@REM If you want to use zsh. +@REM wsl zsh -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" + +ENDLOCAL + +exit /b 0 \ No newline at end of file diff --git a/batch-scripts/wsl2-run-all.bat b/batch-scripts/wsl2-run-all.bat new file mode 100644 index 0000000..43e8fbc --- /dev/null +++ b/batch-scripts/wsl2-run-all.bat @@ -0,0 +1,26 @@ +@echo off +@REM start /wait powershell -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-firewall-rule.ps1'" + +@REM start /wait powershell -WindowStyle Hidden -Wait -NoProfile -ExecutionPolicy Bypass ` +@REM -Command "&{ start-process powershell -Wait -NoNewWindow -WindowStyle Hidden '-NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-firewall-rule.ps1'"-noprofile -file C:\script\psfile.ps1' -verb RunAs}" + +start /wait PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -Wait '-NoProfile -ExecutionPolicy Bypass -Command ""& './wsl2-firewall-rule.ps1'""' -Verb RunAs}"; + +echo after powershell + +pause +call wsl2-vcxsrv.bat +if errorlevel 1 ( + echo VcXsrv is already running. + echo. + echo VcXsrv has to be run after adding the firewall rule. + echo Please terminate VcXsrv and run this script again. + echo. + pause + exit 1 +) + +echo emacs +pause +call wsl2-emacs.bat +exit 0 \ No newline at end of file diff --git a/batch-scripts/wsl2-vcxsrv.bat b/batch-scripts/wsl2-vcxsrv.bat new file mode 100644 index 0000000..e519dc2 --- /dev/null +++ b/batch-scripts/wsl2-vcxsrv.bat @@ -0,0 +1,13 @@ +@REM WSL2 - Start VcXsrv + +@echo off + +@REM Can't start it again if it is already running. +tasklist /fi "imagename eq vcxsrv.exe" | find ":" > nul +if errorlevel 1 ( + exit /b 1 +) + +@REM Start vcxsrv with the flags needed. +start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac +exit /b 0 \ No newline at end of file diff --git a/install-emacs-batch-scripts/install-emacs-01-dependencies.bat b/install-emacs-batch-scripts/install-emacs-01-dependencies.bat new file mode 100644 index 0000000..1a44e15 --- /dev/null +++ b/install-emacs-batch-scripts/install-emacs-01-dependencies.bat @@ -0,0 +1,2 @@ +@echo off +wsl bash -c "sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 libyajl2" \ No newline at end of file diff --git a/ps-scripts/test.bat b/ps-scripts/test.bat new file mode 100644 index 0000000..fb5fd83 --- /dev/null +++ b/ps-scripts/test.bat @@ -0,0 +1,2 @@ +@echo off +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" \ No newline at end of file diff --git a/ps-scripts/works.bat b/ps-scripts/works.bat new file mode 100644 index 0000000..a098475 --- /dev/null +++ b/ps-scripts/works.bat @@ -0,0 +1,3 @@ +@echo off +@REM powershell -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" \ No newline at end of file diff --git a/ps-scripts/wsl2-emacs.ps1 b/ps-scripts/wsl2-emacs.ps1 new file mode 100644 index 0000000..02e2561 --- /dev/null +++ b/ps-scripts/wsl2-emacs.ps1 @@ -0,0 +1,14 @@ +# WSL2 - Launch Emacs + +# Get the IP to use from wsl and set to a variable. +$wslip = wsl bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' + +# Run Emacs +wsl bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" + +# If you want to change the keyboard layout to US. +# x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). +# wsl bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" + +# If you want to use zsh. +# wsl zsh -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" \ No newline at end of file diff --git a/ps-scripts/wsl2-firewall-rule.ps1 b/ps-scripts/wsl2-firewall-rule.ps1 new file mode 100644 index 0000000..77d6c3b --- /dev/null +++ b/ps-scripts/wsl2-firewall-rule.ps1 @@ -0,0 +1,45 @@ +# WSL2 - Add inbound fireall rule + +# Started here and somehow found all I need: +# https://stackoverflow.com/a/61110604/1365754 + +# If the current console is not elevated then pass the script to a new elevated powershell process. +if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Start-Process PowerShell -Verb RunAs -Wait "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`""; + exit; +} + +# Add the firewall rule. + +Import-Module -Name 'NetSecurity' + +$rulename = 'WSL 2 Firewall Unlock' +$programname = 'C:\program files\vcxsrv\vcxsrv.exe' +$localport = 6000 + +# Get the remote ip. +$remoteip = wsl.exe /bin/bash -c "ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'" +$remoteipfound = $remoteip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; +if( !$remoteipfound ){ + Write-Output "The Script exited, the remote ip address cannot be found"; + exit; +} + +## Get the local ip. +$localip = wsl bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' +$localipfound = $localip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; +if( !$localipfound ){ + Write-Output "The Script Exited, the local ip address cannot be found"; + exit; +} + +## Delete the rule if it exists already. +$rulefound = Get-NetFirewallRule -DisplayName $rulename 2> $null; +if ($rulefound) { + Remove-NetFireWallRule -DisplayName $rulename +} + +## Add the new rule. +New-NetFireWallRule -DisplayName $rulename -Direction Inbound -InterfaceType Wired ` +-LocalAddress $localip -RemoteAddress $remoteip -Action Allow ` +-Protocol TCP -LocalPort $localport -Program $programname \ No newline at end of file diff --git a/ps-scripts/wsl2-run-all.ps1 b/ps-scripts/wsl2-run-all.ps1 new file mode 100644 index 0000000..ae23c83 --- /dev/null +++ b/ps-scripts/wsl2-run-all.ps1 @@ -0,0 +1,19 @@ +$vcxsrv = Get-Process vcxsrv -ErrorAction SilentlyContinue +if ($vcxsrv) { + Write-Host (` + "VcXsrv is already running.`n`n" ` + + "VcXsrv has to be run after adding the firewall rule.`n" ` + + "Please terminate VcXsrv and run the script again.`n`n" ` + + "Press any key to exit...") + [void][System.Console]::ReadKey($true) + exit 1 +} + +Write-Host "`nAdding the firewall rule" +& .\wsl2-firewall-rule.ps1 + +Write-Host "`nStarting VcXsrv" +& .\wsl2-vcxsrv.ps1 + +Write-Host "`nLaunching Emacs" +& .\wsl2-emacs.ps1 \ No newline at end of file diff --git a/ps-scripts/wsl2-vcxsrv.ps1 b/ps-scripts/wsl2-vcxsrv.ps1 new file mode 100644 index 0000000..9e54f15 --- /dev/null +++ b/ps-scripts/wsl2-vcxsrv.ps1 @@ -0,0 +1,18 @@ +# WSL2 - Start VcXsrv + +# Stop vcxsrv (if already running it needs to be restarted) +$vcxsrv = Get-Process vcxsrv -ErrorAction SilentlyContinue +if ($vcxsrv) { + Write-Host (` + "VcXsrv is already running.`n`n" ` + + "Press any key to exit...") + [void][System.Console]::ReadKey($true) + exit 1 + # This could be used to stop the process if it is running. + # $vcxsrvid = $vcxsrv.id + # Stop-Process -Id $vcxsrvid + # Wait-Process -Id $vcxsrvid +} + +# Start vcxsrv with the flags needed. +& "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac \ No newline at end of file From d45492601386fcca4c58c6cd18fcd87d081e963e Mon Sep 17 00:00:00 2001 From: hubisan Date: Mon, 11 Jan 2021 00:16:57 +0100 Subject: [PATCH 11/31] adpated folder name --- README-new.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-new.org b/README-new.org index 15dab43..e713029 100644 --- a/README-new.org +++ b/README-new.org @@ -57,7 +57,7 @@ Make sure everything is up to date by running: * Install Emacs 27.1 Run the following commands in Ubuntu 20.04 or download and use (double-click) -the Batch Scripts from the ~install-emacs~ folder: +the Batch Scripts from the ~install-emacs-batch-scripts~ folder: 1. Install all dependencies (taken from the [[https://github.com/alexmurray/emacs-snap/blob/master/snapcraft.yaml][snap]]): #+BEGIN_SRC shell From d378b2672e837c31a9733cc3c163380d30569d39 Mon Sep 17 00:00:00 2001 From: hubisan Date: Mon, 11 Jan 2021 00:26:42 +0100 Subject: [PATCH 12/31] all install eamcs batch script ready --- install-emacs-batch-scripts/install-emacs-01-dependencies.bat | 3 ++- install-emacs-batch-scripts/install-emacs-02-download.bat | 3 +++ .../install-emacs-03-configure-install.bat | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 install-emacs-batch-scripts/install-emacs-02-download.bat create mode 100644 install-emacs-batch-scripts/install-emacs-03-configure-install.bat diff --git a/install-emacs-batch-scripts/install-emacs-01-dependencies.bat b/install-emacs-batch-scripts/install-emacs-01-dependencies.bat index 1a44e15..745fe69 100644 --- a/install-emacs-batch-scripts/install-emacs-01-dependencies.bat +++ b/install-emacs-batch-scripts/install-emacs-01-dependencies.bat @@ -1,2 +1,3 @@ @echo off -wsl bash -c "sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 libyajl2" \ No newline at end of file +wsl bash -c "sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 libyajl2" +pause diff --git a/install-emacs-batch-scripts/install-emacs-02-download.bat b/install-emacs-batch-scripts/install-emacs-02-download.bat new file mode 100644 index 0000000..e4045ca --- /dev/null +++ b/install-emacs-batch-scripts/install-emacs-02-download.bat @@ -0,0 +1,3 @@ +@echo off +wsl bash -c "cd ~ && wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz && tar -xzvf emacs-27.1.tar.gz" +pause diff --git a/install-emacs-batch-scripts/install-emacs-03-configure-install.bat b/install-emacs-batch-scripts/install-emacs-03-configure-install.bat new file mode 100644 index 0000000..c5ea912 --- /dev/null +++ b/install-emacs-batch-scripts/install-emacs-03-configure-install.bat @@ -0,0 +1,3 @@ +@echo off +wsl bash -c "cd ~/emacs-27.1 && ./configure --with-cairo && make && sudo make install && rm ~/emacs-27.1.tar.gz" +pause From 437b5824a094da12f89064283a83482eff431c40 Mon Sep 17 00:00:00 2001 From: hubisan Date: Mon, 11 Jan 2021 08:14:37 +0100 Subject: [PATCH 13/31] some fixes, especially ubuntu version in batch scripts --- README-new.org | 24 ++++++++++++------- .../install-emacs-01-dependencies.bat | 2 +- .../install-emacs-02-download.bat | 2 +- .../install-emacs-03-configure-install.bat | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README-new.org b/README-new.org index e713029..8bdb812 100644 --- a/README-new.org +++ b/README-new.org @@ -18,7 +18,7 @@ Open PowerShell as Administrator and run: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart #+END_SRC -For WSL 2 (see requirements) you have to enable another feature: +For ~WSL 2~ (see [[https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-2---check-requirements-for-running-wsl-2][requirements]]) you have to enable another feature: #+BEGIN_SRC fundamental dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart @@ -28,25 +28,30 @@ Restart the computer. Download and install the [[https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi][Linux kernel update package]]. -If you use WSL 2 you have to set it as default before intstalling Ubuntu: +If you use ~WSL 2~ you have to set it as default before intstalling Ubuntu: #+BEGIN_SRC fundamental wsl --set-default-version 2 #+END_SRC +If you are not able to install WSL with this instructions here go have a look +at the official Microsoft docs +([[https://docs.microsoft.com/en-us/windows/wsl/install-win10][site]]) on how +to install WSL. + * Install Ubuntu 20.04 To install Ubuntu 20.04 open PowerShell and run: #+BEGIN_SRC text - curl.exe -L -o ubuntu-1804.appx https://aka.ms/wsl-ubuntu-1804 - Add-AppxPackage .\ubuntu-1804.appx + curl.exe -L -o ubuntu-2004.appx https://aka.ms/wslubuntu2004 + Add-AppxPackage .\ubuntu-2004.appx #+END_SRC -After installation open Start (@@html:WIN@@) and launch ~Ubuntu 20.04 -LTS~. After a while you have to enter a username and a password. This user will -be your default user for the distribution and is considered the Linux -administrator with the ability to run sudo commands. +After installation open Start @@html:@@WIN@@html:@@ and launch +~Ubuntu 20.04 LTS~. After a while you have to enter a username and a +password. This user will be your default user for the distribution and is +considered the Linux administrator with the ability to run sudo commands. Make sure everything is up to date by running: @@ -61,6 +66,7 @@ the Batch Scripts from the ~install-emacs-batch-scripts~ folder: 1. Install all dependencies (taken from the [[https://github.com/alexmurray/emacs-snap/blob/master/snapcraft.yaml][snap]]): #+BEGIN_SRC shell + sudo apt update sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev \ libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev \ libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev \ @@ -86,6 +92,8 @@ the Batch Scripts from the ~install-emacs-batch-scripts~ folder: libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 \ libyajl2 #+END_SRC + There will be a dialog about the mail server configuration, just select ~no + configuration~ to leave it as it is and confirm with OK. 2. Download Emacs: #+BEGIN_SRC shell diff --git a/install-emacs-batch-scripts/install-emacs-01-dependencies.bat b/install-emacs-batch-scripts/install-emacs-01-dependencies.bat index 745fe69..09d0d73 100644 --- a/install-emacs-batch-scripts/install-emacs-01-dependencies.bat +++ b/install-emacs-batch-scripts/install-emacs-01-dependencies.bat @@ -1,3 +1,3 @@ @echo off -wsl bash -c "sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 libyajl2" +wsl -d Ubuntu-20.04 bash -c "sudo apt update && sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 libyajl2" pause diff --git a/install-emacs-batch-scripts/install-emacs-02-download.bat b/install-emacs-batch-scripts/install-emacs-02-download.bat index e4045ca..11ca0e9 100644 --- a/install-emacs-batch-scripts/install-emacs-02-download.bat +++ b/install-emacs-batch-scripts/install-emacs-02-download.bat @@ -1,3 +1,3 @@ @echo off -wsl bash -c "cd ~ && wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz && tar -xzvf emacs-27.1.tar.gz" +wsl -d Ubuntu-20.04 bash -c "cd ~ && wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz && tar -xzvf emacs-27.1.tar.gz" pause diff --git a/install-emacs-batch-scripts/install-emacs-03-configure-install.bat b/install-emacs-batch-scripts/install-emacs-03-configure-install.bat index c5ea912..0332d8d 100644 --- a/install-emacs-batch-scripts/install-emacs-03-configure-install.bat +++ b/install-emacs-batch-scripts/install-emacs-03-configure-install.bat @@ -1,3 +1,3 @@ @echo off -wsl bash -c "cd ~/emacs-27.1 && ./configure --with-cairo && make && sudo make install && rm ~/emacs-27.1.tar.gz" +wsl -d Ubuntu-20.04 bash -c "cd ~/emacs-27.1 && ./configure --with-cairo && make && sudo make install && rm ~/emacs-27.1.tar.gz" pause From 49eace8dd5879aac957a875f8174e8066ef782b4 Mon Sep 17 00:00:00 2001 From: hubisan Date: Mon, 11 Jan 2021 23:21:14 +0100 Subject: [PATCH 14/31] working on it --- README-new.org | 270 +++++++++--------- .../install-emacs-batch-01-dependencies.bat | 4 + .../install-emacs-batch-02-download.bat | 4 + ...stall-emacs-batch-03-configure-install.bat | 4 + .../install-emacs-shell-01-dependencies.sh | 27 ++ .../install-emacs-shell-02-download.sh | 5 + ...nstall-emacs-shell-03-configure-install.sh | 7 + install-emacs/ubuntu-18.04-dependencies.sh | 18 ++ ps-scripts/wsl2-emacs.ps1 | 8 +- ps-scripts/wsl2-firewall-rule.ps1 | 6 +- run-emacs/wsl1-emacs.bat | 2 + run-emacs/wsl1-vcxsrv.bat | 2 + run-emacs/wsl2-emacs.ps1 | 14 + run-emacs/wsl2-firewall-rule.bat | 5 + run-emacs/wsl2-firewall-rule.ps1 | 44 +++ run-emacs/wsl2-run-all.bat | 3 + run-emacs/wsl2-run-all.ps1 | 19 ++ run-emacs/wsl2-vcxsrv.bat | 2 + run-emacs/wsl2-vcxsrv.ps1 | 18 ++ 19 files changed, 314 insertions(+), 148 deletions(-) rename install-emacs-batch-scripts/install-emacs-01-dependencies.bat => install-emacs/install-emacs-batch-01-dependencies.bat (97%) rename install-emacs-batch-scripts/install-emacs-02-download.bat => install-emacs/install-emacs-batch-02-download.bat (82%) rename install-emacs-batch-scripts/install-emacs-03-configure-install.bat => install-emacs/install-emacs-batch-03-configure-install.bat (78%) create mode 100755 install-emacs/install-emacs-shell-01-dependencies.sh create mode 100755 install-emacs/install-emacs-shell-02-download.sh create mode 100755 install-emacs/install-emacs-shell-03-configure-install.sh create mode 100755 install-emacs/ubuntu-18.04-dependencies.sh create mode 100644 run-emacs/wsl1-emacs.bat create mode 100644 run-emacs/wsl1-vcxsrv.bat create mode 100644 run-emacs/wsl2-emacs.ps1 create mode 100644 run-emacs/wsl2-firewall-rule.bat create mode 100644 run-emacs/wsl2-firewall-rule.ps1 create mode 100644 run-emacs/wsl2-run-all.bat create mode 100644 run-emacs/wsl2-run-all.ps1 create mode 100644 run-emacs/wsl2-vcxsrv.bat create mode 100644 run-emacs/wsl2-vcxsrv.ps1 diff --git a/README-new.org b/README-new.org index 8bdb812..fddd11a 100644 --- a/README-new.org +++ b/README-new.org @@ -1,14 +1,28 @@ -* Emacs-WSL +* Emacs-WSL :noexport: This guide shows you how to run Emacs with the Windows Subsystem for Linux WSL -(Version 1 and 2) on Windows 10 using Ubuntu 20.04 LTS as Linux distribution -(tested with Ubuntu 18.04 as well) and VcXsrv as X server to run Emacs in a -graphical display. +(Version 1 and 2) on Windows 10 using Ubuntu 20.04 LTS as Linux distribution and +VcXsrv as X server to run Emacs in a graphical display. #+caption: Graphical Emacs in Windows 10 with WSL [[./img/emacs-wsl.png]] -* TODO Contents +* Contents :TOC_1_gh: +- [[#preparation][Preparation]] +- [[#enable-wsl-1-or-wsl-2][Enable WSL 1 or WSL 2]] +- [[#install-ubuntu-2004][Install Ubuntu 20.04]] +- [[#install-emacs-271][Install Emacs 27.1]] +- [[#install-windows-x-server-vcxsrv][Install Windows X-Server VcXsrv]] +- [[#run-emacs-in-terminal][Run Emacs in Terminal]] +- [[#run-emacs-in-graphical-display][Run Emacs in Graphical Display]] +- [[#optional-additions][Optional Additions]] +- [[#faq][FAQ]] +- [[#troubleshooting][Troubleshooting]] + +* Preparation + +Clone this repository with Git or download it to any place on your machine to be +able use the scripts later on. * Enable WSL 1 or WSL 2 @@ -48,8 +62,8 @@ To install Ubuntu 20.04 open PowerShell and run: Add-AppxPackage .\ubuntu-2004.appx #+END_SRC -After installation open Start @@html:@@WIN@@html:@@ and launch -~Ubuntu 20.04 LTS~. After a while you have to enter a username and a +After installation open Start @@html:@@WIN@@html:@@ and launch the +~Ubuntu 20.04 LTS~ terminal. After a while you have to enter a username and a password. This user will be your default user for the distribution and is considered the Linux administrator with the ability to run sudo commands. @@ -61,57 +75,65 @@ Make sure everything is up to date by running: * Install Emacs 27.1 -Run the following commands in Ubuntu 20.04 or download and use (double-click) -the Batch Scripts from the ~install-emacs-batch-scripts~ folder: +To install Emacs 27.1 in Ubuntu 20.04 + +- use (double-click) the batch scripts (.bat) from the [[./install-emacs]] folder +- or clone this repo in the Ubuntu terminal and run the shell scipts from the + [[./install-emacs]] folder +- or run the following commands in the Ubuntu terminal: + 1. Install all dependencies (taken from the [[https://github.com/alexmurray/emacs-snap/blob/master/snapcraft.yaml][snap]]): - #+BEGIN_SRC shell - sudo apt update - sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev \ - libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev \ - libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev \ - libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev \ - libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt \ - sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 \ - libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 \ - libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module \ - libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a \ - libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 \ - libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 \ - libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 \ - libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 \ - libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 \ - libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd \ - libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 \ - libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 \ - libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 \ - libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 \ - libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 \ - libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 \ - libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 \ - libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 \ - libyajl2 - #+END_SRC - There will be a dialog about the mail server configuration, just select ~no - configuration~ to leave it as it is and confirm with OK. + #+BEGIN_SRC shell + sudo apt update + sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev \ + libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev \ + libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev \ + libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev \ + libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt \ + sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 \ + libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 \ + libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module \ + libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a \ + libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 \ + libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 \ + libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 \ + libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 \ + libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 \ + libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd \ + libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 \ + libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 \ + libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 \ + libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 \ + libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 \ + libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 \ + libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 \ + libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 \ + libyajl2 + #+END_SRC + There will be a dialog about the mail server configuration, just select ~no + configuration~ to leave it as it is and confirm with OK. + + If you are on ~Ubuntu 18.04~ use the dependencies from + [[./install-emacs/ubuntu-18.04-dependencies.sh]]. 2. Download Emacs: - #+BEGIN_SRC shell - cd ~ - wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz - tar -xzvf emacs-27.1.tar.gz - #+END_SRC + #+BEGIN_SRC shell + cd ~ + wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz + tar -xzvf emacs-27.1.tar.gz + #+END_SRC 3. Configure and install Emacs: - #+BEGIN_SRC shell - cd ~/emacs-27.1 - ./configure --with-cairo - make - sudo make install - rm ~/emacs-27.1.tar.gz - #+END_SRC - Keeps the directory where Emacs was cloned to in case any step fails (to - clean or reinstall) or to be able to reconfigure. + #+BEGIN_SRC shell + cd ~/emacs-27.1 + ./configure --with-cairo + make + sudo make install + rm ~/emacs-27.1.tar.gz + #+END_SRC + Keeps the directory where Emacs was cloned to in case any step fails (to + clean or reinstall) or to be able to reconfigure. To try out if Emacs is working just run it directly in the terminal with ~emacs -nw~. @@ -157,7 +179,7 @@ above can be found at @@html:@@WIN@@html:@@ Windows Defender Firewall *** WSL 2 Additional Firewall Configuration -To make VcXsrv work with WSL 2 you have to disable access control. Disabling the +To make VcXsrv work with ~WSL 2~ you have to disable access control. Disabling the user access control with the ~-ac~ flag has some [[https://www.xfree86.org/current/Xserver.1.html][security issues]]: #+BEGIN_QUOTE @@ -181,107 +203,75 @@ Make sure that you disable the existing inbound rules: RET@@html:@@). 2. Search for VcXsrv entries (there should be two) and disable all found. -**** TODO - -Then run the powershell script to create/update the firewall rule. If VcXsrv was -running before the firewall rules was updated it has to be restarted. - -** Run VcXsrv - -To run VcXsrv use the batch-script provided in the ~scripts~ folder (just -double-click it). If you haven't used the default installation path you have to -adapt the script: - -*** TODO - -- ~WSL 1~ link - #+BEGIN_SRC bat - start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl - #+END_SRC -- ~WSL 2~ link - #+BEGIN_SRC bat - start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac - #+END_SRC - If you are using the additional firewall rule make sure to create/update the - rule before launching VcXsrv. +* Run Emacs in Terminal -If VcXsrv is already running it will show an error message. +Run Emacs with ~emacs -nw~ in Ubuntu terminal. * TODO Run Emacs in Graphical Display -* TODO Optional Additions - -** TODO Use Windows Terminal +To run Emacs in a graphical display you have to: -Install [[https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab][Windows Terminal]] from Microsoft from the Microsoft Store. +- ~WSL 2 only~ Created/update the inbound firewall rule +- Run VcXsrv +- Run Emacs in Ubuntu terminal -#+BEGIN_QUOTE -The Windows Terminal is a modern, fast, efficient, powerful, and productive -terminal application for users of command-line tools and shells like Command -Prompt, PowerShell, and WSL. -#+END_QUOTE - -To make it open WSL by default: - -- Open the Windows Terminal. -- Open the settings by clicking on the dropdown button in the tab bar and then - select settings (bound to @@html:@@Ctrl-,@@html:@@). -- Copy the GUID for WSL (example: {12345678-1234-1234-1234-1234567890AB}). -- Set the default profile to the one copied from WSL: - #+BEGIN_SRC js - { - ... - "defaultProfile": "{12345678-1234-1234-1234-1234567890AB}", - ... - #+END_SRC - -To change the default path to =~=: +For convenience there are batch scripts (double-clickable) to: -- Go to the settings (@@html:@@Ctrl-,@@html:@@). -- Add a line in the WSL part at the end: - #+BEGIN_SRC js - { - ... - "source": "Windows.Terminal.Wsl", - "startingDirectory": "//wsl$/Ubuntu-18.04/home//" - }, - #+END_SRC +- WSL1: + 1. Run VcXsrv + 2. Run Emacs + 3. Run VcXsrv (1.) and then Emacs (2.) -** TODO User +- WSL2: + 1. Create/update the inbound firewall rule (admin rights needed). + 2. Run VcXsrv + 3. Run Emacs + 4. Firewall rule (1.) and VcXsrv (2.) + 5. Firewall rule (1.), VcXsrv (2.) and Emacs (3.) -Instead of using root user it's better to add a user and use that as default -user. +** ~WSL 2 only~ Create/update the Inbound Firewall Rule -*** Add user +As described in [[#wsl-2-additional-firewall-configuration][WSL 2 Additional Firewall Configuration]] we want to restrict the +access by adding a firewall rule. Make sure you have disabled the existing +VcXsrv firewall rules. -#+BEGIN_SRC shell - sudo adduser -#+END_SRC +To create or update the inbound firewall rule you can use the batch script +[[./run-emacs/wsl2-firewall-rule.bat]] (double-click) which calls the PowerShell +script or run the PowerShell [[./run-emacs/wsl2-firewall-rule.ps1]] script directly. +If VcXsrv was running before the firewall rules was updated it has to be +restarted. -*** Make it a sudo user +** Run VcXsrv -Make that user be a sudo user: +To run VcXsrv use the batch script provided in the [[./run-emacs]] folder (just +double-click it). If you haven't used the default installation path you have to +adapt the script. -#+BEGIN_SRC shell - sudo usermod -a -G sudo -#+END_SRC +- ~WSL 1~ [[./run-emacs/wsl1-vcxsrv.bat]] + #+BEGIN_SRC bat + start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl + #+END_SRC +- ~WSL 2~ [[./run-emacs/wsl2-vcxsrv.bat]] + #+BEGIN_SRC bat + start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac + #+END_SRC + If you are using the additional firewall rule make sure to create/update the + rule before launching VcXsrv. -*** Change default user +If VcXsrv is already running it will show an error message. In that case stop +VcXsrv to and run it again. -Change the default user which is used when starting the WSL. +** Run Emacs -Open ~cmd.exe~ and run: +*** WSL 1 -#+BEGIN_SRC shell - ubuntu config --default-user -#+END_SRC +Use -Restart WSL. +*** WSL 2 -You can change the default back to root by using ~root~ as username. To change -to root inside WSL temporarily use ~sudo su -~. +* Optional Additions -** TODO Ssh key +** Ssh key Generate a new ED25519 SSH key pair: @@ -300,11 +290,11 @@ To copy the generated ssh key into the clipboard use: clip.exe < ~/.ssh/id_ed25519.pub #+END_SRC -** TODO Use en_US Language +** Use en_US Language Bash on Ubuntu on Windows starts on the language defined in your Country or -Region settings. If you want to change the default language to en_US you may -need to follow these steps: +Region settings (maybe this got changed, not 100 % sure). If you want to change +the default language to en_US you may need to run the following commands: #+BEGIN_SRC shell sudo apt install -y language-pack-en language-pack-en-base manpages @@ -312,7 +302,7 @@ need to follow these steps: sudo update-locale LANG=en_US.UTF8 #+END_SRC -** TODO Mount network drives +** Mount network drives automatically To do so the fstab file needs to be configured. @@ -325,8 +315,7 @@ make this work, so in this case ~sudo mkdir /mnt/h~ is needed beforehand): From now on that network drive is automatically mounted. - -** TODO Zsh +** Zsh and oh-my-zsh If you want to use [[https://en.wikipedia.org/wiki/Z_shell][zsh]] and [[https://ohmyz.sh/][oh-my-zsh]]: @@ -338,11 +327,10 @@ If you want to use [[https://en.wikipedia.org/wiki/Z_shell][zsh]] and [[https:// Restart WSL. -*** TODO In some scripts you need to change bash to zsh to be able to use it when emulating a terminal in Emacs. -* TODO FAQ +* FAQ ** Where is the root folder located? diff --git a/install-emacs-batch-scripts/install-emacs-01-dependencies.bat b/install-emacs/install-emacs-batch-01-dependencies.bat similarity index 97% rename from install-emacs-batch-scripts/install-emacs-01-dependencies.bat rename to install-emacs/install-emacs-batch-01-dependencies.bat index 09d0d73..2dbf4f3 100644 --- a/install-emacs-batch-scripts/install-emacs-01-dependencies.bat +++ b/install-emacs/install-emacs-batch-01-dependencies.bat @@ -1,3 +1,7 @@ @echo off + +@REM 1. Install all dependencies in Ubuntu 20.04 + wsl -d Ubuntu-20.04 bash -c "sudo apt update && sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 libyajl2" + pause diff --git a/install-emacs-batch-scripts/install-emacs-02-download.bat b/install-emacs/install-emacs-batch-02-download.bat similarity index 82% rename from install-emacs-batch-scripts/install-emacs-02-download.bat rename to install-emacs/install-emacs-batch-02-download.bat index 11ca0e9..037145f 100644 --- a/install-emacs-batch-scripts/install-emacs-02-download.bat +++ b/install-emacs/install-emacs-batch-02-download.bat @@ -1,3 +1,7 @@ @echo off + +@REM 2. Download Emacs 27.1 + wsl -d Ubuntu-20.04 bash -c "cd ~ && wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz && tar -xzvf emacs-27.1.tar.gz" + pause diff --git a/install-emacs-batch-scripts/install-emacs-03-configure-install.bat b/install-emacs/install-emacs-batch-03-configure-install.bat similarity index 78% rename from install-emacs-batch-scripts/install-emacs-03-configure-install.bat rename to install-emacs/install-emacs-batch-03-configure-install.bat index 0332d8d..a932374 100644 --- a/install-emacs-batch-scripts/install-emacs-03-configure-install.bat +++ b/install-emacs/install-emacs-batch-03-configure-install.bat @@ -1,3 +1,7 @@ @echo off + +@REM 3. Configure and install Emacs. + wsl -d Ubuntu-20.04 bash -c "cd ~/emacs-27.1 && ./configure --with-cairo && make && sudo make install && rm ~/emacs-27.1.tar.gz" + pause diff --git a/install-emacs/install-emacs-shell-01-dependencies.sh b/install-emacs/install-emacs-shell-01-dependencies.sh new file mode 100755 index 0000000..6b7f263 --- /dev/null +++ b/install-emacs/install-emacs-shell-01-dependencies.sh @@ -0,0 +1,27 @@ +# 1. Install all dependencies in Ubuntu 20.04 + +sudo apt update +sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev \ + libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev \ + libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev \ + libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev \ + libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt \ + sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 \ + libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 \ + libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module \ + libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a \ + libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 \ + libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 \ + libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 \ + libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 \ + libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 \ + libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd \ + libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 \ + libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 \ + libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 \ + libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 \ + libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 \ + libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 \ + libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 \ + libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 \ + libyajl2 diff --git a/install-emacs/install-emacs-shell-02-download.sh b/install-emacs/install-emacs-shell-02-download.sh new file mode 100755 index 0000000..4ba84a8 --- /dev/null +++ b/install-emacs/install-emacs-shell-02-download.sh @@ -0,0 +1,5 @@ +# 2. Download Emacs + +cd ~ +wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz +tar -xzvf emacs-27.1.tar.gz diff --git a/install-emacs/install-emacs-shell-03-configure-install.sh b/install-emacs/install-emacs-shell-03-configure-install.sh new file mode 100755 index 0000000..3d03ef2 --- /dev/null +++ b/install-emacs/install-emacs-shell-03-configure-install.sh @@ -0,0 +1,7 @@ +# 3. Configure and install Emacs + +cd ~/emacs-27.1 +./configure --with-cairo +make +sudo make install +rm ~/emacs-27.1.tar.gz diff --git a/install-emacs/ubuntu-18.04-dependencies.sh b/install-emacs/ubuntu-18.04-dependencies.sh new file mode 100755 index 0000000..2f6f88e --- /dev/null +++ b/install-emacs/ubuntu-18.04-dependencies.sh @@ -0,0 +1,18 @@ +# Dependencies for Ubuntu 18.04 + +sudo apt install -y autoconf automake autotools-dev bsd-mailx build-essential \ + diffstat gnutls-dev imagemagick libasound2-dev libc6-dev libdatrie-dev \ + libdbus-1-dev libgconf2-dev libgif-dev libgnutls28-dev libgpm-dev libgtk2.0-dev \ + libgtk-3-dev libice-dev libjpeg-dev liblockfile-dev liblqr-1-0 libm17n-dev \ + libmagickwand-dev libncurses5-dev libncurses-dev libotf-dev libpng-dev \ + librsvg2-dev libsm-dev libthai-dev libtiff5-dev libtiff-dev libtinfo-dev libtool \ + libx11-dev libxext-dev libxi-dev libxml2-dev libxmu-dev libxmuu-dev libxpm-dev \ + libxrandr-dev libxt-dev libxtst-dev libxv-dev quilt sharutils texinfo xaw3dg \ + xaw3dg-dev xorg-dev xutils-dev zlib1g-dev libjansson-dev libxaw7-dev \ + libselinux1-dev libmagick++-dev libacl1-dev gir1.2-javascriptcoregtk-4.0 \ + gir1.2-webkit2-4.0 libenchant1c2a libglvnd-core-dev libicu-le-hb-dev \ + libidn2-0-dev libjavascriptcoregtk-4.0-dev liboss4-salsa2 libsoup2.4-dev \ + libsystemd-dev libwebkit2gtk-4.0-dev libx11-xcb-dev libxcb-dri2-0-dev \ + libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxshmfence-dev \ + x11proto-composite-dev x11proto-core-dev x11proto-damage-dev \ + x11proto-fixes-dev diff --git a/ps-scripts/wsl2-emacs.ps1 b/ps-scripts/wsl2-emacs.ps1 index 02e2561..b7e4e61 100644 --- a/ps-scripts/wsl2-emacs.ps1 +++ b/ps-scripts/wsl2-emacs.ps1 @@ -1,14 +1,14 @@ # WSL2 - Launch Emacs # Get the IP to use from wsl and set to a variable. -$wslip = wsl bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' +$wslip = wsl -d Ubuntu-20.04 bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' # Run Emacs -wsl bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" +wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" # If you want to change the keyboard layout to US. # x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). -# wsl bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" +# wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" # If you want to use zsh. -# wsl zsh -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" \ No newline at end of file +# wsl -d Ubuntu-20.04 zsh -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" diff --git a/ps-scripts/wsl2-firewall-rule.ps1 b/ps-scripts/wsl2-firewall-rule.ps1 index 77d6c3b..72f38a2 100644 --- a/ps-scripts/wsl2-firewall-rule.ps1 +++ b/ps-scripts/wsl2-firewall-rule.ps1 @@ -18,7 +18,7 @@ $programname = 'C:\program files\vcxsrv\vcxsrv.exe' $localport = 6000 # Get the remote ip. -$remoteip = wsl.exe /bin/bash -c "ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'" +$remoteip = wsl -d Ubuntu-20.04 bash -c "ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'" $remoteipfound = $remoteip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; if( !$remoteipfound ){ Write-Output "The Script exited, the remote ip address cannot be found"; @@ -26,7 +26,7 @@ if( !$remoteipfound ){ } ## Get the local ip. -$localip = wsl bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' +$localip = wsl -d Ubuntu-20.04 bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' $localipfound = $localip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; if( !$localipfound ){ Write-Output "The Script Exited, the local ip address cannot be found"; @@ -42,4 +42,4 @@ if ($rulefound) { ## Add the new rule. New-NetFireWallRule -DisplayName $rulename -Direction Inbound -InterfaceType Wired ` -LocalAddress $localip -RemoteAddress $remoteip -Action Allow ` --Protocol TCP -LocalPort $localport -Program $programname \ No newline at end of file +-Protocol TCP -LocalPort $localport -Program $programname diff --git a/run-emacs/wsl1-emacs.bat b/run-emacs/wsl1-emacs.bat new file mode 100644 index 0000000..a518115 --- /dev/null +++ b/run-emacs/wsl1-emacs.bat @@ -0,0 +1,2 @@ +@echo off +wsl -d Ubuntu-20.04 -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" diff --git a/run-emacs/wsl1-vcxsrv.bat b/run-emacs/wsl1-vcxsrv.bat new file mode 100644 index 0000000..546d1ee --- /dev/null +++ b/run-emacs/wsl1-vcxsrv.bat @@ -0,0 +1,2 @@ +@rem Start VcXsrv +start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl diff --git a/run-emacs/wsl2-emacs.ps1 b/run-emacs/wsl2-emacs.ps1 new file mode 100644 index 0000000..b7e4e61 --- /dev/null +++ b/run-emacs/wsl2-emacs.ps1 @@ -0,0 +1,14 @@ +# WSL2 - Launch Emacs + +# Get the IP to use from wsl and set to a variable. +$wslip = wsl -d Ubuntu-20.04 bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' + +# Run Emacs +wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" + +# If you want to change the keyboard layout to US. +# x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). +# wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" + +# If you want to use zsh. +# wsl -d Ubuntu-20.04 zsh -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" diff --git a/run-emacs/wsl2-firewall-rule.bat b/run-emacs/wsl2-firewall-rule.bat new file mode 100644 index 0000000..8bbd50d --- /dev/null +++ b/run-emacs/wsl2-firewall-rule.bat @@ -0,0 +1,5 @@ +@echo off + +@rem Just run the PowerShell script. + +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-firewall-rule.ps1'" diff --git a/run-emacs/wsl2-firewall-rule.ps1 b/run-emacs/wsl2-firewall-rule.ps1 new file mode 100644 index 0000000..aa95ff6 --- /dev/null +++ b/run-emacs/wsl2-firewall-rule.ps1 @@ -0,0 +1,44 @@ +# WSL2 - Add inbound firewall rule + +# Started here and somehow found all I need: https://stackoverflow.com/a/61110604/1365754 + +# If the current console is not elevated then pass the script to a new elevated powershell process. +if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Start-Process PowerShell -Verb RunAs -Wait "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`""; + exit; +} + +# Add the firewall rule. + +Import-Module -Name 'NetSecurity' + +$rulename = 'WSL 2 Firewall Unlock' +$programname = 'C:\program files\vcxsrv\vcxsrv.exe' +$localport = 6000 + +# Get the remote ip. +$remoteip = wsl -d Ubuntu-20.04 bash -c "ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'" +$remoteipfound = $remoteip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; +if( !$remoteipfound ){ + Write-Output "The Script exited, the remote ip address cannot be found"; + exit; +} + +## Get the local ip. +$localip = wsl -d Ubuntu-20.04 bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' +$localipfound = $localip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; +if( !$localipfound ){ + Write-Output "The Script Exited, the local ip address cannot be found"; + exit; +} + +## Delete the rule if it exists already. +$rulefound = Get-NetFirewallRule -DisplayName $rulename 2> $null; +if ($rulefound) { + Remove-NetFireWallRule -DisplayName $rulename +} + +## Add the new rule. +New-NetFireWallRule -DisplayName $rulename -Direction Inbound -InterfaceType Wired ` +-LocalAddress $localip -RemoteAddress $remoteip -Action Allow ` +-Protocol TCP -LocalPort $localport -Program $programname diff --git a/run-emacs/wsl2-run-all.bat b/run-emacs/wsl2-run-all.bat new file mode 100644 index 0000000..a098475 --- /dev/null +++ b/run-emacs/wsl2-run-all.bat @@ -0,0 +1,3 @@ +@echo off +@REM powershell -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" \ No newline at end of file diff --git a/run-emacs/wsl2-run-all.ps1 b/run-emacs/wsl2-run-all.ps1 new file mode 100644 index 0000000..ae23c83 --- /dev/null +++ b/run-emacs/wsl2-run-all.ps1 @@ -0,0 +1,19 @@ +$vcxsrv = Get-Process vcxsrv -ErrorAction SilentlyContinue +if ($vcxsrv) { + Write-Host (` + "VcXsrv is already running.`n`n" ` + + "VcXsrv has to be run after adding the firewall rule.`n" ` + + "Please terminate VcXsrv and run the script again.`n`n" ` + + "Press any key to exit...") + [void][System.Console]::ReadKey($true) + exit 1 +} + +Write-Host "`nAdding the firewall rule" +& .\wsl2-firewall-rule.ps1 + +Write-Host "`nStarting VcXsrv" +& .\wsl2-vcxsrv.ps1 + +Write-Host "`nLaunching Emacs" +& .\wsl2-emacs.ps1 \ No newline at end of file diff --git a/run-emacs/wsl2-vcxsrv.bat b/run-emacs/wsl2-vcxsrv.bat new file mode 100644 index 0000000..91313fe --- /dev/null +++ b/run-emacs/wsl2-vcxsrv.bat @@ -0,0 +1,2 @@ +@rem Run VcXsrv +start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac diff --git a/run-emacs/wsl2-vcxsrv.ps1 b/run-emacs/wsl2-vcxsrv.ps1 new file mode 100644 index 0000000..9e54f15 --- /dev/null +++ b/run-emacs/wsl2-vcxsrv.ps1 @@ -0,0 +1,18 @@ +# WSL2 - Start VcXsrv + +# Stop vcxsrv (if already running it needs to be restarted) +$vcxsrv = Get-Process vcxsrv -ErrorAction SilentlyContinue +if ($vcxsrv) { + Write-Host (` + "VcXsrv is already running.`n`n" ` + + "Press any key to exit...") + [void][System.Console]::ReadKey($true) + exit 1 + # This could be used to stop the process if it is running. + # $vcxsrvid = $vcxsrv.id + # Stop-Process -Id $vcxsrvid + # Wait-Process -Id $vcxsrvid +} + +# Start vcxsrv with the flags needed. +& "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac \ No newline at end of file From f5d1e24f279790b40c736ae02f10ac6dfe8ef570 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 00:12:57 +0100 Subject: [PATCH 15/31] almost ready --- README-new.org | 64 ++++++++++++++++--------- run-emacs/wsl1-emacs.bat | 10 +++- run-emacs/wsl1-run-all.bat | 4 ++ run-emacs/wsl2-emacs.bat | 6 +++ run-emacs/wsl2-firewall-rule-vcxsrv.bat | 2 + run-emacs/wsl2-firewall-rule-vcxsrv.ps1 | 16 +++++++ 6 files changed, 79 insertions(+), 23 deletions(-) create mode 100644 run-emacs/wsl1-run-all.bat create mode 100644 run-emacs/wsl2-emacs.bat create mode 100644 run-emacs/wsl2-firewall-rule-vcxsrv.bat create mode 100644 run-emacs/wsl2-firewall-rule-vcxsrv.ps1 diff --git a/README-new.org b/README-new.org index fddd11a..59f0117 100644 --- a/README-new.org +++ b/README-new.org @@ -22,7 +22,7 @@ VcXsrv as X server to run Emacs in a graphical display. * Preparation Clone this repository with Git or download it to any place on your machine to be -able use the scripts later on. +able use the batch scripts (recommended) later on. * Enable WSL 1 or WSL 2 @@ -115,7 +115,10 @@ To install Emacs 27.1 in Ubuntu 20.04 configuration~ to leave it as it is and confirm with OK. If you are on ~Ubuntu 18.04~ use the dependencies from - [[./install-emacs/ubuntu-18.04-dependencies.sh]]. + [[./install-emacs/ubuntu-18.04-dependencies.sh]]. In that case you will also have + to modify the scripts (if you plan to use them) as the distribution is + hardcoded into them to make sure to use the right distribution even it is not + set as default yet. 2. Download Emacs: #+BEGIN_SRC shell @@ -217,17 +220,17 @@ To run Emacs in a graphical display you have to: For convenience there are batch scripts (double-clickable) to: -- WSL1: - 1. Run VcXsrv - 2. Run Emacs - 3. Run VcXsrv (1.) and then Emacs (2.) +- ~WSL1~ + 1. Run VcXsrv [[./run-emacs/wsl1-vcxsrv.bat]] + 2. Run Emacs [[./run-emacs/wsl1-emacs.bat]] + 3. Run VcXsrv (1.) and then Emacs (2.) [[./run-emacs/wsl1-run-all.bat]] -- WSL2: - 1. Create/update the inbound firewall rule (admin rights needed). - 2. Run VcXsrv - 3. Run Emacs - 4. Firewall rule (1.) and VcXsrv (2.) - 5. Firewall rule (1.), VcXsrv (2.) and Emacs (3.) +- ~WSL2~ + 1. Create/update the inbound firewall rule (admin rights needed). [[./run-emacs/wsl2-firewall-rule.bat]] + 2. Run VcXsrv [[./run-emacs/wsl2-vcxsrv.bat]] + 3. Run Emacs [[./run-emacs/wsl2-emacs.bat]] + 4. Firewall rule (1.) and VcXsrv (2.) [[./run-emacs/wsl2-firewall-rule-vcxsrv.bat]] + 5. Firewall rule (1.), VcXsrv (2.) and Emacs (3.) [[./run-emacs/wsl2-run-all.bat]] ** ~WSL 2 only~ Create/update the Inbound Firewall Rule @@ -236,16 +239,14 @@ access by adding a firewall rule. Make sure you have disabled the existing VcXsrv firewall rules. To create or update the inbound firewall rule you can use the batch script -[[./run-emacs/wsl2-firewall-rule.bat]] (double-click) which calls the PowerShell -script or run the PowerShell [[./run-emacs/wsl2-firewall-rule.ps1]] script directly. -If VcXsrv was running before the firewall rules was updated it has to be -restarted. +[[./run-emacs/wsl2-firewall-rule.bat]]. If VcXsrv was running before the firewall +rules was updated it has to be restarted. ** Run VcXsrv -To run VcXsrv use the batch script provided in the [[./run-emacs]] folder (just -double-click it). If you haven't used the default installation path you have to -adapt the script. +To run VcXsrv use the batch script provided or run the following commands in cmd +(if you haven't used the default installation path you have to adapt the +script/command): - ~WSL 1~ [[./run-emacs/wsl1-vcxsrv.bat]] #+BEGIN_SRC bat @@ -263,14 +264,33 @@ VcXsrv to and run it again. ** Run Emacs -*** WSL 1 +To run Emacs you can launch Ubuntu terminal and run the following commands or +use the batch script: -Use +- ~WSL1~ [[./run-emacs/wsl1-emacs.bat]] + #+BEGIN_SRC shell + export DISPLAY=:0.0 + export LIBGL_ALWAYS_INDIRECT=1 + setsid emacs + #+END_SRC +- ~WSL2~ [[./run-emacs/wsl2-emacs.bat]] + #+BEGIN_SRC shell + export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0 + export LIBGL_ALWAYS_INDIRECT=1 + setsid emacs + #+END_SRC -*** WSL 2 +You can add the lines without ~setsid emacs~ to ~~/.bashrc~ and then just use +~setsid emacs~ to launch Emacs in the background. * Optional Additions +** Change keyboard layout + +If you want to change the keyboard layout used make sure ~x11-xkb-utils~ is +installed (~sudo apt install x11-xkb-utils~) and add for instance ~setxkbmap +-layout us~ to ~~/.bashrc~ to use the US keyboard layout + ** Ssh key Generate a new ED25519 SSH key pair: diff --git a/run-emacs/wsl1-emacs.bat b/run-emacs/wsl1-emacs.bat index a518115..3fd1814 100644 --- a/run-emacs/wsl1-emacs.bat +++ b/run-emacs/wsl1-emacs.bat @@ -1,2 +1,10 @@ @echo off -wsl -d Ubuntu-20.04 -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" + +wsl -d Ubuntu-20.04 bash -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" + +@REM If you want to change the keyboard layout to US. +@REM x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). +@REM wsl -d Ubuntu-20.04 bash -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" + +@REM If you want to use zsh. +@REM wsl -d Ubuntu-20.04 zsh -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" diff --git a/run-emacs/wsl1-run-all.bat b/run-emacs/wsl1-run-all.bat new file mode 100644 index 0000000..6c586c7 --- /dev/null +++ b/run-emacs/wsl1-run-all.bat @@ -0,0 +1,4 @@ +@echo off + +CALL wsl1-vcxsrv.bat +CALL wsl1-emacs.bat diff --git a/run-emacs/wsl2-emacs.bat b/run-emacs/wsl2-emacs.bat new file mode 100644 index 0000000..409f175 --- /dev/null +++ b/run-emacs/wsl2-emacs.bat @@ -0,0 +1,6 @@ +@echo off + +@rem Just run the PowerShell script. + +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-emacs.ps1'" + diff --git a/run-emacs/wsl2-firewall-rule-vcxsrv.bat b/run-emacs/wsl2-firewall-rule-vcxsrv.bat new file mode 100644 index 0000000..d704b4f --- /dev/null +++ b/run-emacs/wsl2-firewall-rule-vcxsrv.bat @@ -0,0 +1,2 @@ +@echo off +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-firewall-rule-vcxsrv.ps1'" diff --git a/run-emacs/wsl2-firewall-rule-vcxsrv.ps1 b/run-emacs/wsl2-firewall-rule-vcxsrv.ps1 new file mode 100644 index 0000000..e402583 --- /dev/null +++ b/run-emacs/wsl2-firewall-rule-vcxsrv.ps1 @@ -0,0 +1,16 @@ +$vcxsrv = Get-Process vcxsrv -ErrorAction SilentlyContinue +if ($vcxsrv) { + Write-Host (` + "VcXsrv is already running.`n`n" ` + + "VcXsrv has to be run after adding the firewall rule.`n" ` + + "Please terminate VcXsrv and run the script again.`n`n" ` + + "Press any key to exit...") + [void][System.Console]::ReadKey($true) + exit 1 +} + +Write-Host "`nAdding the firewall rule" +& .\wsl2-firewall-rule.ps1 + +Write-Host "`nStarting VcXsrv" +& .\wsl2-vcxsrv.ps1 From ca39110486f29a7f873759d8be8e4446fc3071b9 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 00:15:03 +0100 Subject: [PATCH 16/31] removed obsolete files --- README-new.org | 392 ------------------- README.org | 599 +++++++++++++----------------- batch-scripts/wsl1-emacs.bat | 3 - batch-scripts/wsl2-emacs.bat | 22 -- batch-scripts/wsl2-run-all.bat | 26 -- batch-scripts/wsl2-vcxsrv.bat | 13 - emacs-27.1.sh | 35 -- packages.org | 195 ---------- ps-scripts/test.bat | 2 - ps-scripts/works.bat | 3 - ps-scripts/wsl2-emacs.ps1 | 14 - ps-scripts/wsl2-firewall-rule.ps1 | 45 --- ps-scripts/wsl2-run-all.ps1 | 19 - ps-scripts/wsl2-vcxsrv.ps1 | 18 - 14 files changed, 262 insertions(+), 1124 deletions(-) delete mode 100644 README-new.org delete mode 100644 batch-scripts/wsl1-emacs.bat delete mode 100644 batch-scripts/wsl2-emacs.bat delete mode 100644 batch-scripts/wsl2-run-all.bat delete mode 100644 batch-scripts/wsl2-vcxsrv.bat delete mode 100755 emacs-27.1.sh delete mode 100644 packages.org delete mode 100644 ps-scripts/test.bat delete mode 100644 ps-scripts/works.bat delete mode 100644 ps-scripts/wsl2-emacs.ps1 delete mode 100644 ps-scripts/wsl2-firewall-rule.ps1 delete mode 100644 ps-scripts/wsl2-run-all.ps1 delete mode 100644 ps-scripts/wsl2-vcxsrv.ps1 diff --git a/README-new.org b/README-new.org deleted file mode 100644 index 59f0117..0000000 --- a/README-new.org +++ /dev/null @@ -1,392 +0,0 @@ -* Emacs-WSL :noexport: - -This guide shows you how to run Emacs with the Windows Subsystem for Linux WSL -(Version 1 and 2) on Windows 10 using Ubuntu 20.04 LTS as Linux distribution and -VcXsrv as X server to run Emacs in a graphical display. - -#+caption: Graphical Emacs in Windows 10 with WSL -[[./img/emacs-wsl.png]] - -* Contents :TOC_1_gh: -- [[#preparation][Preparation]] -- [[#enable-wsl-1-or-wsl-2][Enable WSL 1 or WSL 2]] -- [[#install-ubuntu-2004][Install Ubuntu 20.04]] -- [[#install-emacs-271][Install Emacs 27.1]] -- [[#install-windows-x-server-vcxsrv][Install Windows X-Server VcXsrv]] -- [[#run-emacs-in-terminal][Run Emacs in Terminal]] -- [[#run-emacs-in-graphical-display][Run Emacs in Graphical Display]] -- [[#optional-additions][Optional Additions]] -- [[#faq][FAQ]] -- [[#troubleshooting][Troubleshooting]] - -* Preparation - -Clone this repository with Git or download it to any place on your machine to be -able use the batch scripts (recommended) later on. - -* Enable WSL 1 or WSL 2 - -Open PowerShell as Administrator and run: - -#+BEGIN_SRC fundamental - dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart -#+END_SRC - -For ~WSL 2~ (see [[https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-2---check-requirements-for-running-wsl-2][requirements]]) you have to enable another feature: - -#+BEGIN_SRC fundamental - dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart -#+END_SRC - -Restart the computer. - -Download and install the [[https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi][Linux kernel update package]]. - -If you use ~WSL 2~ you have to set it as default before intstalling Ubuntu: - -#+BEGIN_SRC fundamental - wsl --set-default-version 2 -#+END_SRC - -If you are not able to install WSL with this instructions here go have a look -at the official Microsoft docs -([[https://docs.microsoft.com/en-us/windows/wsl/install-win10][site]]) on how -to install WSL. - -* Install Ubuntu 20.04 - -To install Ubuntu 20.04 open PowerShell and run: - -#+BEGIN_SRC text - curl.exe -L -o ubuntu-2004.appx https://aka.ms/wslubuntu2004 - Add-AppxPackage .\ubuntu-2004.appx -#+END_SRC - -After installation open Start @@html:@@WIN@@html:@@ and launch the -~Ubuntu 20.04 LTS~ terminal. After a while you have to enter a username and a -password. This user will be your default user for the distribution and is -considered the Linux administrator with the ability to run sudo commands. - -Make sure everything is up to date by running: - -#+BEGIN_SRC shell - sudo apt update && sudo apt upgrade -y -#+END_SRC - -* Install Emacs 27.1 - -To install Emacs 27.1 in Ubuntu 20.04 - -- use (double-click) the batch scripts (.bat) from the [[./install-emacs]] folder -- or clone this repo in the Ubuntu terminal and run the shell scipts from the - [[./install-emacs]] folder -- or run the following commands in the Ubuntu terminal: - - -1. Install all dependencies (taken from the [[https://github.com/alexmurray/emacs-snap/blob/master/snapcraft.yaml][snap]]): - #+BEGIN_SRC shell - sudo apt update - sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev \ - libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev \ - libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev \ - libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev \ - libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt \ - sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 \ - libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 \ - libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module \ - libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a \ - libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 \ - libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 \ - libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 \ - libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 \ - libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 \ - libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd \ - libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 \ - libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 \ - libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 \ - libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 \ - libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 \ - libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 \ - libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 \ - libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 \ - libyajl2 - #+END_SRC - There will be a dialog about the mail server configuration, just select ~no - configuration~ to leave it as it is and confirm with OK. - - If you are on ~Ubuntu 18.04~ use the dependencies from - [[./install-emacs/ubuntu-18.04-dependencies.sh]]. In that case you will also have - to modify the scripts (if you plan to use them) as the distribution is - hardcoded into them to make sure to use the right distribution even it is not - set as default yet. - -2. Download Emacs: - #+BEGIN_SRC shell - cd ~ - wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz - tar -xzvf emacs-27.1.tar.gz - #+END_SRC - -3. Configure and install Emacs: - #+BEGIN_SRC shell - cd ~/emacs-27.1 - ./configure --with-cairo - make - sudo make install - rm ~/emacs-27.1.tar.gz - #+END_SRC - Keeps the directory where Emacs was cloned to in case any step fails (to - clean or reinstall) or to be able to reconfigure. - -To try out if Emacs is working just run it directly in the terminal with ~emacs --nw~. - -* Install Windows X-Server VcXsrv - -An X-server lets you access a Linux application or desktop environment’s graphic -user interface (GUI). This guide is using [[https://sourceforge.net/projects/vcxsrv/][VcXsrv]] (free, open source, GPLv3). - -** Installation - -Download VcXsrv from [[https://sourceforge.net/projects/vcxsrv/]] and install it. -Check out the next section about the firewall configuration before launching it. - -** Windows Defender Firewall Configuration - -The first time you launch VcXsrv you are notified that Windows Defender Firewall -has blocked some features. - -#+caption: Windows Defend Firewall Dialog -[[./img/vcxsrv-windows-defender-firewall.png]] - -You have to allow VcXsrv to communicate on: - -- ~WSL 1~ Private networks -- ~WSL 2~ Private and public networks. - -After allowing access the following inbound rules are added: - -~WSl 1~ - -[[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] - -~WSL 2~ - -[[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] - -If you missed this step or are not sure what you've chosen or if you are -switching from WSL 1 to WSL 2 you can retrigger this dialog by deleting the -inbound rules (admin rights needed) and restart VcXsrv. The inbound rules shown -above can be found at @@html:@@WIN@@html:@@ Windows Defender Firewall -> Advanced Settings (or @@html:@@WIN-r wf.msc RET@@html:@@). - -*** WSL 2 Additional Firewall Configuration - -To make VcXsrv work with ~WSL 2~ you have to disable access control. Disabling the -user access control with the ~-ac~ flag has some [[https://www.xfree86.org/current/Xserver.1.html][security issues]]: - -#+BEGIN_QUOTE --ac disables host-based access control mechanisms. Enables access by any host, -and permits any host to modify the access control list. Use with extreme -caution. This option exists primarily for running test suites remotely. -#+END_QUOTE - -Therefore we want to restrict the access as much as possible. Unfortunately you -can't modify the firewall rules if you have ~no admin rights~. In that case you -have to live with the security issue (not sure how severe it is). - -If you have ~admin rights~ you can add an inbound firewall rule to restrict -access as much as possible. As the IP used by WSL 2 is dynamic a powershell -script is provided to create/update the rule. - -Make sure that you disable the existing inbound rules: - -1. Go to the inbound rule settings with @@html:@@WIN@@html:@@ Windows - Defender Firewall > Advanced Settings (or @@html:@@WIN-r wf.msc - RET@@html:@@). -2. Search for VcXsrv entries (there should be two) and disable all found. - -* Run Emacs in Terminal - -Run Emacs with ~emacs -nw~ in Ubuntu terminal. - -* TODO Run Emacs in Graphical Display - -To run Emacs in a graphical display you have to: - -- ~WSL 2 only~ Created/update the inbound firewall rule -- Run VcXsrv -- Run Emacs in Ubuntu terminal - -For convenience there are batch scripts (double-clickable) to: - -- ~WSL1~ - 1. Run VcXsrv [[./run-emacs/wsl1-vcxsrv.bat]] - 2. Run Emacs [[./run-emacs/wsl1-emacs.bat]] - 3. Run VcXsrv (1.) and then Emacs (2.) [[./run-emacs/wsl1-run-all.bat]] - -- ~WSL2~ - 1. Create/update the inbound firewall rule (admin rights needed). [[./run-emacs/wsl2-firewall-rule.bat]] - 2. Run VcXsrv [[./run-emacs/wsl2-vcxsrv.bat]] - 3. Run Emacs [[./run-emacs/wsl2-emacs.bat]] - 4. Firewall rule (1.) and VcXsrv (2.) [[./run-emacs/wsl2-firewall-rule-vcxsrv.bat]] - 5. Firewall rule (1.), VcXsrv (2.) and Emacs (3.) [[./run-emacs/wsl2-run-all.bat]] - -** ~WSL 2 only~ Create/update the Inbound Firewall Rule - -As described in [[#wsl-2-additional-firewall-configuration][WSL 2 Additional Firewall Configuration]] we want to restrict the -access by adding a firewall rule. Make sure you have disabled the existing -VcXsrv firewall rules. - -To create or update the inbound firewall rule you can use the batch script -[[./run-emacs/wsl2-firewall-rule.bat]]. If VcXsrv was running before the firewall -rules was updated it has to be restarted. - -** Run VcXsrv - -To run VcXsrv use the batch script provided or run the following commands in cmd -(if you haven't used the default installation path you have to adapt the -script/command): - -- ~WSL 1~ [[./run-emacs/wsl1-vcxsrv.bat]] - #+BEGIN_SRC bat - start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl - #+END_SRC -- ~WSL 2~ [[./run-emacs/wsl2-vcxsrv.bat]] - #+BEGIN_SRC bat - start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac - #+END_SRC - If you are using the additional firewall rule make sure to create/update the - rule before launching VcXsrv. - -If VcXsrv is already running it will show an error message. In that case stop -VcXsrv to and run it again. - -** Run Emacs - -To run Emacs you can launch Ubuntu terminal and run the following commands or -use the batch script: - -- ~WSL1~ [[./run-emacs/wsl1-emacs.bat]] - #+BEGIN_SRC shell - export DISPLAY=:0.0 - export LIBGL_ALWAYS_INDIRECT=1 - setsid emacs - #+END_SRC -- ~WSL2~ [[./run-emacs/wsl2-emacs.bat]] - #+BEGIN_SRC shell - export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0 - export LIBGL_ALWAYS_INDIRECT=1 - setsid emacs - #+END_SRC - -You can add the lines without ~setsid emacs~ to ~~/.bashrc~ and then just use -~setsid emacs~ to launch Emacs in the background. - -* Optional Additions - -** Change keyboard layout - -If you want to change the keyboard layout used make sure ~x11-xkb-utils~ is -installed (~sudo apt install x11-xkb-utils~) and add for instance ~setxkbmap --layout us~ to ~~/.bashrc~ to use the US keyboard layout - -** Ssh key - -Generate a new ED25519 SSH key pair: - -#+BEGIN_SRC shell - ssh-keygen -t ed25519 -C "email@example.com" -#+END_SRC - -A dialog will ask you to: - -- input a file path: use the suggested path by pressing ~Enter~ -- enter a password: enter your password - -To copy the generated ssh key into the clipboard use: - -#+BEGIN_SRC shell - clip.exe < ~/.ssh/id_ed25519.pub -#+END_SRC - -** Use en_US Language - -Bash on Ubuntu on Windows starts on the language defined in your Country or -Region settings (maybe this got changed, not 100 % sure). If you want to change -the default language to en_US you may need to run the following commands: - -#+BEGIN_SRC shell - sudo apt install -y language-pack-en language-pack-en-base manpages - sudo locale-gen en_US.UTF-8 - sudo update-locale LANG=en_US.UTF8 -#+END_SRC - -** Mount network drives automatically - -To do so the fstab file needs to be configured. - -For instance to mount ~H:~ add this to "/etc/fstab" (the directory has to exist to -make this work, so in this case ~sudo mkdir /mnt/h~ is needed beforehand): - -#+BEGIN_SRC text - H: /mnt/h drvfs defaults 0 0 -#+END_SRC - -From now on that network drive is automatically mounted. - -** Zsh and oh-my-zsh - -If you want to use [[https://en.wikipedia.org/wiki/Z_shell][zsh]] and [[https://ohmyz.sh/][oh-my-zsh]]: - -#+BEGIN_SRC shell - sudo apt install zsh - chsh -s $(which zsh) - sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" -#+END_SRC - -Restart WSL. - -In some scripts you need to change bash to zsh to be able to use it when -emulating a terminal in Emacs. - -* FAQ - -** Where is the root folder located? - -The root is accessible as ~\\wsl$~ in file explorer followed by the -distribution. You can show the current distribution name by running ~wsl -l -q~ -in cmd. - -** How to access Linux files from Windows? - -Run ~explorer.exe .~ in WSL to open the Windows File Explorer at the current -location. The path will start with ~\\wsl$~ unless it is a mounted drive. In the -File Explorer the files and folders can be copied, moved and edited as usual -(see this blog [[https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/][post]]). - -** How start WSL from File Explorer in the current folder? - -To start WSL from Windows File Explorer just type ~wsl~ into the location input -box or hold down ~Shift~ while right-clicking and select ~Open Linux shell here~ -from the context menu. If it's a network drive it has to be mounted else this -will not work. - -#+caption: WSL from windows explorer -[[./img/wsl-from-windows-explorer.png]] - -** What ways are there to run WSL? - -See [[https://docs.microsoft.com/en-us/windows/wsl/wsl-config#ways-to-run-wsl]]. - -* Troubleshooting - -Check out the Microsoft docs: - -- [[https://docs.microsoft.com/en-us/windows/wsl/install-win10#troubleshooting-installation][WSL troubleshooting installation]] -- [[https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#common-issues][WSL troubleshooting page]] - -** The GUI is not loading/showing at all - -Check your firewall settings. - diff --git a/README.org b/README.org index ea74f45..e52ed8d 100644 --- a/README.org +++ b/README.org @@ -1,467 +1,392 @@ -#+STARTUP: indent children - -* Emacs-wsl :noexport: +* Emacs-WSL :noexport: This guide shows you how to run Emacs with the Windows Subsystem for Linux WSL -in Windows 10. Emacs can either be run with a graphical display or directly in -the terminal. - -This guide is using Ubuntu 18.04 LTS as Linux distribution. +(Version 1 and 2) on Windows 10 using Ubuntu 20.04 LTS as Linux distribution and +VcXsrv as X server to run Emacs in a graphical display. #+caption: Graphical Emacs in Windows 10 with WSL [[./img/emacs-wsl.png]] * Contents :TOC_1_gh: -:PROPERTIES: -:VISIBILITY: all -:END: -- [[#enable-the-windows-subsystem-for-linux][Enable the Windows Subsystem for Linux]] -- [[#install-the-linux-distribution][Install the Linux distribution]] -- [[#use-windows-terminal][Use Windows Terminal]] -- [[#configure-wsl][Configure WSL]] -- [[#install-emacs][Install Emacs]] +- [[#preparation][Preparation]] +- [[#enable-wsl-1-or-wsl-2][Enable WSL 1 or WSL 2]] +- [[#install-ubuntu-2004][Install Ubuntu 20.04]] +- [[#install-emacs-271][Install Emacs 27.1]] +- [[#install-windows-x-server-vcxsrv][Install Windows X-Server VcXsrv]] - [[#run-emacs-in-terminal][Run Emacs in Terminal]] - [[#run-emacs-in-graphical-display][Run Emacs in Graphical Display]] -- [[#remarks][Remarks]] +- [[#optional-additions][Optional Additions]] - [[#faq][FAQ]] +- [[#troubleshooting][Troubleshooting]] -* Enable the Windows Subsystem for Linux - -#+begin_quote -https://docs.microsoft.com/en-us/windows/wsl/install-win10 -#+end_quote - -Open PowerShell as Administrator and run the following to enable the feature: - -#+BEGIN_SRC text - Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -#+END_SRC - -Restart your computer (you should be prompted to do so). - -This can also be done with: +* Preparation -- Open Control Panel -- Programs and Features -- Turn Windows Feature on or off -- Check Windows Subsystem for Linux +Clone this repository with Git or download it to any place on your machine to be +able use the batch scripts (recommended) later on. -* Install the Linux distribution +* Enable WSL 1 or WSL 2 -Install a Linux distribution. This guide should work for all Debian based ones. -But it is only tested on Ubuntu 18.04. +Open PowerShell as Administrator and run: -#+begin_quote -[[https://docs.microsoft.com/en-us/windows/wsl/install-win10#install-your-linux-distribution-of-choice][install-your-linux-distribution-of-choice]] -#+end_quote - -You can install the Linux distribution: - -- [[https://docs.microsoft.com/en-us/windows/wsl/install-win10#windows-10-fall-creators-update-and-later-install-from-the-microsoft-store][from the Microsoft store]] -- [[https://docs.microsoft.com/en-us/windows/wsl/install-manual#downloading-distros-via-the-command-line][from the command line]] (used in this guide) -- [[https://docs.microsoft.com/en-us/windows/wsl/install-on-server#download-a-linux-distro][manually (download)]] - -** Installing from command line - -Installing Ubuntu 18.04 from command line with PowerShell. - -#+BEGIN_SRC text - curl.exe -L -o ubuntu-1804.appx https://aka.ms/wsl-ubuntu-1804 - Add-AppxPackage .\ubuntu-1804.appx +#+BEGIN_SRC fundamental + dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart #+END_SRC -* Use Windows Terminal - -This step is optional but recommended. - -Install [[https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab][Windows Terminal]] from Microsoft from the Microsoft Store. +For ~WSL 2~ (see [[https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-2---check-requirements-for-running-wsl-2][requirements]]) you have to enable another feature: -#+BEGIN_QUOTE -The Windows Terminal is a modern, fast, efficient, powerful, and productive -terminal application for users of command-line tools and shells like Command -Prompt, PowerShell, and WSL. -#+END_QUOTE - -To make it open WSL by default: - -- Open the Windows Terminal. -- Open the settings by clicking on the dropdown button in the tab bar and then - select settings (bound to @@html:@@Ctrl-,@@html:@@). -- Copy the GUID for WSL (example: {12345678-1234-1234-1234-1234567890AB}). -- Set the default profile to the one copied from WSL: - #+BEGIN_SRC js - { - ... - "defaultProfile": "{12345678-1234-1234-1234-1234567890AB}", - ... - #+END_SRC - -To change the default path to =~=: - -- Go to the settings (@@html:@@Ctrl-,@@html:@@). -- Add a line in the WSL part at the end: - #+BEGIN_SRC js - { - ... - "source": "Windows.Terminal.Wsl", - "startingDirectory": "//wsl$/Ubuntu-18.04/home//" - }, - #+END_SRC - -* Configure WSL +#+BEGIN_SRC fundamental + dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart +#+END_SRC -Start the WSL (in Windows Terminal if you have installed it) and configure it. +Restart the computer. -** Update +Download and install the [[https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi][Linux kernel update package]]. -Make sure everything is up to date: +If you use ~WSL 2~ you have to set it as default before intstalling Ubuntu: -#+BEGIN_SRC shell - sudo apt update - sudo apt upgrade +#+BEGIN_SRC fundamental + wsl --set-default-version 2 #+END_SRC -** wsl.conf - -With Windows 10 Build 17093 and later [[https://docs.microsoft.com/en-us/windows/wsl/wsl-config#set-wsl-launch-settings][certain functionality]] (automount options -and network configuration) in WSL can be configured inside the file -~/etc/wsl.conf~. - -No need to touch that file, just leave the defaults. - -** User +If you are not able to install WSL with this instructions here go have a look +at the official Microsoft docs +([[https://docs.microsoft.com/en-us/windows/wsl/install-win10][site]]) on how +to install WSL. -Instead of using root user it's better to add a user and use that as default -user. +* Install Ubuntu 20.04 -*** Add user +To install Ubuntu 20.04 open PowerShell and run: -#+BEGIN_SRC shell - sudo adduser +#+BEGIN_SRC text + curl.exe -L -o ubuntu-2004.appx https://aka.ms/wslubuntu2004 + Add-AppxPackage .\ubuntu-2004.appx #+END_SRC -*** Make it a sudo user +After installation open Start @@html:@@WIN@@html:@@ and launch the +~Ubuntu 20.04 LTS~ terminal. After a while you have to enter a username and a +password. This user will be your default user for the distribution and is +considered the Linux administrator with the ability to run sudo commands. -Make that user be a sudo user: +Make sure everything is up to date by running: #+BEGIN_SRC shell - sudo usermod -a -G sudo + sudo apt update && sudo apt upgrade -y #+END_SRC -*** Change default user +* Install Emacs 27.1 -Change the default user which is used when starting the WSL. +To install Emacs 27.1 in Ubuntu 20.04 -Open ~cmd.exe~ and run: +- use (double-click) the batch scripts (.bat) from the [[./install-emacs]] folder +- or clone this repo in the Ubuntu terminal and run the shell scipts from the + [[./install-emacs]] folder +- or run the following commands in the Ubuntu terminal: -#+BEGIN_SRC shell - ubuntu config --default-user -#+END_SRC -Restart WSL. +1. Install all dependencies (taken from the [[https://github.com/alexmurray/emacs-snap/blob/master/snapcraft.yaml][snap]]): + #+BEGIN_SRC shell + sudo apt update + sudo apt install -y autoconf automake bsd-mailx dbus-x11 debhelper dpkg-dev \ + libacl1-dev libasound2-dev libdbus-1-dev libgif-dev libgnutls28-dev libgpm-dev \ + libgtk-3-dev libjansson-dev libjpeg-dev liblcms2-dev liblockfile-dev libm17n-dev \ + libncurses5-dev liboss4-salsa2 libotf-dev libpng-dev librsvg2-dev \ + libselinux1-dev libsystemd-dev libtiff-dev libxml2-dev libxpm-dev procps quilt \ + sharutils texinfo zlib1g-dev gvfs language-pack-en-base libasound2 libaspell15 \ + libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libbrotli1 \ + libcairo-gobject2 libcairo2 libcanberra-gtk3-0 libcanberra-gtk3-module \ + libcanberra0 libcroco3 libdatrie1 libdb5.3 libdrm2 libegl1 libenchant1c2a \ + libepoxy0 libflac8 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf2.0-0 \ + libgif7 libgl1 libglvnd0 libglx0 libgpm2 libgraphite2-3 libgstreamer-gl1.0-0 \ + libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-0 libgudev-1.0-0 \ + libharfbuzz-icu0 libharfbuzz0b libhyphen0 libice6 libicu66 libjansson4 \ + libjavascriptcoregtk-4.0-18 libjbig0 libjpeg-turbo8 liblcms2-2 liblockfile1 \ + libltdl7 libm17n-0 libnotify4 libnss-mdns libnss-myhostname libnss-systemd \ + libogg0 liborc-0.4-0 libotf0 libpango-1.0-0 libpangocairo-1.0-0 \ + libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libpulse0 librsvg2-2 libsasl2-2 \ + libsecret-1-0 libsm6 libsndfile1 libsoup2.4-1 libssl1.1 libstdc++6 libtdb1 \ + libthai0 libtiff5 libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-client0 \ + libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebp6 libwebpdemux2 \ + libwoff1 libx11-6 libx11-xcb1 libxau6 libxcb-render0 libxcb-shm0 libxcb1 \ + libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 \ + libxinerama1 libxkbcommon0 libxml2 libxpm4 libxrandr2 libxrender1 libxslt1.1 \ + libyajl2 + #+END_SRC + There will be a dialog about the mail server configuration, just select ~no + configuration~ to leave it as it is and confirm with OK. -You can change the default back to root by using ~root~ as username. To change -to root inside WSL temporarily use ~sudo su -~. + If you are on ~Ubuntu 18.04~ use the dependencies from + [[./install-emacs/ubuntu-18.04-dependencies.sh]]. In that case you will also have + to modify the scripts (if you plan to use them) as the distribution is + hardcoded into them to make sure to use the right distribution even it is not + set as default yet. -** Ssh key +2. Download Emacs: + #+BEGIN_SRC shell + cd ~ + wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz + tar -xzvf emacs-27.1.tar.gz + #+END_SRC -Generate a new ED25519 SSH key pair: +3. Configure and install Emacs: + #+BEGIN_SRC shell + cd ~/emacs-27.1 + ./configure --with-cairo + make + sudo make install + rm ~/emacs-27.1.tar.gz + #+END_SRC + Keeps the directory where Emacs was cloned to in case any step fails (to + clean or reinstall) or to be able to reconfigure. -#+BEGIN_SRC shell - ssh-keygen -t ed25519 -C "email@example.com" -#+END_SRC +To try out if Emacs is working just run it directly in the terminal with ~emacs +-nw~. -A dialog will ask you to: +* Install Windows X-Server VcXsrv -- input a file path: use the suggested path by pressing ~Enter~ -- enter a password: enter your password +An X-server lets you access a Linux application or desktop environment’s graphic +user interface (GUI). This guide is using [[https://sourceforge.net/projects/vcxsrv/][VcXsrv]] (free, open source, GPLv3). -To copy the generated ssh key into the clipboard use: +** Installation -#+BEGIN_SRC shell - clip.exe < ~/.ssh/id_ed25519.pub -#+END_SRC +Download VcXsrv from [[https://sourceforge.net/projects/vcxsrv/]] and install it. +Check out the next section about the firewall configuration before launching it. -** Language +** Windows Defender Firewall Configuration -This might be needed: +The first time you launch VcXsrv you are notified that Windows Defender Firewall +has blocked some features. -#+BEGIN_SRC shell - sudo update-locale LANG=en_US.UTF8 -#+END_SRC +#+caption: Windows Defend Firewall Dialog +[[./img/vcxsrv-windows-defender-firewall.png]] -** Mount drives +You have to allow VcXsrv to communicate on: -*** Temporarily +- ~WSL 1~ Private networks +- ~WSL 2~ Private and public networks. -You can mount network drives temporarily with: +After allowing access the following inbound rules are added: -#+BEGIN_SRC shell - # mount a mapped drive - sudo mkdir /mnt/g - sudo mount -t drvfs G: /mnt/g - # unmout - sudo umount /mnt/g - # mount network location - sudo mount -t drvfs '\\server\share' /mnt/share -#+END_SRC +~WSl 1~ -All mounted drives are found under ~/mnt~: +[[./img/vcxsrv-wsl1-firewall-inbound-rules.png]] -#+BEGIN_SRC shell - cd /mnt - ls -#+END_SRC +~WSL 2~ -*** Automatically +[[./img/vcxsrv-wsl2-firewall-inbound-rules.png]] -To do so the fstab file needs to be configured. +If you missed this step or are not sure what you've chosen or if you are +switching from WSL 1 to WSL 2 you can retrigger this dialog by deleting the +inbound rules (admin rights needed) and restart VcXsrv. The inbound rules shown +above can be found at @@html:@@WIN@@html:@@ Windows Defender Firewall +> Advanced Settings (or @@html:@@WIN-r wf.msc RET@@html:@@). -For instance to mount ~H:~ add this to "/etc/fstab" (the directory has to exist to -make this work, so in this case ~sudo mkdir /mnt/h~ is needed beforehand): +*** WSL 2 Additional Firewall Configuration -#+BEGIN_SRC text - H: /mnt/h drvfs defaults 0 0 -#+END_SRC +To make VcXsrv work with ~WSL 2~ you have to disable access control. Disabling the +user access control with the ~-ac~ flag has some [[https://www.xfree86.org/current/Xserver.1.html][security issues]]: -** Zsh - -If you want to use [[https://en.wikipedia.org/wiki/Z_shell][zsh]] and [[https://ohmyz.sh/][oh-my-zsh]]: - -#+BEGIN_SRC shell - sudo apt install zsh - chsh -s $(which zsh) - sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" -#+END_SRC - -Restart WSL. - -* Install Emacs +#+BEGIN_QUOTE +-ac disables host-based access control mechanisms. Enables access by any host, +and permits any host to modify the access control list. Use with extreme +caution. This option exists primarily for running test suites remotely. +#+END_QUOTE -Install all dependencies for Emacs and then install Emacs 27.1: +Therefore we want to restrict the access as much as possible. Unfortunately you +can't modify the firewall rules if you have ~no admin rights~. In that case you +have to live with the security issue (not sure how severe it is). -#+BEGIN_SRC shell - ## install dependencies (got those from all over the net and from the snap) - - sudo apt install -y autoconf automake autotools-dev bsd-mailx build-essential \ - diffstat gnutls-dev imagemagick libasound2-dev libc6-dev libdatrie-dev \ - libdbus-1-dev libgconf2-dev libgif-dev libgnutls28-dev libgpm-dev libgtk2.0-dev \ - libgtk-3-dev libice-dev libjpeg-dev liblockfile-dev liblqr-1-0 libm17n-dev \ - libmagickwand-dev libncurses5-dev libncurses-dev libotf-dev libpng-dev \ - librsvg2-dev libsm-dev libthai-dev libtiff5-dev libtiff-dev libtinfo-dev libtool \ - libx11-dev libxext-dev libxi-dev libxml2-dev libxmu-dev libxmuu-dev libxpm-dev \ - libxrandr-dev libxt-dev libxtst-dev libxv-dev quilt sharutils texinfo xaw3dg \ - xaw3dg-dev xorg-dev xutils-dev zlib1g-dev libjansson-dev libxaw7-dev \ - libselinux1-dev libmagick++-dev libacl1-dev gir1.2-javascriptcoregtk-4.0 \ - gir1.2-webkit2-4.0 libenchant1c2a libglvnd-core-dev libicu-le-hb-dev \ - libidn2-0-dev libjavascriptcoregtk-4.0-dev liboss4-salsa2 libsoup2.4-dev \ - libsystemd-dev libwebkit2gtk-4.0-dev libx11-xcb-dev libxcb-dri2-0-dev \ - libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxshmfence-dev \ - x11proto-composite-dev x11proto-core-dev x11proto-damage-dev \ - x11proto-fixes-dev - - ## download and install - - cd ~ - wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz - tar -xzvf emacs-27.1.tar.gz - cd emacs-27.1 - ./configure - make - sudo make install - rm ~/emacs-27.1.tar.gz -#+END_SRC +If you have ~admin rights~ you can add an inbound firewall rule to restrict +access as much as possible. As the IP used by WSL 2 is dynamic a powershell +script is provided to create/update the rule. -Keeps the directory where Emacs was cloned to in case any step fails (to clean -or reinstall) or to be able to reconfigure. +Make sure that you disable the existing inbound rules: -There is also a [[emacs-27.1.sh][script]] included in the repository with those steps. +1. Go to the inbound rule settings with @@html:@@WIN@@html:@@ Windows + Defender Firewall > Advanced Settings (or @@html:@@WIN-r wf.msc + RET@@html:@@). +2. Search for VcXsrv entries (there should be two) and disable all found. * Run Emacs in Terminal -Run Emacs with ~emacs -nw~ to see if it is working. You can also see what path -it is using as home with ~C-h v user-emacs-directory~. That's where you can place -your init.el etc. +Run Emacs with ~emacs -nw~ in Ubuntu terminal. * Run Emacs in Graphical Display -To be able to run Emacs with a graphical display you need to install a Windows X -server. - -** Install Windows X-server - -An X-server lets you access a Linux application or desktop environment’s graphic -user interface (GUI). - -You can use [[https://sourceforge.net/projects/vcxsrv/][VcXsrv]] or [[https://x.cygwin.com/][Cygwin/X]]. Both are free and based on xorg. +To run Emacs in a graphical display you have to: -*** Install VcXsrv +- ~WSL 2 only~ Created/update the inbound firewall rule +- Run VcXsrv +- Run Emacs in Ubuntu terminal -Download VcXsrv from [[https://sourceforge.net/projects/vcxsrv/]] and install it. +For convenience there are batch scripts (double-clickable) to: -*** Install Cygwin/X +- ~WSL1~ + 1. Run VcXsrv [[./run-emacs/wsl1-vcxsrv.bat]] + 2. Run Emacs [[./run-emacs/wsl1-emacs.bat]] + 3. Run VcXsrv (1.) and then Emacs (2.) [[./run-emacs/wsl1-run-all.bat]] -You have to install Cygwin and install additional packages: +- ~WSL2~ + 1. Create/update the inbound firewall rule (admin rights needed). [[./run-emacs/wsl2-firewall-rule.bat]] + 2. Run VcXsrv [[./run-emacs/wsl2-vcxsrv.bat]] + 3. Run Emacs [[./run-emacs/wsl2-emacs.bat]] + 4. Firewall rule (1.) and VcXsrv (2.) [[./run-emacs/wsl2-firewall-rule-vcxsrv.bat]] + 5. Firewall rule (1.), VcXsrv (2.) and Emacs (3.) [[./run-emacs/wsl2-run-all.bat]] -- Download Cygwin from https://cygwin.com/install.html. -- Run the setup to install Cygwin. When you come to the ~select packages~ step - you have to add (change from skip to the newest version) ~xorg-server~ and - ~xinit~. If you want to use the wizard (GUI) for launching the X-Server add - ~xlaunch~ as well. -- If you missed that step you can easily add those packages later on by running - the setup again. - -** Run Emacs +** ~WSL 2 only~ Create/update the Inbound Firewall Rule -If you are using WSL2 some changes are needed. Make sure to also read the -[[#changes-needed-for-wsl2][section]] at the end of this one. +As described in [[#wsl-2-additional-firewall-configuration][WSL 2 Additional Firewall Configuration]] we want to restrict the +access by adding a firewall rule. Make sure you have disabled the existing +VcXsrv firewall rules. -*** Run the X-server +To create or update the inbound firewall rule you can use the batch script +[[./run-emacs/wsl2-firewall-rule.bat]]. If VcXsrv was running before the firewall +rules was updated it has to be restarted. -**** With XLaunch (GUI) +** Run VcXsrv -Start XLaunch and use the defaults: +To run VcXsrv use the batch script provided or run the following commands in cmd +(if you haven't used the default installation path you have to adapt the +script/command): -- Multiple Windows, Display number -1 (or 0 if not working), Next -- Start no client, Next -- Leave checkboxes, Additional parameters for X server: ~-listen tcp~, Next -- Finish +- ~WSL 1~ [[./run-emacs/wsl1-vcxsrv.bat]] + #+BEGIN_SRC bat + start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl + #+END_SRC +- ~WSL 2~ [[./run-emacs/wsl2-vcxsrv.bat]] + #+BEGIN_SRC bat + start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac + #+END_SRC + If you are using the additional firewall rule make sure to create/update the + rule before launching VcXsrv. -**** With a Shortcut +If VcXsrv is already running it will show an error message. In that case stop +VcXsrv to and run it again. -Make a shortcut (right click on your desktop > New > Shortcut) and use the -following as target. +** Run Emacs -- With VcXsrv: +To run Emacs you can launch Ubuntu terminal and run the following commands or +use the batch script: +- ~WSL1~ [[./run-emacs/wsl1-emacs.bat]] #+BEGIN_SRC shell - # Change the path if installed somewhere else. - "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl + export DISPLAY=:0.0 + export LIBGL_ALWAYS_INDIRECT=1 + setsid emacs #+END_SRC - -- With Cygwin/X: - +- ~WSL2~ [[./run-emacs/wsl2-emacs.bat]] #+BEGIN_SRC shell - # Change the path if installed somewhere else. - "C:\cygwin64\bin\run.exe" --quote /usr/bin/bash.exe -l -c "XWin :0 -listen tcp -multiwindow -clipboard -wgl" + export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0 + export LIBGL_ALWAYS_INDIRECT=1 + setsid emacs #+END_SRC -You can put the shortcut into the startup folder to start it when booting. Or -stick it to the task bar to launch it from there. +You can add the lines without ~setsid emacs~ to ~~/.bashrc~ and then just use +~setsid emacs~ to launch Emacs in the background. + +* Optional Additions -**** From command line +** Change keyboard layout -You can use the command from the [[*With a Shortcut][Shortcut]] also from the command line. +If you want to change the keyboard layout used make sure ~x11-xkb-utils~ is +installed (~sudo apt install x11-xkb-utils~) and add for instance ~setxkbmap +-layout us~ to ~~/.bashrc~ to use the US keyboard layout -*** Run Emacs from WSL +** Ssh key -Open WSL and run (this also changes the keyboard layout to US, remove if -you don't want this. Then it should use your default keyboard layout.): +Generate a new ED25519 SSH key pair: #+BEGIN_SRC shell - export DISPLAY=:0.0 - export LIBGL_ALWAYS_INDIRECT=1 - # OPTIONAL Set the keyboard layout to US - setxkbmap -layout us - setsid emacs - exit + ssh-keygen -t ed25519 -C "email@example.com" #+END_SRC -This will open Emacs in a new window. By using setsid this is done in a new -session and therefore the WSL can be closed after with exit. You can just change -it to ~emacs~ and remove ~exit~ if you want. Make sure ~x11-xkb-utils~ is -installed (~sudo apt install x11-xkb-utils~) if you want to change the keyboard layout. +A dialog will ask you to: -To not have to type this over and over make an alias in =~/.bashrc= or if you -installed zsh in =~/.zshrc=: +- input a file path: use the suggested path by pressing ~Enter~ +- enter a password: enter your password + +To copy the generated ssh key into the clipboard use: #+BEGIN_SRC shell - alias eme=' - export DISPLAY=:0.0 - export LIBGL_ALWAYS_INDIRECT=1 - setxkbmap -layout us - setsid emacs - exit - ' + clip.exe < ~/.ssh/id_ed25519.pub #+END_SRC -Now you can fire WSL up and run ~eme~. +** Use en_US Language -**** Desktop shortcut +Bash on Ubuntu on Windows starts on the language defined in your Country or +Region settings (maybe this got changed, not 100 % sure). If you want to change +the default language to en_US you may need to run the following commands: -You can create a shortcut on your desktop to launch Emacs. Create a new file -named ~emacs-wsl.vbs~ on your desktop with the following content (change ~bash~ -to ~zsh~ if you are using it): - -#+BEGIN_SRC text - Set oShell = CreateObject ("Wscript.Shell") - Dim strArgs - strArgs = "wsl bash -c 'export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && emacs'" - oShell.Run strArgs, 0, false +#+BEGIN_SRC shell + sudo apt install -y language-pack-en language-pack-en-base manpages + sudo locale-gen en_US.UTF-8 + sudo update-locale LANG=en_US.UTF8 #+END_SRC -Now you can launch Emacs in WSL by double-clicking the file. +** Mount network drives automatically -**** Changes needed for WSL2 -:PROPERTIES: -:CUSTOM_ID: changes-needed-for-wsl2 -:END: - -Was not able to test this so far but according to multiple sources this should -work. Check out the open issue #3 for -more. +To do so the fstab file needs to be configured. -To make this work on WSL2 you have to disable access control in VcXsrv by -changing the link to (added ~-ac~ flag): +For instance to mount ~H:~ add this to "/etc/fstab" (the directory has to exist to +make this work, so in this case ~sudo mkdir /mnt/h~ is needed beforehand): -#+BEGIN_SRC shell - # Change the path if installed somewhere else. - "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac +#+BEGIN_SRC text + H: /mnt/h drvfs defaults 0 0 #+END_SRC -And to run Emacs you need to use this: - -#+BEGIN_SRC shell - export DISPLAY_NUMBER="0.0" - export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):$DISPLAY_NUMBER - export LIBGL_ALWAYS_INDIRECT=1 - # OPTIONAL Set the keyboard layout to US - setxkbmap -layout us - setsid emacs - exit -#+END_SRC -* Remarks +From now on that network drive is automatically mounted. -** Accessing Linux files from Windows +** Zsh and oh-my-zsh -Don't touch your Linux files from Windows. Creating and changing Linux files -from Windows can result in losing files or corrupting data. +If you want to use [[https://en.wikipedia.org/wiki/Z_shell][zsh]] and [[https://ohmyz.sh/][oh-my-zsh]]: -This also means that if you want to for instance copy a file into your subsystem -this has to be done from inside the WSL. +#+BEGIN_SRC shell + sudo apt install zsh + chsh -s $(which zsh) + sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +#+END_SRC -Looks like this is getting better if one has Windows 10 Version 1903 or newer: +Restart WSL. -#+begin_quote -[[https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/][whats-new-for-wsl-in-windows-10-version-1903]] -#+end_quote +In some scripts you need to change bash to zsh to be able to use it when +emulating a terminal in Emacs. * FAQ ** Where is the root folder located? -It's in ~%LOCALAPPDATA%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs~ -See [[https://superuser.com/a/1280916]]. +The root is accessible as ~\\wsl$~ in file explorer followed by the +distribution. You can show the current distribution name by running ~wsl -l -q~ +in cmd. + +** How to access Linux files from Windows? -** How start WSL from Windows Explorer in the current folder? +Run ~explorer.exe .~ in WSL to open the Windows File Explorer at the current +location. The path will start with ~\\wsl$~ unless it is a mounted drive. In the +File Explorer the files and folders can be copied, moved and edited as usual +(see this blog [[https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/][post]]). -To start WSL from Windows Explorer just type ~wsl~ into the location input box: +** How start WSL from File Explorer in the current folder? + +To start WSL from Windows File Explorer just type ~wsl~ into the location input +box or hold down ~Shift~ while right-clicking and select ~Open Linux shell here~ +from the context menu. If it's a network drive it has to be mounted else this +will not work. #+caption: WSL from windows explorer [[./img/wsl-from-windows-explorer.png]] -The drive has to be mounted else it will not work. - ** What ways are there to run WSL? See [[https://docs.microsoft.com/en-us/windows/wsl/wsl-config#ways-to-run-wsl]]. + +* Troubleshooting + +Check out the Microsoft docs: + +- [[https://docs.microsoft.com/en-us/windows/wsl/install-win10#troubleshooting-installation][WSL troubleshooting installation]] +- [[https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#common-issues][WSL troubleshooting page]] + +** The GUI is not loading/showing at all + +Check your firewall settings. + diff --git a/batch-scripts/wsl1-emacs.bat b/batch-scripts/wsl1-emacs.bat deleted file mode 100644 index 89c3432..0000000 --- a/batch-scripts/wsl1-emacs.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -wsl bash -c "export DISPLAY=:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" -@REM wsl zsh -c "export DISPLAY=:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" \ No newline at end of file diff --git a/batch-scripts/wsl2-emacs.bat b/batch-scripts/wsl2-emacs.bat deleted file mode 100644 index 8f5f738..0000000 --- a/batch-scripts/wsl2-emacs.bat +++ /dev/null @@ -1,22 +0,0 @@ -@REM WSL2 - Launch Emacs - -@echo off - -SETLOCAL -@REM Get the IP to use from wsl and set to a variable. -for /F "tokens=* USEBACKQ" %%F IN (`wsl bash -c "ip route | awk '/default via /' | cut -d ' ' -f3"`) DO ( -set mywslip=%%F -) -@REM Run Emacs. -wsl bash -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" - -@REM If you want to change the keyboard layout to US. -@REM x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). -@REM wsl bash -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" - -@REM If you want to use zsh. -@REM wsl zsh -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" - -ENDLOCAL - -exit /b 0 \ No newline at end of file diff --git a/batch-scripts/wsl2-run-all.bat b/batch-scripts/wsl2-run-all.bat deleted file mode 100644 index 43e8fbc..0000000 --- a/batch-scripts/wsl2-run-all.bat +++ /dev/null @@ -1,26 +0,0 @@ -@echo off -@REM start /wait powershell -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-firewall-rule.ps1'" - -@REM start /wait powershell -WindowStyle Hidden -Wait -NoProfile -ExecutionPolicy Bypass ` -@REM -Command "&{ start-process powershell -Wait -NoNewWindow -WindowStyle Hidden '-NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-firewall-rule.ps1'"-noprofile -file C:\script\psfile.ps1' -verb RunAs}" - -start /wait PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -Wait '-NoProfile -ExecutionPolicy Bypass -Command ""& './wsl2-firewall-rule.ps1'""' -Verb RunAs}"; - -echo after powershell - -pause -call wsl2-vcxsrv.bat -if errorlevel 1 ( - echo VcXsrv is already running. - echo. - echo VcXsrv has to be run after adding the firewall rule. - echo Please terminate VcXsrv and run this script again. - echo. - pause - exit 1 -) - -echo emacs -pause -call wsl2-emacs.bat -exit 0 \ No newline at end of file diff --git a/batch-scripts/wsl2-vcxsrv.bat b/batch-scripts/wsl2-vcxsrv.bat deleted file mode 100644 index e519dc2..0000000 --- a/batch-scripts/wsl2-vcxsrv.bat +++ /dev/null @@ -1,13 +0,0 @@ -@REM WSL2 - Start VcXsrv - -@echo off - -@REM Can't start it again if it is already running. -tasklist /fi "imagename eq vcxsrv.exe" | find ":" > nul -if errorlevel 1 ( - exit /b 1 -) - -@REM Start vcxsrv with the flags needed. -start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac -exit /b 0 \ No newline at end of file diff --git a/emacs-27.1.sh b/emacs-27.1.sh deleted file mode 100755 index eaa0ace..0000000 --- a/emacs-27.1.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Install Emacs 27.1 - -## Install dependencies (got those from all over the net and from the snap) - -sudo apt install -y autoconf automake autotools-dev bsd-mailx build-essential \ - diffstat gnutls-dev imagemagick libasound2-dev libc6-dev libdatrie-dev \ - libdbus-1-dev libgconf2-dev libgif-dev libgnutls28-dev libgpm-dev libgtk2.0-dev \ - libgtk-3-dev libice-dev libjpeg-dev liblockfile-dev liblqr-1-0 libm17n-dev \ - libmagickwand-dev libncurses5-dev libncurses-dev libotf-dev libpng-dev \ - librsvg2-dev libsm-dev libthai-dev libtiff5-dev libtiff-dev libtinfo-dev libtool \ - libx11-dev libxext-dev libxi-dev libxml2-dev libxmu-dev libxmuu-dev libxpm-dev \ - libxrandr-dev libxt-dev libxtst-dev libxv-dev quilt sharutils texinfo xaw3dg \ - xaw3dg-dev xorg-dev xutils-dev zlib1g-dev libjansson-dev libxaw7-dev \ - libselinux1-dev libmagick++-dev libacl1-dev gir1.2-javascriptcoregtk-4.0 \ - gir1.2-webkit2-4.0 libenchant1c2a libglvnd-core-dev libicu-le-hb-dev \ - libidn2-0-dev libjavascriptcoregtk-4.0-dev liboss4-salsa2 libsoup2.4-dev \ - libsystemd-dev libwebkit2gtk-4.0-dev libx11-xcb-dev libxcb-dri2-0-dev \ - libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxshmfence-dev \ - x11proto-composite-dev x11proto-core-dev x11proto-damage-dev \ - x11proto-fixes-dev - -## Download and install Emacs 27.1 -## Keeps the directory where emacs was cloned to in case any step fails (to -## clean or reinstall) or to be able to reconfigure - -cd ~ -wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz -tar -xzvf emacs-27.1.tar.gz -cd emacs-27.1 -./configure -make -sudo make install -rm ~/emacs-27.1.tar.gz diff --git a/packages.org b/packages.org deleted file mode 100644 index f2cbb76..0000000 --- a/packages.org +++ /dev/null @@ -1,195 +0,0 @@ -* Packages to install - -This a collection of packages I found as dependencies to build and run emacs. -It is quite possible that some of those packages are not needed at all. - -List: - -autoconf -automake -autotools-dev -bsd-mailx -build-essential -dbus-x11 -debhelper -diffstat -dpkg-dev -gir1.2-javascriptcoregtk-4.0 -gir1.2-webkit2-4.0 -gnutls-dev -gvfs -language-pack-en-base -libacl1-dev -libasound2 -libasound2-dev -libaspell15 -libasyncns0 -libatk1.0-0 -libatk-bridge2.0-0 -libatspi2.0-0 -libbrotli1 -libc6-dev -libcairo2 -libcairo-gobject2 -libcanberra0 -libcanberra-gtk3-0 -libcanberra-gtk3-module -libcroco3 -libdatrie1 -libdatrie-dev -libdb5.3 -libdbus-1-dev -libdrm2 -libegl1 -libenchant1c2a -libepoxy0 -libflac8 -libfontconfig1 -libfreetype6 -libgbm1 -libgconf2-dev -libgdk-pixbuf2.0-0 -libgif7 -libgif-dev -libgl1 -libglvnd0 -libglvnd-core-dev -libglx0 -libgnutls28-dev -libgpm2 -libgpm-dev -libgraphite2-3 -libgstreamer1.0-0 -libgstreamer-gl1.0-0 -libgstreamer-plugins-base1.0-0 -libgtk2.0-dev -libgtk-3-0 -libgtk-3-dev -libgudev-1.0-0 -libharfbuzz0b -libharfbuzz-icu0 -libhyphen0 -libice6 -libice-dev -libicu60 -libicu-le-hb-dev -libidn2-0-dev -libjansson4 -libjansson-dev -libjavascriptcoregtk-4.0-18 -libjavascriptcoregtk-4.0-dev -libjbig0 -libjpeg-dev -libjpeg-turbo8 -liblcms2-2 -liblcms2-dev -liblockfile1 -liblockfile-dev -liblqr-1-0 -libltdl7 -libm17n-0 -libm17n-dev -libmagick++-dev -libncurses5-dev -libncurses-dev -libnotify4 -libnss-mdns -libnss-myhostname -libnss-systemd -libogg0 -liborc-0.4-0 -liboss4-salsa2 -libotf0 -libotf-dev -libpango-1.0-0 -libpangocairo-1.0-0 -libpangoft2-1.0-0 -libpixman-1-0 -libpng16-16 -libpng-dev -libpulse0 -librsvg2-2 -librsvg2-dev -libsasl2-2 -libsecret-1-0 -libselinux1-dev -libsm6 -libsm-dev -libsndfile1 -libsoup2.4-1 -libsoup2.4-dev -libssl1.1 -libstdc++6 -libsystemd-dev -libtdb1 -libthai0 -libthai-dev -libtiff5 -libtiff5-dev -libtiff-dev -libtinfo-dev -libtool -libvorbis0a -libvorbisenc2 -libvorbisfile3 -libwayland-client0 -libwayland-cursor0 -libwayland-egl1 -libwayland-server0 -libwebkit2gtk-4.0-37 -libwebkit2gtk-4.0-dev -libwebp6 -libwebpdemux2 -libwoff1 -libx11-6 -libx11-dev -libx11-xcb1 -libx11-xcb-dev -libxau6 -libxaw7-dev -libxcb1 -libxcb-dri2-0-dev -libxcb-dri3-dev -libxcb-glx0-dev -libxcb-present-dev -libxcb-render0 -libxcb-shm0 -libxcomposite1 -libxcursor1 -libxdamage1 -libxdmcp6 -libxext6 -libxext-dev -libxfixes3 -libxi6 -libxi-dev -libxinerama1 -libxkbcommon0 -libxml2 -libxml2-dev -libxmu-dev -libxmuu-dev -libxpm4 -libxpm-dev -libxrandr2 -libxrandr-dev -libxrender1 -libxshmfence-dev -libxslt1.1 -libxt-dev -libxtst-dev -libxv-dev -libyajl2 -procps -quilt -sharutils -texinfo -x11proto-composite-dev -x11proto-core-dev -x11proto-damage-dev -x11proto-fixes-dev -xaw3dg -xaw3dg-dev -xorg-dev -xutils-dev -zlib1g-dev \ No newline at end of file diff --git a/ps-scripts/test.bat b/ps-scripts/test.bat deleted file mode 100644 index fb5fd83..0000000 --- a/ps-scripts/test.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" \ No newline at end of file diff --git a/ps-scripts/works.bat b/ps-scripts/works.bat deleted file mode 100644 index a098475..0000000 --- a/ps-scripts/works.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -@REM powershell -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" -powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" \ No newline at end of file diff --git a/ps-scripts/wsl2-emacs.ps1 b/ps-scripts/wsl2-emacs.ps1 deleted file mode 100644 index b7e4e61..0000000 --- a/ps-scripts/wsl2-emacs.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -# WSL2 - Launch Emacs - -# Get the IP to use from wsl and set to a variable. -$wslip = wsl -d Ubuntu-20.04 bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' - -# Run Emacs -wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" - -# If you want to change the keyboard layout to US. -# x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). -# wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" - -# If you want to use zsh. -# wsl -d Ubuntu-20.04 zsh -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" diff --git a/ps-scripts/wsl2-firewall-rule.ps1 b/ps-scripts/wsl2-firewall-rule.ps1 deleted file mode 100644 index 72f38a2..0000000 --- a/ps-scripts/wsl2-firewall-rule.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -# WSL2 - Add inbound fireall rule - -# Started here and somehow found all I need: -# https://stackoverflow.com/a/61110604/1365754 - -# If the current console is not elevated then pass the script to a new elevated powershell process. -if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { - Start-Process PowerShell -Verb RunAs -Wait "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`""; - exit; -} - -# Add the firewall rule. - -Import-Module -Name 'NetSecurity' - -$rulename = 'WSL 2 Firewall Unlock' -$programname = 'C:\program files\vcxsrv\vcxsrv.exe' -$localport = 6000 - -# Get the remote ip. -$remoteip = wsl -d Ubuntu-20.04 bash -c "ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'" -$remoteipfound = $remoteip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; -if( !$remoteipfound ){ - Write-Output "The Script exited, the remote ip address cannot be found"; - exit; -} - -## Get the local ip. -$localip = wsl -d Ubuntu-20.04 bash -c 'ip route | awk ''/default via /'' | cut -d'' '' -f3' -$localipfound = $localip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; -if( !$localipfound ){ - Write-Output "The Script Exited, the local ip address cannot be found"; - exit; -} - -## Delete the rule if it exists already. -$rulefound = Get-NetFirewallRule -DisplayName $rulename 2> $null; -if ($rulefound) { - Remove-NetFireWallRule -DisplayName $rulename -} - -## Add the new rule. -New-NetFireWallRule -DisplayName $rulename -Direction Inbound -InterfaceType Wired ` --LocalAddress $localip -RemoteAddress $remoteip -Action Allow ` --Protocol TCP -LocalPort $localport -Program $programname diff --git a/ps-scripts/wsl2-run-all.ps1 b/ps-scripts/wsl2-run-all.ps1 deleted file mode 100644 index ae23c83..0000000 --- a/ps-scripts/wsl2-run-all.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -$vcxsrv = Get-Process vcxsrv -ErrorAction SilentlyContinue -if ($vcxsrv) { - Write-Host (` - "VcXsrv is already running.`n`n" ` - + "VcXsrv has to be run after adding the firewall rule.`n" ` - + "Please terminate VcXsrv and run the script again.`n`n" ` - + "Press any key to exit...") - [void][System.Console]::ReadKey($true) - exit 1 -} - -Write-Host "`nAdding the firewall rule" -& .\wsl2-firewall-rule.ps1 - -Write-Host "`nStarting VcXsrv" -& .\wsl2-vcxsrv.ps1 - -Write-Host "`nLaunching Emacs" -& .\wsl2-emacs.ps1 \ No newline at end of file diff --git a/ps-scripts/wsl2-vcxsrv.ps1 b/ps-scripts/wsl2-vcxsrv.ps1 deleted file mode 100644 index 9e54f15..0000000 --- a/ps-scripts/wsl2-vcxsrv.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -# WSL2 - Start VcXsrv - -# Stop vcxsrv (if already running it needs to be restarted) -$vcxsrv = Get-Process vcxsrv -ErrorAction SilentlyContinue -if ($vcxsrv) { - Write-Host (` - "VcXsrv is already running.`n`n" ` - + "Press any key to exit...") - [void][System.Console]::ReadKey($true) - exit 1 - # This could be used to stop the process if it is running. - # $vcxsrvid = $vcxsrv.id - # Stop-Process -Id $vcxsrvid - # Wait-Process -Id $vcxsrvid -} - -# Start vcxsrv with the flags needed. -& "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac \ No newline at end of file From b74d62275c76e693cd62d29e51b1d6da61878415 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 00:34:28 +0100 Subject: [PATCH 17/31] small fixes --- README.org | 57 ++++++++++++++++++++-------------------- run-emacs/wsl1-emacs.bat | 7 ----- run-emacs/wsl2-emacs.ps1 | 7 ----- 3 files changed, 28 insertions(+), 43 deletions(-) diff --git a/README.org b/README.org index e52ed8d..bf9e1d2 100644 --- a/README.org +++ b/README.org @@ -42,16 +42,15 @@ Restart the computer. Download and install the [[https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi][Linux kernel update package]]. -If you use ~WSL 2~ you have to set it as default before intstalling Ubuntu: +If you want to use ~WSL 2~ you should set it as default before intstalling +Ubuntu: #+BEGIN_SRC fundamental wsl --set-default-version 2 #+END_SRC -If you are not able to install WSL with this instructions here go have a look -at the official Microsoft docs -([[https://docs.microsoft.com/en-us/windows/wsl/install-win10][site]]) on how -to install WSL. +If you are not able to install WSL with this instructions go have a look at the +official Microsoft docs ([[https://docs.microsoft.com/en-us/windows/wsl/install-win10][site]]) on how to install WSL. * Install Ubuntu 20.04 @@ -62,12 +61,13 @@ To install Ubuntu 20.04 open PowerShell and run: Add-AppxPackage .\ubuntu-2004.appx #+END_SRC -After installation open Start @@html:@@WIN@@html:@@ and launch the -~Ubuntu 20.04 LTS~ terminal. After a while you have to enter a username and a -password. This user will be your default user for the distribution and is -considered the Linux administrator with the ability to run sudo commands. +After installation open Start (@@html:@@WIN@@html:@@) and launch the +~Ubuntu 20.04 LTS~ terminal. After a short while you will be prompted to enter a +username and a password. This user will be your default user for the +distribution and is considered the Linux administrator with the ability to run +sudo commands. -Make sure everything is up to date by running: +Finish the installation by making sure everything is up to date: #+BEGIN_SRC shell sudo apt update && sudo apt upgrade -y @@ -75,14 +75,13 @@ Make sure everything is up to date by running: * Install Emacs 27.1 -To install Emacs 27.1 in Ubuntu 20.04 +To install Emacs 27.1 in Ubuntu 20.04 you can -- use (double-click) the batch scripts (.bat) from the [[./install-emacs]] folder +- use (double-click) the three batch scripts (.bat) from the [[./install-emacs]] folder - or clone this repo in the Ubuntu terminal and run the shell scipts from the [[./install-emacs]] folder - or run the following commands in the Ubuntu terminal: - 1. Install all dependencies (taken from the [[https://github.com/alexmurray/emacs-snap/blob/master/snapcraft.yaml][snap]]): #+BEGIN_SRC shell sudo apt update @@ -118,7 +117,7 @@ To install Emacs 27.1 in Ubuntu 20.04 [[./install-emacs/ubuntu-18.04-dependencies.sh]]. In that case you will also have to modify the scripts (if you plan to use them) as the distribution is hardcoded into them to make sure to use the right distribution even it is not - set as default yet. + set as default. 2. Download Emacs: #+BEGIN_SRC shell @@ -197,9 +196,10 @@ have to live with the security issue (not sure how severe it is). If you have ~admin rights~ you can add an inbound firewall rule to restrict access as much as possible. As the IP used by WSL 2 is dynamic a powershell -script is provided to create/update the rule. +script is provided later on to create/update the rule. -Make sure that you disable the existing inbound rules: +If you want ot used the additional firewall rule make sure that you disable the +existing inbound rules: 1. Go to the inbound rule settings with @@html:@@WIN@@html:@@ Windows Defender Firewall > Advanced Settings (or @@html:@@WIN-r wf.msc @@ -214,23 +214,23 @@ Run Emacs with ~emacs -nw~ in Ubuntu terminal. To run Emacs in a graphical display you have to: -- ~WSL 2 only~ Created/update the inbound firewall rule -- Run VcXsrv -- Run Emacs in Ubuntu terminal +1. ~WSL 2 only, optional~ Created/update the inbound firewall rule (admin rights needed) +2. Run VcXsrv +3. Run Emacs in Ubuntu terminal For convenience there are batch scripts (double-clickable) to: - ~WSL1~ 1. Run VcXsrv [[./run-emacs/wsl1-vcxsrv.bat]] 2. Run Emacs [[./run-emacs/wsl1-emacs.bat]] - 3. Run VcXsrv (1.) and then Emacs (2.) [[./run-emacs/wsl1-run-all.bat]] + 3. Run VcXsrv and then Emacs [[./run-emacs/wsl1-run-all.bat]] - ~WSL2~ 1. Create/update the inbound firewall rule (admin rights needed). [[./run-emacs/wsl2-firewall-rule.bat]] 2. Run VcXsrv [[./run-emacs/wsl2-vcxsrv.bat]] 3. Run Emacs [[./run-emacs/wsl2-emacs.bat]] - 4. Firewall rule (1.) and VcXsrv (2.) [[./run-emacs/wsl2-firewall-rule-vcxsrv.bat]] - 5. Firewall rule (1.), VcXsrv (2.) and Emacs (3.) [[./run-emacs/wsl2-run-all.bat]] + 4. Firewall rule and VcXsrv [[./run-emacs/wsl2-firewall-rule-vcxsrv.bat]] + 5. Firewall rule, VcXsrv and Emacs [[./run-emacs/wsl2-run-all.bat]] ** ~WSL 2 only~ Create/update the Inbound Firewall Rule @@ -260,7 +260,7 @@ script/command): rule before launching VcXsrv. If VcXsrv is already running it will show an error message. In that case stop -VcXsrv to and run it again. +VcXsrv if needed and run the script again. ** Run Emacs @@ -280,7 +280,7 @@ use the batch script: setsid emacs #+END_SRC -You can add the lines without ~setsid emacs~ to ~~/.bashrc~ and then just use +You can add the lines without ~setsid emacs~ to ~\~/.bashrc~ and then just use ~setsid emacs~ to launch Emacs in the background. * Optional Additions @@ -289,9 +289,9 @@ You can add the lines without ~setsid emacs~ to ~~/.bashrc~ and then just use If you want to change the keyboard layout used make sure ~x11-xkb-utils~ is installed (~sudo apt install x11-xkb-utils~) and add for instance ~setxkbmap --layout us~ to ~~/.bashrc~ to use the US keyboard layout +-layout us~ to ~\~/.bashrc~ to use the US keyboard layout -** Ssh key +** Generate SSH Key Generate a new ED25519 SSH key pair: @@ -322,7 +322,7 @@ the default language to en_US you may need to run the following commands: sudo update-locale LANG=en_US.UTF8 #+END_SRC -** Mount network drives automatically +** Mount Network Drives Automatically To do so the fstab file needs to be configured. @@ -388,5 +388,4 @@ Check out the Microsoft docs: ** The GUI is not loading/showing at all -Check your firewall settings. - +Check your firewall settings (see [[#wsl-2-additional-firewall-configuration][WSL 2 Additional Firewall Configuration]]). diff --git a/run-emacs/wsl1-emacs.bat b/run-emacs/wsl1-emacs.bat index 3fd1814..d3ec3e0 100644 --- a/run-emacs/wsl1-emacs.bat +++ b/run-emacs/wsl1-emacs.bat @@ -1,10 +1,3 @@ @echo off wsl -d Ubuntu-20.04 bash -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" - -@REM If you want to change the keyboard layout to US. -@REM x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). -@REM wsl -d Ubuntu-20.04 bash -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" - -@REM If you want to use zsh. -@REM wsl -d Ubuntu-20.04 zsh -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" diff --git a/run-emacs/wsl2-emacs.ps1 b/run-emacs/wsl2-emacs.ps1 index b7e4e61..2c35061 100644 --- a/run-emacs/wsl2-emacs.ps1 +++ b/run-emacs/wsl2-emacs.ps1 @@ -5,10 +5,3 @@ $wslip = wsl -d Ubuntu-20.04 bash -c 'ip route | awk ''/default via /'' | cut -d # Run Emacs wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" - -# If you want to change the keyboard layout to US. -# x11-xkb-utils needs to be installed (sudo apt install x11-xkb-utils). -# wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" - -# If you want to use zsh. -# wsl -d Ubuntu-20.04 zsh -c "export DISPLAY=%mywslip%:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" From 847f89e8d956308062db6cf2413e3aef38cbd344 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 00:36:33 +0100 Subject: [PATCH 18/31] fix spelling --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index bf9e1d2..3665768 100644 --- a/README.org +++ b/README.org @@ -240,7 +240,7 @@ VcXsrv firewall rules. To create or update the inbound firewall rule you can use the batch script [[./run-emacs/wsl2-firewall-rule.bat]]. If VcXsrv was running before the firewall -rules was updated it has to be restarted. +rule was updated it has to be restarted. ** Run VcXsrv From 0e08674595fb1cce4cc248db77811b5a5d4c9b96 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 00:37:41 +0100 Subject: [PATCH 19/31] dum de dum --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 3665768..35e78f9 100644 --- a/README.org +++ b/README.org @@ -216,7 +216,7 @@ To run Emacs in a graphical display you have to: 1. ~WSL 2 only, optional~ Created/update the inbound firewall rule (admin rights needed) 2. Run VcXsrv -3. Run Emacs in Ubuntu terminal +3. Run Emacs For convenience there are batch scripts (double-clickable) to: From 1e4aee9d3ae42685d5d241f1f8dc4c80ef64fa3f Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 00:38:55 +0100 Subject: [PATCH 20/31] of course like this --- README.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 35e78f9..7253021 100644 --- a/README.org +++ b/README.org @@ -280,7 +280,7 @@ use the batch script: setsid emacs #+END_SRC -You can add the lines without ~setsid emacs~ to ~\~/.bashrc~ and then just use +You can add the lines without ~setsid emacs~ to =~/.bashrc= and then just use ~setsid emacs~ to launch Emacs in the background. * Optional Additions @@ -289,7 +289,7 @@ You can add the lines without ~setsid emacs~ to ~\~/.bashrc~ and then just use If you want to change the keyboard layout used make sure ~x11-xkb-utils~ is installed (~sudo apt install x11-xkb-utils~) and add for instance ~setxkbmap --layout us~ to ~\~/.bashrc~ to use the US keyboard layout +-layout us~ to =~/.bashrc= to use the US keyboard layout ** Generate SSH Key From 8f4fc797da5645d3694cbbc6b13fa002d5c1f426 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 06:57:53 +0100 Subject: [PATCH 21/31] small last change hopefully --- README.org | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 7253021..20a8ff1 100644 --- a/README.org +++ b/README.org @@ -56,7 +56,7 @@ official Microsoft docs ([[https://docs.microsoft.com/en-us/windows/wsl/install- To install Ubuntu 20.04 open PowerShell and run: -#+BEGIN_SRC text +#+BEGIN_SRC fundamental curl.exe -L -o ubuntu-2004.appx https://aka.ms/wslubuntu2004 Add-AppxPackage .\ubuntu-2004.appx #+END_SRC @@ -67,12 +67,19 @@ username and a password. This user will be your default user for the distribution and is considered the Linux administrator with the ability to run sudo commands. -Finish the installation by making sure everything is up to date: +Make sure everything is up to date: #+BEGIN_SRC shell sudo apt update && sudo apt upgrade -y #+END_SRC +If you already have been using another Linux distribution you might want to +set Ubuntu 20.04 as default. Open PowerShell and run: + +#+BEGIN_SRC fundamental + wsl --set-default Ubuntu-20.04 +#+END_SRC + * Install Emacs 27.1 To install Emacs 27.1 in Ubuntu 20.04 you can From cfc4e9b1891c5dbfadc9ed2cc0a4561dda587996 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 07:55:54 +0100 Subject: [PATCH 22/31] tested it through --- README.org | 70 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/README.org b/README.org index 20a8ff1..837cf8d 100644 --- a/README.org +++ b/README.org @@ -82,10 +82,11 @@ set Ubuntu 20.04 as default. Open PowerShell and run: * Install Emacs 27.1 -To install Emacs 27.1 in Ubuntu 20.04 you can +To install Emacs 27.1 in Ubuntu 20.04 you can (check the commmands run below +in any case beforehand): - use (double-click) the three batch scripts (.bat) from the [[./install-emacs]] folder -- or clone this repo in the Ubuntu terminal and run the shell scipts from the +- or clone this repo in the Ubuntu terminal and run the shell scripts from the [[./install-emacs]] folder - or run the following commands in the Ubuntu terminal: @@ -118,7 +119,8 @@ To install Emacs 27.1 in Ubuntu 20.04 you can libyajl2 #+END_SRC There will be a dialog about the mail server configuration, just select ~no - configuration~ to leave it as it is and confirm with OK. + configuration~ to leave it as it is and confirm with OK (use TAB and RET to + get through this). If you are on ~Ubuntu 18.04~ use the dependencies from [[./install-emacs/ubuntu-18.04-dependencies.sh]]. In that case you will also have @@ -126,7 +128,7 @@ To install Emacs 27.1 in Ubuntu 20.04 you can hardcoded into them to make sure to use the right distribution even it is not set as default. -2. Download Emacs: +2. Download and extract Emacs: #+BEGIN_SRC shell cd ~ wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.1.tar.gz @@ -134,6 +136,7 @@ To install Emacs 27.1 in Ubuntu 20.04 you can #+END_SRC 3. Configure and install Emacs: + This Step will take a while and you are prompted to enter your password once. #+BEGIN_SRC shell cd ~/emacs-27.1 ./configure --with-cairo @@ -155,7 +158,8 @@ user interface (GUI). This guide is using [[https://sourceforge.net/projects/vcx ** Installation Download VcXsrv from [[https://sourceforge.net/projects/vcxsrv/]] and install it. -Check out the next section about the firewall configuration before launching it. +Check out the next section about the firewall configuration before launching +it (app is called XLaunch) for a first time to add the firewall rules. ** Windows Defender Firewall Configuration @@ -287,16 +291,64 @@ use the batch script: setsid emacs #+END_SRC -You can add the lines without ~setsid emacs~ to =~/.bashrc= and then just use -~setsid emacs~ to launch Emacs in the background. +You can add the lines without ~setsid emacs~ to =~/.bashrc= (or +=~/.profile=) and then just use ~setsid emacs~ to launch Emacs in the +background. If you do so the VcXsrv has to be running before launching the +terminal else this will give an error when starting the terminal and in that +case slow the startup down. * Optional Additions +** Use Windows Terminal + +This step is optional but recommended. + +Install [[https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab][Windows Terminal]] from Microsoft from the Microsoft Store. + +#+BEGIN_QUOTE +The Windows Terminal is a modern, fast, efficient, powerful, and productive +terminal application for users of command-line tools and shells like Command +Prompt, PowerShell, and WSL. +#+END_QUOTE + +To make it open WSL by default: + +- Open the Windows Terminal. +- Open the settings by clicking on the dropdown button in the tab bar and then + select settings (bound to @@html:@@Ctrl-,@@html:@@). +- Copy the GUID for WSL (example: {12345678-1234-1234-1234-1234567890AB}). +- Set the default profile to the one copied from WSL: + #+BEGIN_SRC js + { + ... + "defaultProfile": "{12345678-1234-1234-1234-1234567890AB}", + ... + #+END_SRC + +To change the default path to =~=: + +- Go to the settings (@@html:@@Ctrl-,@@html:@@). +- Add a line in the WSL part at the end (make sure to also add the ~,~ on the + previous line): + #+BEGIN_SRC js + { + ... + "source": "Windows.Terminal.Wsl", + "startingDirectory": "//wsl$/Ubuntu-20.04/home//" + }, + #+END_SRC + ** Change keyboard layout If you want to change the keyboard layout used make sure ~x11-xkb-utils~ is -installed (~sudo apt install x11-xkb-utils~) and add for instance ~setxkbmap --layout us~ to =~/.bashrc= to use the US keyboard layout +installed (~sudo apt install x11-xkb-utils~) and add for instance + +#+BEGIN_SRC shell + setxkbmap -layout us +#+END_SRC + +to =~/.bashrc= (or =~/.profile=) to use the US keyboard layout. Or add it to +the scripts used to run Emacs (~... && setxkbmap -layout us && setsid emacs~). ** Generate SSH Key From d1153a650438dc94f4f465ca8a3c5c39701a5c91 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 21:25:46 +0100 Subject: [PATCH 23/31] renamed the scripts --- run-emacs-wsl-1/wsl-1_0-run-all.bat | 4 ++++ .../wsl1-vcxsrv.bat => run-emacs-wsl-1/wsl-1_1-vcxsrv.bat | 0 run-emacs-wsl-1/wsl-1_2-emacs.bat | 6 ++++++ .../wsl2-run-all.bat => run-emacs-wsl-2/wsl-2_0-run-all.bat | 2 +- .../wsl2-run-all.ps1 => run-emacs-wsl-2/wsl-2_0-run-all.ps1 | 6 +++--- .../wsl-2_1-firewall-rule-vcxsrv.bat | 2 +- .../wsl-2_1-firewall-rule-vcxsrv.ps1 | 4 ++-- .../wsl-2_2-firewall-rule.bat | 2 +- .../wsl-2_2-firewall-rule.ps1 | 0 .../wsl2-vcxsrv.bat => run-emacs-wsl-2/wsl-2_3-vcxsrv.bat | 0 .../wsl2-vcxsrv.ps1 => run-emacs-wsl-2/wsl-2_3-vcxsrv.ps1 | 0 .../wsl2-emacs.bat => run-emacs-wsl-2/wsl-2_4-emacs.bat | 2 +- .../wsl2-emacs.ps1 => run-emacs-wsl-2/wsl-2_4-emacs.ps1 | 3 +++ run-emacs/wsl1-emacs.bat | 3 --- run-emacs/wsl1-run-all.bat | 4 ---- 15 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 run-emacs-wsl-1/wsl-1_0-run-all.bat rename run-emacs/wsl1-vcxsrv.bat => run-emacs-wsl-1/wsl-1_1-vcxsrv.bat (100%) create mode 100644 run-emacs-wsl-1/wsl-1_2-emacs.bat rename run-emacs/wsl2-run-all.bat => run-emacs-wsl-2/wsl-2_0-run-all.bat (90%) rename run-emacs/wsl2-run-all.ps1 => run-emacs-wsl-2/wsl-2_0-run-all.ps1 (86%) rename run-emacs/wsl2-firewall-rule-vcxsrv.bat => run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.bat (69%) rename run-emacs/wsl2-firewall-rule-vcxsrv.ps1 => run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.ps1 (88%) rename run-emacs/wsl2-firewall-rule.bat => run-emacs-wsl-2/wsl-2_2-firewall-rule.bat (81%) rename run-emacs/wsl2-firewall-rule.ps1 => run-emacs-wsl-2/wsl-2_2-firewall-rule.ps1 (100%) rename run-emacs/wsl2-vcxsrv.bat => run-emacs-wsl-2/wsl-2_3-vcxsrv.bat (100%) rename run-emacs/wsl2-vcxsrv.ps1 => run-emacs-wsl-2/wsl-2_3-vcxsrv.ps1 (100%) rename run-emacs/wsl2-emacs.bat => run-emacs-wsl-2/wsl-2_4-emacs.bat (87%) rename run-emacs/wsl2-emacs.ps1 => run-emacs-wsl-2/wsl-2_4-emacs.ps1 (61%) delete mode 100644 run-emacs/wsl1-emacs.bat delete mode 100644 run-emacs/wsl1-run-all.bat diff --git a/run-emacs-wsl-1/wsl-1_0-run-all.bat b/run-emacs-wsl-1/wsl-1_0-run-all.bat new file mode 100644 index 0000000..ebed983 --- /dev/null +++ b/run-emacs-wsl-1/wsl-1_0-run-all.bat @@ -0,0 +1,4 @@ +@echo off + +CALL wsl-1_1-vcxsrv.bat +CALL wsl-1_2-emacs.bat diff --git a/run-emacs/wsl1-vcxsrv.bat b/run-emacs-wsl-1/wsl-1_1-vcxsrv.bat similarity index 100% rename from run-emacs/wsl1-vcxsrv.bat rename to run-emacs-wsl-1/wsl-1_1-vcxsrv.bat diff --git a/run-emacs-wsl-1/wsl-1_2-emacs.bat b/run-emacs-wsl-1/wsl-1_2-emacs.bat new file mode 100644 index 0000000..8cf4cf1 --- /dev/null +++ b/run-emacs-wsl-1/wsl-1_2-emacs.bat @@ -0,0 +1,6 @@ +@echo off + +wsl -d Ubuntu-20.04 bash -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" + +@rem Use this to also set the keyboard layout to US. +@rem wsl -d Ubuntu-20.04 bash -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" diff --git a/run-emacs/wsl2-run-all.bat b/run-emacs-wsl-2/wsl-2_0-run-all.bat similarity index 90% rename from run-emacs/wsl2-run-all.bat rename to run-emacs-wsl-2/wsl-2_0-run-all.bat index a098475..bbd2ce6 100644 --- a/run-emacs/wsl2-run-all.bat +++ b/run-emacs-wsl-2/wsl-2_0-run-all.bat @@ -1,3 +1,3 @@ @echo off @REM powershell -WindowStyle Hidden -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" -powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-run-all.ps1'" \ No newline at end of file +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl-2_0-run-all.ps1'" \ No newline at end of file diff --git a/run-emacs/wsl2-run-all.ps1 b/run-emacs-wsl-2/wsl-2_0-run-all.ps1 similarity index 86% rename from run-emacs/wsl2-run-all.ps1 rename to run-emacs-wsl-2/wsl-2_0-run-all.ps1 index ae23c83..1790721 100644 --- a/run-emacs/wsl2-run-all.ps1 +++ b/run-emacs-wsl-2/wsl-2_0-run-all.ps1 @@ -10,10 +10,10 @@ if ($vcxsrv) { } Write-Host "`nAdding the firewall rule" -& .\wsl2-firewall-rule.ps1 +& .\wsl-2_2-firewall-rule.ps1 Write-Host "`nStarting VcXsrv" -& .\wsl2-vcxsrv.ps1 +& .\wsl-2_3-vcxsrv.ps1 Write-Host "`nLaunching Emacs" -& .\wsl2-emacs.ps1 \ No newline at end of file +& .\wsl-2_4-emacs.ps1 \ No newline at end of file diff --git a/run-emacs/wsl2-firewall-rule-vcxsrv.bat b/run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.bat similarity index 69% rename from run-emacs/wsl2-firewall-rule-vcxsrv.bat rename to run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.bat index d704b4f..c6a15c6 100644 --- a/run-emacs/wsl2-firewall-rule-vcxsrv.bat +++ b/run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.bat @@ -1,2 +1,2 @@ @echo off -powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-firewall-rule-vcxsrv.ps1'" +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl-2_1-firewall-rule-vcxsrv.ps1'" diff --git a/run-emacs/wsl2-firewall-rule-vcxsrv.ps1 b/run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.ps1 similarity index 88% rename from run-emacs/wsl2-firewall-rule-vcxsrv.ps1 rename to run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.ps1 index e402583..c92fb89 100644 --- a/run-emacs/wsl2-firewall-rule-vcxsrv.ps1 +++ b/run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.ps1 @@ -10,7 +10,7 @@ if ($vcxsrv) { } Write-Host "`nAdding the firewall rule" -& .\wsl2-firewall-rule.ps1 +& .\wsl-2_2-firewall-rule.ps1 Write-Host "`nStarting VcXsrv" -& .\wsl2-vcxsrv.ps1 +& .\wsl-2_3-vcxsrv.ps1 diff --git a/run-emacs/wsl2-firewall-rule.bat b/run-emacs-wsl-2/wsl-2_2-firewall-rule.bat similarity index 81% rename from run-emacs/wsl2-firewall-rule.bat rename to run-emacs-wsl-2/wsl-2_2-firewall-rule.bat index 8bbd50d..d479321 100644 --- a/run-emacs/wsl2-firewall-rule.bat +++ b/run-emacs-wsl-2/wsl-2_2-firewall-rule.bat @@ -2,4 +2,4 @@ @rem Just run the PowerShell script. -powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-firewall-rule.ps1'" +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl-2_2-firewall-rule.ps1'" diff --git a/run-emacs/wsl2-firewall-rule.ps1 b/run-emacs-wsl-2/wsl-2_2-firewall-rule.ps1 similarity index 100% rename from run-emacs/wsl2-firewall-rule.ps1 rename to run-emacs-wsl-2/wsl-2_2-firewall-rule.ps1 diff --git a/run-emacs/wsl2-vcxsrv.bat b/run-emacs-wsl-2/wsl-2_3-vcxsrv.bat similarity index 100% rename from run-emacs/wsl2-vcxsrv.bat rename to run-emacs-wsl-2/wsl-2_3-vcxsrv.bat diff --git a/run-emacs/wsl2-vcxsrv.ps1 b/run-emacs-wsl-2/wsl-2_3-vcxsrv.ps1 similarity index 100% rename from run-emacs/wsl2-vcxsrv.ps1 rename to run-emacs-wsl-2/wsl-2_3-vcxsrv.ps1 diff --git a/run-emacs/wsl2-emacs.bat b/run-emacs-wsl-2/wsl-2_4-emacs.bat similarity index 87% rename from run-emacs/wsl2-emacs.bat rename to run-emacs-wsl-2/wsl-2_4-emacs.bat index 409f175..293a6df 100644 --- a/run-emacs/wsl2-emacs.bat +++ b/run-emacs-wsl-2/wsl-2_4-emacs.bat @@ -2,5 +2,5 @@ @rem Just run the PowerShell script. -powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl2-emacs.ps1'" +powershell -NoProfile -ExecutionPolicy Bypass -Command "& './wsl-2_4-emacs.ps1'" diff --git a/run-emacs/wsl2-emacs.ps1 b/run-emacs-wsl-2/wsl-2_4-emacs.ps1 similarity index 61% rename from run-emacs/wsl2-emacs.ps1 rename to run-emacs-wsl-2/wsl-2_4-emacs.ps1 index 2c35061..52833c6 100644 --- a/run-emacs/wsl2-emacs.ps1 +++ b/run-emacs-wsl-2/wsl-2_4-emacs.ps1 @@ -5,3 +5,6 @@ $wslip = wsl -d Ubuntu-20.04 bash -c 'ip route | awk ''/default via /'' | cut -d # Run Emacs wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" + +# Use this to also set the keyboard layout to US +# wsl -d Ubuntu-20.04 bash -c "export DISPLAY=$wslip`:0.0 export LIBGL_ALWAYS_INDIRECT=1 && setxkbmap -layout us && setsid emacs" \ No newline at end of file diff --git a/run-emacs/wsl1-emacs.bat b/run-emacs/wsl1-emacs.bat deleted file mode 100644 index d3ec3e0..0000000 --- a/run-emacs/wsl1-emacs.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -wsl -d Ubuntu-20.04 bash -c "export DISPLAY=:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && setsid emacs" diff --git a/run-emacs/wsl1-run-all.bat b/run-emacs/wsl1-run-all.bat deleted file mode 100644 index 6c586c7..0000000 --- a/run-emacs/wsl1-run-all.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off - -CALL wsl1-vcxsrv.bat -CALL wsl1-emacs.bat From 857b3c16ebc0922cda00b8540d47acd28a75d986 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 21:27:28 +0100 Subject: [PATCH 24/31] updated readme --- README.org | 67 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/README.org b/README.org index 837cf8d..3cc8aac 100644 --- a/README.org +++ b/README.org @@ -229,19 +229,20 @@ To run Emacs in a graphical display you have to: 2. Run VcXsrv 3. Run Emacs -For convenience there are batch scripts (double-clickable) to: +For convenience there are batch scripts (double-clickable) to (you can copy +the run-emacs folder for WSL 1 or WSL 2 to wherever you want): -- ~WSL1~ - 1. Run VcXsrv [[./run-emacs/wsl1-vcxsrv.bat]] - 2. Run Emacs [[./run-emacs/wsl1-emacs.bat]] - 3. Run VcXsrv and then Emacs [[./run-emacs/wsl1-run-all.bat]] +- ~WSL 1~ + 1. Run VcXsrv and Emacs [[./run-emacs-wsl-1/wsl-1_0-run-all.bat]] + 2. Run VcXsrv [[./run-emacs-wsl-1/wsl-1_1-vcxsrv.bat]] + 3. Run Emacs [[./run-emacs-wsl-1/wsl-1_2-emacs.bat]] -- ~WSL2~ - 1. Create/update the inbound firewall rule (admin rights needed). [[./run-emacs/wsl2-firewall-rule.bat]] - 2. Run VcXsrv [[./run-emacs/wsl2-vcxsrv.bat]] - 3. Run Emacs [[./run-emacs/wsl2-emacs.bat]] - 4. Firewall rule and VcXsrv [[./run-emacs/wsl2-firewall-rule-vcxsrv.bat]] - 5. Firewall rule, VcXsrv and Emacs [[./run-emacs/wsl2-run-all.bat]] +- ~WSL 2~ + 1. Run all (Firewall rule, VcXsrv and Emacs) [[./run-emacs-wsl-2/wsl-2_0-run-all.bat]] + 2. Run Firewall rule and VcXsrv [[./run-emacs-wsl-2/wsl-2_1-firewall-rule-vcxsrv.bat]] + 3. Run Firewall rule (admin rights needed). [[./run-emacs-wsl-2/wsl-2_2-firewall-rule.bat]] + 4. Run VcXsrv [[./run-emacs-wsl-2/wsl-2_3-vcxsrv.bat]] + 5. Run Emacs [[./run-emacs-wsl-2/wsl-2_4-emacs.bat]] ** ~WSL 2 only~ Create/update the Inbound Firewall Rule @@ -250,7 +251,7 @@ access by adding a firewall rule. Make sure you have disabled the existing VcXsrv firewall rules. To create or update the inbound firewall rule you can use the batch script -[[./run-emacs/wsl2-firewall-rule.bat]]. If VcXsrv was running before the firewall +[[./run-emacs-wsl-2/wsl-2_2-firewall-rule.bat]]. If VcXsrv was running before the firewall rule was updated it has to be restarted. ** Run VcXsrv @@ -259,11 +260,11 @@ To run VcXsrv use the batch script provided or run the following commands in cmd (if you haven't used the default installation path you have to adapt the script/command): -- ~WSL 1~ [[./run-emacs/wsl1-vcxsrv.bat]] +- ~WSL 1~ [[./run-emacs-wsl-1/wsl-1_1-vcxsrv.bat]] #+BEGIN_SRC bat start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl #+END_SRC -- ~WSL 2~ [[./run-emacs/wsl2-vcxsrv.bat]] +- ~WSL 2~ [[./run-emacs-wsl-2/wsl-2_3-vcxsrv.bat]] #+BEGIN_SRC bat start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac #+END_SRC @@ -278,24 +279,43 @@ VcXsrv if needed and run the script again. To run Emacs you can launch Ubuntu terminal and run the following commands or use the batch script: -- ~WSL1~ [[./run-emacs/wsl1-emacs.bat]] +- ~WSL1~ [[./run-emacs-wsl-1/wsl-1_2-emacs.bat]] #+BEGIN_SRC shell export DISPLAY=:0.0 export LIBGL_ALWAYS_INDIRECT=1 setsid emacs #+END_SRC -- ~WSL2~ [[./run-emacs/wsl2-emacs.bat]] +- ~WSL2~ [[./run-emacs-wsl-2/wsl-2_4-emacs.bat]] #+BEGIN_SRC shell export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0 export LIBGL_ALWAYS_INDIRECT=1 setsid emacs #+END_SRC -You can add the lines without ~setsid emacs~ to =~/.bashrc= (or -=~/.profile=) and then just use ~setsid emacs~ to launch Emacs in the -background. If you do so the VcXsrv has to be running before launching the -terminal else this will give an error when starting the terminal and in that -case slow the startup down. +You can add the lines without ~setsid emacs~ to =~/.bashrc= and then just use +~setsid emacs~ to launch Emacs in the background. If you do so the VcXsrv has +to be running before launching the terminal else this will give an error when +starting the terminal and in that case slow the startup down. + +To not have to type this over and over add an alias in =~/.bashrc= and then +run Emacs with ~ema~ (needs a restart): + +- ~WSL1~ + #+BEGIN_SRC shell + alias ema=' + export DISPLAY=:0.0 + export LIBGL_ALWAYS_INDIRECT=1 + setsid emacs + ' + #+END_SRC +- ~WSL2~ + #+BEGIN_SRC shell + alias ema=' + export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0 + export LIBGL_ALWAYS_INDIRECT=1 + setsid emacs + ' + #+END_SRC * Optional Additions @@ -347,8 +367,9 @@ installed (~sudo apt install x11-xkb-utils~) and add for instance setxkbmap -layout us #+END_SRC -to =~/.bashrc= (or =~/.profile=) to use the US keyboard layout. Or add it to -the scripts used to run Emacs (~... && setxkbmap -layout us && setsid emacs~). +to =~/.bashrc= or to the alias to use the US keyboard layout. Or add it to +the scripts used to run Emacs (~... && setxkbmap -layout us && setsid +emacs~). ** Generate SSH Key From 51d7203d29335a4efa04a999a99f1123824f0993 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 22:00:11 +0100 Subject: [PATCH 25/31] changelog, contrib, fixed readme --- CHANGELOG.org | 32 ++++++++++++++++++++++++++++++++ CONTRIBUTING.org | 22 ++++++++++++++++++++++ README.org | 8 ++++---- 3 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.org create mode 100644 CONTRIBUTING.org diff --git a/CHANGELOG.org b/CHANGELOG.org new file mode 100644 index 0000000..be9c53c --- /dev/null +++ b/CHANGELOG.org @@ -0,0 +1,32 @@ +#+STARTUP: showall + +* Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +*** [Unreleased] + +**** Added +**** Changed +**** Removed +**** Fixed + +*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][\[1.0.0\]]] - 2021-01-12 + +A complete overhaul of the existing README.org. + +**** Added +- Full instructions for WSL 2 +- Batch scripts to install Emacs 27.1 +- Batch scripts to run Emacs in WSL 1 or WSL 2 (double-clickable) +- A simple CONTRIBUTING.org +- This CHANGELOG.org + +**** Changed +- Uses Ubuntu 20.04 instead of 18.04 + +**** Removed +- Removed instructions for other X-Servers, focus on VcXsrv. diff --git a/CONTRIBUTING.org b/CONTRIBUTING.org new file mode 100644 index 0000000..b4a346e --- /dev/null +++ b/CONTRIBUTING.org @@ -0,0 +1,22 @@ +#+STARTUP: showall + +* Contributing + +* Bugs, Improvements and new Features + +Go to [[https://github.com/hubisan/emacs-wsl/issues][Issues]] and make a new issue. + +Make sure to: + +- Check that the issue has not already been reported (open and closed ones). +- Check that the issue is not part of an active pull request. + +* Pull Requests + +Cool that you want to contribute your code :-) + +Remember to: + +- Include only one feature in a pull request. +- Open an issue and mention your planned pull request. +- Update the CHANGELOG.org \ No newline at end of file diff --git a/README.org b/README.org index 3cc8aac..9bfff76 100644 --- a/README.org +++ b/README.org @@ -279,13 +279,13 @@ VcXsrv if needed and run the script again. To run Emacs you can launch Ubuntu terminal and run the following commands or use the batch script: -- ~WSL1~ [[./run-emacs-wsl-1/wsl-1_2-emacs.bat]] +- ~WSL 1~ [[./run-emacs-wsl-1/wsl-1_2-emacs.bat]] #+BEGIN_SRC shell export DISPLAY=:0.0 export LIBGL_ALWAYS_INDIRECT=1 setsid emacs #+END_SRC -- ~WSL2~ [[./run-emacs-wsl-2/wsl-2_4-emacs.bat]] +- ~WSL 2~ [[./run-emacs-wsl-2/wsl-2_4-emacs.bat]] #+BEGIN_SRC shell export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0 export LIBGL_ALWAYS_INDIRECT=1 @@ -300,7 +300,7 @@ starting the terminal and in that case slow the startup down. To not have to type this over and over add an alias in =~/.bashrc= and then run Emacs with ~ema~ (needs a restart): -- ~WSL1~ +- ~WSL 1~ #+BEGIN_SRC shell alias ema=' export DISPLAY=:0.0 @@ -308,7 +308,7 @@ run Emacs with ~ema~ (needs a restart): setsid emacs ' #+END_SRC -- ~WSL2~ +- ~WSL 2~ #+BEGIN_SRC shell alias ema=' export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0 From 8a69df8ed847e676b05a97361aad2c80aa97e1e0 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 22:22:50 +0100 Subject: [PATCH 26/31] more fixes --- CHANGELOG.org | 2 +- README.org | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index be9c53c..1ff81b9 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 **** Removed **** Fixed -*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][\[1.0.0\]]] - 2021-01-12 +*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][[1.0.0[]] - 2021-01-12 A complete overhaul of the existing README.org. diff --git a/README.org b/README.org index 9bfff76..8313941 100644 --- a/README.org +++ b/README.org @@ -82,13 +82,16 @@ set Ubuntu 20.04 as default. Open PowerShell and run: * Install Emacs 27.1 -To install Emacs 27.1 in Ubuntu 20.04 you can (check the commmands run below -in any case beforehand): +To install Emacs 27.1 in Ubuntu 20.04 you can - use (double-click) the three batch scripts (.bat) from the [[./install-emacs]] folder - or clone this repo in the Ubuntu terminal and run the shell scripts from the [[./install-emacs]] folder -- or run the following commands in the Ubuntu terminal: +- or run the following commands in the Ubuntu terminal + +#+BEGIN_QUOTE +Check out the commands run and especially the remarks below in any case. +#+END_QUOTE 1. Install all dependencies (taken from the [[https://github.com/alexmurray/emacs-snap/blob/master/snapcraft.yaml][snap]]): #+BEGIN_SRC shell @@ -209,8 +212,8 @@ If you have ~admin rights~ you can add an inbound firewall rule to restrict access as much as possible. As the IP used by WSL 2 is dynamic a powershell script is provided later on to create/update the rule. -If you want ot used the additional firewall rule make sure that you disable the -existing inbound rules: +If you want to use the additional firewall rule make sure that you disable +the existing inbound rules: 1. Go to the inbound rule settings with @@html:@@WIN@@html:@@ Windows Defender Firewall > Advanced Settings (or @@html:@@WIN-r wf.msc @@ -293,8 +296,8 @@ use the batch script: #+END_SRC You can add the lines without ~setsid emacs~ to =~/.bashrc= and then just use -~setsid emacs~ to launch Emacs in the background. If you do so the VcXsrv has -to be running before launching the terminal else this will give an error when +~setsid emacs~ to launch Emacs in the background. If you do so VcXsrv has to +be running before launching the terminal else this will give an error when starting the terminal and in that case slow the startup down. To not have to type this over and over add an alias in =~/.bashrc= and then @@ -321,8 +324,6 @@ run Emacs with ~ema~ (needs a restart): ** Use Windows Terminal -This step is optional but recommended. - Install [[https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab][Windows Terminal]] from Microsoft from the Microsoft Store. #+BEGIN_QUOTE From c5b4520dd5d9e340bf55b9c12cc51896ea1a9f30 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 22:24:31 +0100 Subject: [PATCH 27/31] more fixes --- CHANGELOG.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 1ff81b9..12ead60 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 **** Removed **** Fixed -*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][[1.0.0[]] - 2021-01-12 +*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]] - 2021-01-12 A complete overhaul of the existing README.org. From 04eb3deb22e5bd0de8a121bcf9bed0abb591d78b Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 22:25:51 +0100 Subject: [PATCH 28/31] more fixes --- CHANGELOG.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.org b/CHANGELOG.org index 12ead60..9ee3dc2 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -14,7 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 **** Removed **** Fixed +*** [[[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]]] - 2021-01-12 *** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]] - 2021-01-12 +*** \[[[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]]\] - 2021-01-12 +*** ([[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][1.0.0]]) - 2021-01-12 A complete overhaul of the existing README.org. From 28c0a64010796d8d000e3c0a36e30c360059ab43 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 22:26:53 +0100 Subject: [PATCH 29/31] more fixes --- CHANGELOG.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 9ee3dc2..1ebc5ea 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 **** Removed **** Fixed -*** [[[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]]] - 2021-01-12 +*** [[[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][1.0.0]]] - 2021-01-12 +*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][1.0.0]] - 2021-01-12 *** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]] - 2021-01-12 *** \[[[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]]\] - 2021-01-12 *** ([[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][1.0.0]]) - 2021-01-12 From d333de8f644948b66ee9ecdc433c0c2ee165234a Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 22:27:58 +0100 Subject: [PATCH 30/31] more fixes --- CHANGELOG.org | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 1ebc5ea..2ec65a9 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -14,11 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 **** Removed **** Fixed -*** [[[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][1.0.0]]] - 2021-01-12 *** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][1.0.0]] - 2021-01-12 -*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]] - 2021-01-12 -*** \[[[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][(1.0.0)]]\] - 2021-01-12 -*** ([[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][1.0.0]]) - 2021-01-12 A complete overhaul of the existing README.org. From 8a4e4f3fa7ee25fa5e8c3c3880e097b6880002a4 Mon Sep 17 00:00:00 2001 From: hubisan Date: Tue, 12 Jan 2021 22:30:32 +0100 Subject: [PATCH 31/31] more fixes --- CHANGELOG.org | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 2ec65a9..e941fef 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -7,14 +7,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -*** [Unreleased] - -**** Added -**** Changed -**** Removed -**** Fixed - -*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v0.0.1][1.0.0]] - 2021-01-12 +*** [[https://github.com/hubisan/emacs-wsl/releases/tag/v1.0.0][1.0.0]] - 2021-01-12 A complete overhaul of the existing README.org.