🪴 Second Brain

Search IconIcon to open search

Running arch with i3 in wsl using vcxsrv

Created April 17, 2022

The goal of this post is to show a minimal configuration to run i3

in Arch linux

Arch linux

Arch Linux. What can I say!\ I have been familiar with it, and pacman for such a long time, it feels...

7/29/2022

under WSL

WSL

WSL stands for Window subsystem for linux. After struggling for years with dual-booting, and running linux on inefficient VM's, I finally...

7/29/2022

using vcxsrv

VcXsrv

VcXsrv is an X-server for windows. It allows WSL users to run a full fledge GUI system under linux. Note that...

7/29/2022

.

Installing necessary apps

  1. Make sure you installed Arch linux on WSL

    Installing Arch linux on WSL

    Install Arch linux under WSL is quite straightforward. Head over to ArchWsl and download the latest version Extract the file Launch a terminal...

    7/29/2022

  2. Download and install VcXsrv

    VcXsrv

    VcXsrv is an X-server for windows. It allows WSL users to run a full fledge GUI system under linux. Note that...

    7/29/2022

Creating launch scripts

Step 1:

You are going to need 2 files. The first is called arch.vbs and contains the following:

1
2
Set shell = CreateObject("WScript.Shell" )
shell.Run "wsl.exe -u <username> -- sh ~/.config/wsl.sh", 0

⚠️ Make sure your replace <username> with your actual user.

Step 2:

Next, inside wsl run the following code:

1
2
mkdir ~/.config
touch ~/.config/wsl.sh

This will create a .config folder in your home, and add a wsl.sh file to it.

Step 3:

Add the following to the wsl.sh file:

1
2
3
4
5
6
7
#!/bin/bash

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0;
export WAYLAND_DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0;

/mnt/c/Program\ Files/VcXsrv/vcxsrv.exe -ac -wgl -dpms -fullscreen&
i3

Let’s break down the file: The first 2 line are important to tell wsl how to connect to the X-server. You don’t have to worry about customizing it.

The line that launches vcxsrv is important:

  1. The -ac is very important. It disables access control. Without it, nothing will work.
  2. The last options are… optional 😆 Try playing around with the -fullscreen and -multimonitor options depending on your setup

You might also want to try -nodecoration in case you don’t want to run the -fullscreen option. A full breakdown of options is available on the VcXsrv page


Launch it

Now, when you double click the arch.vbs file in windows, it should run wsl and start i3 for you.
If it fails, try running wsl.sh from a wsl instance running in a standard windows terminal.


Interactive Graph

VcXsrvWSLMeditationAwakeningThe 8-fold pathMeditation is not about becoming a monkLosing what is dear📚 The Mind IlluminatedThe 3 jewelsBuddhismTaking refugeDharmaThe PathInsight (Vipassanā)🧠 Buddhist PhilosophyEnlightenmnentSufferingNirvanaDesireThe PathSelfPurpose of LifeEmptinessThe 3 EvilsOther religionsHappinessA solution to the Paradox of Desire in Buddhism🧠 Buddhist PhilosophyNirvanaSamsaraSufferingSuffering in ChristianitySamsaraKarmaAnchorTerraAnchor ReviewBettermentMakara🐮 Crypto Farm DubaiPassive IncomeLending StableCoinsHedged Coin StakingAutomated Market Making (AMM)Yield FarmingEarning DividendsNFT strategiesMetaVerse strategiesArbitrageInvestment in Other fundsInvesting in crypto projectsOptions strategiesSpeculative TradingTrade TogetherDeep BalancerFeel Mining/Just MiningFeel MiningStaking as a ServiceGlossaryPortfolio TrackingInvesting in crypto projectsSheeShaa FinanceLending StableCoinsAnchorMakaraBettermentMitigating RiskRug PullOptions strategiesCovered Calls StrategiesSqueethDeribitStakeDaoOpynPassive IncomeStakingRobo-advisor/notes/Passive Income/Financial-advisorsRobo-advisorUnagiiSofi/notes/Passive Income/M1-FinanceStaking as a Service/www.mycointainer.com/Trade TogetherHistoryRussia - UkraineWWIIAnchorBetterment🐮 Crypto Farm DubaiFeel MiningGlossaryInvesting in crypto projectsLending StableCoinsMakaraMitigating RiskOptions strategiesPassive IncomeRobo-advisorStaking as a ServiceTrade Together🪴 Second Brain/./Buddhism/BuddhismProgramming/./CFD/CFDTrading/tags/meditation blog//tags/code blog/BacktestingC#JavascriptabsolutelyTypescriptReactImpermanenceVipassana MeditationMindfulnessFunctional programmingThích Nhất HạnhRamdaVimQuantower/typescript/reactThe Four Noble TruthsRunning arch with i3 in wsl using vcxsrvi3Arch linuxInstalling Arch linux on WSLA solution to the Paradox of Desire in BuddhismHistory🐮 Crypto Farm DubaiGlossaryMitigating RiskMetacognitive Introspective AwarenessEquanimityanalytical meditation