Installing Niente on Windows 11

1.0 Introduction

I find myself in a bit of a dilemma as far as running Niente on Windows 11, because I lack any hardware that is capable of running it in a supported fashion... yet, I do run it on a vintage 2012 spare laptop and Niente runs on it perfectly well. It remains, however, a problem to offer support for doing something on a platform that remains, for me, technically unsupported! Therefore, I won't: if you want to run Niente on Windows 11, I'll give you instructions which have worked for me, but I cannot vouch for them in the long-run and I won't offer support for it. You're on your own, basically! Of course, if you are a well-off classical music enthusiast who loves using Windows and wants to donate Windows 11-supported hardware on which I can continue to develop Niente for Windows 11 in a properly supported manner, do please get in touch!

Those preliminaries out of the way: whilst Niente itself merely sips PC hardware resources, the Windows Subsystem for Linux version 2 (WSL2) that makes it possible to run Niente at all is a bit of a resource hog. It works, fundamentally, by co-hosting a virtual Linux PC alongside and simultaneously with the running Windows one. That sort of virtualisation immediately demands a 64-bit operating system and reasonable quantities of memory and CPU grunt -though we are not in ludicrously-overspecc'd monster gaming PC territory! I mentioned my 2012-vintage HP Folio13 onto which I've managed to crow-bar a working version of Windows 11, despite its ancient and unsupported hardware: it manages on 8GB RAM, a 500GB solid state hard disk and a 2nd generation Intel i5, 2-core CPU running at a sedate 1.6GHz. That seems at least adequate.

2.0 Installing WSL2

Before you can even think about running Niente on Windows 11 then, you have to first install the Windows Subsystem for Linux itself. Fortunately, Microsoft has made this a walk in the park these days! Just open a command prompt window with Administrator privileges (so, click Start, search for 'command', then right-click the Command Prompt item and select Run as administrator):

In the command window that then appears, type the command:

wsl --install

This triggers quite a lot of activity, including downloading a complete copy of Ubuntu:

Note in particular the mention of 'GUI App Support has been installed': it's this message which tells you that you're actually installing WSL2g, where the 'g' indicates baked-in support for graphical and audio Linux apps to run in a Windows environment.

Once the Ubuntu download is complete, you'll see a message that reads, "The requested operation is successful. Changes will not be effective until the system is rebooted." So, reboot your PC when you're ready.

When you log in after the reboot, "things" start happening automatically! To begin with, you'll find a command-prompt-lookalike window appears, though it's got an Ubuntu roundell as its logo in the title bar and task bar:

This installation process takes a few minutes and ends with you being prompted to create a new UNIX account (note to Microsoft: Linux isn't actually UNIX, so there's a terminological inexactitude at this point, but whatever...):

The account you create at this point doesn't have to match or be the same as your Windows' username/password combo... but I usually make them the same anyway, for ease of remembering things! Once the password has been accepted, you will find yourself staring at a full-blown Linux command prompt, where you can type all sorts of Linux-y things:

...by which you will swiftly learn that though this is 'proper' Ubuntu, it's using a special 'Microsoft WSL2' kernel. It's a technical detail which needn't detain us now, but it's interesting.

3.0 Post-WSL2-Install Steps

Once you've installed WSL2, you need to update it. At the Ubuntu command prompt, therefore, type:

sudo apt update && sudo apt upgrade

A lot of software download will then take place, followed by a long process of updating hundreds of packages. Give it time and let it complete.

Once it does, I would also take this opportunity to issue this command:

sudo apt install x11-apps

...swiftly followed by:

xeyes

...which will appear to pause for quite a few seconds before displaying this sort of thing:

The pair of eyes is a Linux program running on the Windows desktop and, incidentally, interacting with the movements of your mouse around the Windows desktop: it's clever stuff, basically! Close the eyes when you're done proving that Linux graphical apps appear on the Windows desktop without you having to install third-party X servers.

Now, you should reboot your Ubuntu 'virtual environment' so that the software updates we applied earlier actually take full effect... but you can't reboot WSL2 by typing 'reboot' at the Ubuntu command prompt! You'll get an error message about 'System has not been booted with systemd...' if you try! Instead, to reboot a WSL2 virtual environment, you open a Windows command prompt window (administrator rights are not required) and type:

wsl.exe --shutdown

To then simulate powering on your Ubuntu PC once more, you simply click Start -> Ubuntu, and that will re-open the Ubuntu command prompt window afresh.

