Simple QEMU m68k Setup & File Sharing Scripts for Ubuntu

About Qemu-system-m68k, a m68k Mac emulator for Windows, macOS and Linux that can run MacOS 7.1 to 8.1, AUX 3.x and NetBSD

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
mndeaves
Space Cadet
Posts: 3
Joined: Wed Apr 02, 2025 11:24 am

Simple QEMU m68k Setup & File Sharing Scripts for Ubuntu

Post by mndeaves »

Hi there,

I've put together a couple of simple bash scripts to make managing QEMU m68k (classic Mac) emulation setups a bit easier, especially if you run multiple configurations or want straightforward networking on Ubuntu.

What it is:

run68k.sh: A launcher script that uses simple .conf files to define your QEMU settings (machine type, RAM, ROM, disk images, PRAM, graphics). This lets you easily switch between different Mac OS installs without messing with long command lines each time. It automatically creates disk/PRAM images if they don't exist based on the config.

mac_disc_mounter.sh: (Linux focused) A helper script that reads the same .conf file to easily mount/unmount the shared HFS/HFS+ disk image associated with a specific QEMU setup onto your host system. Makes copying files back and forth much simpler. It even tries to install needed HFS utilities (hfsprogs, hfsplus) if you don't have them.

Why use it?
  • Keeps different OS setups clean and separate (unique HDDs, shared disks, PRAM per config).
    Simplifies launching QEMU with consistent settings.
    Makes booting from CD ISOs for installation straightforward (-c and -b flags).
    Provides a dedicated, easy way to access a shared disk from your Linux host.
You still need QEMU (qemu-system-m68k) and your own legally obtained ROM files. The scripts just wrap around QEMU to make management easier.

If you juggle different QEMU m68k setups or want a simpler way to handle file sharing via a shared disk image (especially on Linux), you might find these useful.

https://github.com/matthewdeaves/QemuMac

Let me know what you think. If anyone wants to try it on an Apple Silicon Mac, I'd be happy to make a branch and update the scripts to also work there.. I've not got a modern Mac, yet.
mndeaves
Space Cadet
Posts: 3
Joined: Wed Apr 02, 2025 11:24 am

Re: Simple QEMU m68k Setup & File Sharing Scripts for Ubuntu

Post by mndeaves »

I added support for 2 modes of networking - TAP or USER.... tap will enabled VM to VM communication over AppleTalk to work whilst User will allow connections to the internet. I can't find a nice way to get both working at the same time. The readme has been updated with detailed usage info
User avatar
adespoton
Forum All-Star
Posts: 4620
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com

Re: Simple QEMU m68k Setup & File Sharing Scripts for Ubuntu

Post by adespoton »

mndeaves wrote: Wed Apr 02, 2025 5:49 pm I added support for 2 modes of networking - TAP or USER.... tap will enabled VM to VM communication over AppleTalk to work whilst User will allow connections to the internet. I can't find a nice way to get both working at the same time. The readme has been updated with detailed usage info
If you're focusing on macOS hosts, there should be a few options:

USER - SLiRP networking using netdev user
- you can set DHCP address and guest name with host=<addr>,hostname=<name>
- you can set the guest-visible virtual DNS server address with dns=<addr>
- you can use the old SMB sharing using smb=<dir>,smbserver=<addr>
- you can forward host ports using hostfwd=<hostip>:<hostport>-<guestip>:<guestport>

TAP - Tun/Tap - you've already sorted that out.

VDE - using the Virtual Distributed Ethernet back-end - there are macOS, BSD and Linux drivers for this, but it's REALLY deprecated at this point. VMNET is much better.

Socket - create a virtual network on host sockets where various guest systems can network with each other
- one netdev with listen=:<port>
- one netdev with connect=:<port>

VMNET - use the macOS vmnet virtual network interface that allows full access to the network stack from the guest (I don't think this supports DDP over WiFi, however):
- netdev vmnet-bridged,id=net0,ifname=en0
- device virtio-net,netdev=net0

Beyond these, there's also the following options on qemu-system-m68k:

stream
dgram
hubport
bridge
vhost-user (connect to the network only, not the host or other guests)
vmnet-host (connect to the host only)
vmnet-shared (shared between instances, like socket)
mndeaves
Space Cadet
Posts: 3
Joined: Wed Apr 02, 2025 11:24 am

Re: Simple QEMU m68k Setup & File Sharing Scripts for Ubuntu

Post by mndeaves »

I’ll have a crack at adding support for some of those modes on a Mac host. I don’t have a modern Mac at the moment, still rocking a 2015 MacBook Pro but likely to upgrade this year.

I might try adding more slirp options again first - can you use that with just port forwarding configured and using the host machine ip on main interface as hostfwd?
User avatar
adespoton
Forum All-Star
Posts: 4620
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com

Re: Simple QEMU m68k Setup & File Sharing Scripts for Ubuntu

Post by adespoton »

mndeaves wrote: Thu Apr 03, 2025 6:59 am I might try adding more slirp options again first - can you use that with just port forwarding configured and using the host machine ip on main interface as hostfwd?
Yes; you can set as many forwarding rules as you want, and it works just like NAT port forwarding on your router (where in this case, your host is the router). Of course, you can't forward a port that's already in use.
Post Reply