Virtual Machines for BBSs: WSl2
From
Alpha@21:4/158 to
All on Sat Oct 24 15:35:06 2020
I wanted to post a recap of my time spent with setting up various VMs for use with BBSs, mystic in particular. Not sure if it's helpful to anyone!
In this case, it's Windows 10's new(ish) WSL2.
Why run a BBS on a Virtual Machine?
PCs are cheap, particularly the kind of specs that are needed to run a BBS. You probably have one lying around. Why not just re-purpose that as a linux box?
Yes, yes. Do that. But this is about VMs!
Most likely scenario, like me, you want to run the Linux version of a BBS but have only a "main" Windows or Mac machine. Also, VMSs are great for spinning up testing environments, too.
There are many options: WSL1+2, Hyper-V, VirtualBox--all of which can be run locally. There are also (paid) cloud-based ones, of course. But I wanted a local--and free--solution.
Enter WSL2...
The latest updates of Windows 10 from Microsoft comes with the option to install "Windows Subsystem for Linux 2" (WLS2). There are various tutorials out there on how to enable and install a linux distro like Ubuntu.
WSL 2 *is technically* a virtual machine, but in MS's words "not like any VM you've seen before." It utilizes a very minimal Hyper-V toolset to run the Linux kernel. The file mounting/sharing, command running, and networking between your Windows desktop environment and the WSL2 environment is seamless and *nearly instant* on launch. You do not have to manage this environment -- it will update alongside Windows.
Note: the "VM" isn't running until it's launched via the terminal app. And it launches in ~1s. This is a full system boot. That's pretty... Wow.
Why it's ideal...
File system integration is amazing, particularly for running an Ansi editor. You don't have to load a VM manager or start, stop, etc. Type "code" in linux and your Windows vscode editor pops up. Nice.
Bad news: why it doesn't work... yet...
Bottom line, there are just too many hurdles to make this work right now:
- Networking: By design, WSL 2 seems to NAT it's virtual network, instead of making it bridged to the host NIC. Which means - it's basically unreachable on your local network by default. The machine gets a new IP every time the machine reboots. So if you are running some sort of virtual server or port forwarding via your router to the BBS, it's difficult to map. There are some community scripts to work around this--essentially new firewall rules have to be created dynamically at start up, linkages, etc. etc. but it's a major kludgy pain. The github threads are endless. MS does plans to fix this, eventually.
- No real persistence: The ideal use-case from MS is: open the WSL2 terminal, do some linux stuff, close it out. Done. It is not intended (right now) to be used as a server where you need services/processes to be running all the time.
(Also, you can only install a console version of linux at the moment,
but some folks have tutorials on adding graphical front-end/X packages and connecting over RDP...)
Recently MS added support for daemonized processes to stay active, but it's spotty. I'd find about 50% of time when I close the terminal, my mis process would halt. There is also *no systemd support* for WSL2; MS is working on this, but you've got no reliable way to run scripts on start because Microsoft controls the "boot up" process. Deal-breaker for me.
- No graceful shutdown: MS needs to install a 2am update? -ZAP- you get a hard power-off, and then when it restarts: no local network connectivity, no BBS running, etc. And possible data corruption. You *can* turn off Windows 10 auto-updates, but MS doesn't make this easy, either.
Bottom line...
WSL2 shows GREAT promise for being an easy linux solution for running a BBS like mystic, but it's not ready for prime-time. When there's a solution for bridged networking, systemd support and a way to gracefuly start/stop the VM, it'll be a killer option!
The next approach is utilizing Hyper-V, Microsoft's built-in VM manager, which works marginally better--you can install any server or desktop linux and run it just like you would on a non-VM.
But that's another post for another day.
|07┌[|08..|15Alpha|08.....................|07]┐
|07├[|08..|11The Drunken Gamer BBS|08.....|07]┤ |07└[|08..|03TheDrunkenGamer.com:8888|08..|07]┘
--- Mystic BBS v1.12 A47 2020/10/20 (Linux/64)
* Origin: The Drunken Gamer BBS (21:4/158)