Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikeboss

macrumors 68000
Original poster
Aug 13, 2009
1,546
862
switzerland
latest version of SimpleVM.app
github.com/mibosshard/SimpleVM

put together from bits an pieces here and there:
github.com/KhaosT/SimpleVM
github.com/brucehoult/SimpleVM
github.com/jonmasters/SimpleVM

- adjusted size of console window so it fits nicely
- added the capability to attach a second disk image (pasted into jonmasters fork from brucehoult fork)
 

Attachments

  • SimpleVM.zip
    733.4 KB · Views: 196
Last edited:
  • Like
Reactions: pippox0

gbevin

macrumors newbie
Nov 27, 2020
6
2
@mikeboss I got the Ubuntu server installation working and completed using a blank second disk image, do you have a Command Line handy to boot into the new image? If that's not what you're doing, could you please provide some more instructions about which images you're using exactly and which steps?
 

mikeboss

macrumors 68000
Original poster
Aug 13, 2009
1,546
862
switzerland
@mikeboss I got the Ubuntu server installation working and completed using a blank second disk image, do you have a Command Line handy to boot into the new image? If that's not what you're doing, could you please provide some more instructions about which images you're using exactly and which steps?

so far I was unable to install Ubuntu from an ISO -> #32

it'll be easier if you're going to download the images I made -> #56
 

mikeboss

macrumors 68000
Original poster
Aug 13, 2009
1,546
862
switzerland
Thanks for the info, could you talk a bit about about how you made the image?

I used these images:
cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-arm64.tar.gz
cloud-images.ubuntu.com/releases/focal/release/unpacked/ubuntu-20.04-server-cloudimg-arm64-vmlinuz-generic
cloud-images.ubuntu.com/releases/focal/release/unpacked/ubuntu-20.04-server-cloudimg-arm64-initrd-generic

and followed this guide to resize the image and to set a root password (I did this on a Linux box of course):
serverascode.com/2018/06/26/using-cloud-images.html
 
  • Like
Reactions: MK500

gbevin

macrumors newbie
Nov 27, 2020
6
2
I used these images:
cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-arm64.tar.gz
cloud-images.ubuntu.com/releases/focal/release/unpacked/ubuntu-20.04-server-cloudimg-arm64-vmlinuz-generic
cloud-images.ubuntu.com/releases/focal/release/unpacked/ubuntu-20.04-server-cloudimg-arm64-initrd-generic

and followed this guide to resize the image and to set a root password (I did this on a Linux box of course):
serverascode.com/2018/06/26/using-cloud-images.html
Thanks so much!!!
 

jdb8167

macrumors 601
Nov 17, 2008
4,859
4,599
has anyone tried to compile QEMU natively for OS X-ARM64? Id love to give it a bash but I dont own/cant afford an Apple Silicon mac sadly

I know QEMU already has Apple HVF support on intel macs, so it would be very interesting to see if that worked on Apple Silicon macs :)

especially as you can already boot windows for ARM in QEMU in emulation mode on an intel mac, so if you can make QEMU work via HVF on an Apple silicon mac it might actually be possible to run windows on an Apple Silicon mac at a half decent speed :)

View attachment 1680735
It compiles but immediately crashes with a memory allocation error. I’ll check in on the Qemu patches posted here to see if it fixes the problem for me.

I use MacPorts to get most of the required tools without any real problems. I’ve been working on getting a decent Unix dev environment for days so don’t exactly remember if I had to build something from source or not.

Qemu doesn’t build with MacPorts so I grabbed the source from git and was able to do a ./configure;make successfully. I don’t know what branch the posted patches are from but I’ll look into it more later this afternoon.
 

gbevin

macrumors newbie
Nov 27, 2020
6
2
Yay! I got it all working and it's compiling an ARM build root image for the raspberry pi system I'm working on. This is super exciting, I don't even need a more capable virtual machine, just CLI linux being able to build stuff!
 
  • Like
Reactions: MK500 and mikeboss

bombardier10

