Live data from Hacker News

Running GUI Linux in a virtual machine on a Mac

developer.apple.com

81–90 of 206 posts

Re: Running GUI Linux in a virtual machine on a Mac

#82

Earlier quoted context omitted.

> VirtualBox doesn't work on ARM by the way, they only release for x86(_64). Because VirtualBox is not a CPU emulator, unlike QEMU, MAME/MESS, and other emulators. Virtualization software such as Fusion and Parallels run VMs of operating systems that match the architecture of the host OS. Intel VMs like those in VirtualBox will not run on Apple Silicon, and Apple Silicon VMs won't run on Intel. The CPU instruction se…

I added some clarification. There is no VirtualBox on ARM platform. So you can't virtualise ARM on ARM with VirtualBox, because they don't make ARM compatible releases. But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products. So if you need something like a sandbox or IR workstation, you can have plenty of virtual environments, just not with Virtual…

> But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products.

Right, but the VMs themselves are not cross platform. ARM Linux won't work in Intel VMWare, and x86 Linux won't work in ARM VMWare. I am sure you knew, or course, but as you pointed out there is confusion below about VirtualBox working on Apple Silicon.

Re: Running GUI Linux in a virtual machine on a Mac

#83

Earlier quoted context omitted.

> VirtualBox doesn't work on ARM by the way, they only release for x86(_64). Because VirtualBox is not a CPU emulator, unlike QEMU, MAME/MESS, and other emulators. Virtualization software such as Fusion and Parallels run VMs of operating systems that match the architecture of the host OS. Intel VMs like those in VirtualBox will not run on Apple Silicon, and Apple Silicon VMs won't run on Intel. The CPU instruction se…

I added some clarification. There is no VirtualBox on ARM platform. So you can't virtualise ARM on ARM with VirtualBox, because they don't make ARM compatible releases. But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products. So if you need something like a sandbox or IR workstation, you can have plenty of virtual environments, just not with Virtual…

Doesn't AArch64 support the same virtualisation primitives that VirtualBox uses on AMD64?

Re: Running GUI Linux in a virtual machine on a Mac

#84

Earlier quoted context omitted.

I added some clarification. There is no VirtualBox on ARM platform. So you can't virtualise ARM on ARM with VirtualBox, because they don't make ARM compatible releases. But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products. So if you need something like a sandbox or IR workstation, you can have plenty of virtual environments, just not with Virtual…

> But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products. Right, but the VMs themselves are not cross platform. ARM Linux won't work in Intel VMWare, and x86 Linux won't work in ARM VMWare. I am sure you knew, or course, but as you pointed out there is confusion below about VirtualBox working on Apple Silicon.

> ARM Linux won't work in Intel VMWare

Newsflash: program for one processor's instruction set won't work on another processor.

Re: Running GUI Linux in a virtual machine on a Mac

#85

Earlier quoted context omitted.

I added some clarification. There is no VirtualBox on ARM platform. So you can't virtualise ARM on ARM with VirtualBox, because they don't make ARM compatible releases. But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products. So if you need something like a sandbox or IR workstation, you can have plenty of virtual environments, just not with Virtual…

> But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products. Right, but the VMs themselves are not cross platform. ARM Linux won't work in Intel VMWare, and x86 Linux won't work in ARM VMWare. I am sure you knew, or course, but as you pointed out there is confusion below about VirtualBox working on Apple Silicon.

That is correct. But lets leave the VMs for now. The hypervisors is where the problem is at, if a hypervisor has no release for a specific platform, you cannot use it, period. That is the problem with VirtualBox. There is no VirtualBox for ARM. Only VirtualBox for x86. If you have an ARM host, and you wish you run an ARM guest, you cannot do that with VirtualBox. Because there is no VirtualBox for ARM.

Re: Running GUI Linux in a virtual machine on a Mac

#86

Earlier quoted context omitted.

There is already much user demand & vendor support for running virtual machines (including for Windows) on Apple hardware, through Parallels, VMWare and Qemu. Like there are options for containers, it is great to have another option for virtual machines.

Options are good. But the way Apple operates to exert control and cripples softwares that don't align with their goals, don't be surprised if Apple suddenly forces developers to only use their virtualisation API on macOS, just like they did for application firewalls (that are no longer allowed to have their own custom kernel extensions for "security" and "stability"). They are slowly squeezing macOS to make it more a…

They had the opportunity to do this when introducing the M-series Macs, because under the hood those work very similarly to iPhones and iPads. They could've done a direct copy-paste from the iDevice boot process and called it a day, but they didn't… they went out of their way to develop support for booting third-party operating systems, complete with a path for painless long term support with the flexibility of allowing the OS to choose which version of firmware to run on the hardware (so Apple can deploy compatibility breaking firmware updates for use with macOS without stepping on the toes of e.g. Asahi Linux).

In macOS itself the main goal is to get third parties out of the kernel to the greatest extent possible, which makes perfect sense. Third parties, ideally, should be operating solely in userland, because otherwise you get pointlessly insecure nonsense like cloud file storage apps installing kernel extensions (like Dropbox used to on macOS).

Re: Running GUI Linux in a virtual machine on a Mac

#87

Earlier quoted context omitted.

I added some clarification. There is no VirtualBox on ARM platform. So you can't virtualise ARM on ARM with VirtualBox, because they don't make ARM compatible releases. But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products. So if you need something like a sandbox or IR workstation, you can have plenty of virtual environments, just not with Virtual…

Doesn't AArch64 support the same virtualisation primitives that VirtualBox uses on AMD64?

Yes and no. Similar in functionality, different in implementation. So you do get things like IOMMU etc. but you need a different software implementation to make use of it, even if only to use the different ISA and setup procedures.

Imagine it like this:

    ┌─────────────────────────────────────┐
    │higher-level software to abstract it │
    ├────────────────────────────▲────────┤
    ├───▼─────────────────────────────────┤
    │low-level software to make use of it │
    ├────────────────────────────▲────────┤
    ├───▼─────────────────────────────────┤
    │hardware with virtualisation support │
    └─────────────────────────────────────┘

Even within the same architecture you might need different low-level interfacing software to make use of it. Even a type-1 hypervisor like Xen would need to know a bit about the specifics of the hardware to know what features exist and how to use them. Then you get some higher level abstractions that allow you to use a virtualisation interface to make use of the system without having to re-invent that interface every time some new hardware gets released.

So if you have libvirt, you have a high-level abstraction for multiple hypervisors (like KVM and Xen) which in turn know how to interact with various hardware implementations to actually have it act the way we want it.

On macOS there were essentially two low-level implementations, one for ARM and one for Intel, and a higher-level abstraction, Hypervisor.framework, that lets you simply "create" virtual machine instances, which then make use of the various virtualisation features depending on the underlying hardware.

In the early days, the implementations between AMD and Intel were so different that you often needed specific builds for one or the other implementations, and you couldn't have both loaded at the same time (even if just 1 active and every other implementation inactive).

Re: Running GUI Linux in a virtual machine on a Mac

#89
post #5

UTM works great. Emulate X86, AMD64, or run on Apple Silicon. It's essentially a GUI on top of QEMU. https://mac.getutm.app/

The only problem seems to be that it won't allow you to run an earlier OS X that can still run 32-bit programs.

Those earlier macOS versions don't have the frameworks to run virtualisation with. There are some hacks (mackintosh-ish) that allow you to run very old Intel releases on non-ARM releases, those virtualise the CPU but emulate nearly everything else.
Post reply on HN