Support for vaults in Windows Subsystem for Linux (WSL)

+1 for for this feature request!

+1 - this is much needed for me!

+1 Here guys! :slight_smile:

+1 would love this

+1 for this feature request

1 Like

+1 need this

Thanks PurplProto, your solution works perfect! :blush:

Thanks for sharing; would you mind clarifying whether your vault/source of Markdown files is stored within:

  • WSL (i.e., \\wsl.localhost\Ubuntu\home\username\folder) or
  • Win11 (i.e., C:\Users\username\folder).

I think the context of this feature request is to render Markdown files stored within WSL directly, as opposed to linking an existing vault in Win11.

Just confirmed that Obsidian now works within WSL2 directories (thanks to Maztuto from Discord) since WSL2 has enabled native support for Linux GUI apps (X11 and Wayland)!

How To Get It To Work

Requirements

Install Obsidian inside WSL2.

I’ve gone ahead and installed the latest obsidian.deb package in the latest Ubuntu 22.04.3 LTS on WSL2, like so:

# Remember to update the URL for the latest version on https://obsidian.md/download.
wget https://github.com/obsidianmd/obsidian-releases/releases/download/v1.4.13/obsidian_1.4.13_amd64.deb
sudo apt-get install -y ./obsidian_1.4.13_amd64.deb

Confirm Installation

This automatically adds Obsidian (Ubuntu) to the Start Menu, in the following directory:

C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Ubuntu

A restart of WSL2 may be required for the entry to update, via wsl --shutdown.

Additional Dependencies

In my case, Obsidian wouldn’t load until I installed a couple of dependencies, like so:

sudo apt-get update
sudo apt-get install -y libgbm1 libasound2

Run Obsidian

And that’s it!

Either select Obsidian from the Start Menu or type obsidian or /opt/Obsidian/obsidian to launch the all-familiar Obsidian GUI from within WSL2, and it just works.

2 Likes

I wanted to store a vault synced with Github in Onedrive.
I wanted to access this vault with webdav to make sure there was not any conflict in case another computer cloned this vault and tried to update files at the same time as the first computer. Does this make sense?

Well, if it makes sense, it would be great if this issue got fixed because I got the same error:
An error occurred while loading Obsidian. Error: EISDIR: illegal operation on a directory

Thank you for your instructions! This helped me to get Obsidian installed using WSL2. Since I have a 5K monitor the scaling of the Obsidian-Linux-App is a bit off as it is not using Windows’ high resolution scaling capabilities. Do you know if this can be changed through some flags when starting Obsidian?

Great to hear the steps came in use, @bennycode!

I’m afraid I’ve got nothing for the scaling issue but the rendering of Linux GUI apps is done by WSLg repo on GitHub. As recently as a month ago, there are issues/PRs related to display scaling so it might be worth raising questions there.

There’re also some mentions of enabling scaling by creating creating the following “.wslgconfig” then restarting WSL and running GTKWave (though this is beyond me):

[system-distro-env]
WESTON_RDP_HI_DPI_SCALING=true
WESTON_RDP_FRACTIONAL_HI_DPI_SCALING=false
WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR=200

Commenting to report this how to topic got me going with Obsidian on WSL2 :slight_smile: Thanks for sharing your discovery!

If you have troubles getting plugins to work with WSL2-ran Obsidian, here’s what I did:

  • Initially, installing community plugins do nothing, and the “open plugins folders” icon in the plugins tab was not showing up.
  • To fix, I ran /opt/Obsidian/obsidian with sudo
  • With this privilege level, I was able to install the community plugins.

If I later were to run Obsidian with the normal privileges, I can still used those plugins. Note though, everytime you want to install new plugins, you have launch under privileged mode.

Not sure why this is the case, on my (purely) Ubuntu machine, I never had any trouble.

+1 vote
I would love to have it working seamlessly like VS Code too.

+1 It would make our life much easier in windows!

I’ve tried installing obsidian within WSL2 but performance and some issues like copying images from the clipboard make the experience much worse

+1 for this.

Created an account just to bump this request

I also use Obsidian in wls2 with wslg, but has other issues like font type, IME, etc.