NASA actually uses both Windows as well as Linux, depending on the specific task they are doing and the environment.
At NASA windows operating system is used alongside of macOS as well as Linux operating system on everyday NASA office desktops as well as general NASA internal workstations, and was also previously used on ISS laptops before migration.
NASA flight hardware and embedded systems also often rely on real time operating systems such as VxWorks, instead of general purpose desktop operating systems.
And Linux operating systems at NASA dominate supercomputing clusters like Red Hat Enterprise Linux based systems on NASA Advanced Supercomputing systems, servers and mission critical operations.
Also, NASA migrated ISS or International Space Station laptops over from Windows operating system to Linux operating system, like Debian and Scientific Linux, beginning around the year 2013 for greater control and stability.
SpaceX uses a customized version of Linux (with real-time patches such as Preempt RT) across its rockets and spacecraft—including Falcon 9, Dragon, and Starship.
Operating System & Code: Modified Linux kernel with mission-specific drivers and real-time scheduling tweaks; flight software is written primarily in C++.
Hardware & Redundancy: Runs on commercial x86 processors rather than traditional radiation-hardened chips, using triple-redundant computing (voting in triplicate) to tolerate faults.
User Interfaces: On Crew Dragon, touchscreen displays use web technologies (like Chromium and JavaScript), backed up by physical controls.
Development Ecosystem: Using Linux across flight systems and engineering workstations streamlines tooling, hiring, and development.
Because SpaceX runs the software internally and on its own vehicles rather than distributing it externally, GPL licensing does not require it to publish all custom kernel modifications, though it can contribute patches upstream.