4.0 Installing Niente

At your freshly-rebooted Ubuntu command prompt, type this command:

wget https://absolutelybaching.com/abc_installer

That quickly fetches a tiny (7KB-ish) text file from this website's servers:

You then run it as follows:

bash abc_installer --niente

That will trigger a further software download and a prompt for your password to grant sudo privileges:

And that's really all that's required to install Niente! Next, we have to launch it and navigate one or two extra steps to get it running!

5.0 Running Niente for the first time

To run Niente for the first time, just type the command:

niente

It is quite likely at this point that you'll be met with this error message:

The version of Ubuntu that gets installed when you install WSL2 is pretty minimal and therefore is likely to lack the 'bc' utility which Niente needs as an absolute prerequisite before it can even work out what other software it needs to have been installed before it can work properly. Therefore, if bc is found to be missing, it will be prompted for separately in the manner you see above. The command to install the missing package is shown at the end of the red error text: in this case, sudo apt install bc. You therefore press a key to quit out of Niente and get back to a command prompt and type that command in: the installation will be over in seconds, because the bc package itself is so small (a couple hundred kilobytes or so).

Once bc is installed, you can try running Niente once more (again, by typing the command niente):

Superficially, this might look like the same error as before, but it's not: now that bc is present, Niente was able to do a proper software inventory and has determined that several required packages to do with FLACs, databases and file finding need to be present before it can work properly. Note that the precise list of 'missing' software dependencies will vary: if you've already installed Giocoso or Semplice into a WSL2 Ubuntu environment, for example, then it's quite likely that no software packages will be detected as missing at all!

If you do get told required packages are missing, however, then you simply press a key to return to the command prompt and type the installation command that appears at the end of the red error text. In my case, that's simply sudo apt install fd-find sqlite3 flac ffmpeg:

As you can see, some 140MB of software had to be downloaded for me at this point. Once the installation of those packages is complete, you're ready to run the niente command a third time, and this time you'll have a more successful outcome:

At this point you are met with a yellow warning message to say that a required 'persistent configuration file is missing': this is not a surprise, as the abc_installer program doesn't create one! So, the first time you run Niente after all the software dependencies are met, the lack of a persistent configuration file will prompt Niente to simply download a generic, default one from this website's servers. You just press a key to make the download happen (which takes fractions of a second to complete, because the plain text file is tiny). As soon as the configuration file has been downloaded, the screen will change to show this:

...and that's Niente running in all its glory in a Linux environment running within a Windows 11 operating system.

6.0 Visual Tweaks

Niente will warn you if your WSL terminal is too small to display itself correctly: it ideally wants a terminal that's 103 columns wide and 28 rows deep. You can ignore the warning that results if your terminal is smaller than that, but the program output is likely to be badly garbled if you do. Ideally, therefore, you should set your terminal size to the 103x28 recommended dimensions. In Windows, you can achieve this by right-clicking the little Ubuntu roundel that appears in the very top-left corner of your Linux/Bash terminal window and selecting 'Defaults' from the context menu that appears. Switch to the Layout tab when the Console Windows Properties dialog box then appears:

Here, I'm setting the 'Windows Size' numbers to be 103 and 28 for Width and Height respectively. If you want to change colours, fonts, windows positioning and so on: these are also things you can fiddle with at this point, by clicking around and seeing what settings are available. When you're done, click [OK] and then any future Console windows you open will adopt the new settings as their own.

7.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)?

7.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).

7.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:

8.0 Conclusion

Summarising  all of the above, then:

  • The Windows Subsystem for Linux (WSL2) on Windows 11 means you don't have to worry about installing third-party audio or graphical servers on Windows for a Linux virtual machine to talk to: it's all baked-in and ready to run by default (unlike on most Windows 10 installations at the time of writing, for example)
  • Installing WSL2 is a simple one-line command: wsl --install
  • Niente is then installed within Ubuntu by downloading the abc_installer script and running it with the --niente runtime parameter
  • Niente will prompt for installation of extra software within the Ubuntu environment (probably bc to start with; other packages the next time it's run)
  • When all software dependencies are met, Niente will download a persistent configuration parameter file when you press a key at the relevant prompt message
  • Anything that's available on your Windows PC is accessible directly from within the Ubuntu environment at the /mnt/<drive letter> folder, though files accessed via a remote server need special mounting commands before the Linux environment will be aware of them

|[Back to Front Page]