Primary Menu

Running Darktable in Windows 10 Through WSL

Darkroom view inside Darktable

Darktable is a free and open-source RAW file editor, available for many *NIX operating systems but unfortunately not for Windows. And you may have heard that the you can have the Ubuntu Bash shell right inside Windows 10 Anniversary Update, which means you can also run Linux GUI apps from the terminal. And you guess it, this trick really work 🙂

First of all, you need to have WSL (Windows Subsystem for Linux). There are already many guide to do this, like this one. You may need to restart a few times.

Once you have WSL installed, time to fire up the terminal. Go to Start, type “bash” and you should see an entry for “Bash on Ubuntu on Windows”. This is your Ubuntu terminal, although you can use other terminal simulators available for Windows such as Conemu if you want more features, as this default terminal is very basic. You can pin it to start menu, taskbar, or wherever you want for easy access. The current version (Windows 10 Anniversary Update) requires that you fix the hostname. Press Windows+X > System and you’ll see your hostname as computer name. Inside your Ubuntu terminal, type:

sudo nano /etc/hosts

On the line that says 127.0.0.1, type your hostname after localhost. My hostname right here is xwing-windows. Once done, press Ctrl+X, Y, then Enter to save.

Fixing hostname in WSL

Now we can update all the packages:

sudo apt-get update && sudo apt-get upgrade -y

After everything is up to date, we can install Darktable itself (press Enter when you’re asked to):

Darktable won’t be able to start without an X server for Windows. There are many X servers you can use in Windows, but I personally use VcXsrv. Make sure that it always run in the background, at least when you want to run Darktable or any other Linux GUI apps. Use your favorite method to autostart it so you don’t forget it. To bind our Ubuntu environment to the X server, edit your ~/.bashrc:

Our Ubuntu environment should now be able to connect to the X server. For verification, this command should return localhost:0.0:

echo $DISPLAY

At this point, everything is ready for use. Simply type darktable into the terminal and do not close it, and you should get the GUI on your screen!

Main view of Darktable in Windows

Some quirks I’ve noticed running it inside WSL:

It uses Ubuntu’s directory structure instead of Windows, so you won’t see your drives’ partitions! Don’t fret, they’re at /mnt/. When you see the window to select files, click on Computer at the left side, then go to mnt, and you’ll see your drives’ partitions.

You cannot move the files to the trash/Recycle Bin, and you’ll be asked to remove them permanently instead every time. You can set it to always delete permanently so it won’t make a warning (watch out, they’ll be gone forever!), by clicking on the gear icon and uncheck “send files to trash when erasing images”.

Darkroom view inside Darktable

Now you have a free and open-source RAW editor without coughing up your hard-earned cash for Adobe Lightroom! How you use it is your choice.

8 comments on “Running Darktable in Windows 10 Through WSL”

This looks great but I am having issues with importing photos into Darktable on WSL that have previously been edited using Darktable on a native Linux machine?
When I attempt to do this it doesn’t import the sidecard (XMP) edit info correctly.
When I import and view a previously edited and imported photo on my WSL install I get the following result;
– In lighttable the image does not show the “edited” icon and the image appears as if it has not been edited.
– If I then view it in Darkroom the image looks mostly like the edited version (although any crop & rotate edits do not appear and I don’t know if there are others).
– Even though the image appears edited in Darkroom there is nothing in the history stack. It only shows “original image”.
I know these “edited” images import correctly on a Linux machine because I have started Darktable with a new specified (empty) library database and when I imported the images all the XMP data came through correctly.
I have also previously had Darktable installed on a VirtualBox Linux Mint install and I get the same poor result as the WSL install. So Windows appears to be the common denominator.
Do you have any idea what might be the problem.
Cheers

I didn’t have such problems in my case. On my Ubuntu 16.04 install it was version 2.0.x (I don’t use it now), and all the NEF files that I open in WSL have the same edits just like what I’ve done in Ubuntu. Right now the latest version of Darktable is 2.2.x but that requires Ubuntu 16.04, while WSL is still on 14.04 so it’s stuck at 2.0.7 unless you’re on Insider build.

Thank You for your very helpful description.
I had to install darktable after I finished all you have described.
So just to complete your guide, maybe you could add a line at the appropriate position with the
sudo apt-get-install darktable.
Wolfgang