I use a MacBook Air M1 as my dev laptop, and I just wanted to have a reproducible dev environment running Debian.
My options: use devcontainer, or use a VM on Virtualbox, VMWare, Parallels, UTM, etc.
VSCode & Typescript gets messed up every now and then, such that they don't work and I simply can't continue with them. Not sure why, but I think there are weird internal bugs in those that surface whenever there is some special combination of circumstances on my machine. With devcontainer I think VSCode still runs directly on my machine but connects to the container, so this is nto a solution for me, I need a real VM.
So I try VirtualBox first. After spending hours installing Debian on a VM and getting it running nicely, within a short time the VM slows to a crawl. Nothing I do reliably fixes this. I also cannto get the display resolution to behave properly. I give up on VirtualBox, again (I keep trying this every few years forgetting why I don't use VirtualBox)
Next, I want to try VMWare, only to find out it is sold to Broadcom, and when I follow the link to their page, I'm supposed to log in to download, and yet I see no way to register. Oh well.
Next, I try Parallels. After getting a Debian VM running on it, I marvel at how smoothly it works. I'm in the trial, but I'm not going to have a problem paying up if everything goes on well. Alas, it was too good to be true. I start to to have random loss of internet connectivity (weirdly affecting the terminal only) in the VM. I see that the default networking mode is shared networking. I read guides online suggesting to switch to bridged networking. After spending oodles of time setting up the firewall and other security configuration on the VM and switching to bridged networking, I'm still having intermittent connectivity issues. it seems they are even worse now. Suddenly I remember again why I don't have a Parallels subscription after all these years.
Frustrated, I finally give up. I ruefully remember that UTM also has similar performance and screen display problems as VirtualBox.
So what options are left? I can't really physically install a dual-boot Linux on my Macbook (Asahi notwithstanding, since I only want Debian). Maybe I could sign up for a cloud VPS and use that. Or just buy new AMD mini PCs and run Debian on those. Either way, it's clear the virtualization story, after decades of supposed tech advancement, is still a bitter one.
Virtualization is definitely solved for your use case on Linux. Personally I use virt-manager for the UI but its all qemu underneath AFAIK.
I am running 100% automatically deployed/configured Debian desktops on Apple hardware for several years now, Intel and M1 CPUs. (100% reproducible is another level and another story).
Right now and for most of the past years I am running VMWare Fusion, which works with the features I need as long as you don't update macOS immediately after a new major revision was released. (Apple messing up internal APIs nearly every time.)
Sometimes in the past I also used the QEMU version provided by macPorts, and the only issue I had was with my non English keyboard, if you use a US keyboard layout you shouldn't have any issues at all.
Still, I am surprised, you seem to imply that you need to provision a new VM because of trouble with TypeScript/VSCode? Not sure what you are doing, or what plugins in VSCode you are running, but that I have to provision an entirely new VM to solve such kind of problems never happened to me and I haven't heard about that in my environment (big company, quite a lot of VSCode and TypeScript users).
Just now things are starting to catch up, but there's still a wide gap in features; Apple Virtualization Framework is still very limited. And a personal limitation I hit recently, no USB4/Thunderbolt passthrough anywhere, not in UTM (which uses AVF), not in VMWare either.
Also remember the final Apple Silicon version of VMWare supporting M1/M2 wasn't available until November 2022 (it was a tech preview before), while all the Broadcom situation was ensuing. And I think only as of 2024 it runs smoothly. So far it's still the most reliable for desktop Linux VMs for me. Windows 11 for ARM runs very well too, and it does x86 emulation transparently, even 2010s games run well.
Virtualization is a solved problem. In fact, it's the virtualization of the IBM 1401 that was made available as an option on the IBM 360 systems that caused (or greatly contributed to) the Y2K problem a few decades back.
Because new architectures and instruction sets happened every few years, the expected lifespan of any program back in the 1950s-60s was expected to be less than a decade. Combined with the eye-watering price of memory back then, it made sense to save every possible bit of RAM. Those programs weren't expected to be alive anywhere near the year 2000, when many of their assumptions about dates would prove invalid.
You can emulate a 1401, System 360, PDP-11, VAX 11/780, IBM PC, or pretty much any mass produced computer more than 20 years old on your computer, or even on your smartphone. It'll run with almost perfect fidelity, except that it'll likely run way too fast for timing related things. (I'm looking at you, Turbo Pascal runtime)
I haven't tested VirtuaBox on latest Mac versions as I'm happy with VMWare Fusion (also on ARM M1/M2 machines). The product is still good, regardless of Broadcom's business shenanigans.
Edit: If Parallels works for you, but only the SSH terminal sessions get stuck, maybe the "shared network" connection drops your connections for some reason. Before diving too deep into troubleshooting this across layers, you could try out the usual suspects workaround, setting SSH TCP keepalive. I have this for some connections in my ~/.ssh/config file:
TCPKeepalive yes
ServerAliveInterval 30
why?
I don't understand why you need a real VM here for a dev environment, you don't. A docker file-based dev container will work on your machine and then work just the same with dockerfile deployed wherever in the cloud or on a server.
see : https://code.visualstudio.com/docs/devcontainers/create-dev-...
> Work with a container deployed application defined by an image, Dockerfile, or Docker Compose.
Have you tried using Colima [1] with a Docker volume, instead of all those heavyweight tools?
[1] https://github.com/abiosoft/colima
I think I need a full VM, since I am working on stuff that require a fully isolated environment.
https://wiki.debian.org/Teams/Bananas