Monday, 27 March 2023

Running an INDI server on Windows

Running an INDI Server on Windows


We now routinely use an INDI server to control the mount and other devices with AstroDMx Capture for all platforms.


The INDI server always runs on a POSIX compliant operating system and we frequently use a Raspberry Pi running Raspberry Pi OS, a version of Debian Linux. With this system we can use AstroDMx Capture for any platform to control the mount and whatever other devices. However, we note that not everyone has a Raspberry Pi computer and due to supply chain shortages, they are, at the time of writing, hard to obtain.


We therefore explored installing an INDI server on the imaging computer which cuts down the amount of hardware required. This is fine for POSIX compliant operating systems such as Linux and macOS, but can't be done directly with Windows because Windows is not exactly a POSIX compliant operating system.


INDI was developed for the POSIX compliant operating systems: Linux, macOS, FreeBSD and  OpenBSD; all UNIX-like operating systems. Mac OS is largely POSIX compliant and has UNIX 03 certification by The Open Group® as conforming to the Single UNIX Specification. It is also noteworthy that two Linux distributions based on CentOS also have UNIX certification; these are K-UX®; K-UX and EulerOS®; EulerOS.


The Linux Standard Base (LSB) was established in 2001 to try to standardise the internal structures of Linux-based systems for increased compatibility. It is based on the POSIX specifications, the Single UNIX Specification and other open standards.  All of these facts make two important points, Firstly, that Linux (a UNIX-like OS) is basically UNIX, but without the expense (who would pay?) of UNIX certification. Secondly, because Linux ensures that it is compliant with the same standards as UNIX, and has from the very start, the distinction between UNIX and Linux is basically semantic. Unix seems to be on the decline, with more and more IT vendors moving their investments from UNIX to Linux. New technologies and applications are often not tested or certified on UNIX systems, but instead are developed for Linux platforms. So, Linux is now increasingly occupying the niche previously enjoyed by UNIX.


In the early 1980’s there were three branches of UNIX development: Firstly, UNIX system III from the Bell laboratories UNIX Support Group. Secondly, Berkeley Software Distribution (BSD®) from the University of California at Berkeley.  The third branch of UNIX development was Microsoft’s XENIX®, a version of UNIX that ran on the X86 family of processors’ and licensed from AT&T Corporation. In fact, in the early 80s, XENIX had the largest installation base of any UNIX system. UNIX fragmentation produced compatibility problems between UNIX versions which gave rise to the formulation of the POSIX® standard (Portable Operating System Interface for UNIX), which was an attempt to standardise the system-call interface in order to maintain compatibility between operating systems.


Microsoft with Windows NT, made moves towards being POSIX compliant. This is because they wanted to win an Air Force contract. The Federal Information Processing Standard FIPS-151 required that some types of government software purchases had to be POSIX compliant. In order to meet the requirements Microsoft got a company called Softway who were marketing a POSIX compliant subsystem called OpenNT to produce a solution that they released as 'Interix' that sat side by side with Windows as an environmental subsystem and called the NT Kernel directly. This meant that it was possible to compile and run POSIX code. Microsoft incorporated the Microsoft POSIX subsystem into the first versions of Windows NT. However, the Windows NT POSIX subsystem did not incorporate a POSIX shell or any UNIX commands. Nevertheless, the system was sufficiently POSIX compliant to allow Microsoft to win the contract. Microsoft eventually bought Softway and after a couple of re-namings 'Interix' became 'SUA' 'Subsystem for UNIX-based Applications. SUA was deprecated in Windows 8 and removed altogether from Windows 8.1. POSIX returned to Windows with WSL (Windows subsystem for Linux) in Windows 10; eventually with a Linux kernel and finally packaged as a Windows 11 application available from the Microsoft store. 


It is important to understand that being UNIX does not depend on, for example, having a certain kernel; it depends on meeting a number of criteria, mainly POSIX compliance, to conform to the Single UNIX Specification. If Microsoft had gone all of the way in making Windows compliant, Windows too could have been classified as UNIX. This was obviously not what Microsoft wanted.


Putting an INDI server on a Windows 11 computer to run alongside AstroDMx Capture.


Using an Oracle VM VirtualBox


We have previously written HERE about installing on a Windows machine, Oracle VM VirtualBox running a Linux distribution. (That was back in the days before Nicola had ported AstroDMx Capture over to Windows, and this was a way of running AstroDMx Capture on a Windows computer) The procedure shown could be used to install Oracle VM VirtualBox with a Linux guest OS, but it is, of course, no longer necessary to install AstroDMx Capture into the VM , only the INDI server will be installed in the VM.


This is a quick and simple solution and is the one we prefer.




Using Windows Subsystem for Linux


We have tested installing WSL2 on Windows 11 and then installing an INDI server into it.

However, WSL is not as mature as Oracle VM VirtualBox and the application here is not really why Microsoft has put WSL into Windows. They have developers in mind: ‘The Windows Subsystem for Linux allows developers to run a GNU/Linux environment, including most command-line tools, utilities, and applications, directly on Windows’. Basically, because many, if not most developers work in a Linux environment and Microsoft’s Cloud systems largely use Linux systems, Microsoft believes that it is no longer necessary for developers to have separate Linux computers. This is all well and good, but Microsoft has neglected to make provision for USB devices to be passed through to WSL. When the Microsoft website is searched it is found that they suggest an Open Source solution to do this. We have done this and found the WSL solution to work.




We may write a separate article to describe exactly how this is done, but unless the user is already using WSL2 for other reasons, we suggest that the Oracle VM VirtualBox or possibly another virtual machine solution is the way to run an INDI server on a Windows machine.