macrumors member
Nov 20, 2020
62
45
For maximum performance Linux must be compiled exactly for M1 CPU/GPU.
Even if You manage to install Linux on M1 computer the CPU/GPU will not be full performance.
M1 technology is so closed by apple so I dont think that appear any special libraries for GPU.
I have a few ARM microcomputers and special ARM linux version are developed
over the years. But it is open source .
Next , linux repository for ARM CPU/GPU is limited so You dont run all apps like
on PC platform.
I dont see any sense to run Linux on M1 computers .
 

MK500

macrumors 6502
Aug 28, 2009
434
550
For maximum performance Linux must be compiled exactly for M1 CPU/GPU.

I'm trying to parse this out. Is it true that Linux must be custom compiled for the M1? The same linux kernel runs on a wide variety of X86 chips that can vary pretty wildly architecturally (examples would be Intel, AMD, and some Chinese variants). I'm not a kernel expert, but my understanding is there are kind of branches inside the kernel to support micro architecture variation so it runs relatively smoothly on all X86. I mean I'm sure there might be a 5% or even 10% variation in performance, but would there be a dramatic change in performance if someone created a custom kernel just for a certain AMD X86 chip for example?

If you are speaking more about compiling support for devices such as network and disk; I believe the Hypervisor can sort this out for us. But certainly this is where things will take more time to stabilize.

My point is that ARM64 cores are pretty well supported in Linux already (Android is based on linux kernel, also Raspberry Pi, etc.). Why would we need a custom compiled M1 Linux?

Even if You manage to install Linux on M1 computer the CPU/GPU will not be full performance.

Now the GPU is a totally different situation. It is completely custom to Apple, and thus it may be a long time (or even never) before it gets full native Linux support. But I don't think most of the people in this thread care about GPU much, as we are more interested in high performing CLI tools for development, experimenting, and general open source goodness. Probably any Linux GPU usefulness on M1 will come through translation layers like OpenGL. And this is kind of how the ARM industry works already. There are probably around a dozen different kinds of GPUs inside ARM chips.

I dont see any sense to run Linux on M1 computers .

I have always had a Linux VM quickly available on every one of my Macs since this became feasible. For people who support open source but are also Mac users (yes, there are many of us), this is extremely useful. I develop code that processes images, for example, and there are quite often more sophisticated engines available in the Linux community than native on Mac. Sometimes these can be compiled directly on the Mac via homebrew, but not always. Sometimes the Linux architecture is just better. And it is what will be running on my server/cloud host anyway.

It's important to understand that with Hypervisor technology, an alternate operating system can run inside your Mac at speeds that are only a small percentage slower than bare metal. So it is great to be able to have several variants of ARM Linux running on my Mac within 10% of the full speed they would run on an M1 without macOS.

Since we all know the M1 has the fastest ARM cores available (probably 2x or more the closest competitor?), this is a big deal for Linux and open source developers.

Even those developing code for Raspberry Pi may appreciate being able to compile code many many times faster.
 
Last edited:
  • Like
Reactions: Argus500

bombardier10

macrumors member
Nov 20, 2020
62
45
No linux drivers for M1 GPU are available...
just read the post above yours and you'll see that it makes perfectly sense to run Linux on a Mac...

regarding performance: you might read this blog post -> http://hoult.org/arm64_mini.html
Linux on the M1 is plenty fast already.
32 cores ThreadRipper 2990wx is slower than M1 ? Unbelievable maybe fake .
ThinkPad E14 Gen 2 Zen 2 4500U - windows linux emulation
Only Rapsberry Pi works native but cost about 50 $ )

Sorry but what is sense buy 1000-2000$ apple machine and install/work with linux ?

Linux is a great OS because You can run it even on very old x86 computers with
all apps for home use like browser , GIMP , open office etc.
I have a linux server on Odroid XU4 (50$) and never reach about 20% performance of CPU.
OS for free, soft for free , very low hardware requirements.

So You don’t need buy M1 or any apple machine to run linux.
Maybe You have old PC and you want to throw it in the trash ?
No, install linux and get second live to this computer. This is true linux.

