Using Windows: Running Linux apps with Alpine WSL and VcXsrv

If you want to use Linux applications on Windows you have multiple options. Using the Windows version of the application if it’s available, cross-compile the app, use a VM or Docker, or use the Windows Subsystem for Linux with a X Server.

A small and lightweight WSL distro is Alpine, which is also quite popular in the Docker world. It’s based on musl, uses busybox and just contains the most important things to be functional.

For the X Server part, you can installVcXsrv.

By default you start the Alpine WSL with an unprivileged user. I setup the ability to use sudo, by following these steps ( I hope I remembered them all correctly ):

  1. logging in with root ( wsl.exe --distribution Alpine --user root ),
  2. setting a root password ( passwd ),
  3. installing sudo ( apk add sudo ),
  4. un-commenting a line in the /etc/sudoers file to allow anyone use sudo who is in the sudo group ( %sudo ALL=(ALL) ALL ),
  5. create a sudo group ( addgroup sudo ) and
  6. add my default user to that group ( usermod -aG sudo <username> ).
  7. After that set the password for the default user ( passwd <username> ), close and reopen the Alpine console.

After you installed and setup everything, you can start VcXsrv and type the following command in the WSL console to tell which display should be used.

export DISPLAY=:0

To install Geany, I used the following command:

sudo apk add geany adwaita-icon-theme noto-fonts

noto-fonts are required because if not installed you won’t see any text in the application. adwaita-icon-theme is also recommended, because applications like Geany use the system icon theme and if none is installed, some icons are missing.

Xournal isn’t available in the preconfigured repositories, so I ran the following to install it:

sudo apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add xournal

By calling xournal in the correct folder, I can now open the notes I took with my Linux laptop using Xournal.

我来评几句
登录后评论

已发表评论数()

相关站点

+订阅
热门文章