Hacker News new | ask | show | jobs
by derefr 3345 days ago
Rather than dropping compatibility entirely, I've always wondered why no modern OS has gone the route of creating a "compatibility layer" that's actually a (very-tightly-sandboxed) VM containing a [stripped-down] older copy of the OS.

This would be perfect to re-add Win16 support to W10, for example. Try to double-click a 16-bit app? It opens with its handler, "Windows 3.1 Hyper-V Association Background Launcher". As long as no W3.1 apps are running, it unloads, and the rest of the OS can be completely free of 3.1-era cruft.

You could deprecate features from your latest OS at a breakneck pace if you really took this strategy to heart. WinRT really could have been just Metro/UWP + a "Desktop" that's actually a Windows 7 VM with a high-level paravirtualized shared filesystem.

(And it's not like Microsoft didn't do this themselves before; this is essentially how DOS applications ran under Windows 3.1, in a [hypervised!] DOS VM.)

---

EDIT: let me clarify the specific point I was getting at.

If you ship $OldOS as a VM within $NewOS, very tightly sandboxed, then you never have to update $OldOS again, nor do you have to keep the code from $OldOS around in $NewOS. The $OldOS VM is now a "static artifact"—something that will never change, but will continue to run old software perfectly.

So, if $OldOS gains more security flaws, you don't update $OldOS; you update the virtualization software to make the sandbox stricter.

And when you find that your $NewOS is now, itself, old—well, you just do the whole thing again, writing an emulator for $NewOS within $EvenNewerOS, and then your $OldOS programs run by launching a VM-in-a-VM. If you like, you can port the $OldOS emulator to run on $EvenNewerOS—but you could also just consider it legacy software of exactly the type your $NewOS emulator is built to run.

The point of this is to decrease maintenance burden, by freezing the previous OS, so that you never need to think of it again. This wasn't what was done with "XP Mode"; Windows XP continued to receive updates as a component of Windows 7. The point here would be to EOL the older OS, and then virtualize it.

8 comments

Windows 7 included what you describe as a feature called "Windows XP Mode," which would launch applications inside a Windows XP virtual machine which was closely tied to the host OS. It worked really well for a lot of applications which weren't ready for Win 7 yet.

https://technet.microsoft.com/en-us/library/ee681616(v=ws.10...

It wasn't really that closely tied, if I remember. It simply used Terminal Services to run a single application on the server. You've long been able to open local documents with remote applications, and have the general experience very close to a local application.
Windows Virtual PC, the core of the technology, is more akin to VMWare, VirtualBox. The "Windows XP Mode" part of the equation was that Microsoft offered a pre-installed image of Windows XP.

While the virtual environment integrated somewhat with the base (eg audio, printers, some networking shares and hard drives), it still is a separate window running a separate virtualized OS. I'm not sure I would call that too tightly integrated.

Nonetheless I personally found it handy nonetheless to run the occasional very old 16-bit application.

Was sad when I found out they dumped it for Win8 and newer...
> Rather than dropping compatibility entirely, I've always wondered why no modern OS has gone the route of creating a "compatibility layer" that's actually a (very-tightly-sandboxed) VM containing a [stripped-down] older copy of the OS.

I think Raymond Chen discussed this on this blog at one point. The answer is that users want a single integrated environment for all their apps and not a bunch of isolated sandboxes. They want to drag and drop, copy and paste, share files, inter-application communication, etc. They also want a single look and feel.

The other reason is that creating a new platform from scratch is a good way to lose features and alienate developers. The core of Windows NT doesn't look anything like Windows 3.1 but for developers the API they present is similar enough to get them on board.

https://www.joelonsoftware.com/2000/04/06/things-you-should-...

MS tried to rewrite and get compatibility by using these sorts of features. It was looked at by the PMs and dismissed because it was completely broken.

Turns out most hacks are in the software for a reason. They actually solve a problem that needs solving. Who knew ?

OSX did this when they went from 68k to PPC [0], from PPC to x86[1], and also with Classic to support macos 9[2]. They maintained compatibility by emulated the previous architecture on the new one.

[0] : https://en.wikipedia.org/wiki/Mac_68k_emulator

[1] : https://en.wikipedia.org/wiki/Rosetta_(software)

[2] : https://en.wikipedia.org/wiki/List_of_macOS_components#Class...

Mac Classic was great. For some reason the G4s they issued us in high school didn't have the Classic compatibility mode locked down as tight as everything else useful (to a teenager), so I could play older Mac video games in study hall...
Ah, this is virtualization, though: the OS was trying to integrate the software from the old OS, letting it interact with all the older APIs of the modern OS as if it was running directly on it. Less like a VM, more like Wine.

My point was less about compatibility, and more about security. If you took this approach, old software would still expose the new OS it was virtualized atop of, to its old security flaws. So you'd still have to move away from old software, eventually, for security reasons.

But with proper VM isolation (and checkpointing, and a few other things), you could still have programs like IE6 around today, serving in its last purpose as the '90s-era Intranet web-services equivalent to the '80s 3270 mainframe terminal clients.

Most any modern VM software can offer this level of isolation, but most have "host integrations" that turn them back into security holes. To be able to ship a static, EOLed copy of XP that could run IE6 indefinitely, without that causing problems, your compatibility layer would need to be a lot less like "Windows XP Mode" or Rosetta, and a lot more like DOSBox or qemu.

There is one case where this already happens: many pieces of IBM z/OS software have been wrapped in layers of hard-isolated emulators for decades now, such that programs from the 70s are able to continue running without recompilation, atop a stack of VMs, where many of the intermediary pieces of VM software have themselves long been EOLed.

In fact beyond virtualization, it was emulation. I remember trying to install Windows 95 on my iMac G5 under QEMU and having it barely usable. Trying to debug issues with my setup using a very buggy PPC build of Firefox.
This is partially the motivation behind MSR's Drawbridge project (which is the predecessor for Windows Subsystem for Linux), the idea being that the personality of the OS runs in user space and each application runs in a sandboxed picoprocess. All ~14,000 functions exposed by Windows DLLs could be implemented by a narrow ~45 ABI calls provided by the host.

https://www.microsoft.com/en-us/research/project/drawbridge/

Technically they're already doing it via their subsystem mechanism. They're taking it "to the next level" with the Linux subsystem, where there's a kernel driver emulating a totally different kernel
> I've always wondered why no modern OS has gone the route of creating a "compatibility layer"

You could even hold down the Commodore key while booting to get a mode compatible with the previous system.

Yep. Many of their products stood or fell relevant to their C64 compatibility.

Once a install base has been built up, compatibility (or lack there of) can make or break you.

Perhaps I'm missing something, but that sounds pretty much exactly how Win16 apps worked on 32-bit NT.
Early releases of OSX did this using "Rosetta"