OK sometimes we need serious apps for video editing, graphics etc or
maybe new games. Yes this the reason why we need MacOS or windows.
Linux is limited by no serious apps. But not limited by hardware.

I could list the advantages of having a separate linux computer for a long time
(very cheap computer), but is not the subject of this thread.
The theme of this thread is "breaking open doors" )
 
Last edited:
  • Angry
Reactions: jido

gbevin

macrumors newbie
Nov 27, 2020
6
2
I used these images:
cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-arm64.tar.gz
cloud-images.ubuntu.com/releases/focal/release/unpacked/ubuntu-20.04-server-cloudimg-arm64-vmlinuz-generic
cloud-images.ubuntu.com/releases/focal/release/unpacked/ubuntu-20.04-server-cloudimg-arm64-initrd-generic

and followed this guide to resize the image and to set a root password (I did this on a Linux box of course):
serverascode.com/2018/06/26/using-cloud-images.html
How did you do the growpart and resize2fs parts? Did you do that on an ARM hardware Linux machine? I'd like to grow the image size, but it doesn't seem to let me resize the the online filesystem while running with SimpleVM (I resized the image with qemu-img on another machine).
 

theluggage

macrumors G3
Jul 29, 2011
8,015
8,449
No linux drivers for M1 GPU are available...

...and when Parallels (which was demonstrated at WWDC) and other commercial hypervisors become available Real Soon Now it won't need drivers for the M1 GPU - it will either use paravirtualised drivers that talk to the hypervisor, which will interface with the MacOS drivers, or the hypervisors will emulate some generic GPU - just like x86 Linux works on x86 Hypervisors. Probably using the same code.

Its true that there may never be any fully M1 native, bare-metal alternative OSs (be it Linux, xBSD or Windows) but for a large proportion of people who need it, running under virtualisation is not only acceptable, but better (no rebooting, no wasteful partitioning of discs and juggling HFS/APFS/ext4/NTFS, file sharing, virtual networking, sandboxing, snapshots...) and well worth the modest performance hit.

...and as several people in this thread have already stated, a lot of the demand for Linux on Mac is for web development and building/testing binaries for other ARM Linux systems, which doesn't need a GUI, just a headless Linux system to use with SSH and/or the remote dev tools in things like VS Code. Docker for Mac already just uses the built-in hypervisor.

...plus most of the GUIs in Linux are still based around X, so you can run a GUI via XQuartz. Mind you, the main reason a lot of Unix/Linux people buy Macs is so that they can use Linux for what it is good at - command line, server and networking - without having to use godawful X GUIs designed by someone who doesn't understand why people think "vi" is difficult to use.
 
  • Like
Reactions: mctell and wyrdness

MK500

macrumors 6502
Aug 28, 2009
434
550
Sorry but what is sense buy 1000-2000$ apple machine and install/work with linux ?
I have at least 8 Raspberry Pi's in my house, and 3 of them are model 4s. I love Linux. The reason I love running Linux on my M1 is as follows:

Raspberry Pi 4 GeekBench 5:
Single core: 229
Multi core: 661

My M1 GeekBench 5:
Single core: 1726
Multi core: 7522

An M1 Mac Mini 8GB costs $699
A Raspberry Pi 8GB + SD Card + Power Supply + HDMI adapter costs ~ $100

So 7x the cost for 7x the single core performance. Pretty easy math. Warning: Don't do the math on multicore, GPU accelerated video processing, neural engine work, disk IO, RAM IO, etc. or you might end up buying a Mini.

My life is too short to spend waiting for compilers.
 
  • Like
Reactions: The Mercurian

mikeboss

macrumors 68000
Original poster
Aug 13, 2009
1,546
862
switzerland
How did you do the growpart and resize2fs parts? Did you do that on an ARM hardware Linux machine? I'd like to grow the image size, but it doesn't seem to let me resize the the online filesystem while running with SimpleVM (I resized the image with qemu-img on another machine).

