1.0 Introduction
Running Niente on Windows is not exactly difficult, but it's not trivially to document either! The basic premise is that Niente is a Bash script and so Windows needs to be able to run Bash scripts for it to work on that platform. There are various ways that can be arranged, but in these days of Windows 10 and 11, the simplest is probably to install and run the Windows Subsystem for Linux, Version 2 -or 'WSL2' for short.
WSL2 is a fairly transparent way to run a real Linux distro 'within' Windows -and, in its most recent incarnations, it's fairly easy to get Linux programs that output graphics to 'pipe them' onto the Windows desktop. All that needs to be present on Windows for that to happen is an X server.
So, in this article, I'm going to show you how to do two distinct things: 1) install WSL2; and 2) install an X Server on Windows. Once those things are done -and properly configured!- then Niente will run as a first-class Windows program, albeit within the context of a Linux virtual environment. Be aware that things work very differently in Windows 11, where a separate X server is not required. There is accordingly a separate article for doing things on Windows 11.
Note that if you are the kind of person that just wants the commands and instructions, without all the explanations and pretty pictures, a very short and concise 'Niente on Windows 10 Distilled' article can be read instead of this one 🙂
Do bear in mind that if you have already installed the Giocoso music player (or the Semplice music manager) on your Windows 10 PC, you'll already have done all the necessary preliminaries and can simply jump straight to Section 8 below.
2.0 Preliminaries
Before we start, let me say I'm running my Windows 10 on 2012-era laptops -so nothing very fancy or particularly over-specced. I'd say 8GB RAM was a practical minimum for what follows, but I'm running in one case on an i5 1.6GHz mobile processor, so CPU grunt is not especially necessary:
That said, be sure you are running the very latest versions of Windows 10 (or even Windows 11). In earlier versions of Windows 10, Microsoft emulated a Linux environment with 'WSL Version 1', and that won't do what we need it to do. In later versions, WSL Version 2 came out, but even then, the Linux environments couldn't talk to things like sound cards and graphics cards. But the most recent Windows 10 releases have included the ability fo Linux programs to directly address video and audio hardware ordinarily managed by Windows. It's this latest version of WSL2 that we need.
Practically, that means you want to upgrade your Windows 10 PC to be running at least 21H2... but preferably 22H1. Also note that WSL2 installs on any edition of Windows 10: Home, Pro, Enterprise... if it's Windows 10 of any sort, it should work fine.
Be aware that WSL2 is essentially a Hyper-V virtual machine running Linux in a cleverly Windows-integrated manner -but it's still Hyper-V under the hood. This specifically means that your PC needs to have either Intel's VT-x or AMD's AMD-V hardware acceleration features enabled: doing that will require you getting into your PC's BIOS (or UEFI equivalent) and finding the relevant option and enabling it. Since practically every BIOS is unique, I can't tell you how to do that on your specific PC, only that you must do it!
Also be aware that if you're running WSL2 and thus Hyper-V, you can expect other virtualisation platforms (such as VirtualBox or VMware) to behave 'problematically' after installing WSL2. If they work at all, they'll only do so in slow-as-treacle software virtualisation mode. If you are heavily in to VirtualBox (for work, say), I'd suggest that this WSL2 path might not be appropriate for you, basically: though you could install full-bore Hyper-V and hypervise solely using that technology in the future.
As a general point, I've fully updated my various Windows systems, as of February 2023. Subsequent software updates might break things, I suppose; and if you aren't at least that up-to-date, I can't guarantee that what I describe below will work correctly. But it's working for me satisfactorily, as of that date, at least.
3.0 Installing WSL2
The first thing we need to do, therefore, is to install the Windows Subsystem for Linux version 2 onto a fully patched Windows 10 machine. Happily, that's a lot easier to do these days than it used to be!
You'll need a command prompt running with administrator's privileges. So, click [Start], type the letters command until the option to run 'Command Prompt' becomes visible, then right-click it and select the 'Run as administrator' option:
Since you are asking to run this program with elevated privileges, a pop-up will appear asking you to confirm that you are happy to let 'this app make changes to your device'. Click 'Yes' to that question, and you'll finally have access to a command prompt with administrative rights.
Once you do, type this command:
wsl --install
That command will trigger quite a lot of activity, including some substantial downloads of software from the Internet (so make sure you have a functioning Internet connection before you start!):
You'll note that the Ubuntu distro gets downloaded, too: that's the default distro that WSL2 works with, but you can install lots of others (such as Debian, OpenSuse and Manjaro). However, installing those other distros is outside the scope of this article and I'll be running with Ubuntu-in-WSL2 for the rest of what follows.
You will also see from that last screenshot that once the WSL2 installation finishes, you need to reboot your PC to really finish things off. Do that now, and when you log on once more, a WSL2 window will automatically open in order to complete the installation process:
You'll see that the Linux penguin initially appears in the window's title bar; that will eventually change to the Ubuntu roundel logo. This is no longer installing WSL2, in other words, but is actually setting up a full-blown Ubuntu system within your Windows PC. It can accordingly take quite a while for everything to be downloaded, copied to the right place and configured appropriately. Be patient!
Eventually, you should get to this point:
Here, you're being asked to create a new Linux user account (and password). Note that this account doesn't have to be the same one as you use to log onto Windows itself: the two 'realms' of Windows and Linux are completely independent of each other, so you can log on to Windows as 'Fred' and Linux as 'Wilma' if you so wish. For convenience, on the other hand, I tend to re-use my Windows username and password for the Linux account, but you certainly don't have to.
So, simply type in a 'UNIX username' (I love that Microsoft can't really decide if Linux is Unix or not: they call it WSL and then prompt for a Unix username!) and then provide a password for that account (twice, for confirmation). As soon as the password is typed in the second time, this happens:
...and you'll note you're dropped into a Linux command prompt, complete with username "@" hostname prompt -to remind you who and where you are!
And that's it, really: WSL2 is now installed, along with a fully-functioning version of Ubuntu. In my case, I got Ubuntu 20.04, but by the time you read this, it's possible that you might end up with the newer long-term release, 22.04:
Note that you can close this window at any time, either by clicking the 'X' button in the top right-hand corner, or by typing the command 'exit'. You can then re-launch into your Ubuntu system at any time by clicking Start -> Ubuntu.
4.0 Update Ubuntu
Once you have a working Ubuntu system in Windows, you should update it as it's likely to have used relatively out-of-date sources to build itself. The commands to do that are:
sudo apt update && sudo apt upgrade
The output is likely to look a bit intimidating:
...but that wall of text simply means that there's 177MB of software packages that need upgrading. Answer 'y' to initiate the download and installation of all of them.
Depending on the speed of your Internet connection, the update might take a while... so be patient!
At the end of a complete upgrade of a 'real' Ubuntu system, the expectation would be that you would reboot the PC involved. But this is WSL2's virtual environment and if you try issuing the command to reboot, you'll simply be told:
...and that's clearly a bit bonkers. If the 'host is down', how is it able to send you an error message?!
The point is that Ubuntu is confused at this point: it cannot respond to a reboot command as a 'normal' Ubuntu PC would.
To reboot a WSL2 distro, therefore, you actually have to open a Windows command prompt (with or without administrator rights: it works either way) and type the command:
wsl.exe --shutdown
When you then relaunch the Ubuntu item from the Windows Start menu, the WSL2 distro will be rebooted, with all updates taking proper effect.
5.0 Install an X Server
So now we have an up-to-date command-line Linux environment co-existing with the graphical Windows desktop we know and (cough!) love. Can we get the two to interact? That is, can I launch a graphical program in the Linux environment and have it displayed in the Windows desktop one?
Well, let's test with a simple program to start with: xeyes. We first need to install that in the Ubuntu environment with the command:
sudo apt install x11-apps
You'll be prompted to supply your password; the system will check what needs to be installed to satisfy that program's dependencies; and you'll be asked to confirm you want to proceed:
Type a 'y' answer to that question and a bunch of packages will be downloaded and installed for you. Now you can type the command:
xeyes
...and this will happen:
Updated Note: be aware that in the latest versions of Windows 10's WSL2 (as of February 2023, at any rate), Microsoft added native support for X applications to draw directly onto the Windows desktop, making WSL2 on Windows 10 behave much more like WSL2 on Windows 11. If you are running such a WSL2 version, the response to typing the 'xeyes' command will be the appearance of a set of eyes, following your mouse pointer around, on your Windows desktop. This is great news: it means you can skip the installation of the X server components described below, as they are no longer needed. In this case, please jump straight to Section 8 below.
You see the problem: "Can't open display" is Linux's way of saying that it has no way of drawing graphical programs on the Windows desktop. Sure, the program is there wanting to draw things on a screen somewhere, but it has no means of doing it itself, and there's nothing it can talk to that knows how to do it, either.
The crucial bit of the puzzle that's missing is an 'X Server'. That's a piece of software which runs on Windows, and listens out to draw commands from programs running in Linux; when it hears from a Linux program, it's the X Server that knows how to display things on the Windows desktop. So, we need to install an X server before we do anything else.
The easiest way to do that is to install a program called Vcxsrv, which is freely available to download and use as much as you want. Visit that link in your Windows browser and download the program to somewhere on your Windows PC's hard disk (the Downloads folder is usually used for this!) Click the big, green 'Download' button and a ~40MB file will be fetched for you. Locate the downloaded file on your hard disk and double-click it to launch the standard Windows installer.
You'll first see a pop-up asking if you 'want to allow this app from an unknown publisher to make changes to your device'. Click 'Yes' to that and you'll then see this:
Just accept the selections made by default (which is all the possible items!) and click [Next]. The installer will suggest to house the program files in the C:\Program Files\VcXsrv folder: you may as well accept that, as one folder name is as good as any other in this context! Click [Install] when you're ready and the software copying fun will begin:
When the process is complete, you'll be able to click a [Close] button -and you'll see a big 'X' icon on your desktop, labelled 'XLaunch': double-clicking that is how you'll be able to manually launch the X Server in future. Launch the program now by doing that and you'll see this dialog:
The X Server can display Linux programs in various ways and you get to choose which of those ways should be used here. The default is 'Multiple windows' and that's the option you should generally take: so, with that item selected, click [Next].
Now you are asked what the X Server should do once it launches:
Once again, the default option ("Start no client") is the correct one to select, so just click [Next] once more. That will take you to a final page of configuration settings:
The first two selected items here are both 'on' by default, but the 'Disable access control' one is not, and you need to select it manually. The bad news is this means that your new X Server will now accept connections from any client on your network -so your kids could run a Linux program on their laptop and direct its output to your main desktop, for example! It's not the most secure way of doing things, basically... but it's the simplest.
You might also pause to read the note attached to the second option, though: 'make sure to export the LIBGL_ALWAYS_INDIRECT environment variable'. This is something we'll definitely have to do later on, and I'll show you how and what to do when the time comes.
For now, click [Next] once more. This takes you to the last page of the setup wizard:
You should click the [Save configuration] button at this point. The program will offer to create a file called 'config' with a type of 'Xlaunch File'. That's fine: there's no need to change the default filename suggestion: just make sure to save it somewhere where you'll easily find the file again in the future. I tend to save mine to the Desktop! We'll come back to what to do with this file later (see Section 9 below): for now, just save it and end the setup process by then clicking the [Finish] button.
As you do so, Windows will pop up this screen:
For a Linux program to communicate with your new Windows X Server, it needs to be able to pass its messages through the Windows firewall: you must therefore click the [Allow access] button here to make that possible. If you don't, things simply won't work properly! To make certain things work, I'd be sure to make sure both the Private and Public networks checkboxes are enabled before clicking the [Allow access] button. You can always correct the private/public settings later on using the Windows Defender Firewall settings tool, by clicking on the option to 'allow an app through the firewall', but it's simpler if you just set both options now.
Once you've opened up the firewall in this way, the installer will vanish and it will seem as though nothing really has happened. Check the system tray area, however, and you'll notice a new icon has appeared:
The 'X' symbol indicates that the X Server is actually running. Hovering over the icon also tells you that the X Server is known as 'milhaud:0.0'... that's my Windows PC's hostname, and the "0:0" bit is the 'screen identifier' the server is using to identify its work. You should make a note of this information, as we'll need it later on.
For now, then, the question is: does the fact that there's now an X Server running on my Windows PC make it possible for Linux programs to draw graphical things on my Windows desktop? Let's see:
That's me back inside my WSL2 Ubuntu window trying, several times, to launch the Xeyes program. You can see that it's still not working, despite the existence of the X Server, and even despite me using an 'export DISPLAY' command to try to explicitly tell Ubuntu how to talk to it (at that 'milhaud:0.0' identifier we identified earlier).
That DISPLAY command is nearly right, in fact: it's just that the word 'milhaud' doesn't mean anything to the Linux system as far as a specific IP address is concerned. The Ubuntu software doesn't know how to 'resolve' the name 'milhaud' into an IP address for your Windows PC, basically, and thus setting the DISPLAY to an unresolvable name hasn't helped.
The other issue is that even if we were to set up a mapping between the Windows PC name and a specific IP address ...what if the IP address changes in the future? I'm assuming you're doing this at home, where the use of DHCP means your PCs, tablets and laptops are assigned IP address dynamically, so there's the ever-present risk of them changing over time. If you hardcode a specific address into (for example) the /etc/hosts file, your configuration may well not work one day.
We need to get cleverer and subtler about it, basically!
6.0 Linux Configuration
(Note: this section is skippable, if running the xeyes command back in Section 5 produced a working result, rather than errors about 'can't open display').
In Linux, environment variables are set in a file called .bashrc (there are lots of possible ways of setting them, actually, and some distros do it differently from others... but on Ubuntu, the .bashrc file is the easiest one to deal with for now). Notice the file has a full-stop (or period) at the start of its name: that makes it a 'hidden' file, so it won't usually appear in file listings... but it still exists, even so. It is usually found in your home folder within the Linux system. To edit it, therefore, in an Ubuntu window, type this:
nano $HOME/.bashrc
We then need to append the following lines of text to the file, without altering anything that's already there:
export HOST_IP="$(ip route | awk '/^default/{print $3}')"
export DISPLAY=$(route.exe print | grep 0.0.0.0 | head -1 | awk '{print $4}'):0.0
I realise that can all look like hieroglyphics, but it's essentially just a little bit of coding magic to say 'your X server is over there, and this is how you contact it'. More importantly, it's determining the IP addresses of the Ubuntu environment and the Windows PC it's running on dynamically... so these lines of code should always result in the Linux environment being able to find and talk to the Windows one.
So: just type or copy/paste those lines to the end of the existing .bashrc and then press Ctrl+X to save (and 'y' + Enter to confirm).
To make the new bashrc actually take effect, we need to re-load it with this command:
source $HOME/.bashrc
...and then you can type this command to make sure one of the new variables has been set correctly:
echo $DISPLAY
...which should return you something like '192.168.0.167:0.0'... which is actually the IP address of your Windows PC, plus the '0:0' identifier you saw the X Server system tray icon displaying earlier.
So, with those new environment variables in force, let's try our graphical Linux program display test once more:
And bingo! There we have the xeyes "utility" displaying on a Windows desktop having been invoked from inside the Ubuntu environment. What's more, the eyes will follow your mouse pointer as it moves around the Windows desktop, even though it's being run in a command-line only Ubuntu environment! Clever stuff, indeed!
You can do this with any graphical Linux application -though there aren't many of them installed in WSL2's Ubuntu distro by default. You might like to add a fairly small one, just to make the point though:
sudo apt install mypaint
...followed by the command:
mypaint
...should result in you seeing a full-bore Linux painting program appear on your Windows desktop:
However you test it, the point is that Linux now knows how to 'draw stuff' on your Windows desktop. We're half-way there!
7.0 Automating Server Startups
(Note: this section is skippable, if running the xeyes command back in Section 5 produced a working result, rather than errors about 'can't open display').
At this point, we have Linux integrated with Windows as far as graphics are concerned, so running Niente is not going to be a drama. The only issue I can really see with this setup is that it's clunky. Specifically, if you were to reboot your Windows PC, you would discover that it comes back up without the Xserver running automatically. That, of course, might be something you're perfectly happy with -but I suspect most people would like that server to auto-start at every boot, without having to futz around with them by hand! So here's how we get the X Server to auto-run.
You will remember (way back in Section 5) that I got you to save your XLaunch configuration file as a file cunningly named 'config.xlaunch'. I stuck mine on my desktop.
To get the X Server to auto-launch at every reboot, we just need to copy that to Windows' auto-start folder, which is located at: %HOME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. By "%HOME%" I mean your own user's home folder, which is usually in c:\users\<your username>. The only issue with finding this horrendously long-named folder path is that AppData is a hidden folder, so in Explorer, you'll have to click View -> Hidden items to make it discoverable and clickable.
Here's me navigating to my personal version of that folder:
As you can see, the folder starts out empty... but anything you drop here will be executed automatically at boot-up. So, to get our X Server auto-starting, we simply have to move the config.xlaunch file here: a judicious bit of cut-and-paste is all that's required:
Once that's done, you can close Explorer down. The change won't take effect until you next reboot the PC, of course. You'll know it has worked if, after a reboot, you check the System Tray area and discover an 'X' logo there without you having to have done a thing.
8.0 Installing Niente
It's been a long article to get to this point, I realise! Funnily enough, installing and running Niente is the least problematic part of proceedings, since if you've successfully got this far in the article, Niente is certain to install and work exactly as described for the Ubuntu operating system. I shan't therefore repeat all those details here, but will merely give the basic instructions required to get Niente functioning!
8.1 Installation
Niente is installed by downloading an installation script and then running it with the instruction to fetch and install the Niente program. So, within a WSL2 Ubuntu window, you first type the command:
cd && wget https://absolutelybaching.com/abc_installer
That fetches the installation script:
Next, you run the script with the following command:
bash abc_installer --niente
...which downloads the Niente program script and installs it:
The installation will, at one point, ask for the sudo password. You just type in your Linux username's password at that point.
And that's it. That's all it takes to install Niente. Download one script, run it with --niente specified as a run-time parameter. Supply your password when prompted. Job done.
8.2 Running Niente
Once the installation is complete, you just type the word 'niente' (all in lower-case: Linux and Ubuntu are case-sensitive) to launch the program itself. There will be a few bumps along the way before it actually runs successfully, however!
Here's the first run of the program after typing 'niente' in the WSL2 Ubuntu terminal window:
The version of Ubuntu that gets installed during the WSL2 installation is pretty minimal -and, in this case, is lacking the 'bc' utility that Niente needs to even begin to run properly. It will therefore prompt you to install bc before it does anything else. The command needed to achieve this will be displayed as the last part of the red error text: in this case sudo apt install bc. You therefore simply press any key to quit out of Niente completely, back to the command prompt, and submit that command:
As you can see, the installation is tiny, requring no more than 200KB or so of downloads. Installation time is accordingly trivial. Once it's finished, you can try running Niente once more (by again typing the command, in all lower case, niente):
This looks similar to before, but if you read the actual error text, you'll note that progress has been made! This time, Niente is prompting you to install a bunch of packages which are to do with databases, FLACs and file finding. Once again, the precise command needed to install these software prerequisites is shown at the end of the red text message. Just press a key to quit Niente once more and submit that command:
This time, quite a lot more downloading will be required: as you can see from the above, in my case around 130MB of software extras were required. Installation is still relatively quick, however: a matter of minutes at most. Once it's complete, you can try running Niente for a third (and final!) time:
This message only appears the first time Niente is run with all software prerequisites satisfied: a persistent configuration file is expected to be found in the $HOME/.local/share/niente folder, and when one can't be (as will always be the case on the very first run of the program), Niente will download a 'default' configuration file from the absolutelybaching servers and store it in that folder. You just press any key at this point in order to proceed. As soon as the default configuration file is downloaded, the screen will end up displaying something similar to this:
...and that's Niente running properly on a Windows 10 PC, displaying its 'main menu interface'. Using Niente is simply a matter of taking the appropriate numbered menu options (for an explanation of which, see the rest of this manual!)
9.0 Improving the Looks
9.1 Fonts
So, Niente works... and it may even work just fine, straight 'out of the box'. On several Windows 10 installations, however, I've seen the 'music notes' logo (on the very first line of text shown in the main menu interface) look more like the ones you see here:
The square symbol next to the musical note on the first line there is not supposed to be a square! It's only displaying that way because Linux expects fonts to be able to handle what's called 'Unicode fallback encodings' for characters to display... and Windows 10 doesn't do that. Confronted with a special Unicode character, the Windows font being used to display the Ubuntu terminal gives up and resorts to drawing squares!
Unfortunately, because it's a technical Windows thing, there are zero TrueType fonts installed in Windows 10 by default which won't suffer from the same problem. Your only real fix is therefore to download and install a new font which is known to handle Unicode 'properly'.
Happily, such fonts are readily available for zero cost. One such, for example, is 'Dejavu Mono Sans', which can be downloaded as a ZIP file here. Save it somewhere on your Windows PC, not the Linux environment, then right-click the downloaded file and select the 'Extract All' option from the context menu: that creates a folder called dejavu-fonts-ttf-x.xx (where the 'x.xx' will be specific version numbers that may change over time). Inside that folder, there'll be another folder of the same name, then inside that, there'll be a bunch of files and folders -one of which will be called ttf.
Entering the ttf folder, you'll see the entire family of Dejavu fonts and you can install all of them if you wish: just right-click a .ttf file and select 'Install' from the context menu. The one we're interested in particular, however, is called DejavuSansMono.ttf
Right-click and Install that one, then you can switch back to your Ubuntu command window. Click the little Ubuntu 'roundel' icon in the left of the title bar and select Properties:
As you can see, a dialog pops up in which there is a 'Fonts' tab. Click on that, then locate the new font in the list shown in the middle of the dialog. I don't think you'll particularly need to alter the font size, but you can do so if you wish. Click [OK] when you're ready and the rogue squares should now have gone, to be replaced by correctly-displayed semi-quavers:
Well... it's solved temporarily. You only set the properties of the currently-running Ubuntu command prompt. If you want to set them for all future Ubuntu command prompt windows, you need to right-click the Ubuntu 'roundel' once more, but this time select Defaults. Make exactly the same alterations to the Fonts tab as before, and now you're genuinely set to use good-looking fonts that understand Unicode correctly.
9.2 Terminal Widths
Niente expects the terminal in which it is run to be at least 103 columns wide and 28 rows deep. Windows' default terminal sizes are much larger than that, however. If you want to fix that, you again need to click on the Ubuntu roundel, select Properties (for a one-time fix of the current window) and/or Defaults (for a permanent fix of all future windows). This time, instead of the 'Fonts' tab, you need to select the 'Layout' one.
Be careful not to change the 'Screen Buffer Size' section: the one that alters what we need altering is labelled 'Window Size': change those settings to 103 and 28 respectively:
10.0 File Access
I thought I'd conclude this very long article by a quick look at how you 'map network drives' inside a WSL2/Ubuntu environment -simply because I myself never store my music on my main PC, but instead access it over the home network. Thus any Windows PC running WSL2/Ubuntu won't have any local FLAC files to play and will instead need to find them on a remote server.
More fundamentally, the question is 'how does the Ubuntu environment see what the Windows PC knows about' (and a related question is how you can see the Ubuntu environment's folders from Windows)?
10.1 Local Files
Let's start with the simplest case: how can you see your Windows PC's C: drive from within the Ubuntu environment? That one's easy: it's accessible from Ubuntu's /mnt/c folder:
Ignore for the moment the various 'permission denied' errors in that lot of output: take a look instead at the list of folders displayed there. Do they look in the least bit familiar? How about now:
And hopefully you will be able to recognise that the listing of /mnt/c in the Ubuntu environment exactly corresponds to the contents of your C: drive on Windows.
If you wanted Niente to process some music you had stored in your Music folder on Windows, therefore, you'd simply navigate inside Ubuntu to /mnt/c/Users/hjr/Music. (Though, obviously, if your username isn't 'hjr', you'd replace that bit with whatever is more relevant to you!)
For the record, you can do the same thing in reverse: if you open Windows Explorer (i.e., the File Manager) and type \\wsl$ in the address bar, you'd be able to navigate your way through the Ubuntu file system using a purely Windows tool:
Hopefully, you recognise the contents of the main panel there as being what you'd expect to find in the /home/hjr folder inside my Ubuntu environment!
The point is that whilst we have two separate operating system environments -one Windows, one Linux running 'inside' Windows-, they both share the same file system and each can 'see' the other, though they remain distinct within their own folder structures. If you store all your music files on the C: drive, therefore, it's not going to be hard to get Niente to 'see' them: you just tell it to play the contents of the /mnt/c/username/Music folder (or wherever is actually applicable).
10.2 Remote Files
What do you do, however, if your music files are stored on a remote server and you've mapped that 'share' to your Windows PC's M: drive, like this:
Here, I have a server called 'jsb' which I've mapped to my M: drive. All my music is thus accessible in Windows by visiting the M: drive and its various sub-folders. How can I get Niente running in the WSL2/Ubuntu environment to see that M: drive? If you try visiting /mnt/m inside Ubuntu, for example, you'll find that doesn't work.
Well, the quick fix (which won't persist between reboots) is to issue this command from within the Ubuntu environment:
sudo mkdir /mnt/m && sudo mount -t drvfs M: /mnt/m
Here you see me first listing the contents of the /mnt folder inside the Ubuntu environment: the C: drive mapping is listed (along with a 'wsl' one, which is of no interest), but there's no M: drive. So I issue the above command... and all of sudden, a new listing of /mnt does show an M: drive, and I can 'cd' into it and list its contents, too.
The command is actually in two parts: the 'mkdir' makes a new /mnt/m folder permanently... but it will be merely an empty placeholder at this stage. The second part then mounts or maps the Windows' M: drive to the empty placeholder folder -and thus makes it appear to contain the same contents as the Windows' drive.
As I say, this will grant you temporary access to a mapped network drive. Reboot your PC or restart your WSL2 environment and though the /mnt/m mount point will still be there as a folder, its contents won't be.
The persistent fix, therefore, is to issue this command from within your WSL2/Ubuntu environment:
sudo nano /etc/fstab
...and then add this line to the end of the existing file:
M: /mnt/m drvfs defaults 0 0
...which is simply another way of saying 'please make my Windows M: drive appear at the /mnt/m mountpoint I created earlier'. Because that request is in the fstab file, however, it will be re-executed automatically every time the Ubuntu system re-initialises: your /mnt/m folder will therefore automatically and always contain the contents of your Windows' M: drive.
Once the Ubuntu environment can 'see' your network files, you can simply use the Niente main menu Option 11 to configure the MUSICDIR parameter to be something like /mnt/m, after which you can start the process of Niente database creation and integrity checking with confidence that Niente will be working directly on your networked music files:
11.0 Conclusion!
This has been a long article and it is accordingly easy to get overwhelmed by it and think it's way too hard to get Niente working on Windows. Appearances are deceptive, though! The process is really quite straightforward:
- Install WSL2 into Windows and then install the x11-apps package into the resulting Ubuntu environment.
- If the xeyes application runs correctly inside Ubuntu, skip to installing Niente (step 3 below); else:
- Configure an X Server to run on Windows
- Configure the X Server to automatically re-start on Windows
- Configure Ubuntu (via the .bashrc file) to know where its X Server can be found
- Install Niente and associated package dependencies (probably requiring bc installation first; other packages second)
- Get some decent terminal fonts, so Niente's output isn't garbled
- Know how to access Windows' local and networked files from inside Ubuntu
So yes, it's a long article because there are a quite a number of steps you either have or might want to do, but none of them are particularly difficult, if you're careful with your typing! But: now you've got Niente running on Windows, please go and read the full Niente documentation for Linux, for it applies completely to the setup you've just created.