since I didn't boot the image at any point before uploading it, it will do the growpart stuff upon first boot (Ubuntu Cloud Images do that it seems). the two only things I did was resizing the image to 8.0 GB and setting a root password (while on a Linux/intel box).
 

mikeboss

macrumors 68000
Original poster
Aug 13, 2009
1,546
862
switzerland
while playing around with vftool #66 I noticed that

- the high/fluctuating response times when pinging the VM from the host were gone
- the hangs when logging into the VM were gone
- the VM rebooted immediately when I told it to do so

this only was the case when providing a single CPU core to the VM.

I have no idea as of why this happens, but if I build SimpleVM.app with the option to provide only 1 CPU to the guest OS these phenomena disappear. so here's the latest build of SimpleVM.app (single CPU with 2 gigs of RAM):
 

Attachments

  • SimpleVM.zip
    733.2 KB · Views: 156
Last edited:
  • Like
Reactions: simonhard

wyrdness

macrumors 6502
Dec 2, 2008
274
322
Thanks @mikeboss I've been playing around with this. Not only do I have Docker running on Apple Silicon, I also have Docker running Intel binaries :D
I wasn't able to run amd64 docker images, only i386, but I'm impressed that it works.


Code:
root@ubuntu:~# uname -a
Linux ubuntu 5.4.0-54-generic #60-Ubuntu SMP Fri Nov 6 10:42:16 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

root@ubuntu:~# docker run -it i386/ubuntu /bin/bash

root@a8d1ae74b5be:/# file /usr/bin/file
/usr/bin/file: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV),
dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, Build
ID[sha1]=33cf2679f6b920c6c3141d9876eb5d92ae9a1f83, stripped
root@a8d1ae74b5be:/#
root@a8d1ae74b5be:/#
root@a8d1ae74b5be:/# uname -a
Linux a8d1ae74b5be 5.4.0-54-generic #60-Ubuntu SMP Fri Nov 6 10:42:16 UTC 2020 i686 i686 i686 GNU/Linux
root@a8d1ae74b5be:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS”
VERSION_ID="18.04”
 
  • Like
Reactions: mikeboss

jdb8167

macrumors 601
Nov 17, 2008
4,859
4,599
Thanks @mikeboss I've been playing around with this. Not only do I have Docker running on Apple Silicon, I also have Docker running Intel binaries :D
I wasn't able to run amd64 docker images, only i386, but I'm impressed that it works.


Code:
root@ubuntu:~# uname -a
Linux ubuntu 5.4.0-54-generic #60-Ubuntu SMP Fri Nov 6 10:42:16 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

root@ubuntu:~# docker run -it i386/ubuntu /bin/bash

root@a8d1ae74b5be:/# file /usr/bin/file
/usr/bin/file: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV),
dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, Build
ID[sha1]=33cf2679f6b920c6c3141d9876eb5d92ae9a1f83, stripped
root@a8d1ae74b5be:/#
root@a8d1ae74b5be:/#
root@a8d1ae74b5be:/# uname -a
Linux a8d1ae74b5be 5.4.0-54-generic #60-Ubuntu SMP Fri Nov 6 10:42:16 UTC 2020 i686 i686 i686 GNU/Linux
root@a8d1ae74b5be:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS”
VERSION_ID="18.04”
how did you get Docker to work? Is there a beta?

Edit: Or did you mean that you have Docker running virtualized under Linux?
 

wyrdness

macrumors 6502
Dec 2, 2008
274
322
how did you get Docker to work? Is there a beta?

Edit: Or did you mean that you have Docker running virtualized under Linux?
I installed Docker in a virtualised Linux, then enabled the experimental features to run i386 images.
 

mikeboss

macrumors 68000
Original poster
Aug 13, 2009
1,546
862
switzerland
As a humble observer, can I suggest perhaps using GitHub releases for these artefacts. Slightly more trustworthy and relevant to the code its built from, than a shady piracy website in middle earth.

this being the first time ever, me messing around with GitHub and Xcode etc, it didn't occur to me that I can do that ;-)
of course this is a way better solution to host the package, thank you for your suggestion! here you go:

 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.